From c7977705b55acc8d933df45f724f905679436914 Mon Sep 17 00:00:00 2001 From: GalT <39020298+tatarco@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:33:54 +0100 Subject: [PATCH] local generation --- .speakeasy/gen.lock | 74 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 12 +- .speakeasy/workflow.yaml | 2 +- README.md | 37 +- docs/models/getsubscriberpreferencesdto.md | 9 + docs/models/globalpreferencedto.md | 9 + docs/models/overrides.md | 8 +- docs/models/overrideschannel.md | 14 + docs/models/patchpreferencechannelsdto.md | 12 + docs/models/patchsubscriberpreferencesdto.md | 9 + docs/models/source.md | 12 + ...ntrollergetsubscriberpreferencesrequest.md | 9 + ...trollergetsubscriberpreferencesresponse.md | 9 + ...ollerupdatesubscriberpreferencesrequest.md | 10 + ...llerupdatesubscriberpreferencesresponse.md | 9 + docs/models/triggereventtoallrequestdto.md | 2 +- .../triggereventtoallrequestdtooverrides.md | 9 + docs/models/workflowinfodto.md | 10 + docs/models/workflowpreferencedto.md | 11 + docs/sdks/messages/README.md | 5 +- docs/sdks/notifications/README.md | 4 +- docs/sdks/novunotifications/README.md | 3 +- docs/sdks/preferences/README.md | 97 ++- docs/sdks/subscribers/README.md | 2 +- docs/sdks/topics/README.md | 2 +- pyproject.toml | 2 +- src/novu_py/_version.py | 6 +- src/novu_py/authentication.py | 80 +- src/novu_py/credentials.py | 120 +-- src/novu_py/integrations.py | 240 +++--- src/novu_py/messages.py | 120 +-- src/novu_py/models/__init__.py | 56 +- .../models/getsubscriberpreferencesdto.py | 24 + src/novu_py/models/globalpreferencedto.py | 21 + src/novu_py/models/overrides.py | 39 + .../models/patchpreferencechannelsdto.py | 36 + .../models/patchsubscriberpreferencesdto.py | 26 + ...rscontroller_getsubscriberpreferencesop.py | 44 + ...ontroller_updatesubscriberpreferencesop.py | 59 ++ .../models/triggereventtoallrequestdto.py | 8 +- src/novu_py/models/workflowinfodto.py | 25 + src/novu_py/models/workflowpreferencedto.py | 34 + src/novu_py/notifications.py | 80 +- src/novu_py/novu_messages.py | 120 +-- src/novu_py/novu_notifications.py | 80 +- src/novu_py/novu_subscribers.py | 120 +-- src/novu_py/preferences.py | 782 ++++++++++++++++-- src/novu_py/properties.py | 40 +- src/novu_py/sdk.py | 160 ++-- src/novu_py/stats.py | 80 +- src/novu_py/subscribers.py | 400 +++++---- src/novu_py/topics.py | 200 +++-- src/novu_py/webhooks.py | 40 +- 54 files changed, 2457 insertions(+), 967 deletions(-) create mode 100644 docs/models/getsubscriberpreferencesdto.md create mode 100644 docs/models/globalpreferencedto.md create mode 100644 docs/models/overrideschannel.md create mode 100644 docs/models/patchpreferencechannelsdto.md create mode 100644 docs/models/patchsubscriberpreferencesdto.md create mode 100644 docs/models/source.md create mode 100644 docs/models/subscriberscontrollergetsubscriberpreferencesrequest.md create mode 100644 docs/models/subscriberscontrollergetsubscriberpreferencesresponse.md create mode 100644 docs/models/subscriberscontrollerupdatesubscriberpreferencesrequest.md create mode 100644 docs/models/subscriberscontrollerupdatesubscriberpreferencesresponse.md create mode 100644 docs/models/triggereventtoallrequestdtooverrides.md create mode 100644 docs/models/workflowinfodto.md create mode 100644 docs/models/workflowpreferencedto.md create mode 100644 src/novu_py/models/getsubscriberpreferencesdto.py create mode 100644 src/novu_py/models/globalpreferencedto.py create mode 100644 src/novu_py/models/overrides.py create mode 100644 src/novu_py/models/patchpreferencechannelsdto.py create mode 100644 src/novu_py/models/patchsubscriberpreferencesdto.py create mode 100644 src/novu_py/models/subscriberscontroller_getsubscriberpreferencesop.py create mode 100644 src/novu_py/models/subscriberscontroller_updatesubscriberpreferencesop.py create mode 100644 src/novu_py/models/workflowinfodto.py create mode 100644 src/novu_py/models/workflowpreferencedto.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 001d874..0dfa3fd 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: f83d894c-c934-499f-8a8d-e128395ae8ff management: - docChecksum: df920daa1ffe269a97cd51bb03a07002 + docChecksum: 8a535acf4d6882a9b0f29742d4b68279 docVersion: "1.0" - speakeasyVersion: 1.480.0 - generationVersion: 2.499.0 - releaseVersion: 0.3.0 - configChecksum: bc8186c34fbd0f4882cade12d98ead4b + speakeasyVersion: 1.481.1 + generationVersion: 2.500.5 + releaseVersion: 0.3.1 + configChecksum: cd9f15119203542c204e1be62977bd58 repoURL: https://github.com/novuhq/novu-py.git installationURL: https://github.com/novuhq/novu-py.git published: true @@ -15,14 +15,14 @@ features: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.10.7 + core: 5.10.9 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 examples: 3.0.1 - flattening: 3.1.0 + flattening: 3.1.1 globalSecurity: 3.0.2 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 @@ -130,8 +130,10 @@ generatedFiles: - docs/models/feedresponsedto.md - docs/models/fieldfilterpartdto.md - docs/models/filtertopicsresponsedto.md + - docs/models/getsubscriberpreferencesdto.md - docs/models/getsubscriberpreferencesresponsedto.md - docs/models/gettopicresponsedto.md + - docs/models/globalpreferencedto.md - docs/models/integrationresponsedto.md - docs/models/integrationscontrollercreateintegrationrequest.md - docs/models/integrationscontrollercreateintegrationresponse.md @@ -211,7 +213,10 @@ generatedFiles: - docs/models/ordinalvalue.md - docs/models/ordinalvalueenum.md - docs/models/overrides.md + - docs/models/overrideschannel.md - docs/models/parameter.md + - docs/models/patchpreferencechannelsdto.md + - docs/models/patchsubscriberpreferencesdto.md - docs/models/patchsubscriberrequestdto.md - docs/models/patchsubscriberrequestdtodata.md - docs/models/payload.md @@ -226,6 +231,7 @@ generatedFiles: - docs/models/renametopicresponsedto.md - docs/models/replycallback.md - docs/models/security.md + - docs/models/source.md - docs/models/status.md - docs/models/stepfilterdto.md - docs/models/steptypeenum.md @@ -233,6 +239,8 @@ generatedFiles: - docs/models/subscriberfeedresponsedto.md - docs/models/subscriberpayloaddto.md - docs/models/subscriberresponsedto.md + - docs/models/subscriberscontrollergetsubscriberpreferencesrequest.md + - docs/models/subscriberscontrollergetsubscriberpreferencesresponse.md - docs/models/subscriberscontrollergetsubscriberrequest.md - docs/models/subscriberscontrollergetsubscriberresponse.md - docs/models/subscriberscontrollerpatchsubscriberrequest.md @@ -241,6 +249,8 @@ generatedFiles: - docs/models/subscriberscontrollerremovesubscriberresponse.md - docs/models/subscriberscontrollersearchsubscribersrequest.md - docs/models/subscriberscontrollersearchsubscribersresponse.md + - docs/models/subscriberscontrollerupdatesubscriberpreferencesrequest.md + - docs/models/subscriberscontrollerupdatesubscriberpreferencesresponse.md - docs/models/subscribersv1controllerbulkcreatesubscribersrequest.md - docs/models/subscribersv1controllerbulkcreatesubscribersresponse.md - docs/models/subscribersv1controllerchataccessoauthrequest.md @@ -317,6 +327,7 @@ generatedFiles: - docs/models/triggereventresponsedto.md - docs/models/triggereventtoallrequestdto.md - docs/models/triggereventtoallrequestdtoactor.md + - docs/models/triggereventtoallrequestdtooverrides.md - docs/models/triggereventtoallrequestdtotenant.md - docs/models/triggerrecipientstypeenum.md - docs/models/triggerreservedvariableresponse.md @@ -340,7 +351,9 @@ generatedFiles: - docs/models/validationerrordtovalue.md - docs/models/value.md - docs/models/weekdays.md + - docs/models/workflowinfodto.md - docs/models/workflowintegrationstatus.md + - docs/models/workflowpreferencedto.md - docs/models/workflowresponse.md - docs/models/workflowresponsedata.md - docs/sdks/authentication/README.md @@ -433,8 +446,10 @@ generatedFiles: - src/novu_py/models/feedresponsedto.py - src/novu_py/models/fieldfilterpartdto.py - src/novu_py/models/filtertopicsresponsedto.py + - src/novu_py/models/getsubscriberpreferencesdto.py - src/novu_py/models/getsubscriberpreferencesresponsedto.py - src/novu_py/models/gettopicresponsedto.py + - src/novu_py/models/globalpreferencedto.py - src/novu_py/models/integrationresponsedto.py - src/novu_py/models/integrationscontroller_createintegrationop.py - src/novu_py/models/integrationscontroller_getactiveintegrationsop.py @@ -476,6 +491,9 @@ generatedFiles: - src/novu_py/models/notificationtriggervariableresponse.py - src/novu_py/models/ordinalenum.py - src/novu_py/models/ordinalvalueenum.py + - src/novu_py/models/overrides.py + - src/novu_py/models/patchpreferencechannelsdto.py + - src/novu_py/models/patchsubscriberpreferencesdto.py - src/novu_py/models/patchsubscriberrequestdto.py - src/novu_py/models/preference.py - src/novu_py/models/preferencechannels.py @@ -493,9 +511,11 @@ generatedFiles: - src/novu_py/models/subscriberpayloaddto.py - src/novu_py/models/subscriberresponsedto.py - src/novu_py/models/subscriberscontroller_getsubscriberop.py + - src/novu_py/models/subscriberscontroller_getsubscriberpreferencesop.py - src/novu_py/models/subscriberscontroller_patchsubscriberop.py - src/novu_py/models/subscriberscontroller_removesubscriberop.py - src/novu_py/models/subscriberscontroller_searchsubscribersop.py + - src/novu_py/models/subscriberscontroller_updatesubscriberpreferencesop.py - src/novu_py/models/subscribersv1controller_bulkcreatesubscribersop.py - src/novu_py/models/subscribersv1controller_chataccessoauthop.py - src/novu_py/models/subscribersv1controller_chatoauthcallbackop.py @@ -549,6 +569,8 @@ generatedFiles: - src/novu_py/models/updatesubscriberpreferenceresponsedto.py - src/novu_py/models/updatesubscriberrequestdto.py - src/novu_py/models/validationerrordto.py + - src/novu_py/models/workflowinfodto.py + - src/novu_py/models/workflowpreferencedto.py - src/novu_py/models/workflowresponse.py - src/novu_py/notifications.py - src/novu_py/novu_messages.py @@ -607,7 +629,7 @@ examples: EventsController_triggerBulk: speakeasy-default-events-controller-trigger-bulk: requestBody: - application/json: {"events": [{"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": {"subscriberId": ""}}, {"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": {"topicKey": "", "type": "Subscriber"}}, {"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": ["SUBSCRIBER_ID", "SUBSCRIBER_ID"]}]} + application/json: {"events": [{"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": {"subscriberId": ""}}, {"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": [{"topicKey": "", "type": "Subscriber"}]}, {"name": "workflow_identifier", "payload": {"comment_id": "string", "post": {"text": "string"}}, "overrides": {"fcm": {"data": {"key": "value"}}}, "to": ["SUBSCRIBER_ID", "SUBSCRIBER_ID"]}]} responses: "201": application/json: [{"acknowledged": true, "status": "error"}, {"acknowledged": true, "status": "no_workflow_active_steps_defined"}, {"acknowledged": true, "status": "trigger_not_active"}] @@ -1470,5 +1492,41 @@ examples: application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName2": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName3": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName4": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}}} "500": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + SubscribersController_getSubscriberPreferences: + speakeasy-default-subscribers-controller-get-subscriber-preferences: + parameters: + path: + subscriberId: "" + header: {} + responses: + "200": + application/json: {"global": {"enabled": true, "channels": {}}, "workflows": [{"enabled": true, "channels": {}, "overrides": [{"channel": "in_app", "source": "template"}], "workflow": {"slug": "", "identifier": "", "name": ""}}, {"enabled": false, "channels": {}, "overrides": [], "workflow": {"slug": "", "identifier": "", "name": ""}}, {"enabled": false, "channels": {}, "overrides": [], "workflow": {"slug": "", "identifier": "", "name": ""}}]} + "414": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "400": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "422": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName2": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName3": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName4": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}}} + "500": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + SubscribersController_updateSubscriberPreferences: + speakeasy-default-subscribers-controller-update-subscriber-preferences: + parameters: + path: + subscriberId: "" + header: {} + requestBody: + application/json: {"channels": {}} + responses: + "200": + application/json: {"global": {"enabled": false, "channels": {}}, "workflows": [{"enabled": true, "channels": {}, "overrides": [{"channel": "chat", "source": "template"}, {"channel": "push", "source": "subscriber"}, {"channel": "push", "source": "template"}], "workflow": {"slug": "", "identifier": "", "name": ""}}, {"enabled": true, "channels": {}, "overrides": [], "workflow": {"slug": "", "identifier": "", "name": ""}}]} + "414": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "400": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "422": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName2": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName3": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName4": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}}} + "500": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "Resource not found.", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8de3f89..7808637 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true python: - version: 0.3.0 + version: 0.3.1 additionalDependencies: dev: - pytest>=6.0.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 03c21fc..5cce8a6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.480.0 +speakeasyVersion: 1.481.1 sources: novu-OAS: sourceNamespace: novu-oas - sourceRevisionDigest: sha256:2f2b2bbec58fe6dd2249927dc6cad537de65b1ec7c272eb355b2fa85ff36993e - sourceBlobDigest: sha256:f1f23afd38066a7a52e04d578cb3102c4a48406c4e1d90ca7219ccad681698d3 + sourceRevisionDigest: sha256:440e5a529f600c918908bbe22b108a7ca890dafa5c4cc4a68f0e09ea632c54be + sourceBlobDigest: sha256:6069d31f5e273690c45ca9f77302879921f2a385dd2fefed297a93f7bbc36865 tags: - latest - "1.0" @@ -11,10 +11,10 @@ targets: novu: source: novu-OAS sourceNamespace: novu-oas - sourceRevisionDigest: sha256:2f2b2bbec58fe6dd2249927dc6cad537de65b1ec7c272eb355b2fa85ff36993e - sourceBlobDigest: sha256:f1f23afd38066a7a52e04d578cb3102c4a48406c4e1d90ca7219ccad681698d3 + sourceRevisionDigest: sha256:440e5a529f600c918908bbe22b108a7ca890dafa5c4cc4a68f0e09ea632c54be + sourceBlobDigest: sha256:6069d31f5e273690c45ca9f77302879921f2a385dd2fefed297a93f7bbc36865 codeSamplesNamespace: novu-oas-python-code-samples - codeSamplesRevisionDigest: sha256:8f51bfe0a8221600379dee0ab850388b53a16437508020d5d2632143799ce63f + codeSamplesRevisionDigest: sha256:bec0e753e998822f3fbafc46e31ee7b3aed98bfb2fd43d4c3d677491afabfc97 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 50950c4..da300c0 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -3,7 +3,7 @@ speakeasyVersion: latest sources: novu-OAS: inputs: - - location: https://api.novu.co/openapi.sdk.yaml + - location: http://127.0.0.1:3000/openapi.sdk.yaml overlays: - location: .speakeasy/speakeasy-modifications-overlay.yaml registry: diff --git a/README.md b/README.md index 51fe680..4275a36 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,37 @@ pip install novu-py ```bash poetry add novu-py ``` + +### Shell and script usage with `uv` + +You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so: + +```shell +uvx --from novu-py python +``` + +It's also possible to write a standalone Python script without needing to set up a whole project like so: + +```python +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "novu-py", +# ] +# /// + +from novu_py import Novu + +sdk = Novu( + # SDK arguments +) + +# Rest of script here... +``` + +Once that is saved to a file, you can run it with `uv run script.py` where +`script.py` can be replaced with the actual file name. @@ -504,7 +535,9 @@ asyncio.run(main()) * [list](docs/sdks/preferences/README.md#list) - Get subscriber preferences * [update_global](docs/sdks/preferences/README.md#update_global) - Update subscriber global preferences * [retrieve_by_level](docs/sdks/preferences/README.md#retrieve_by_level) - Get subscriber preferences by level -* [update](docs/sdks/preferences/README.md#update) - Update subscriber preference +* [update_legacy](docs/sdks/preferences/README.md#update_legacy) - Update subscriber preference +* [retrieve](docs/sdks/preferences/README.md#retrieve) - Get subscriber preferences +* [update](docs/sdks/preferences/README.md#update) - Update subscriber global or workflow specific preferences #### [subscribers.properties](docs/sdks/properties/README.md) @@ -543,7 +576,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.subscribers.list(limit=10) + res = novu.subscribers.list() while res is not None: # Handle items diff --git a/docs/models/getsubscriberpreferencesdto.md b/docs/models/getsubscriberpreferencesdto.md new file mode 100644 index 0000000..2e2bc6c --- /dev/null +++ b/docs/models/getsubscriberpreferencesdto.md @@ -0,0 +1,9 @@ +# GetSubscriberPreferencesDto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `global_` | [models.GlobalPreferenceDto](../models/globalpreferencedto.md) | :heavy_check_mark: | Global preference settings | +| `workflows` | List[[models.WorkflowPreferenceDto](../models/workflowpreferencedto.md)] | :heavy_check_mark: | Workflow-specific preference settings | \ No newline at end of file diff --git a/docs/models/globalpreferencedto.md b/docs/models/globalpreferencedto.md new file mode 100644 index 0000000..93d47a5 --- /dev/null +++ b/docs/models/globalpreferencedto.md @@ -0,0 +1,9 @@ +# GlobalPreferenceDto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `enabled` | *bool* | :heavy_check_mark: | Whether notifications are enabled globally | +| `channels` | [models.PreferenceChannels](../models/preferencechannels.md) | :heavy_check_mark: | Channel-specific preference settings | \ No newline at end of file diff --git a/docs/models/overrides.md b/docs/models/overrides.md index a7c3ddf..3ed34cd 100644 --- a/docs/models/overrides.md +++ b/docs/models/overrides.md @@ -1,9 +1,9 @@ # Overrides -This could be used to override provider specific configurations - ## Fields -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `channel` | [models.OverridesChannel](../models/overrideschannel.md) | :heavy_check_mark: | The channel type which is overridden | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | The source of overrides | \ No newline at end of file diff --git a/docs/models/overrideschannel.md b/docs/models/overrideschannel.md new file mode 100644 index 0000000..b5d2cf4 --- /dev/null +++ b/docs/models/overrideschannel.md @@ -0,0 +1,14 @@ +# OverridesChannel + +The channel type which is overridden + + +## Values + +| Name | Value | +| -------- | -------- | +| `IN_APP` | in_app | +| `EMAIL` | email | +| `SMS` | sms | +| `CHAT` | chat | +| `PUSH` | push | \ No newline at end of file diff --git a/docs/models/patchpreferencechannelsdto.md b/docs/models/patchpreferencechannelsdto.md new file mode 100644 index 0000000..9d7d832 --- /dev/null +++ b/docs/models/patchpreferencechannelsdto.md @@ -0,0 +1,12 @@ +# PatchPreferenceChannelsDto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `email` | *Optional[bool]* | :heavy_minus_sign: | Email channel preference | +| `sms` | *Optional[bool]* | :heavy_minus_sign: | SMS channel preference | +| `in_app` | *Optional[bool]* | :heavy_minus_sign: | In-app channel preference | +| `push` | *Optional[bool]* | :heavy_minus_sign: | Push channel preference | +| `chat` | *Optional[bool]* | :heavy_minus_sign: | Chat channel preference | \ No newline at end of file diff --git a/docs/models/patchsubscriberpreferencesdto.md b/docs/models/patchsubscriberpreferencesdto.md new file mode 100644 index 0000000..e30b962 --- /dev/null +++ b/docs/models/patchsubscriberpreferencesdto.md @@ -0,0 +1,9 @@ +# PatchSubscriberPreferencesDto + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `channels` | [models.PatchPreferenceChannelsDto](../models/patchpreferencechannelsdto.md) | :heavy_check_mark: | Channel-specific preference settings | +| `workflow_id` | *Optional[str]* | :heavy_minus_sign: | If provided, update workflow specific preferences, otherwise update global preferences | \ No newline at end of file diff --git a/docs/models/source.md b/docs/models/source.md new file mode 100644 index 0000000..591a9c2 --- /dev/null +++ b/docs/models/source.md @@ -0,0 +1,12 @@ +# Source + +The source of overrides + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `SUBSCRIBER` | subscriber | +| `TEMPLATE` | template | +| `WORKFLOW_OVERRIDE` | workflowOverride | \ No newline at end of file diff --git a/docs/models/subscriberscontrollergetsubscriberpreferencesrequest.md b/docs/models/subscriberscontrollergetsubscriberpreferencesrequest.md new file mode 100644 index 0000000..6af413e --- /dev/null +++ b/docs/models/subscriberscontrollergetsubscriberpreferencesrequest.md @@ -0,0 +1,9 @@ +# SubscribersControllerGetSubscriberPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `subscriber_id` | *str* | :heavy_check_mark: | N/A | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A header for idempotency purposes | \ No newline at end of file diff --git a/docs/models/subscriberscontrollergetsubscriberpreferencesresponse.md b/docs/models/subscriberscontrollergetsubscriberpreferencesresponse.md new file mode 100644 index 0000000..afb8b4b --- /dev/null +++ b/docs/models/subscriberscontrollergetsubscriberpreferencesresponse.md @@ -0,0 +1,9 @@ +# SubscribersControllerGetSubscriberPreferencesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `headers` | Dict[str, List[*str*]] | :heavy_check_mark: | N/A | +| `result` | [models.GetSubscriberPreferencesDto](../models/getsubscriberpreferencesdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/subscriberscontrollerupdatesubscriberpreferencesrequest.md b/docs/models/subscriberscontrollerupdatesubscriberpreferencesrequest.md new file mode 100644 index 0000000..59778bb --- /dev/null +++ b/docs/models/subscriberscontrollerupdatesubscriberpreferencesrequest.md @@ -0,0 +1,10 @@ +# SubscribersControllerUpdateSubscriberPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `subscriber_id` | *str* | :heavy_check_mark: | N/A | +| `patch_subscriber_preferences_dto` | [models.PatchSubscriberPreferencesDto](../models/patchsubscriberpreferencesdto.md) | :heavy_check_mark: | N/A | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A header for idempotency purposes | \ No newline at end of file diff --git a/docs/models/subscriberscontrollerupdatesubscriberpreferencesresponse.md b/docs/models/subscriberscontrollerupdatesubscriberpreferencesresponse.md new file mode 100644 index 0000000..2ce10c5 --- /dev/null +++ b/docs/models/subscriberscontrollerupdatesubscriberpreferencesresponse.md @@ -0,0 +1,9 @@ +# SubscribersControllerUpdateSubscriberPreferencesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `headers` | Dict[str, List[*str*]] | :heavy_check_mark: | N/A | +| `result` | [models.GetSubscriberPreferencesDto](../models/getsubscriberpreferencesdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/triggereventtoallrequestdto.md b/docs/models/triggereventtoallrequestdto.md index 4665077..3cfd74e 100644 --- a/docs/models/triggereventtoallrequestdto.md +++ b/docs/models/triggereventtoallrequestdto.md @@ -7,7 +7,7 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | The trigger identifier associated for the template you wish to send. This identifier can be found on the template page. | | | `payload` | Dict[str, *Any*] | :heavy_check_mark: | The payload object is used to pass additional information that
could be used to render the template, or perform routing rules based on it.
For In-App channel, payload data are also available in | {
"comment_id": "string",
"post": {
"text": "string"
}
} | -| `overrides` | [Optional[models.Overrides]](../models/overrides.md) | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"fcm": {
"data": {
"key": "value"
}
}
} | +| `overrides` | [Optional[models.TriggerEventToAllRequestDtoOverrides]](../models/triggereventtoallrequestdtooverrides.md) | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"fcm": {
"data": {
"key": "value"
}
}
} | | `transaction_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for this transaction, we will generated a UUID if not provided. | | | `actor` | [Optional[models.TriggerEventToAllRequestDtoActor]](../models/triggereventtoallrequestdtoactor.md) | :heavy_minus_sign: | It is used to display the Avatar of the provided actor's subscriber id or actor object.
If a new actor object is provided, we will create a new subscriber in our system
| | | `tenant` | [Optional[models.TriggerEventToAllRequestDtoTenant]](../models/triggereventtoallrequestdtotenant.md) | :heavy_minus_sign: | It is used to specify a tenant context during trigger event.
If a new tenant object is provided, we will create a new tenant.
| | \ No newline at end of file diff --git a/docs/models/triggereventtoallrequestdtooverrides.md b/docs/models/triggereventtoallrequestdtooverrides.md new file mode 100644 index 0000000..1e19e25 --- /dev/null +++ b/docs/models/triggereventtoallrequestdtooverrides.md @@ -0,0 +1,9 @@ +# TriggerEventToAllRequestDtoOverrides + +This could be used to override provider specific configurations + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/workflowinfodto.md b/docs/models/workflowinfodto.md new file mode 100644 index 0000000..c42225c --- /dev/null +++ b/docs/models/workflowinfodto.md @@ -0,0 +1,10 @@ +# WorkflowInfoDto + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `slug` | *str* | :heavy_check_mark: | Workflow slug | +| `identifier` | *str* | :heavy_check_mark: | Unique identifier of the workflow | +| `name` | *str* | :heavy_check_mark: | Display name of the workflow | \ No newline at end of file diff --git a/docs/models/workflowpreferencedto.md b/docs/models/workflowpreferencedto.md new file mode 100644 index 0000000..b5c2a05 --- /dev/null +++ b/docs/models/workflowpreferencedto.md @@ -0,0 +1,11 @@ +# WorkflowPreferenceDto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `enabled` | *bool* | :heavy_check_mark: | Whether notifications are enabled for this workflow | +| `channels` | [models.PreferenceChannels](../models/preferencechannels.md) | :heavy_check_mark: | Channel-specific preference settings for this workflow | +| `overrides` | List[[models.Overrides](../models/overrides.md)] | :heavy_check_mark: | List of preference overrides | +| `workflow` | [models.WorkflowInfoDto](../models/workflowinfodto.md) | :heavy_check_mark: | Workflow information | \ No newline at end of file diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index c806cbe..f67e9f2 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -26,10 +26,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.messages.retrieve(request={ - "page": 0, - "limit": 10, - }) + res = novu.messages.retrieve(request={}) # Handle response print(res) diff --git a/docs/sdks/notifications/README.md b/docs/sdks/notifications/README.md index 7fe5450..9c743ee 100644 --- a/docs/sdks/notifications/README.md +++ b/docs/sdks/notifications/README.md @@ -22,9 +22,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.notifications.list(request={ - "page": 0, - }) + res = novu.notifications.list(request={}) # Handle response print(res) diff --git a/docs/sdks/novunotifications/README.md b/docs/sdks/novunotifications/README.md index ff2f9ab..2a7b710 100644 --- a/docs/sdks/novunotifications/README.md +++ b/docs/sdks/novunotifications/README.md @@ -24,7 +24,6 @@ with Novu( res = novu.subscribers.notifications.feed(request={ "subscriber_id": "", - "limit": 10, "payload": "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", }) @@ -68,7 +67,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.subscribers.notifications.unseen_count(subscriber_id="", seen=False, limit=100) + res = novu.subscribers.notifications.unseen_count(subscriber_id="") # Handle response print(res) diff --git a/docs/sdks/preferences/README.md b/docs/sdks/preferences/README.md index 784902c..8bf529d 100644 --- a/docs/sdks/preferences/README.md +++ b/docs/sdks/preferences/README.md @@ -8,7 +8,9 @@ * [list](#list) - Get subscriber preferences * [update_global](#update_global) - Update subscriber global preferences * [retrieve_by_level](#retrieve_by_level) - Get subscriber preferences by level -* [update](#update) - Update subscriber preference +* [update_legacy](#update_legacy) - Update subscriber preference +* [retrieve](#retrieve) - Get subscriber preferences +* [update](#update) - Update subscriber global or workflow specific preferences ## list @@ -144,7 +146,7 @@ with Novu( | models.ErrorDto | 500 | application/json | | models.APIError | 4XX, 5XX | \*/\* | -## update +## update_legacy Update subscriber preference @@ -158,7 +160,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.subscribers.preferences.update(subscriber_id="", workflow_id="", update_subscriber_preference_request_dto={}) + res = novu.subscribers.preferences.update_legacy(subscriber_id="", workflow_id="", update_subscriber_preference_request_dto={}) # Handle response print(res) @@ -181,6 +183,95 @@ with Novu( ### Errors +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models.ErrorDto | 414 | application/json | +| models.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | +| models.ValidationErrorDto | 422 | application/json | +| models.ErrorDto | 500 | application/json | +| models.APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get subscriber global and workflow specific preferences + +### Example Usage + +```python +from novu_py import Novu +import os + +with Novu( + secret_key=os.getenv("NOVU_SECRET_KEY", ""), +) as novu: + + res = novu.subscribers.preferences.retrieve(subscriber_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `subscriber_id` | *str* | :heavy_check_mark: | N/A | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A header for idempotency purposes | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SubscribersControllerGetSubscriberPreferencesResponse](../../models/subscriberscontrollergetsubscriberpreferencesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models.ErrorDto | 414 | application/json | +| models.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | +| models.ValidationErrorDto | 422 | application/json | +| models.ErrorDto | 500 | application/json | +| models.APIError | 4XX, 5XX | \*/\* | + +## update + +Update subscriber global or workflow specific preferences + +### Example Usage + +```python +from novu_py import Novu +import os + +with Novu( + secret_key=os.getenv("NOVU_SECRET_KEY", ""), +) as novu: + + res = novu.subscribers.preferences.update(subscriber_id="", patch_subscriber_preferences_dto={ + "channels": {}, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `subscriber_id` | *str* | :heavy_check_mark: | N/A | +| `patch_subscriber_preferences_dto` | [models.PatchSubscriberPreferencesDto](../../models/patchsubscriberpreferencesdto.md) | :heavy_check_mark: | N/A | +| `idempotency_key` | *Optional[str]* | :heavy_minus_sign: | A header for idempotency purposes | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SubscribersControllerUpdateSubscriberPreferencesResponse](../../models/subscriberscontrollerupdatesubscriberpreferencesresponse.md)** + +### Errors + | Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | models.ErrorDto | 414 | application/json | diff --git a/docs/sdks/subscribers/README.md b/docs/sdks/subscribers/README.md index 17fffb8..29e715b 100644 --- a/docs/sdks/subscribers/README.md +++ b/docs/sdks/subscribers/README.md @@ -33,7 +33,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.subscribers.list(limit=10) + res = novu.subscribers.list() while res is not None: # Handle items diff --git a/docs/sdks/topics/README.md b/docs/sdks/topics/README.md index 2b2402d..6de958b 100644 --- a/docs/sdks/topics/README.md +++ b/docs/sdks/topics/README.md @@ -74,7 +74,7 @@ with Novu( secret_key=os.getenv("NOVU_SECRET_KEY", ""), ) as novu: - res = novu.topics.list(page=0, page_size=10, key="exampleKey") + res = novu.topics.list(key="exampleKey") # Handle response print(res) diff --git a/pyproject.toml b/pyproject.toml index 5db6a63..a03e75c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "novu-py" -version = "0.3.0" +version = "0.3.1" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/src/novu_py/_version.py b/src/novu_py/_version.py index e32caa6..72b07c3 100644 --- a/src/novu_py/_version.py +++ b/src/novu_py/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "novu-py" -__version__: str = "0.3.0" +__version__: str = "0.3.1" __openapi_doc_version__: str = "1.0" -__gen_version__: str = "2.499.0" -__user_agent__: str = "speakeasy-sdk/python 0.3.0 2.499.0 1.0 novu-py" +__gen_version__: str = "2.500.5" +__user_agent__: str = "speakeasy-sdk/python 0.3.1 2.500.5 1.0 novu-py" try: if __package__ is not None: diff --git a/src/novu_py/authentication.py b/src/novu_py/authentication.py index 233a306..9ba314d 100644 --- a/src/novu_py/authentication.py +++ b/src/novu_py/authentication.py @@ -110,7 +110,7 @@ def chat_access_oauth_call_back( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "text/html"): return models.SubscribersV1ControllerChatOauthCallbackResponse( result=http_res.text, @@ -122,26 +122,28 @@ def chat_access_oauth_call_back( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -262,7 +264,7 @@ async def chat_access_oauth_call_back_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "text/html"): return models.SubscribersV1ControllerChatOauthCallbackResponse( result=http_res.text, @@ -274,26 +276,28 @@ async def chat_access_oauth_call_back_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -410,30 +414,32 @@ def chat_access_oauth( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return models.SubscribersV1ControllerChatAccessOauthResponse(headers={}) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -550,30 +556,32 @@ async def chat_access_oauth_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return models.SubscribersV1ControllerChatAccessOauthResponse(headers={}) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/credentials.py b/src/novu_py/credentials.py index a3e66f3..a2ac22d 100644 --- a/src/novu_py/credentials.py +++ b/src/novu_py/credentials.py @@ -116,7 +116,7 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberChannelResponse( result=utils.unmarshal_json( @@ -125,26 +125,28 @@ def update( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -277,7 +279,7 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberChannelResponse( result=utils.unmarshal_json( @@ -286,26 +288,28 @@ async def update_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -440,7 +444,7 @@ def append( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerModifySubscriberChannelResponse( result=utils.unmarshal_json( @@ -449,26 +453,28 @@ def append( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -603,7 +609,7 @@ async def append_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerModifySubscriberChannelResponse( result=utils.unmarshal_json( @@ -612,26 +618,28 @@ async def append_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -751,32 +759,34 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.SubscribersV1ControllerDeleteSubscriberCredentialsResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -896,32 +906,34 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.SubscribersV1ControllerDeleteSubscriberCredentialsResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/integrations.py b/src/novu_py/integrations.py index 16d0101..1c4cf35 100644 --- a/src/novu_py/integrations.py +++ b/src/novu_py/integrations.py @@ -113,7 +113,7 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerListIntegrationsResponse( result=utils.unmarshal_json( @@ -122,26 +122,28 @@ def list( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -255,7 +257,7 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerListIntegrationsResponse( result=utils.unmarshal_json( @@ -264,26 +266,28 @@ async def list_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -412,7 +416,7 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IntegrationsControllerCreateIntegrationResponse( result=utils.unmarshal_json( @@ -421,26 +425,28 @@ def create( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -569,7 +575,7 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IntegrationsControllerCreateIntegrationResponse( result=utils.unmarshal_json( @@ -578,26 +584,28 @@ async def create_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -711,7 +719,7 @@ def list_active( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerGetActiveIntegrationsResponse( result=utils.unmarshal_json( @@ -720,26 +728,28 @@ def list_active( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -853,7 +863,7 @@ async def list_active_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerGetActiveIntegrationsResponse( result=utils.unmarshal_json( @@ -862,26 +872,28 @@ async def list_active_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1011,7 +1023,7 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerUpdateIntegrationByIDResponse( result=utils.unmarshal_json( @@ -1020,26 +1032,28 @@ def update( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, ["404", "429"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1169,7 +1183,7 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerUpdateIntegrationByIDResponse( result=utils.unmarshal_json( @@ -1178,26 +1192,28 @@ async def update_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, ["404", "429"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1312,7 +1328,7 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerRemoveIntegrationResponse( result=utils.unmarshal_json( @@ -1321,26 +1337,28 @@ def delete( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1455,7 +1473,7 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerRemoveIntegrationResponse( result=utils.unmarshal_json( @@ -1464,26 +1482,28 @@ async def delete_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1598,7 +1618,7 @@ def set_as_primary( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerSetIntegrationAsPrimaryResponse( result=utils.unmarshal_json( @@ -1607,26 +1627,28 @@ def set_as_primary( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, ["404", "429"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1741,7 +1763,7 @@ async def set_as_primary_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerSetIntegrationAsPrimaryResponse( result=utils.unmarshal_json( @@ -1750,26 +1772,28 @@ async def set_as_primary_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, ["404", "429"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/messages.py b/src/novu_py/messages.py index e3dcf73..8c4e458 100644 --- a/src/novu_py/messages.py +++ b/src/novu_py/messages.py @@ -106,7 +106,7 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.MessagesControllerGetMessagesResponse( result=utils.unmarshal_json( @@ -115,26 +115,28 @@ def retrieve( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -253,7 +255,7 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.MessagesControllerGetMessagesResponse( result=utils.unmarshal_json( @@ -262,26 +264,28 @@ async def retrieve_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -398,7 +402,7 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.MessagesControllerDeleteMessageResponse( result=utils.unmarshal_json( @@ -407,26 +411,28 @@ def delete( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -543,7 +549,7 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.MessagesControllerDeleteMessageResponse( result=utils.unmarshal_json( @@ -552,26 +558,28 @@ async def delete_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -691,32 +699,34 @@ def delete_by_transaction_id( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.MessagesControllerDeleteMessagesByTransactionIDResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -836,32 +846,34 @@ async def delete_by_transaction_id_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.MessagesControllerDeleteMessagesByTransactionIDResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/models/__init__.py b/src/novu_py/models/__init__.py index 6137a75..0dd4ba7 100644 --- a/src/novu_py/models/__init__.py +++ b/src/novu_py/models/__init__.py @@ -192,11 +192,16 @@ FilterTopicsResponseDto, FilterTopicsResponseDtoTypedDict, ) +from .getsubscriberpreferencesdto import ( + GetSubscriberPreferencesDto, + GetSubscriberPreferencesDtoTypedDict, +) from .getsubscriberpreferencesresponsedto import ( GetSubscriberPreferencesResponseDto, GetSubscriberPreferencesResponseDtoTypedDict, ) from .gettopicresponsedto import GetTopicResponseDto, GetTopicResponseDtoTypedDict +from .globalpreferencedto import GlobalPreferenceDto, GlobalPreferenceDtoTypedDict from .integrationresponsedto import ( Channel, IntegrationResponseDto, @@ -382,6 +387,15 @@ ) from .ordinalenum import OrdinalEnum from .ordinalvalueenum import OrdinalValueEnum +from .overrides import Overrides, OverridesChannel, OverridesTypedDict, Source +from .patchpreferencechannelsdto import ( + PatchPreferenceChannelsDto, + PatchPreferenceChannelsDtoTypedDict, +) +from .patchsubscriberpreferencesdto import ( + PatchSubscriberPreferencesDto, + PatchSubscriberPreferencesDtoTypedDict, +) from .patchsubscriberrequestdto import ( PatchSubscriberRequestDto, PatchSubscriberRequestDtoData, @@ -430,6 +444,12 @@ SubscribersControllerGetSubscriberResponse, SubscribersControllerGetSubscriberResponseTypedDict, ) +from .subscriberscontroller_getsubscriberpreferencesop import ( + SubscribersControllerGetSubscriberPreferencesRequest, + SubscribersControllerGetSubscriberPreferencesRequestTypedDict, + SubscribersControllerGetSubscriberPreferencesResponse, + SubscribersControllerGetSubscriberPreferencesResponseTypedDict, +) from .subscriberscontroller_patchsubscriberop import ( SubscribersControllerPatchSubscriberRequest, SubscribersControllerPatchSubscriberRequestTypedDict, @@ -449,6 +469,12 @@ SubscribersControllerSearchSubscribersResponse, SubscribersControllerSearchSubscribersResponseTypedDict, ) +from .subscriberscontroller_updatesubscriberpreferencesop import ( + SubscribersControllerUpdateSubscriberPreferencesRequest, + SubscribersControllerUpdateSubscriberPreferencesRequestTypedDict, + SubscribersControllerUpdateSubscriberPreferencesResponse, + SubscribersControllerUpdateSubscriberPreferencesResponseTypedDict, +) from .subscribersv1controller_bulkcreatesubscribersop import ( SubscribersV1ControllerBulkCreateSubscribersRequest, SubscribersV1ControllerBulkCreateSubscribersRequestTypedDict, @@ -665,11 +691,11 @@ TriggerEventResponseDtoTypedDict, ) from .triggereventtoallrequestdto import ( - Overrides, - OverridesTypedDict, TriggerEventToAllRequestDto, TriggerEventToAllRequestDtoActor, TriggerEventToAllRequestDtoActorTypedDict, + TriggerEventToAllRequestDtoOverrides, + TriggerEventToAllRequestDtoOverridesTypedDict, TriggerEventToAllRequestDtoTenant, TriggerEventToAllRequestDtoTenantTypedDict, TriggerEventToAllRequestDtoTypedDict, @@ -723,6 +749,8 @@ ValidationErrorDtoData, ValidationErrorDtoValue, ) +from .workflowinfodto import WorkflowInfoDto, WorkflowInfoDtoTypedDict +from .workflowpreferencedto import WorkflowPreferenceDto, WorkflowPreferenceDtoTypedDict from .workflowresponse import ( WorkflowIntegrationStatus, WorkflowIntegrationStatusTypedDict, @@ -882,10 +910,14 @@ "FieldFilterPartDtoTypedDict", "FilterTopicsResponseDto", "FilterTopicsResponseDtoTypedDict", + "GetSubscriberPreferencesDto", + "GetSubscriberPreferencesDtoTypedDict", "GetSubscriberPreferencesResponseDto", "GetSubscriberPreferencesResponseDtoTypedDict", "GetTopicResponseDto", "GetTopicResponseDtoTypedDict", + "GlobalPreferenceDto", + "GlobalPreferenceDtoTypedDict", "IntegrationResponseDto", "IntegrationResponseDtoTypedDict", "IntegrationsControllerCreateIntegrationRequest", @@ -1026,8 +1058,13 @@ "OrdinalValue", "OrdinalValueEnum", "Overrides", + "OverridesChannel", "OverridesTypedDict", "Parameter", + "PatchPreferenceChannelsDto", + "PatchPreferenceChannelsDtoTypedDict", + "PatchSubscriberPreferencesDto", + "PatchSubscriberPreferencesDtoTypedDict", "PatchSubscriberRequestDto", "PatchSubscriberRequestDtoData", "PatchSubscriberRequestDtoDataTypedDict", @@ -1053,6 +1090,7 @@ "ReplyCallbackTypedDict", "Security", "SecurityTypedDict", + "Source", "Status", "StepFilterDto", "StepFilterDtoTypedDict", @@ -1065,6 +1103,10 @@ "SubscriberPayloadDtoTypedDict", "SubscriberResponseDto", "SubscriberResponseDtoTypedDict", + "SubscribersControllerGetSubscriberPreferencesRequest", + "SubscribersControllerGetSubscriberPreferencesRequestTypedDict", + "SubscribersControllerGetSubscriberPreferencesResponse", + "SubscribersControllerGetSubscriberPreferencesResponseTypedDict", "SubscribersControllerGetSubscriberRequest", "SubscribersControllerGetSubscriberRequestTypedDict", "SubscribersControllerGetSubscriberResponse", @@ -1081,6 +1123,10 @@ "SubscribersControllerSearchSubscribersRequestTypedDict", "SubscribersControllerSearchSubscribersResponse", "SubscribersControllerSearchSubscribersResponseTypedDict", + "SubscribersControllerUpdateSubscriberPreferencesRequest", + "SubscribersControllerUpdateSubscriberPreferencesRequestTypedDict", + "SubscribersControllerUpdateSubscriberPreferencesResponse", + "SubscribersControllerUpdateSubscriberPreferencesResponseTypedDict", "SubscribersV1ControllerBulkCreateSubscribersRequest", "SubscribersV1ControllerBulkCreateSubscribersRequestTypedDict", "SubscribersV1ControllerBulkCreateSubscribersResponse", @@ -1230,6 +1276,8 @@ "TriggerEventToAllRequestDto", "TriggerEventToAllRequestDtoActor", "TriggerEventToAllRequestDtoActorTypedDict", + "TriggerEventToAllRequestDtoOverrides", + "TriggerEventToAllRequestDtoOverridesTypedDict", "TriggerEventToAllRequestDtoTenant", "TriggerEventToAllRequestDtoTenantTypedDict", "TriggerEventToAllRequestDtoTypedDict", @@ -1266,8 +1314,12 @@ "ValidationErrorDtoValue", "Value", "WeekDays", + "WorkflowInfoDto", + "WorkflowInfoDtoTypedDict", "WorkflowIntegrationStatus", "WorkflowIntegrationStatusTypedDict", + "WorkflowPreferenceDto", + "WorkflowPreferenceDtoTypedDict", "WorkflowResponse", "WorkflowResponseData", "WorkflowResponseDataTypedDict", diff --git a/src/novu_py/models/getsubscriberpreferencesdto.py b/src/novu_py/models/getsubscriberpreferencesdto.py new file mode 100644 index 0000000..7bdf12e --- /dev/null +++ b/src/novu_py/models/getsubscriberpreferencesdto.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .globalpreferencedto import GlobalPreferenceDto, GlobalPreferenceDtoTypedDict +from .workflowpreferencedto import WorkflowPreferenceDto, WorkflowPreferenceDtoTypedDict +from novu_py.types import BaseModel +import pydantic +from typing import List +from typing_extensions import Annotated, TypedDict + + +class GetSubscriberPreferencesDtoTypedDict(TypedDict): + global_: GlobalPreferenceDtoTypedDict + r"""Global preference settings""" + workflows: List[WorkflowPreferenceDtoTypedDict] + r"""Workflow-specific preference settings""" + + +class GetSubscriberPreferencesDto(BaseModel): + global_: Annotated[GlobalPreferenceDto, pydantic.Field(alias="global")] + r"""Global preference settings""" + + workflows: List[WorkflowPreferenceDto] + r"""Workflow-specific preference settings""" diff --git a/src/novu_py/models/globalpreferencedto.py b/src/novu_py/models/globalpreferencedto.py new file mode 100644 index 0000000..15e429c --- /dev/null +++ b/src/novu_py/models/globalpreferencedto.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .preferencechannels import PreferenceChannels, PreferenceChannelsTypedDict +from novu_py.types import BaseModel +from typing_extensions import TypedDict + + +class GlobalPreferenceDtoTypedDict(TypedDict): + enabled: bool + r"""Whether notifications are enabled globally""" + channels: PreferenceChannelsTypedDict + r"""Channel-specific preference settings""" + + +class GlobalPreferenceDto(BaseModel): + enabled: bool + r"""Whether notifications are enabled globally""" + + channels: PreferenceChannels + r"""Channel-specific preference settings""" diff --git a/src/novu_py/models/overrides.py b/src/novu_py/models/overrides.py new file mode 100644 index 0000000..4b96ff2 --- /dev/null +++ b/src/novu_py/models/overrides.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from novu_py.types import BaseModel +from typing_extensions import TypedDict + + +class OverridesChannel(str, Enum): + r"""The channel type which is overridden""" + + IN_APP = "in_app" + EMAIL = "email" + SMS = "sms" + CHAT = "chat" + PUSH = "push" + + +class Source(str, Enum): + r"""The source of overrides""" + + SUBSCRIBER = "subscriber" + TEMPLATE = "template" + WORKFLOW_OVERRIDE = "workflowOverride" + + +class OverridesTypedDict(TypedDict): + channel: OverridesChannel + r"""The channel type which is overridden""" + source: Source + r"""The source of overrides""" + + +class Overrides(BaseModel): + channel: OverridesChannel + r"""The channel type which is overridden""" + + source: Source + r"""The source of overrides""" diff --git a/src/novu_py/models/patchpreferencechannelsdto.py b/src/novu_py/models/patchpreferencechannelsdto.py new file mode 100644 index 0000000..d74dc1e --- /dev/null +++ b/src/novu_py/models/patchpreferencechannelsdto.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from novu_py.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PatchPreferenceChannelsDtoTypedDict(TypedDict): + email: NotRequired[bool] + r"""Email channel preference""" + sms: NotRequired[bool] + r"""SMS channel preference""" + in_app: NotRequired[bool] + r"""In-app channel preference""" + push: NotRequired[bool] + r"""Push channel preference""" + chat: NotRequired[bool] + r"""Chat channel preference""" + + +class PatchPreferenceChannelsDto(BaseModel): + email: Optional[bool] = None + r"""Email channel preference""" + + sms: Optional[bool] = None + r"""SMS channel preference""" + + in_app: Optional[bool] = None + r"""In-app channel preference""" + + push: Optional[bool] = None + r"""Push channel preference""" + + chat: Optional[bool] = None + r"""Chat channel preference""" diff --git a/src/novu_py/models/patchsubscriberpreferencesdto.py b/src/novu_py/models/patchsubscriberpreferencesdto.py new file mode 100644 index 0000000..296dbe0 --- /dev/null +++ b/src/novu_py/models/patchsubscriberpreferencesdto.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .patchpreferencechannelsdto import ( + PatchPreferenceChannelsDto, + PatchPreferenceChannelsDtoTypedDict, +) +from novu_py.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PatchSubscriberPreferencesDtoTypedDict(TypedDict): + channels: PatchPreferenceChannelsDtoTypedDict + r"""Channel-specific preference settings""" + workflow_id: NotRequired[str] + r"""If provided, update workflow specific preferences, otherwise update global preferences""" + + +class PatchSubscriberPreferencesDto(BaseModel): + channels: PatchPreferenceChannelsDto + r"""Channel-specific preference settings""" + + workflow_id: Annotated[Optional[str], pydantic.Field(alias="workflowId")] = None + r"""If provided, update workflow specific preferences, otherwise update global preferences""" diff --git a/src/novu_py/models/subscriberscontroller_getsubscriberpreferencesop.py b/src/novu_py/models/subscriberscontroller_getsubscriberpreferencesop.py new file mode 100644 index 0000000..4236bda --- /dev/null +++ b/src/novu_py/models/subscriberscontroller_getsubscriberpreferencesop.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .getsubscriberpreferencesdto import ( + GetSubscriberPreferencesDto, + GetSubscriberPreferencesDtoTypedDict, +) +from novu_py.types import BaseModel +from novu_py.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SubscribersControllerGetSubscriberPreferencesRequestTypedDict(TypedDict): + subscriber_id: str + idempotency_key: NotRequired[str] + r"""A header for idempotency purposes""" + + +class SubscribersControllerGetSubscriberPreferencesRequest(BaseModel): + subscriber_id: Annotated[ + str, + pydantic.Field(alias="subscriberId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + + idempotency_key: Annotated[ + Optional[str], + pydantic.Field(alias="idempotency-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""A header for idempotency purposes""" + + +class SubscribersControllerGetSubscriberPreferencesResponseTypedDict(TypedDict): + headers: Dict[str, List[str]] + result: GetSubscriberPreferencesDtoTypedDict + + +class SubscribersControllerGetSubscriberPreferencesResponse(BaseModel): + headers: Dict[str, List[str]] + + result: GetSubscriberPreferencesDto diff --git a/src/novu_py/models/subscriberscontroller_updatesubscriberpreferencesop.py b/src/novu_py/models/subscriberscontroller_updatesubscriberpreferencesop.py new file mode 100644 index 0000000..a943537 --- /dev/null +++ b/src/novu_py/models/subscriberscontroller_updatesubscriberpreferencesop.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .getsubscriberpreferencesdto import ( + GetSubscriberPreferencesDto, + GetSubscriberPreferencesDtoTypedDict, +) +from .patchsubscriberpreferencesdto import ( + PatchSubscriberPreferencesDto, + PatchSubscriberPreferencesDtoTypedDict, +) +from novu_py.types import BaseModel +from novu_py.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SubscribersControllerUpdateSubscriberPreferencesRequestTypedDict(TypedDict): + subscriber_id: str + patch_subscriber_preferences_dto: PatchSubscriberPreferencesDtoTypedDict + idempotency_key: NotRequired[str] + r"""A header for idempotency purposes""" + + +class SubscribersControllerUpdateSubscriberPreferencesRequest(BaseModel): + subscriber_id: Annotated[ + str, + pydantic.Field(alias="subscriberId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + + patch_subscriber_preferences_dto: Annotated[ + PatchSubscriberPreferencesDto, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + idempotency_key: Annotated[ + Optional[str], + pydantic.Field(alias="idempotency-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""A header for idempotency purposes""" + + +class SubscribersControllerUpdateSubscriberPreferencesResponseTypedDict(TypedDict): + headers: Dict[str, List[str]] + result: GetSubscriberPreferencesDtoTypedDict + + +class SubscribersControllerUpdateSubscriberPreferencesResponse(BaseModel): + headers: Dict[str, List[str]] + + result: GetSubscriberPreferencesDto diff --git a/src/novu_py/models/triggereventtoallrequestdto.py b/src/novu_py/models/triggereventtoallrequestdto.py index 687e0fe..a52d1a6 100644 --- a/src/novu_py/models/triggereventtoallrequestdto.py +++ b/src/novu_py/models/triggereventtoallrequestdto.py @@ -9,11 +9,11 @@ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -class OverridesTypedDict(TypedDict): +class TriggerEventToAllRequestDtoOverridesTypedDict(TypedDict): r"""This could be used to override provider specific configurations""" -class Overrides(BaseModel): +class TriggerEventToAllRequestDtoOverrides(BaseModel): r"""This could be used to override provider specific configurations""" @@ -62,7 +62,7 @@ class TriggerEventToAllRequestDtoTypedDict(TypedDict): could be used to render the template, or perform routing rules based on it. For In-App channel, payload data are also available in """ - overrides: NotRequired[OverridesTypedDict] + overrides: NotRequired[TriggerEventToAllRequestDtoOverridesTypedDict] r"""This could be used to override provider specific configurations""" transaction_id: NotRequired[str] r"""A unique identifier for this transaction, we will generated a UUID if not provided.""" @@ -88,7 +88,7 @@ class TriggerEventToAllRequestDto(BaseModel): For In-App channel, payload data are also available in """ - overrides: Optional[Overrides] = None + overrides: Optional[TriggerEventToAllRequestDtoOverrides] = None r"""This could be used to override provider specific configurations""" transaction_id: Annotated[Optional[str], pydantic.Field(alias="transactionId")] = ( diff --git a/src/novu_py/models/workflowinfodto.py b/src/novu_py/models/workflowinfodto.py new file mode 100644 index 0000000..e7b0672 --- /dev/null +++ b/src/novu_py/models/workflowinfodto.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from novu_py.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowInfoDtoTypedDict(TypedDict): + slug: str + r"""Workflow slug""" + identifier: str + r"""Unique identifier of the workflow""" + name: str + r"""Display name of the workflow""" + + +class WorkflowInfoDto(BaseModel): + slug: str + r"""Workflow slug""" + + identifier: str + r"""Unique identifier of the workflow""" + + name: str + r"""Display name of the workflow""" diff --git a/src/novu_py/models/workflowpreferencedto.py b/src/novu_py/models/workflowpreferencedto.py new file mode 100644 index 0000000..f0e544e --- /dev/null +++ b/src/novu_py/models/workflowpreferencedto.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .overrides import Overrides, OverridesTypedDict +from .preferencechannels import PreferenceChannels, PreferenceChannelsTypedDict +from .workflowinfodto import WorkflowInfoDto, WorkflowInfoDtoTypedDict +from novu_py.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class WorkflowPreferenceDtoTypedDict(TypedDict): + enabled: bool + r"""Whether notifications are enabled for this workflow""" + channels: PreferenceChannelsTypedDict + r"""Channel-specific preference settings for this workflow""" + overrides: List[OverridesTypedDict] + r"""List of preference overrides""" + workflow: WorkflowInfoDtoTypedDict + r"""Workflow information""" + + +class WorkflowPreferenceDto(BaseModel): + enabled: bool + r"""Whether notifications are enabled for this workflow""" + + channels: PreferenceChannels + r"""Channel-specific preference settings for this workflow""" + + overrides: List[Overrides] + r"""List of preference overrides""" + + workflow: WorkflowInfoDto + r"""Workflow information""" diff --git a/src/novu_py/notifications.py b/src/novu_py/notifications.py index fa17ada..14485e8 100644 --- a/src/novu_py/notifications.py +++ b/src/novu_py/notifications.py @@ -112,7 +112,7 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerListNotificationsResponse( result=utils.unmarshal_json( @@ -121,26 +121,28 @@ def list( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -257,7 +259,7 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerListNotificationsResponse( result=utils.unmarshal_json( @@ -266,26 +268,28 @@ async def list_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -400,7 +404,7 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetNotificationResponse( result=utils.unmarshal_json( @@ -409,26 +413,28 @@ def retrieve( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -543,7 +549,7 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetNotificationResponse( result=utils.unmarshal_json( @@ -552,26 +558,28 @@ async def retrieve_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/novu_messages.py b/src/novu_py/novu_messages.py index 3e104a8..7d6d7a5 100644 --- a/src/novu_py/novu_messages.py +++ b/src/novu_py/novu_messages.py @@ -112,7 +112,7 @@ def mark_all_as( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkMessagesAsResponse( result=utils.unmarshal_json( @@ -121,26 +121,28 @@ def mark_all_as( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -269,7 +271,7 @@ async def mark_all_as_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkMessagesAsResponse( result=utils.unmarshal_json( @@ -278,26 +280,28 @@ async def mark_all_as_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -427,33 +431,35 @@ def mark_all( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkAllUnreadAsReadResponse( result=utils.unmarshal_json(http_res.text, float), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -583,33 +589,35 @@ async def mark_all_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkAllUnreadAsReadResponse( result=utils.unmarshal_json(http_res.text, float), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -733,33 +741,35 @@ def update_as_seen( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkActionAsSeenResponse( result=utils.unmarshal_json(http_res.text, models.MessageResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -883,33 +893,35 @@ async def update_as_seen_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerMarkActionAsSeenResponse( result=utils.unmarshal_json(http_res.text, models.MessageResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/novu_notifications.py b/src/novu_py/novu_notifications.py index 43668c3..8a7b3c2 100644 --- a/src/novu_py/novu_notifications.py +++ b/src/novu_py/novu_notifications.py @@ -102,33 +102,35 @@ def feed( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetNotificationsFeedResponse( result=utils.unmarshal_json(http_res.text, models.FeedResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -247,33 +249,35 @@ async def feed_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetNotificationsFeedResponse( result=utils.unmarshal_json(http_res.text, models.FeedResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -394,33 +398,35 @@ def unseen_count( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetUnseenCountResponse( result=utils.unmarshal_json(http_res.text, models.UnseenCountResponse), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -541,33 +547,35 @@ async def unseen_count_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetUnseenCountResponse( result=utils.unmarshal_json(http_res.text, models.UnseenCountResponse), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/novu_subscribers.py b/src/novu_py/novu_subscribers.py index 285a409..3e75ce3 100644 --- a/src/novu_py/novu_subscribers.py +++ b/src/novu_py/novu_subscribers.py @@ -114,7 +114,7 @@ def assign( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerAssignResponse( result=utils.unmarshal_json( @@ -123,26 +123,28 @@ def assign( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -273,7 +275,7 @@ async def assign_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerAssignResponse( result=utils.unmarshal_json( @@ -282,26 +284,28 @@ async def assign_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -421,33 +425,35 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerGetTopicSubscriberResponse( result=utils.unmarshal_json(http_res.text, models.TopicSubscriberDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -567,33 +573,35 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerGetTopicSubscriberResponse( result=utils.unmarshal_json(http_res.text, models.TopicSubscriberDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -725,32 +733,34 @@ def remove( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.TopicsControllerRemoveSubscribersResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -882,32 +892,34 @@ async def remove_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.TopicsControllerRemoveSubscribersResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/preferences.py b/src/novu_py/preferences.py index 4b609e5..8cb72fa 100644 --- a/src/novu_py/preferences.py +++ b/src/novu_py/preferences.py @@ -101,7 +101,7 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerListSubscriberPreferencesResponse( result=utils.unmarshal_json( @@ -110,26 +110,28 @@ def list( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -247,7 +249,7 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerListSubscriberPreferencesResponse( result=utils.unmarshal_json( @@ -256,26 +258,28 @@ async def list_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -406,7 +410,7 @@ def update_global( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return ( models.SubscribersV1ControllerUpdateSubscriberGlobalPreferencesResponse( @@ -418,26 +422,28 @@ def update_global( ) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -568,7 +574,7 @@ async def update_global_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return ( models.SubscribersV1ControllerUpdateSubscriberGlobalPreferencesResponse( @@ -580,26 +586,28 @@ async def update_global_async( ) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -720,7 +728,7 @@ def retrieve_by_level( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetSubscriberPreferenceByLevelResponse( result=utils.unmarshal_json( @@ -729,26 +737,28 @@ def retrieve_by_level( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -869,7 +879,7 @@ async def retrieve_by_level_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetSubscriberPreferenceByLevelResponse( result=utils.unmarshal_json( @@ -878,26 +888,28 @@ async def retrieve_by_level_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -923,7 +935,7 @@ async def retrieve_by_level_async( http_res, ) - def update( + def update_legacy( self, *, subscriber_id: str, @@ -1031,7 +1043,7 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberPreferenceResponse( result=utils.unmarshal_json( @@ -1040,26 +1052,28 @@ def update( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1085,7 +1099,7 @@ def update( http_res, ) - async def update_async( + async def update_legacy_async( self, *, subscriber_id: str, @@ -1193,7 +1207,7 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberPreferenceResponse( result=utils.unmarshal_json( @@ -1202,26 +1216,646 @@ async def update_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "405", "409", "413", "415"], + "application/json", + ): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) + if utils.match_response(http_res, "429", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "503", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.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 models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def retrieve( + self, + *, + subscriber_id: str, + idempotency_key: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SubscribersControllerGetSubscriberPreferencesResponse: + r"""Get subscriber preferences + + Get subscriber global and workflow specific preferences + + :param subscriber_id: + :param idempotency_key: A header for idempotency purposes + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.SubscribersControllerGetSubscriberPreferencesRequest( + subscriber_id=subscriber_id, + idempotency_key=idempotency_key, + ) + + req = self._build_request( + method="GET", + path="/v2/subscribers/{subscriberId}/preferences", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + 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(1000, 30000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "409", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="SubscribersController_getSubscriberPreferences", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "413", + "414", + "415", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.SubscribersControllerGetSubscriberPreferencesResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubscriberPreferencesDto + ), + headers=utils.get_response_headers(http_res.headers), + ) + if utils.match_response(http_res, "414", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) + if utils.match_response(http_res, "429", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "503", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "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 models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def retrieve_async( + self, + *, + subscriber_id: str, + idempotency_key: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SubscribersControllerGetSubscriberPreferencesResponse: + r"""Get subscriber preferences + + Get subscriber global and workflow specific preferences + + :param subscriber_id: + :param idempotency_key: A header for idempotency purposes + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.SubscribersControllerGetSubscriberPreferencesRequest( + subscriber_id=subscriber_id, + idempotency_key=idempotency_key, + ) + + req = self._build_request_async( + method="GET", + path="/v2/subscribers/{subscriberId}/preferences", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + 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(1000, 30000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "409", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="SubscribersController_getSubscriberPreferences", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "413", + "414", + "415", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.SubscribersControllerGetSubscriberPreferencesResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubscriberPreferencesDto + ), + headers=utils.get_response_headers(http_res.headers), + ) + if utils.match_response(http_res, "414", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "405", "409", "413", "415"], + "application/json", + ): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) + if utils.match_response(http_res, "429", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "503", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.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 models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update( + self, + *, + subscriber_id: str, + patch_subscriber_preferences_dto: Union[ + models.PatchSubscriberPreferencesDto, + models.PatchSubscriberPreferencesDtoTypedDict, + ], + idempotency_key: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SubscribersControllerUpdateSubscriberPreferencesResponse: + r"""Update subscriber global or workflow specific preferences + + Update subscriber global or workflow specific preferences + + :param subscriber_id: + :param patch_subscriber_preferences_dto: + :param idempotency_key: A header for idempotency purposes + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.SubscribersControllerUpdateSubscriberPreferencesRequest( + subscriber_id=subscriber_id, + idempotency_key=idempotency_key, + patch_subscriber_preferences_dto=utils.get_pydantic_model( + patch_subscriber_preferences_dto, models.PatchSubscriberPreferencesDto + ), + ) + + req = self._build_request( + method="PATCH", + path="/v2/subscribers/{subscriberId}/preferences", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.patch_subscriber_preferences_dto, + False, + False, + "json", + models.PatchSubscriberPreferencesDto, + ), + 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(1000, 30000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "409", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="SubscribersController_updateSubscriberPreferences", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "413", + "414", + "415", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.SubscribersControllerUpdateSubscriberPreferencesResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubscriberPreferencesDto + ), + headers=utils.get_response_headers(http_res.headers), + ) + if utils.match_response(http_res, "414", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "405", "409", "413", "415"], + "application/json", + ): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) + if utils.match_response(http_res, "429", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "503", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "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 models.APIError( + 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, + *, + subscriber_id: str, + patch_subscriber_preferences_dto: Union[ + models.PatchSubscriberPreferencesDto, + models.PatchSubscriberPreferencesDtoTypedDict, + ], + idempotency_key: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SubscribersControllerUpdateSubscriberPreferencesResponse: + r"""Update subscriber global or workflow specific preferences + + Update subscriber global or workflow specific preferences + + :param subscriber_id: + :param patch_subscriber_preferences_dto: + :param idempotency_key: A header for idempotency purposes + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.SubscribersControllerUpdateSubscriberPreferencesRequest( + subscriber_id=subscriber_id, + idempotency_key=idempotency_key, + patch_subscriber_preferences_dto=utils.get_pydantic_model( + patch_subscriber_preferences_dto, models.PatchSubscriberPreferencesDto + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v2/subscribers/{subscriberId}/preferences", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.patch_subscriber_preferences_dto, + False, + False, + "json", + models.PatchSubscriberPreferencesDto, + ), + 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(1000, 30000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "409", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="SubscribersController_updateSubscriberPreferences", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=[ + "400", + "401", + "403", + "404", + "405", + "409", + "413", + "414", + "415", + "422", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.SubscribersControllerUpdateSubscriberPreferencesResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubscriberPreferencesDto + ), + headers=utils.get_response_headers(http_res.headers), + ) + if utils.match_response(http_res, "414", "application/json"): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "405", "409", "413", "415"], + "application/json", + ): + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/properties.py b/src/novu_py/properties.py index 5fecb52..1b4a5a8 100644 --- a/src/novu_py/properties.py +++ b/src/novu_py/properties.py @@ -116,7 +116,7 @@ def update_online_flag( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse( result=utils.unmarshal_json( @@ -125,26 +125,28 @@ def update_online_flag( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -277,7 +279,7 @@ async def update_online_flag_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse( result=utils.unmarshal_json( @@ -286,26 +288,28 @@ async def update_online_flag_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/sdk.py b/src/novu_py/sdk.py index 32a06d3..17fd3d6 100644 --- a/src/novu_py/sdk.py +++ b/src/novu_py/sdk.py @@ -256,7 +256,7 @@ def trigger( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.EventsControllerTriggerResponse( result=utils.unmarshal_json( @@ -265,26 +265,28 @@ def trigger( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -416,7 +418,7 @@ async def trigger_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.EventsControllerTriggerResponse( result=utils.unmarshal_json( @@ -425,26 +427,28 @@ async def trigger_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -575,7 +579,7 @@ def trigger_bulk( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.EventsControllerTriggerBulkResponse( result=utils.unmarshal_json( @@ -584,26 +588,28 @@ def trigger_bulk( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -734,7 +740,7 @@ async def trigger_bulk_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.EventsControllerTriggerBulkResponse( result=utils.unmarshal_json( @@ -743,26 +749,28 @@ async def trigger_bulk_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -893,7 +901,7 @@ def trigger_broadcast( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, ["200", "201"], "application/json"): return models.EventsControllerBroadcastEventToAllResponse( result=utils.unmarshal_json( @@ -902,26 +910,28 @@ def trigger_broadcast( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1052,7 +1062,7 @@ async def trigger_broadcast_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, ["200", "201"], "application/json"): return models.EventsControllerBroadcastEventToAllResponse( result=utils.unmarshal_json( @@ -1061,26 +1071,28 @@ async def trigger_broadcast_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1200,33 +1212,35 @@ def cancel( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EventsControllerCancelResponse( result=utils.unmarshal_json(http_res.text, models.DataBooleanDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1346,33 +1360,35 @@ async def cancel_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EventsControllerCancelResponse( result=utils.unmarshal_json(http_res.text, models.DataBooleanDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/stats.py b/src/novu_py/stats.py index a0e3da2..ffc0721 100644 --- a/src/novu_py/stats.py +++ b/src/novu_py/stats.py @@ -95,7 +95,7 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetActivityStatsResponse( result=utils.unmarshal_json( @@ -104,26 +104,28 @@ def retrieve( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -235,7 +237,7 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetActivityStatsResponse( result=utils.unmarshal_json( @@ -244,26 +246,28 @@ async def retrieve_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -378,7 +382,7 @@ def graph( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetActivityGraphStatsResponse( result=utils.unmarshal_json( @@ -387,26 +391,28 @@ def graph( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -521,7 +527,7 @@ async def graph_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.NotificationsControllerGetActivityGraphStatsResponse( result=utils.unmarshal_json( @@ -530,26 +536,28 @@ async def graph_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/subscribers.py b/src/novu_py/subscribers.py index 89ca5e2..c333dea 100644 --- a/src/novu_py/subscribers.py +++ b/src/novu_py/subscribers.py @@ -159,7 +159,7 @@ def next_func() -> ( retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerListSubscribersResponse( result=utils.unmarshal_json( @@ -170,26 +170,28 @@ def next_func() -> ( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -332,7 +334,7 @@ def next_func() -> ( retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerListSubscribersResponse( result=utils.unmarshal_json( @@ -343,26 +345,28 @@ def next_func() -> ( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -491,7 +495,7 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerCreateSubscriberResponse( result=utils.unmarshal_json( @@ -500,26 +504,28 @@ def create( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -648,7 +654,7 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerCreateSubscriberResponse( result=utils.unmarshal_json( @@ -657,26 +663,28 @@ async def create_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -796,7 +804,7 @@ def retrieve_legacy( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetSubscriberResponse( result=utils.unmarshal_json( @@ -805,26 +813,28 @@ def retrieve_legacy( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -944,7 +954,7 @@ async def retrieve_legacy_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerGetSubscriberResponse( result=utils.unmarshal_json( @@ -953,26 +963,28 @@ async def retrieve_legacy_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1104,7 +1116,7 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberResponse( result=utils.unmarshal_json( @@ -1113,26 +1125,28 @@ def update( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1264,7 +1278,7 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerUpdateSubscriberResponse( result=utils.unmarshal_json( @@ -1273,26 +1287,28 @@ async def update_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1412,7 +1428,7 @@ def delete_legacy( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerRemoveSubscriberResponse( result=utils.unmarshal_json( @@ -1421,26 +1437,28 @@ def delete_legacy( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1560,7 +1578,7 @@ async def delete_legacy_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersV1ControllerRemoveSubscriberResponse( result=utils.unmarshal_json( @@ -1569,26 +1587,28 @@ async def delete_legacy_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1719,7 +1739,7 @@ def create_bulk( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerBulkCreateSubscribersResponse( result=utils.unmarshal_json( @@ -1728,26 +1748,28 @@ def create_bulk( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1878,7 +1900,7 @@ async def create_bulk_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SubscribersV1ControllerBulkCreateSubscribersResponse( result=utils.unmarshal_json( @@ -1887,26 +1909,28 @@ async def create_bulk_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -2023,7 +2047,7 @@ def search( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerSearchSubscribersResponse( result=utils.unmarshal_json( @@ -2032,26 +2056,28 @@ def search( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -2168,7 +2194,7 @@ async def search_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerSearchSubscribersResponse( result=utils.unmarshal_json( @@ -2177,26 +2203,28 @@ async def search_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -2313,7 +2341,7 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerGetSubscriberResponse( result=utils.unmarshal_json( @@ -2322,26 +2350,28 @@ def retrieve( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -2458,7 +2488,7 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerGetSubscriberResponse( result=utils.unmarshal_json( @@ -2467,26 +2497,28 @@ async def retrieve_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -2617,7 +2649,7 @@ def patch( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerPatchSubscriberResponse( result=utils.unmarshal_json( @@ -2626,26 +2658,28 @@ def patch( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -2776,7 +2810,7 @@ async def patch_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerPatchSubscriberResponse( result=utils.unmarshal_json( @@ -2785,26 +2819,28 @@ async def patch_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -2921,7 +2957,7 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerRemoveSubscriberResponse( result=utils.unmarshal_json( @@ -2930,26 +2966,28 @@ def delete( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -3066,7 +3104,7 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscribersControllerRemoveSubscriberResponse( result=utils.unmarshal_json( @@ -3075,26 +3113,28 @@ async def delete_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/topics.py b/src/novu_py/topics.py index c37498a..3dc0bcf 100644 --- a/src/novu_py/topics.py +++ b/src/novu_py/topics.py @@ -127,7 +127,7 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.TopicsControllerCreateTopicResponse( result=utils.unmarshal_json( @@ -136,26 +136,28 @@ def create( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -283,7 +285,7 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.TopicsControllerCreateTopicResponse( result=utils.unmarshal_json( @@ -292,26 +294,28 @@ async def create_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -434,7 +438,7 @@ def list( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerListTopicsResponse( result=utils.unmarshal_json( @@ -443,26 +447,28 @@ def list( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -585,7 +591,7 @@ async def list_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerListTopicsResponse( result=utils.unmarshal_json( @@ -594,26 +600,28 @@ async def list_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -730,32 +738,34 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.TopicsControllerDeleteTopicResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -872,32 +882,34 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return models.TopicsControllerDeleteTopicResponse( headers=utils.get_response_headers(http_res.headers) ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1014,33 +1026,35 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerGetTopicResponse( result=utils.unmarshal_json(http_res.text, models.GetTopicResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1157,33 +1171,35 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerGetTopicResponse( result=utils.unmarshal_json(http_res.text, models.GetTopicResponseDto), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -1314,7 +1330,7 @@ def rename( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerRenameTopicResponse( result=utils.unmarshal_json( @@ -1323,26 +1339,28 @@ def rename( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -1473,7 +1491,7 @@ async def rename_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.TopicsControllerRenameTopicResponse( result=utils.unmarshal_json( @@ -1482,26 +1500,28 @@ async def rename_async( headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/src/novu_py/webhooks.py b/src/novu_py/webhooks.py index 0e7d1e3..60b2836 100644 --- a/src/novu_py/webhooks.py +++ b/src/novu_py/webhooks.py @@ -100,33 +100,35 @@ def retrieve( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerGetWebhookSupportStatusResponse( result=utils.unmarshal_json(http_res.text, bool), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -243,33 +245,35 @@ async def retrieve_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IntegrationsControllerGetWebhookSupportStatusResponse( result=utils.unmarshal_json(http_res.text, bool), headers=utils.get_response_headers(http_res.headers), ) if utils.match_response(http_res, "414", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response( http_res, ["400", "401", "403", "404", "405", "409", "413", "415"], "application/json", ): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ValidationErrorDtoData) - raise models.ValidationErrorDto(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ValidationErrorDtoData + ) + raise models.ValidationErrorDto(data=response_data) if utils.match_response(http_res, "429", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) - raise models.ErrorDto(data=data) + response_data = utils.unmarshal_json(http_res.text, models.ErrorDtoData) + raise models.ErrorDto(data=response_data) if utils.match_response(http_res, "503", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError(