From 8eb9395ec4d41d744f68e52005e364f85a055191 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 6 Feb 2025 00:02:38 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1 --- .speakeasy/gen.lock | 62 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 +- README.md | 33 + RELEASES.md | 12 +- codeSamples.yaml | 62 +- .../errors/getcountrieslibrarybadrequest.md | 11 + .../errors/getcountrieslibraryerrors.md | 10 + .../getcountrieslibrarylibraryerrors.md | 10 + .../errors/getcountrieslibraryunauthorized.md | 11 + .../errors/getgenreslibrarybadrequest.md | 11 + docs/models/errors/getgenreslibraryerrors.md | 10 + .../errors/getgenreslibrarylibraryerrors.md | 10 + .../errors/getgenreslibraryunauthorized.md | 11 + .../models/operations/{field.md => fieldt.md} | 2 +- .../getcountrieslibrarydirectory.md | 10 + .../getcountrieslibrarymediacontainer.md | 22 + .../operations/getcountrieslibraryrequest.md | 8 + .../operations/getcountrieslibraryresponse.md | 11 + .../getcountrieslibraryresponsebody.md | 10 + .../operations/getgenreslibrarydirectory.md | 11 + .../getgenreslibrarymediacontainer.md | 22 + .../operations/getgenreslibraryrequest.md | 8 + .../operations/getgenreslibraryresponse.md | 11 + .../getgenreslibraryresponsebody.md | 10 + .../operations/getrecentlyaddedlibrarytype.md | 2 +- .../getrecentlyaddedmediacontainer.md | 2 +- docs/sdks/authentication/README.md | 1 - docs/sdks/hubs/README.md | 3 - docs/sdks/library/README.md | 98 ++- docs/sdks/plex/README.md | 4 +- docs/sdks/search/README.md | 4 +- docs/sdks/watchlist/README.md | 2 - poetry.lock | 14 +- pyproject.toml | 4 +- src/plex_api_client/_version.py | 6 +- src/plex_api_client/activities.py | 56 +- src/plex_api_client/authentication.py | 112 +-- src/plex_api_client/butler.py | 156 ++-- src/plex_api_client/hubs.py | 56 +- src/plex_api_client/library.py | 812 ++++++++++++++---- src/plex_api_client/log.py | 92 +- src/plex_api_client/media.py | 144 ++-- src/plex_api_client/models/errors/__init__.py | 36 + .../models/errors/get_countries_library.py | 79 ++ .../models/errors/get_genres_library.py | 79 ++ .../models/operations/__init__.py | 52 +- .../operations/get_countries_library.py | 135 +++ .../models/operations/get_genres_library.py | 137 +++ .../operations/get_recently_added_library.py | 8 +- src/plex_api_client/playlists.py | 256 +++--- src/plex_api_client/plex.py | 196 +++-- src/plex_api_client/search.py | 84 +- src/plex_api_client/server.py | 244 +++--- src/plex_api_client/sessions.py | 116 +-- src/plex_api_client/statistics.py | 84 +- src/plex_api_client/updater.py | 92 +- src/plex_api_client/video.py | 60 +- src/plex_api_client/watchlist.py | 28 +- 59 files changed, 2516 insertions(+), 1132 deletions(-) create mode 100644 docs/models/errors/getcountrieslibrarybadrequest.md create mode 100644 docs/models/errors/getcountrieslibraryerrors.md create mode 100644 docs/models/errors/getcountrieslibrarylibraryerrors.md create mode 100644 docs/models/errors/getcountrieslibraryunauthorized.md create mode 100644 docs/models/errors/getgenreslibrarybadrequest.md create mode 100644 docs/models/errors/getgenreslibraryerrors.md create mode 100644 docs/models/errors/getgenreslibrarylibraryerrors.md create mode 100644 docs/models/errors/getgenreslibraryunauthorized.md rename docs/models/operations/{field.md => fieldt.md} (98%) create mode 100644 docs/models/operations/getcountrieslibrarydirectory.md create mode 100644 docs/models/operations/getcountrieslibrarymediacontainer.md create mode 100644 docs/models/operations/getcountrieslibraryrequest.md create mode 100644 docs/models/operations/getcountrieslibraryresponse.md create mode 100644 docs/models/operations/getcountrieslibraryresponsebody.md create mode 100644 docs/models/operations/getgenreslibrarydirectory.md create mode 100644 docs/models/operations/getgenreslibrarymediacontainer.md create mode 100644 docs/models/operations/getgenreslibraryrequest.md create mode 100644 docs/models/operations/getgenreslibraryresponse.md create mode 100644 docs/models/operations/getgenreslibraryresponsebody.md create mode 100644 src/plex_api_client/models/errors/get_countries_library.py create mode 100644 src/plex_api_client/models/errors/get_genres_library.py create mode 100644 src/plex_api_client/models/operations/get_countries_library.py create mode 100644 src/plex_api_client/models/operations/get_genres_library.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9dfe62b..33d8b82 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 3eeea668-4ef4-464e-a888-bdfa023bedf5 management: - docChecksum: a643a64d282d705e3e24f61ed6f068c6 + docChecksum: 14b35829d4be91a88269761c3ed01426 docVersion: 0.0.3 - speakeasyVersion: 1.476.2 - generationVersion: 2.495.1 - releaseVersion: 0.21.1 - configChecksum: db2fe2bda98c7138ce99a5ee8525cca3 + speakeasyVersion: 1.484.1 + generationVersion: 2.503.2 + releaseVersion: 0.21.2 + configChecksum: 8b6dcb5cd25065d9fbc63e5ede1119c9 repoURL: https://github.com/LukeHagar/plexpy.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexpy.git @@ -15,7 +15,7 @@ features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.10.5 + core: 5.10.9 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 downloadStreams: 1.0.1 @@ -23,7 +23,7 @@ features: enums: 3.1.1 envVarSecurityUsage: 0.3.2 errors: 3.2.0 - flattening: 3.1.0 + flattening: 3.1.1 globalSecurity: 3.0.2 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 @@ -101,6 +101,10 @@ generatedFiles: - docs/models/errors/getcompanionsdataerrors.md - docs/models/errors/getcompanionsdataplexerrors.md - docs/models/errors/getcompanionsdataunauthorized.md + - docs/models/errors/getcountrieslibrarybadrequest.md + - docs/models/errors/getcountrieslibraryerrors.md + - docs/models/errors/getcountrieslibrarylibraryerrors.md + - docs/models/errors/getcountrieslibraryunauthorized.md - docs/models/errors/getdevicesbadrequest.md - docs/models/errors/getdeviceserrors.md - docs/models/errors/getdevicesservererrors.md @@ -109,6 +113,10 @@ generatedFiles: - docs/models/errors/getfilehasherrors.md - docs/models/errors/getfilehashlibraryerrors.md - docs/models/errors/getfilehashunauthorized.md + - docs/models/errors/getgenreslibrarybadrequest.md + - docs/models/errors/getgenreslibraryerrors.md + - docs/models/errors/getgenreslibrarylibraryerrors.md + - docs/models/errors/getgenreslibraryunauthorized.md - docs/models/errors/getgeodatabadrequest.md - docs/models/errors/getgeodataerrors.md - docs/models/errors/getgeodataplexerrors.md @@ -381,7 +389,7 @@ generatedFiles: - docs/models/operations/enablepapertrailresponse.md - docs/models/operations/episodesort.md - docs/models/operations/feature.md - - docs/models/operations/field.md + - docs/models/operations/fieldt.md - docs/models/operations/fieldtype.md - docs/models/operations/filter_.md - docs/models/operations/flattenseasons.md @@ -408,11 +416,21 @@ generatedFiles: - docs/models/operations/getbutlertasksresponse.md - docs/models/operations/getbutlertasksresponsebody.md - docs/models/operations/getcompanionsdataresponse.md + - docs/models/operations/getcountrieslibrarydirectory.md + - docs/models/operations/getcountrieslibrarymediacontainer.md + - docs/models/operations/getcountrieslibraryrequest.md + - docs/models/operations/getcountrieslibraryresponse.md + - docs/models/operations/getcountrieslibraryresponsebody.md - docs/models/operations/getdevicesmediacontainer.md - docs/models/operations/getdevicesresponse.md - docs/models/operations/getdevicesresponsebody.md - docs/models/operations/getfilehashrequest.md - docs/models/operations/getfilehashresponse.md + - docs/models/operations/getgenreslibrarydirectory.md + - docs/models/operations/getgenreslibrarymediacontainer.md + - docs/models/operations/getgenreslibraryrequest.md + - docs/models/operations/getgenreslibraryresponse.md + - docs/models/operations/getgenreslibraryresponsebody.md - docs/models/operations/getgeodatageodata.md - docs/models/operations/getgeodataresponse.md - docs/models/operations/getglobalhubsmediacontainer.md @@ -890,6 +908,8 @@ generatedFiles: - src/plex_api_client/models/errors/enablepapertrail.py - src/plex_api_client/models/errors/get_all_libraries.py - src/plex_api_client/models/errors/get_banner_image.py + - src/plex_api_client/models/errors/get_countries_library.py + - src/plex_api_client/models/errors/get_genres_library.py - src/plex_api_client/models/errors/get_library_details.py - src/plex_api_client/models/errors/get_library_items.py - src/plex_api_client/models/errors/get_media_providers.py @@ -967,6 +987,8 @@ generatedFiles: - src/plex_api_client/models/operations/enablepapertrail.py - src/plex_api_client/models/operations/get_all_libraries.py - src/plex_api_client/models/operations/get_banner_image.py + - src/plex_api_client/models/operations/get_countries_library.py + - src/plex_api_client/models/operations/get_genres_library.py - src/plex_api_client/models/operations/get_library_details.py - src/plex_api_client/models/operations/get_library_items.py - src/plex_api_client/models/operations/get_media_providers.py @@ -2047,5 +2069,29 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + get-genres-library: + speakeasy-default-get-genres-library: + parameters: + path: + sectionKey: 9518 + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Shows (Reality)", "title2": "By Genre", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/10/all?genre=89", "key": "89", "title": "Action", "type": "genre"}]}} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} + get-countries-library: + speakeasy-default-get-countries-library: + parameters: + path: + sectionKey: 9518 + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Series", "title2": "By Country", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/2/all?country=15491", "key": "15491", "title": "Japan"}]}} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index eddecd6..3daea2c 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false python: - version: 0.21.1 + version: 0.21.2 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index db43166..6a17263 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.476.2 +speakeasyVersion: 1.484.1 sources: my-source: sourceNamespace: my-source @@ -8,19 +8,19 @@ sources: - latest plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c - sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696 + sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10 + sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55 tags: - latest - - speakeasy-sdk-regen-1738022506 + - speakeasy-sdk-regen-1738800087 targets: plexpy: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c - sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696 + sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10 + sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55 codeSamplesNamespace: code-samples-python-plexpy - codeSamplesRevisionDigest: sha256:bc15ff165c65f5567be1675febe04ab81d64f96e0d364efbf9b6c61b0fbb46e9 + codeSamplesRevisionDigest: sha256:e060abd1e6124c442333335008e39e994ede6ecf685a0d1e0e1c0813fc496ca5 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index b4a329e..75a8d7e 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,37 @@ pip install plex-api-client ```bash poetry add plex-api-client ``` + +### 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 plex-api-client 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 = [ +# "plex-api-client", +# ] +# /// + +from plex_api_client import PlexAPI + +sdk = PlexAPI( + # 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. @@ -186,6 +217,8 @@ asyncio.run(main()) * [get_library_items](docs/sdks/library/README.md#get_library_items) - Get Library Items * [get_refresh_library_metadata](docs/sdks/library/README.md#get_refresh_library_metadata) - Refresh Metadata Of The Library * [get_search_library](docs/sdks/library/README.md#get_search_library) - Search Library +* [get_genres_library](docs/sdks/library/README.md#get_genres_library) - Get Genres of library media +* [get_countries_library](docs/sdks/library/README.md#get_countries_library) - Get Countries of library media * [get_search_all_libraries](docs/sdks/library/README.md#get_search_all_libraries) - Search All Libraries * [get_meta_data_by_rating_key](docs/sdks/library/README.md#get_meta_data_by_rating_key) - Get Metadata by RatingKey * [get_metadata_children](docs/sdks/library/README.md#get_metadata_children) - Get Items Children diff --git a/RELEASES.md b/RELEASES.md index 43945e6..b027cef 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -908,4 +908,14 @@ Based on: ### Generated - [python v0.21.1] . ### Releases -- [PyPI v0.21.1] https://pypi.org/project/plex-api-client/0.21.1 - . \ No newline at end of file +- [PyPI v0.21.1] https://pypi.org/project/plex-api-client/0.21.1 - . + +## 2025-02-06 00:01:12 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.21.2] . +### Releases +- [PyPI v0.21.2] https://pypi.org/project/plex-api-client/0.21.2 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index c45d830..ac58240 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -392,9 +392,6 @@ actions: "content_directory_id": 470161, "section_id": 2, "type": operations.Type.TV_SHOW, - "include_meta": operations.IncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None @@ -413,7 +410,7 @@ actions: access_token="", ) as plex_api: - res = plex_api.search.perform_search(query="dylan", limit=5) + res = plex_api.search.perform_search(query="dylan") assert res is not None @@ -431,7 +428,7 @@ actions: access_token="", ) as plex_api: - res = plex_api.search.perform_voice_search(query="dead+poop", limit=5) + res = plex_api.search.perform_voice_search(query="dead+poop") assert res is not None @@ -643,9 +640,6 @@ actions: ], "section_id": 2, "type": operations.QueryParamType.TV_SHOW, - "include_meta": operations.QueryParamIncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None @@ -671,8 +665,6 @@ actions: "search_types": [ operations.SearchTypes.PEOPLE, ], - "include_collections": operations.QueryParamIncludeCollections.ENABLE, - "include_external_media": operations.QueryParamIncludeExternalMedia.ENABLE, }) assert res.object is not None @@ -712,8 +704,6 @@ actions: res = plex_api.watchlist.get_watch_list(request={ "filter_": operations.Filter.AVAILABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, "x_plex_token": "CV5xoxjTpFKUzBTShsaf", }) @@ -746,13 +736,48 @@ actions: label: details source: |- from plex_api_client import PlexAPI - from plex_api_client.models import operations with PlexAPI( access_token="", ) as plex_api: - res = plex_api.library.get_library_details(section_key=9518, include_details=operations.IncludeDetails.ZERO) + res = plex_api.library.get_library_details(section_key=9518) + + assert res.object is not None + + # Handle response + print(res.object) + - target: $["paths"]["/library/sections/{sectionKey}/country"]["get"] + update: + x-codeSamples: + - lang: python + label: library + source: |- + from plex_api_client import PlexAPI + + with PlexAPI( + access_token="", + ) as plex_api: + + res = plex_api.library.get_countries_library(section_key=9518) + + assert res.object is not None + + # Handle response + print(res.object) + - target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"] + update: + x-codeSamples: + - lang: python + label: library + source: |- + from plex_api_client import PlexAPI + + with PlexAPI( + access_token="", + ) as plex_api: + + res = plex_api.library.get_genres_library(section_key=9518) assert res.object is not None @@ -811,12 +836,8 @@ actions: res = plex_api.library.get_library_items(request={ "tag": operations.Tag.EDITION, - "include_guids": operations.IncludeGuids.ENABLE, "type": operations.GetLibraryItemsQueryParamType.TV_SHOW, "section_key": 9518, - "include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None @@ -954,7 +975,6 @@ actions: with PlexAPI() as plex_api: res = plex_api.plex.get_pin(request={ - "strong": False, "client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58", "client_name": "Plex for Roku", "device_nickname": "Roku 3", @@ -1166,13 +1186,12 @@ actions: label: resources source: |- from plex_api_client import PlexAPI - from plex_api_client.models import operations with PlexAPI( access_token="", ) as plex_api: - res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58", include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE) + res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58") assert res.plex_devices is not None @@ -1470,7 +1489,6 @@ actions: "request_body": { "login": "username@email.com", "password": "password123", - "remember_me": False, "verification_code": "123456", }, }) diff --git a/docs/models/errors/getcountrieslibrarybadrequest.md b/docs/models/errors/getcountrieslibrarybadrequest.md new file mode 100644 index 0000000..be70fba --- /dev/null +++ b/docs/models/errors/getcountrieslibrarybadrequest.md @@ -0,0 +1,11 @@ +# GetCountriesLibraryBadRequest + +Bad Request - A parameter was not specified, or was specified incorrectly. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `errors` | List[[errors.GetCountriesLibraryErrors](../../models/errors/getcountrieslibraryerrors.md)] | :heavy_minus_sign: | N/A | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/getcountrieslibraryerrors.md b/docs/models/errors/getcountrieslibraryerrors.md new file mode 100644 index 0000000..a404937 --- /dev/null +++ b/docs/models/errors/getcountrieslibraryerrors.md @@ -0,0 +1,10 @@ +# GetCountriesLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `code` | *Optional[int]* | :heavy_minus_sign: | N/A | 1000 | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | +| `status` | *Optional[int]* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/errors/getcountrieslibrarylibraryerrors.md b/docs/models/errors/getcountrieslibrarylibraryerrors.md new file mode 100644 index 0000000..2ff8f84 --- /dev/null +++ b/docs/models/errors/getcountrieslibrarylibraryerrors.md @@ -0,0 +1,10 @@ +# GetCountriesLibraryLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional[int]* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional[int]* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/getcountrieslibraryunauthorized.md b/docs/models/errors/getcountrieslibraryunauthorized.md new file mode 100644 index 0000000..9a56acc --- /dev/null +++ b/docs/models/errors/getcountrieslibraryunauthorized.md @@ -0,0 +1,11 @@ +# GetCountriesLibraryUnauthorized + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `errors` | List[[errors.GetCountriesLibraryLibraryErrors](../../models/errors/getcountrieslibrarylibraryerrors.md)] | :heavy_minus_sign: | N/A | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/getgenreslibrarybadrequest.md b/docs/models/errors/getgenreslibrarybadrequest.md new file mode 100644 index 0000000..eeef321 --- /dev/null +++ b/docs/models/errors/getgenreslibrarybadrequest.md @@ -0,0 +1,11 @@ +# GetGenresLibraryBadRequest + +Bad Request - A parameter was not specified, or was specified incorrectly. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `errors` | List[[errors.GetGenresLibraryErrors](../../models/errors/getgenreslibraryerrors.md)] | :heavy_minus_sign: | N/A | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/getgenreslibraryerrors.md b/docs/models/errors/getgenreslibraryerrors.md new file mode 100644 index 0000000..0c524a2 --- /dev/null +++ b/docs/models/errors/getgenreslibraryerrors.md @@ -0,0 +1,10 @@ +# GetGenresLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `code` | *Optional[int]* | :heavy_minus_sign: | N/A | 1000 | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | +| `status` | *Optional[int]* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/models/errors/getgenreslibrarylibraryerrors.md b/docs/models/errors/getgenreslibrarylibraryerrors.md new file mode 100644 index 0000000..e7f2d6c --- /dev/null +++ b/docs/models/errors/getgenreslibrarylibraryerrors.md @@ -0,0 +1,10 @@ +# GetGenresLibraryLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *Optional[int]* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *Optional[int]* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/errors/getgenreslibraryunauthorized.md b/docs/models/errors/getgenreslibraryunauthorized.md new file mode 100644 index 0000000..93b78b8 --- /dev/null +++ b/docs/models/errors/getgenreslibraryunauthorized.md @@ -0,0 +1,11 @@ +# GetGenresLibraryUnauthorized + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `errors` | List[[errors.GetGenresLibraryLibraryErrors](../../models/errors/getgenreslibrarylibraryerrors.md)] | :heavy_minus_sign: | N/A | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/field.md b/docs/models/operations/fieldt.md similarity index 98% rename from docs/models/operations/field.md rename to docs/models/operations/fieldt.md index a6348b3..38da447 100644 --- a/docs/models/operations/field.md +++ b/docs/models/operations/fieldt.md @@ -1,4 +1,4 @@ -# Field +# FieldT ## Fields diff --git a/docs/models/operations/getcountrieslibrarydirectory.md b/docs/models/operations/getcountrieslibrarydirectory.md new file mode 100644 index 0000000..e8a2678 --- /dev/null +++ b/docs/models/operations/getcountrieslibrarydirectory.md @@ -0,0 +1,10 @@ +# GetCountriesLibraryDirectory + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `fast_key` | *str* | :heavy_check_mark: | N/A | /library/sections/2/all?country=15491 | +| `key` | *str* | :heavy_check_mark: | N/A | 15491 | +| `title` | *str* | :heavy_check_mark: | N/A | Japan | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibrarymediacontainer.md b/docs/models/operations/getcountrieslibrarymediacontainer.md new file mode 100644 index 0000000..ff9990b --- /dev/null +++ b/docs/models/operations/getcountrieslibrarymediacontainer.md @@ -0,0 +1,22 @@ +# GetCountriesLibraryMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `size` | *float* | :heavy_check_mark: | N/A | 50 | +| `identifier` | *str* | :heavy_check_mark: | N/A | com.plexapp.plugins.library | +| `allow_sync` | *bool* | :heavy_check_mark: | N/A | false | +| `art` | *str* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg | +| `content` | *str* | :heavy_check_mark: | N/A | secondary | +| `media_tag_prefix` | *str* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ | +| `media_tag_version` | *int* | :heavy_check_mark: | N/A | 1734362201 | +| `nocache` | *bool* | :heavy_check_mark: | N/A | true | +| `thumb` | *str* | :heavy_check_mark: | N/A | /:/resources/show.png | +| `title1` | *str* | :heavy_check_mark: | N/A | TV Series | +| `title2` | *str* | :heavy_check_mark: | N/A | By Country | +| `view_group` | *str* | :heavy_check_mark: | N/A | secondary | +| `offset` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `total_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `directory` | List[[operations.GetCountriesLibraryDirectory](../../models/operations/getcountrieslibrarydirectory.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryrequest.md b/docs/models/operations/getcountrieslibraryrequest.md new file mode 100644 index 0000000..46c9f21 --- /dev/null +++ b/docs/models/operations/getcountrieslibraryrequest.md @@ -0,0 +1,8 @@ +# GetCountriesLibraryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `section_key` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryresponse.md b/docs/models/operations/getcountrieslibraryresponse.md new file mode 100644 index 0000000..495d975 --- /dev/null +++ b/docs/models/operations/getcountrieslibraryresponse.md @@ -0,0 +1,11 @@ +# GetCountriesLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional[operations.GetCountriesLibraryResponseBody]](../../models/operations/getcountrieslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getcountrieslibraryresponsebody.md b/docs/models/operations/getcountrieslibraryresponsebody.md new file mode 100644 index 0000000..49dd12d --- /dev/null +++ b/docs/models/operations/getcountrieslibraryresponsebody.md @@ -0,0 +1,10 @@ +# GetCountriesLibraryResponseBody + +Successful response containing media container data. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `media_container` | [Optional[operations.GetCountriesLibraryMediaContainer]](../../models/operations/getcountrieslibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibrarydirectory.md b/docs/models/operations/getgenreslibrarydirectory.md new file mode 100644 index 0000000..3598394 --- /dev/null +++ b/docs/models/operations/getgenreslibrarydirectory.md @@ -0,0 +1,11 @@ +# GetGenresLibraryDirectory + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `fast_key` | *str* | :heavy_check_mark: | N/A | /library/sections/10/all?genre=89 | +| `key` | *str* | :heavy_check_mark: | N/A | 89 | +| `title` | *str* | :heavy_check_mark: | N/A | Action | +| `type` | *str* | :heavy_check_mark: | N/A | genre | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibrarymediacontainer.md b/docs/models/operations/getgenreslibrarymediacontainer.md new file mode 100644 index 0000000..33c3fdf --- /dev/null +++ b/docs/models/operations/getgenreslibrarymediacontainer.md @@ -0,0 +1,22 @@ +# GetGenresLibraryMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `size` | *float* | :heavy_check_mark: | N/A | 50 | +| `identifier` | *str* | :heavy_check_mark: | N/A | com.plexapp.plugins.library | +| `allow_sync` | *bool* | :heavy_check_mark: | N/A | false | +| `art` | *str* | :heavy_check_mark: | N/A | /:/resources/show-fanart.jpg | +| `content` | *str* | :heavy_check_mark: | N/A | secondary | +| `media_tag_prefix` | *str* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ | +| `media_tag_version` | *int* | :heavy_check_mark: | N/A | 1734362201 | +| `nocache` | *bool* | :heavy_check_mark: | N/A | true | +| `thumb` | *str* | :heavy_check_mark: | N/A | /:/resources/show.png | +| `title1` | *str* | :heavy_check_mark: | N/A | TV Shows (Reality) | +| `title2` | *str* | :heavy_check_mark: | N/A | By Genre | +| `view_group` | *str* | :heavy_check_mark: | N/A | secondary | +| `offset` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `total_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `directory` | List[[operations.GetGenresLibraryDirectory](../../models/operations/getgenreslibrarydirectory.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryrequest.md b/docs/models/operations/getgenreslibraryrequest.md new file mode 100644 index 0000000..35e917e --- /dev/null +++ b/docs/models/operations/getgenreslibraryrequest.md @@ -0,0 +1,8 @@ +# GetGenresLibraryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `section_key` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryresponse.md b/docs/models/operations/getgenreslibraryresponse.md new file mode 100644 index 0000000..a0b5094 --- /dev/null +++ b/docs/models/operations/getgenreslibraryresponse.md @@ -0,0 +1,11 @@ +# GetGenresLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional[operations.GetGenresLibraryResponseBody]](../../models/operations/getgenreslibraryresponsebody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/getgenreslibraryresponsebody.md b/docs/models/operations/getgenreslibraryresponsebody.md new file mode 100644 index 0000000..6197e20 --- /dev/null +++ b/docs/models/operations/getgenreslibraryresponsebody.md @@ -0,0 +1,10 @@ +# GetGenresLibraryResponseBody + +Successful response containing media container data. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `media_container` | [Optional[operations.GetGenresLibraryMediaContainer]](../../models/operations/getgenreslibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedlibrarytype.md b/docs/models/operations/getrecentlyaddedlibrarytype.md index 988d386..6a9a08a 100644 --- a/docs/models/operations/getrecentlyaddedlibrarytype.md +++ b/docs/models/operations/getrecentlyaddedlibrarytype.md @@ -11,4 +11,4 @@ | `active` | *bool* | :heavy_check_mark: | N/A | false | | `filter_` | List[[operations.GetRecentlyAddedLibraryFilter](../../models/operations/getrecentlyaddedlibraryfilter.md)] | :heavy_minus_sign: | N/A | | | `sort` | List[[operations.Sort](../../models/operations/sort.md)] | :heavy_minus_sign: | N/A | | -| `field` | List[[operations.Field](../../models/operations/field.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `field` | List[[operations.FieldT](../../models/operations/fieldt.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedmediacontainer.md b/docs/models/operations/getrecentlyaddedmediacontainer.md index 7af4b84..0139433 100644 --- a/docs/models/operations/getrecentlyaddedmediacontainer.md +++ b/docs/models/operations/getrecentlyaddedmediacontainer.md @@ -9,6 +9,6 @@ | `offset` | *Optional[int]* | :heavy_minus_sign: | N/A | | | `total_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | | `identifier` | *Optional[str]* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `allow_sync` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `allow_sync` | *Optional[bool]* | :heavy_minus_sign: | N/A | false | | `meta` | [Optional[operations.Meta]](../../models/operations/meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | | `metadata` | List[[operations.GetRecentlyAddedMetadata](../../models/operations/getrecentlyaddedmetadata.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index e529462..a1d8e59 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -161,7 +161,6 @@ with PlexAPI() as plex_api: "request_body": { "login": "username@email.com", "password": "password123", - "remember_me": False, "verification_code": "123456", }, }) diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index b9aa34c..dd3fa3b 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -73,9 +73,6 @@ with PlexAPI( "content_directory_id": 470161, "type": operations.Type.TV_SHOW, "section_id": 2, - "include_meta": operations.IncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 6205cec..de880bf 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -16,6 +16,8 @@ API Calls interacting with Plex Media Server Libraries * [get_library_items](#get_library_items) - Get Library Items * [get_refresh_library_metadata](#get_refresh_library_metadata) - Refresh Metadata Of The Library * [get_search_library](#get_search_library) - Search Library +* [get_genres_library](#get_genres_library) - Get Genres of library media +* [get_countries_library](#get_countries_library) - Get Countries of library media * [get_search_all_libraries](#get_search_all_libraries) - Search All Libraries * [get_meta_data_by_rating_key](#get_meta_data_by_rating_key) - Get Metadata by RatingKey * [get_metadata_children](#get_metadata_children) - Get Items Children @@ -97,9 +99,6 @@ with PlexAPI( 17, ], "section_id": 2, - "include_meta": operations.QueryParamIncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None @@ -221,13 +220,12 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi ```python from plex_api_client import PlexAPI -from plex_api_client.models import operations with PlexAPI( access_token="", ) as plex_api: - res = plex_api.library.get_library_details(section_key=9518, include_details=operations.IncludeDetails.ZERO) + res = plex_api.library.get_library_details(section_key=9518) assert res.object is not None @@ -335,11 +333,7 @@ with PlexAPI( res = plex_api.library.get_library_items(request={ "tag": operations.Tag.EDITION, "section_key": 9518, - "include_guids": operations.IncludeGuids.ENABLE, "type": operations.GetLibraryItemsQueryParamType.TV_SHOW, - "include_meta": operations.GetLibraryItemsQueryParamIncludeMeta.ENABLE, - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None @@ -473,6 +467,90 @@ with PlexAPI( | errors.GetSearchLibraryUnauthorized | 401 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_genres_library + +Retrieves a list of all the genres that are found for the media in this library. + + +### Example Usage + +```python +from plex_api_client import PlexAPI + +with PlexAPI( + access_token="", +) as plex_api: + + res = plex_api.library.get_genres_library(section_key=9518) + + assert res.object is not None + + # Handle response + print(res.object) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `section_key` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.GetGenresLibraryResponse](../../models/operations/getgenreslibraryresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| errors.GetGenresLibraryBadRequest | 400 | application/json | +| errors.GetGenresLibraryUnauthorized | 401 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_countries_library + +Retrieves a list of all the countries that are found for the media in this library. + + +### Example Usage + +```python +from plex_api_client import PlexAPI + +with PlexAPI( + access_token="", +) as plex_api: + + res = plex_api.library.get_countries_library(section_key=9518) + + assert res.object is not None + + # Handle response + print(res.object) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `section_key` | *int* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.GetCountriesLibraryResponse](../../models/operations/getcountrieslibraryresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.GetCountriesLibraryBadRequest | 400 | application/json | +| errors.GetCountriesLibraryUnauthorized | 401 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## get_search_all_libraries Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. @@ -494,8 +572,6 @@ with PlexAPI( "search_types": [ operations.SearchTypes.PEOPLE, ], - "include_collections": operations.QueryParamIncludeCollections.ENABLE, - "include_external_media": operations.QueryParamIncludeExternalMedia.ENABLE, }) assert res.object is not None diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 8f4189f..62f688f 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -185,13 +185,12 @@ Get Plex server access tokens and server connections ```python from plex_api_client import PlexAPI -from plex_api_client.models import operations with PlexAPI( access_token="", ) as plex_api: - res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58", include_https=operations.IncludeHTTPS.ENABLE, include_relay=operations.IncludeRelay.ENABLE, include_i_pv6=operations.IncludeIPv6.ENABLE) + res = plex_api.plex.get_server_resources(client_id="3381b62b-9ab7-4e37-827b-203e9809eb58") assert res.plex_devices is not None @@ -236,7 +235,6 @@ with PlexAPI() as plex_api: res = plex_api.plex.get_pin(request={ "client_id": "3381b62b-9ab7-4e37-827b-203e9809eb58", - "strong": False, "client_name": "Plex for Roku", "device_nickname": "Roku 3", "client_version": "2.4.1", diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 7273be1..2ba7207 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -37,7 +37,7 @@ with PlexAPI( access_token="", ) as plex_api: - res = plex_api.search.perform_search(query="dylan", limit=5) + res = plex_api.search.perform_search(query="dylan") assert res is not None @@ -84,7 +84,7 @@ with PlexAPI( access_token="", ) as plex_api: - res = plex_api.search.perform_voice_search(query="dead+poop", limit=5) + res = plex_api.search.perform_voice_search(query="dead+poop") assert res is not None diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 6b18747..4946540 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -27,8 +27,6 @@ with PlexAPI( res = plex_api.watchlist.get_watch_list(request={ "filter_": operations.Filter.AVAILABLE, "x_plex_token": "CV5xoxjTpFKUzBTShsaf", - "x_plex_container_start": 0, - "x_plex_container_size": 50, }) assert res.object is not None diff --git a/poetry.lock b/poetry.lock index 4b7a2d5..800991d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -208,18 +208,6 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] -[[package]] -name = "jsonpath-python" -version = "1.0.6" -description = "A more powerful JSONPath implementation in modern python" -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, - {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, -] - [[package]] name = "mccabe" version = "0.7.0" @@ -593,4 +581,4 @@ typing-extensions = ">=3.7.4" [metadata] lock-version = "2.1" python-versions = ">=3.9" -content-hash = "17ee8ce85dd5ac9f352e21dba9eb0fd4cf2c084fd797ca222e426ba7d39002ef" +content-hash = "1f0dcb22a1bf4d933c50fbaab2e7f694592f680adf1171c2dc13507e4259a9c0" diff --git a/pyproject.toml b/pyproject.toml index 01621b5..5cd6c47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "plex-api-client" -version = "0.21.1" +version = "0.21.2" description = "Python Client SDK Generated by Speakeasy" authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" @@ -8,7 +8,6 @@ requires-python = ">=3.9" dependencies = [ "eval-type-backport >=0.2.0", "httpx >=0.28.1", - "jsonpath-python >=1.0.6", "pydantic >=2.10.3", "python-dateutil >=2.8.2", "typing-inspect >=0.9.0", @@ -37,6 +36,7 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" pythonpath = ["src"] [tool.mypy] diff --git a/src/plex_api_client/_version.py b/src/plex_api_client/_version.py index 4ba9d11..62a2129 100644 --- a/src/plex_api_client/_version.py +++ b/src/plex_api_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "plex-api-client" -__version__: str = "0.21.1" +__version__: str = "0.21.2" __openapi_doc_version__: str = "0.0.3" -__gen_version__: str = "2.495.1" -__user_agent__: str = "speakeasy-sdk/python 0.21.1 2.495.1 0.0.3 plex-api-client" +__gen_version__: str = "2.503.2" +__user_agent__: str = "speakeasy-sdk/python 0.21.2 2.503.2 0.0.3 plex-api-client" try: if __package__ is not None: diff --git a/src/plex_api_client/activities.py b/src/plex_api_client/activities.py index 7351e3d..8dc084e 100644 --- a/src/plex_api_client/activities.py +++ b/src/plex_api_client/activities.py @@ -78,7 +78,7 @@ class Activities(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerActivitiesResponse( object=utils.unmarshal_json( @@ -89,17 +89,17 @@ class Activities(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerActivitiesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerActivitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerActivitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerActivitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerActivitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerActivitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -179,7 +179,7 @@ class Activities(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerActivitiesResponse( object=utils.unmarshal_json( @@ -190,17 +190,17 @@ class Activities(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerActivitiesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerActivitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerActivitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerActivitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerActivitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerActivitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -287,7 +287,7 @@ class Activities(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.CancelServerActivitiesResponse( status_code=http_res.status_code, @@ -295,17 +295,17 @@ class Activities(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CancelServerActivitiesBadRequestData ) - data.raw_response = http_res - raise errors.CancelServerActivitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CancelServerActivitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CancelServerActivitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.CancelServerActivitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CancelServerActivitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -392,7 +392,7 @@ class Activities(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.CancelServerActivitiesResponse( status_code=http_res.status_code, @@ -400,17 +400,17 @@ class Activities(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CancelServerActivitiesBadRequestData ) - data.raw_response = http_res - raise errors.CancelServerActivitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CancelServerActivitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CancelServerActivitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.CancelServerActivitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CancelServerActivitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/authentication.py b/src/plex_api_client/authentication.py index 3318e50..7c87104 100644 --- a/src/plex_api_client/authentication.py +++ b/src/plex_api_client/authentication.py @@ -81,7 +81,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetTransientTokenResponse( status_code=http_res.status_code, @@ -89,17 +89,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTransientTokenBadRequestData ) - data.raw_response = http_res - raise errors.GetTransientTokenBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTransientTokenBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTransientTokenUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTransientTokenUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTransientTokenUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -190,7 +190,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetTransientTokenResponse( status_code=http_res.status_code, @@ -198,17 +198,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTransientTokenBadRequestData ) - data.raw_response = http_res - raise errors.GetTransientTokenBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTransientTokenBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTransientTokenUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTransientTokenUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTransientTokenUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -297,7 +297,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetSourceConnectionInformationResponse( status_code=http_res.status_code, @@ -305,17 +305,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSourceConnectionInformationBadRequestData ) - data.raw_response = http_res - raise errors.GetSourceConnectionInformationBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSourceConnectionInformationBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSourceConnectionInformationUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSourceConnectionInformationUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSourceConnectionInformationUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -404,7 +404,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetSourceConnectionInformationResponse( status_code=http_res.status_code, @@ -412,17 +412,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSourceConnectionInformationBadRequestData ) - data.raw_response = http_res - raise errors.GetSourceConnectionInformationBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSourceConnectionInformationBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSourceConnectionInformationUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSourceConnectionInformationUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSourceConnectionInformationUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -504,7 +504,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTokenDetailsResponse( user_plex_account=utils.unmarshal_json( @@ -515,17 +515,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenDetailsBadRequestData ) - data.raw_response = http_res - raise errors.GetTokenDetailsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTokenDetailsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenDetailsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTokenDetailsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTokenDetailsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -607,7 +607,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTokenDetailsResponse( user_plex_account=utils.unmarshal_json( @@ -618,17 +618,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenDetailsBadRequestData ) - data.raw_response = http_res - raise errors.GetTokenDetailsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTokenDetailsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenDetailsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTokenDetailsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTokenDetailsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -726,7 +726,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return operations.PostUsersSignInDataResponse( user_plex_account=utils.unmarshal_json( @@ -738,17 +738,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PostUsersSignInDataBadRequestData ) - data.raw_response = http_res - raise errors.PostUsersSignInDataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PostUsersSignInDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PostUsersSignInDataUnauthorizedData ) - data.raw_response = http_res - raise errors.PostUsersSignInDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PostUsersSignInDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -846,7 +846,7 @@ class Authentication(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return operations.PostUsersSignInDataResponse( user_plex_account=utils.unmarshal_json( @@ -858,17 +858,17 @@ class Authentication(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PostUsersSignInDataBadRequestData ) - data.raw_response = http_res - raise errors.PostUsersSignInDataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PostUsersSignInDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PostUsersSignInDataUnauthorizedData ) - data.raw_response = http_res - raise errors.PostUsersSignInDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PostUsersSignInDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/butler.py b/src/plex_api_client/butler.py index 9e9b848..120c2e3 100644 --- a/src/plex_api_client/butler.py +++ b/src/plex_api_client/butler.py @@ -70,7 +70,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetButlerTasksResponse( object=utils.unmarshal_json( @@ -81,17 +81,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetButlerTasksBadRequestData ) - data.raw_response = http_res - raise errors.GetButlerTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetButlerTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetButlerTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.GetButlerTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetButlerTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -171,7 +171,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetButlerTasksResponse( object=utils.unmarshal_json( @@ -182,17 +182,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetButlerTasksBadRequestData ) - data.raw_response = http_res - raise errors.GetButlerTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetButlerTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetButlerTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.GetButlerTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetButlerTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -277,7 +277,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StartAllTasksResponse( status_code=http_res.status_code, @@ -285,17 +285,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartAllTasksBadRequestData ) - data.raw_response = http_res - raise errors.StartAllTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StartAllTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartAllTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.StartAllTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StartAllTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -380,7 +380,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StartAllTasksResponse( status_code=http_res.status_code, @@ -388,17 +388,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartAllTasksBadRequestData ) - data.raw_response = http_res - raise errors.StartAllTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StartAllTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartAllTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.StartAllTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StartAllTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -479,7 +479,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StopAllTasksResponse( status_code=http_res.status_code, @@ -487,17 +487,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopAllTasksBadRequestData ) - data.raw_response = http_res - raise errors.StopAllTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StopAllTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopAllTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.StopAllTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StopAllTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -578,7 +578,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StopAllTasksResponse( status_code=http_res.status_code, @@ -586,17 +586,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopAllTasksBadRequestData ) - data.raw_response = http_res - raise errors.StopAllTasksBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StopAllTasksBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopAllTasksUnauthorizedData ) - data.raw_response = http_res - raise errors.StopAllTasksUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StopAllTasksUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -688,7 +688,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, ["200", "202"], "*"): return operations.StartTaskResponse( status_code=http_res.status_code, @@ -696,13 +696,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StartTaskBadRequestData) - data.raw_response = http_res - raise errors.StartTaskBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StartTaskBadRequestData + ) + response_data.raw_response = http_res + raise errors.StartTaskBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StartTaskUnauthorizedData) - data.raw_response = http_res - raise errors.StartTaskUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StartTaskUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.StartTaskUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -794,7 +798,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, ["200", "202"], "*"): return operations.StartTaskResponse( status_code=http_res.status_code, @@ -802,13 +806,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StartTaskBadRequestData) - data.raw_response = http_res - raise errors.StartTaskBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StartTaskBadRequestData + ) + response_data.raw_response = http_res + raise errors.StartTaskBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StartTaskUnauthorizedData) - data.raw_response = http_res - raise errors.StartTaskUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StartTaskUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.StartTaskUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -896,7 +904,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StopTaskResponse( status_code=http_res.status_code, @@ -904,13 +912,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StopTaskBadRequestData) - data.raw_response = http_res - raise errors.StopTaskBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StopTaskBadRequestData + ) + response_data.raw_response = http_res + raise errors.StopTaskBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StopTaskUnauthorizedData) - data.raw_response = http_res - raise errors.StopTaskUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StopTaskUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.StopTaskUnauthorized(data=response_data) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -998,7 +1010,7 @@ class Butler(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StopTaskResponse( status_code=http_res.status_code, @@ -1006,13 +1018,17 @@ class Butler(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StopTaskBadRequestData) - data.raw_response = http_res - raise errors.StopTaskBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StopTaskBadRequestData + ) + response_data.raw_response = http_res + raise errors.StopTaskBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.StopTaskUnauthorizedData) - data.raw_response = http_res - raise errors.StopTaskUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.StopTaskUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.StopTaskUnauthorized(data=response_data) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/hubs.py b/src/plex_api_client/hubs.py index e3cb232..dcd45e7 100644 --- a/src/plex_api_client/hubs.py +++ b/src/plex_api_client/hubs.py @@ -80,7 +80,7 @@ class Hubs(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetGlobalHubsResponse( object=utils.unmarshal_json( @@ -91,17 +91,17 @@ class Hubs(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGlobalHubsBadRequestData ) - data.raw_response = http_res - raise errors.GetGlobalHubsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetGlobalHubsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGlobalHubsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetGlobalHubsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetGlobalHubsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -191,7 +191,7 @@ class Hubs(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetGlobalHubsResponse( object=utils.unmarshal_json( @@ -202,17 +202,17 @@ class Hubs(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGlobalHubsBadRequestData ) - data.raw_response = http_res - raise errors.GetGlobalHubsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetGlobalHubsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGlobalHubsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetGlobalHubsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetGlobalHubsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -504,7 +504,7 @@ class Hubs(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryHubsResponse( object=utils.unmarshal_json( @@ -515,17 +515,17 @@ class Hubs(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryHubsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryHubsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryHubsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryHubsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryHubsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryHubsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -619,7 +619,7 @@ class Hubs(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryHubsResponse( object=utils.unmarshal_json( @@ -630,17 +630,17 @@ class Hubs(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryHubsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryHubsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryHubsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryHubsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryHubsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryHubsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/library.py b/src/plex_api_client/library.py index e316fbf..313e714 100644 --- a/src/plex_api_client/library.py +++ b/src/plex_api_client/library.py @@ -80,7 +80,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetFileHashResponse( status_code=http_res.status_code, @@ -88,15 +88,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetFileHashBadRequestData) - data.raw_response = http_res - raise errors.GetFileHashBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetFileHashBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetFileHashBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetFileHashUnauthorizedData ) - data.raw_response = http_res - raise errors.GetFileHashUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetFileHashUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -186,7 +188,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetFileHashResponse( status_code=http_res.status_code, @@ -194,15 +196,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetFileHashBadRequestData) - data.raw_response = http_res - raise errors.GetFileHashBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetFileHashBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetFileHashBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetFileHashUnauthorizedData ) - data.raw_response = http_res - raise errors.GetFileHashUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetFileHashUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -295,7 +299,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetRecentlyAddedLibraryResponse( object=utils.unmarshal_json( @@ -307,17 +311,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRecentlyAddedLibraryBadRequestData ) - data.raw_response = http_res - raise errors.GetRecentlyAddedLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetRecentlyAddedLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRecentlyAddedLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetRecentlyAddedLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetRecentlyAddedLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -410,7 +414,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetRecentlyAddedLibraryResponse( object=utils.unmarshal_json( @@ -422,17 +426,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRecentlyAddedLibraryBadRequestData ) - data.raw_response = http_res - raise errors.GetRecentlyAddedLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetRecentlyAddedLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRecentlyAddedLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetRecentlyAddedLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetRecentlyAddedLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -518,7 +522,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetAllLibrariesResponse( object=utils.unmarshal_json( @@ -529,17 +533,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAllLibrariesBadRequestData ) - data.raw_response = http_res - raise errors.GetAllLibrariesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetAllLibrariesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAllLibrariesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetAllLibrariesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetAllLibrariesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -625,7 +629,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetAllLibrariesResponse( object=utils.unmarshal_json( @@ -636,17 +640,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAllLibrariesBadRequestData ) - data.raw_response = http_res - raise errors.GetAllLibrariesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetAllLibrariesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAllLibrariesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetAllLibrariesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetAllLibrariesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -777,7 +781,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryDetailsResponse( object=utils.unmarshal_json( @@ -788,17 +792,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryDetailsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryDetailsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryDetailsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryDetailsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryDetailsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryDetailsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -929,7 +933,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryDetailsResponse( object=utils.unmarshal_json( @@ -940,17 +944,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryDetailsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryDetailsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryDetailsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryDetailsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryDetailsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryDetailsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1037,7 +1041,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.DeleteLibraryResponse( status_code=http_res.status_code, @@ -1045,17 +1049,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeleteLibraryBadRequestData ) - data.raw_response = http_res - raise errors.DeleteLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.DeleteLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeleteLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.DeleteLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.DeleteLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1142,7 +1146,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.DeleteLibraryResponse( status_code=http_res.status_code, @@ -1150,17 +1154,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeleteLibraryBadRequestData ) - data.raw_response = http_res - raise errors.DeleteLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.DeleteLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeleteLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.DeleteLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.DeleteLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1271,7 +1275,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryItemsResponse( object=utils.unmarshal_json( @@ -1282,17 +1286,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryItemsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryItemsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryItemsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryItemsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryItemsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryItemsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1403,7 +1407,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetLibraryItemsResponse( object=utils.unmarshal_json( @@ -1414,17 +1418,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryItemsBadRequestData ) - data.raw_response = http_res - raise errors.GetLibraryItemsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryItemsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetLibraryItemsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetLibraryItemsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetLibraryItemsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1515,7 +1519,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetRefreshLibraryMetadataResponse( status_code=http_res.status_code, @@ -1523,17 +1527,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRefreshLibraryMetadataBadRequestData ) - data.raw_response = http_res - raise errors.GetRefreshLibraryMetadataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetRefreshLibraryMetadataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRefreshLibraryMetadataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetRefreshLibraryMetadataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetRefreshLibraryMetadataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1624,7 +1628,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetRefreshLibraryMetadataResponse( status_code=http_res.status_code, @@ -1632,17 +1636,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRefreshLibraryMetadataBadRequestData ) - data.raw_response = http_res - raise errors.GetRefreshLibraryMetadataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetRefreshLibraryMetadataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetRefreshLibraryMetadataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetRefreshLibraryMetadataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetRefreshLibraryMetadataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1750,7 +1754,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchLibraryResponse( object=utils.unmarshal_json( @@ -1761,17 +1765,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchLibraryBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1879,7 +1883,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchLibraryResponse( object=utils.unmarshal_json( @@ -1890,17 +1894,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchLibraryBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchLibraryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchLibraryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchLibraryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchLibraryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchLibraryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1921,6 +1925,442 @@ class Library(BaseSDK): http_res, ) + def get_genres_library( + self, + *, + section_key: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetGenresLibraryResponse: + r"""Get Genres of library media + + Retrieves a list of all the genres that are found for the media in this library. + + + :param section_key: The unique key of the Plex library. Note: This is unique in the context of the Plex server. + :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 = operations.GetGenresLibraryRequest( + section_key=section_key, + ) + + req = self._build_request( + method="GET", + path="/library/sections/{sectionKey}/genre", + 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 + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-genres-library", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetGenresLibraryResponse( + object=utils.unmarshal_json( + http_res.text, Optional[operations.GetGenresLibraryResponseBody] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetGenresLibraryBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetGenresLibraryBadRequest(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetGenresLibraryUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetGenresLibraryUnauthorized(data=response_data) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "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 errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_genres_library_async( + self, + *, + section_key: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetGenresLibraryResponse: + r"""Get Genres of library media + + Retrieves a list of all the genres that are found for the media in this library. + + + :param section_key: The unique key of the Plex library. Note: This is unique in the context of the Plex server. + :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 = operations.GetGenresLibraryRequest( + section_key=section_key, + ) + + req = self._build_request_async( + method="GET", + path="/library/sections/{sectionKey}/genre", + 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 + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-genres-library", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetGenresLibraryResponse( + object=utils.unmarshal_json( + http_res.text, Optional[operations.GetGenresLibraryResponseBody] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetGenresLibraryBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetGenresLibraryBadRequest(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetGenresLibraryUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetGenresLibraryUnauthorized(data=response_data) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_countries_library( + self, + *, + section_key: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetCountriesLibraryResponse: + r"""Get Countries of library media + + Retrieves a list of all the countries that are found for the media in this library. + + + :param section_key: The unique key of the Plex library. Note: This is unique in the context of the Plex server. + :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 = operations.GetCountriesLibraryRequest( + section_key=section_key, + ) + + req = self._build_request( + method="GET", + path="/library/sections/{sectionKey}/country", + 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 + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-countries-library", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetCountriesLibraryResponse( + object=utils.unmarshal_json( + http_res.text, Optional[operations.GetCountriesLibraryResponseBody] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetCountriesLibraryBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetCountriesLibraryBadRequest(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetCountriesLibraryUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetCountriesLibraryUnauthorized(data=response_data) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "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 errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_countries_library_async( + self, + *, + section_key: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetCountriesLibraryResponse: + r"""Get Countries of library media + + Retrieves a list of all the countries that are found for the media in this library. + + + :param section_key: The unique key of the Plex library. Note: This is unique in the context of the Plex server. + :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 = operations.GetCountriesLibraryRequest( + section_key=section_key, + ) + + req = self._build_request_async( + method="GET", + path="/library/sections/{sectionKey}/country", + 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 + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-countries-library", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetCountriesLibraryResponse( + object=utils.unmarshal_json( + http_res.text, Optional[operations.GetCountriesLibraryResponseBody] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetCountriesLibraryBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetCountriesLibraryBadRequest(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GetCountriesLibraryUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetCountriesLibraryUnauthorized(data=response_data) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def get_search_all_libraries( self, *, @@ -1991,7 +2431,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchAllLibrariesResponse( object=utils.unmarshal_json( @@ -2003,17 +2443,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchAllLibrariesBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchAllLibrariesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchAllLibrariesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchAllLibrariesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchAllLibrariesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchAllLibrariesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -2104,7 +2544,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchAllLibrariesResponse( object=utils.unmarshal_json( @@ -2116,17 +2556,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchAllLibrariesBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchAllLibrariesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchAllLibrariesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchAllLibrariesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchAllLibrariesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchAllLibrariesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -2214,7 +2654,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMetaDataByRatingKeyResponse( object=utils.unmarshal_json( @@ -2226,17 +2666,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetaDataByRatingKeyBadRequestData ) - data.raw_response = http_res - raise errors.GetMetaDataByRatingKeyBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMetaDataByRatingKeyBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetaDataByRatingKeyUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMetaDataByRatingKeyUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMetaDataByRatingKeyUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -2324,7 +2764,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMetaDataByRatingKeyResponse( object=utils.unmarshal_json( @@ -2336,17 +2776,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetaDataByRatingKeyBadRequestData ) - data.raw_response = http_res - raise errors.GetMetaDataByRatingKeyBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMetaDataByRatingKeyBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetaDataByRatingKeyUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMetaDataByRatingKeyUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMetaDataByRatingKeyUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -2437,7 +2877,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMetadataChildrenResponse( object=utils.unmarshal_json( @@ -2448,17 +2888,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetadataChildrenBadRequestData ) - data.raw_response = http_res - raise errors.GetMetadataChildrenBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMetadataChildrenBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetadataChildrenUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMetadataChildrenUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMetadataChildrenUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -2549,7 +2989,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMetadataChildrenResponse( object=utils.unmarshal_json( @@ -2560,17 +3000,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetadataChildrenBadRequestData ) - data.raw_response = http_res - raise errors.GetMetadataChildrenBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMetadataChildrenBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMetadataChildrenUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMetadataChildrenUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMetadataChildrenUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -2661,7 +3101,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTopWatchedContentResponse( object=utils.unmarshal_json( @@ -2672,17 +3112,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTopWatchedContentBadRequestData ) - data.raw_response = http_res - raise errors.GetTopWatchedContentBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTopWatchedContentBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTopWatchedContentUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTopWatchedContentUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTopWatchedContentUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -2773,7 +3213,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTopWatchedContentResponse( object=utils.unmarshal_json( @@ -2784,17 +3224,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTopWatchedContentBadRequestData ) - data.raw_response = http_res - raise errors.GetTopWatchedContentBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTopWatchedContentBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTopWatchedContentUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTopWatchedContentUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTopWatchedContentUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -2875,7 +3315,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetOnDeckResponse( object=utils.unmarshal_json( @@ -2886,13 +3326,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetOnDeckBadRequestData) - data.raw_response = http_res - raise errors.GetOnDeckBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetOnDeckBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetOnDeckBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetOnDeckUnauthorizedData) - data.raw_response = http_res - raise errors.GetOnDeckUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetOnDeckUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetOnDeckUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -2973,7 +3417,7 @@ class Library(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetOnDeckResponse( object=utils.unmarshal_json( @@ -2984,13 +3428,17 @@ class Library(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetOnDeckBadRequestData) - data.raw_response = http_res - raise errors.GetOnDeckBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetOnDeckBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetOnDeckBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetOnDeckUnauthorizedData) - data.raw_response = http_res - raise errors.GetOnDeckUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetOnDeckUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.GetOnDeckUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/log.py b/src/plex_api_client/log.py index 733de85..b46c680 100644 --- a/src/plex_api_client/log.py +++ b/src/plex_api_client/log.py @@ -84,7 +84,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.LogLineResponse( status_code=http_res.status_code, @@ -92,13 +92,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.LogLineBadRequestData) - data.raw_response = http_res - raise errors.LogLineBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.LogLineBadRequestData + ) + response_data.raw_response = http_res + raise errors.LogLineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.LogLineUnauthorizedData) - data.raw_response = http_res - raise errors.LogLineUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.LogLineUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.LogLineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -192,7 +196,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.LogLineResponse( status_code=http_res.status_code, @@ -200,13 +204,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.LogLineBadRequestData) - data.raw_response = http_res - raise errors.LogLineBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.LogLineBadRequestData + ) + response_data.raw_response = http_res + raise errors.LogLineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.LogLineUnauthorizedData) - data.raw_response = http_res - raise errors.LogLineUnauthorized(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.LogLineUnauthorizedData + ) + response_data.raw_response = http_res + raise errors.LogLineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -313,7 +321,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.LogMultiLineResponse( status_code=http_res.status_code, @@ -321,17 +329,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.LogMultiLineBadRequestData ) - data.raw_response = http_res - raise errors.LogMultiLineBadRequest(data=data) + response_data.raw_response = http_res + raise errors.LogMultiLineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.LogMultiLineUnauthorizedData ) - data.raw_response = http_res - raise errors.LogMultiLineUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.LogMultiLineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -438,7 +446,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.LogMultiLineResponse( status_code=http_res.status_code, @@ -446,17 +454,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.LogMultiLineBadRequestData ) - data.raw_response = http_res - raise errors.LogMultiLineBadRequest(data=data) + response_data.raw_response = http_res + raise errors.LogMultiLineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.LogMultiLineUnauthorizedData ) - data.raw_response = http_res - raise errors.LogMultiLineUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.LogMultiLineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -537,7 +545,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.EnablePaperTrailResponse( status_code=http_res.status_code, @@ -545,17 +553,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.EnablePaperTrailBadRequestData ) - data.raw_response = http_res - raise errors.EnablePaperTrailBadRequest(data=data) + response_data.raw_response = http_res + raise errors.EnablePaperTrailBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.EnablePaperTrailUnauthorizedData ) - data.raw_response = http_res - raise errors.EnablePaperTrailUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.EnablePaperTrailUnauthorized(data=response_data) if utils.match_response(http_res, ["403", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -636,7 +644,7 @@ class Log(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.EnablePaperTrailResponse( status_code=http_res.status_code, @@ -644,17 +652,17 @@ class Log(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.EnablePaperTrailBadRequestData ) - data.raw_response = http_res - raise errors.EnablePaperTrailBadRequest(data=data) + response_data.raw_response = http_res + raise errors.EnablePaperTrailBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.EnablePaperTrailUnauthorizedData ) - data.raw_response = http_res - raise errors.EnablePaperTrailUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.EnablePaperTrailUnauthorized(data=response_data) if utils.match_response(http_res, ["403", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/media.py b/src/plex_api_client/media.py index d101f7d..5508cda 100644 --- a/src/plex_api_client/media.py +++ b/src/plex_api_client/media.py @@ -77,7 +77,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.MarkPlayedResponse( status_code=http_res.status_code, @@ -85,15 +85,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.MarkPlayedBadRequestData) - data.raw_response = http_res - raise errors.MarkPlayedBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.MarkPlayedBadRequestData + ) + response_data.raw_response = http_res + raise errors.MarkPlayedBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkPlayedUnauthorizedData ) - data.raw_response = http_res - raise errors.MarkPlayedUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.MarkPlayedUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -180,7 +182,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.MarkPlayedResponse( status_code=http_res.status_code, @@ -188,15 +190,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.MarkPlayedBadRequestData) - data.raw_response = http_res - raise errors.MarkPlayedBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.MarkPlayedBadRequestData + ) + response_data.raw_response = http_res + raise errors.MarkPlayedBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkPlayedUnauthorizedData ) - data.raw_response = http_res - raise errors.MarkPlayedUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.MarkPlayedUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -283,7 +287,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.MarkUnplayedResponse( status_code=http_res.status_code, @@ -291,17 +295,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkUnplayedBadRequestData ) - data.raw_response = http_res - raise errors.MarkUnplayedBadRequest(data=data) + response_data.raw_response = http_res + raise errors.MarkUnplayedBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkUnplayedUnauthorizedData ) - data.raw_response = http_res - raise errors.MarkUnplayedUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.MarkUnplayedUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -388,7 +392,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.MarkUnplayedResponse( status_code=http_res.status_code, @@ -396,17 +400,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkUnplayedBadRequestData ) - data.raw_response = http_res - raise errors.MarkUnplayedBadRequest(data=data) + response_data.raw_response = http_res + raise errors.MarkUnplayedBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.MarkUnplayedUnauthorizedData ) - data.raw_response = http_res - raise errors.MarkUnplayedUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.MarkUnplayedUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -500,7 +504,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UpdatePlayProgressResponse( status_code=http_res.status_code, @@ -508,17 +512,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlayProgressBadRequestData ) - data.raw_response = http_res - raise errors.UpdatePlayProgressBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlayProgressBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlayProgressUnauthorizedData ) - data.raw_response = http_res - raise errors.UpdatePlayProgressUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlayProgressUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -612,7 +616,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UpdatePlayProgressResponse( status_code=http_res.status_code, @@ -620,17 +624,17 @@ class Media(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlayProgressBadRequestData ) - data.raw_response = http_res - raise errors.UpdatePlayProgressBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlayProgressBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlayProgressUnauthorizedData ) - data.raw_response = http_res - raise errors.UpdatePlayProgressUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlayProgressUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -720,7 +724,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "image/jpeg"): return operations.GetBannerImageResponse( response_stream=http_res, @@ -731,18 +735,18 @@ class Media(BaseSDK): ) if utils.match_response(http_res, "400", "application/json"): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetBannerImageBadRequestData ) - data.raw_response = http_res - raise errors.GetBannerImageBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetBannerImageBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetBannerImageUnauthorizedData ) - data.raw_response = http_res - raise errors.GetBannerImageUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetBannerImageUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -832,7 +836,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "image/jpeg"): return operations.GetBannerImageResponse( response_stream=http_res, @@ -843,18 +847,18 @@ class Media(BaseSDK): ) if utils.match_response(http_res, "400", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetBannerImageBadRequestData ) - data.raw_response = http_res - raise errors.GetBannerImageBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetBannerImageBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetBannerImageUnauthorizedData ) - data.raw_response = http_res - raise errors.GetBannerImageUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetBannerImageUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -944,7 +948,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "image/jpeg"): return operations.GetThumbImageResponse( response_stream=http_res, @@ -955,18 +959,18 @@ class Media(BaseSDK): ) if utils.match_response(http_res, "400", "application/json"): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetThumbImageBadRequestData ) - data.raw_response = http_res - raise errors.GetThumbImageBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetThumbImageBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetThumbImageUnauthorizedData ) - data.raw_response = http_res - raise errors.GetThumbImageUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetThumbImageUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1056,7 +1060,7 @@ class Media(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "image/jpeg"): return operations.GetThumbImageResponse( response_stream=http_res, @@ -1067,18 +1071,18 @@ class Media(BaseSDK): ) if utils.match_response(http_res, "400", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetThumbImageBadRequestData ) - data.raw_response = http_res - raise errors.GetThumbImageBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetThumbImageBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res_text, errors.GetThumbImageUnauthorizedData ) - data.raw_response = http_res - raise errors.GetThumbImageUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetThumbImageUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/models/errors/__init__.py b/src/plex_api_client/models/errors/__init__.py index 69685ba..9c02d7e 100644 --- a/src/plex_api_client/models/errors/__init__.py +++ b/src/plex_api_client/models/errors/__init__.py @@ -110,6 +110,26 @@ from .get_banner_image import ( GetBannerImageUnauthorized, GetBannerImageUnauthorizedData, ) +from .get_countries_library import ( + GetCountriesLibraryBadRequest, + GetCountriesLibraryBadRequestData, + GetCountriesLibraryErrors, + GetCountriesLibraryErrorsTypedDict, + GetCountriesLibraryLibraryErrors, + GetCountriesLibraryLibraryErrorsTypedDict, + GetCountriesLibraryUnauthorized, + GetCountriesLibraryUnauthorizedData, +) +from .get_genres_library import ( + GetGenresLibraryBadRequest, + GetGenresLibraryBadRequestData, + GetGenresLibraryErrors, + GetGenresLibraryErrorsTypedDict, + GetGenresLibraryLibraryErrors, + GetGenresLibraryLibraryErrorsTypedDict, + GetGenresLibraryUnauthorized, + GetGenresLibraryUnauthorizedData, +) from .get_library_details import ( GetLibraryDetailsBadRequest, GetLibraryDetailsBadRequestData, @@ -866,6 +886,14 @@ __all__ = [ "GetCompanionsDataPlexErrorsTypedDict", "GetCompanionsDataUnauthorized", "GetCompanionsDataUnauthorizedData", + "GetCountriesLibraryBadRequest", + "GetCountriesLibraryBadRequestData", + "GetCountriesLibraryErrors", + "GetCountriesLibraryErrorsTypedDict", + "GetCountriesLibraryLibraryErrors", + "GetCountriesLibraryLibraryErrorsTypedDict", + "GetCountriesLibraryUnauthorized", + "GetCountriesLibraryUnauthorizedData", "GetDevicesBadRequest", "GetDevicesBadRequestData", "GetDevicesErrors", @@ -882,6 +910,14 @@ __all__ = [ "GetFileHashLibraryErrorsTypedDict", "GetFileHashUnauthorized", "GetFileHashUnauthorizedData", + "GetGenresLibraryBadRequest", + "GetGenresLibraryBadRequestData", + "GetGenresLibraryErrors", + "GetGenresLibraryErrorsTypedDict", + "GetGenresLibraryLibraryErrors", + "GetGenresLibraryLibraryErrorsTypedDict", + "GetGenresLibraryUnauthorized", + "GetGenresLibraryUnauthorizedData", "GetGeoDataBadRequest", "GetGeoDataBadRequestData", "GetGeoDataErrors", diff --git a/src/plex_api_client/models/errors/get_countries_library.py b/src/plex_api_client/models/errors/get_countries_library.py new file mode 100644 index 0000000..4d9b4f4 --- /dev/null +++ b/src/plex_api_client/models/errors/get_countries_library.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from plex_api_client import utils +from plex_api_client.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCountriesLibraryLibraryErrorsTypedDict(TypedDict): + code: NotRequired[int] + message: NotRequired[str] + status: NotRequired[int] + + +class GetCountriesLibraryLibraryErrors(BaseModel): + code: Optional[int] = None + + message: Optional[str] = None + + status: Optional[int] = None + + +class GetCountriesLibraryUnauthorizedData(BaseModel): + errors: Optional[List[GetCountriesLibraryLibraryErrors]] = None + + raw_response: Annotated[Optional[httpx.Response], pydantic.Field(exclude=True)] = ( + None + ) + r"""Raw HTTP response; suitable for custom response parsing""" + + +class GetCountriesLibraryUnauthorized(Exception): + r"""Unauthorized - Returned if the X-Plex-Token is missing from the header or query.""" + + data: GetCountriesLibraryUnauthorizedData + + def __init__(self, data: GetCountriesLibraryUnauthorizedData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GetCountriesLibraryUnauthorizedData) + + +class GetCountriesLibraryErrorsTypedDict(TypedDict): + code: NotRequired[int] + message: NotRequired[str] + status: NotRequired[int] + + +class GetCountriesLibraryErrors(BaseModel): + code: Optional[int] = None + + message: Optional[str] = None + + status: Optional[int] = None + + +class GetCountriesLibraryBadRequestData(BaseModel): + errors: Optional[List[GetCountriesLibraryErrors]] = None + + raw_response: Annotated[Optional[httpx.Response], pydantic.Field(exclude=True)] = ( + None + ) + r"""Raw HTTP response; suitable for custom response parsing""" + + +class GetCountriesLibraryBadRequest(Exception): + r"""Bad Request - A parameter was not specified, or was specified incorrectly.""" + + data: GetCountriesLibraryBadRequestData + + def __init__(self, data: GetCountriesLibraryBadRequestData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GetCountriesLibraryBadRequestData) diff --git a/src/plex_api_client/models/errors/get_genres_library.py b/src/plex_api_client/models/errors/get_genres_library.py new file mode 100644 index 0000000..628cb91 --- /dev/null +++ b/src/plex_api_client/models/errors/get_genres_library.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from plex_api_client import utils +from plex_api_client.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetGenresLibraryLibraryErrorsTypedDict(TypedDict): + code: NotRequired[int] + message: NotRequired[str] + status: NotRequired[int] + + +class GetGenresLibraryLibraryErrors(BaseModel): + code: Optional[int] = None + + message: Optional[str] = None + + status: Optional[int] = None + + +class GetGenresLibraryUnauthorizedData(BaseModel): + errors: Optional[List[GetGenresLibraryLibraryErrors]] = None + + raw_response: Annotated[Optional[httpx.Response], pydantic.Field(exclude=True)] = ( + None + ) + r"""Raw HTTP response; suitable for custom response parsing""" + + +class GetGenresLibraryUnauthorized(Exception): + r"""Unauthorized - Returned if the X-Plex-Token is missing from the header or query.""" + + data: GetGenresLibraryUnauthorizedData + + def __init__(self, data: GetGenresLibraryUnauthorizedData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GetGenresLibraryUnauthorizedData) + + +class GetGenresLibraryErrorsTypedDict(TypedDict): + code: NotRequired[int] + message: NotRequired[str] + status: NotRequired[int] + + +class GetGenresLibraryErrors(BaseModel): + code: Optional[int] = None + + message: Optional[str] = None + + status: Optional[int] = None + + +class GetGenresLibraryBadRequestData(BaseModel): + errors: Optional[List[GetGenresLibraryErrors]] = None + + raw_response: Annotated[Optional[httpx.Response], pydantic.Field(exclude=True)] = ( + None + ) + r"""Raw HTTP response; suitable for custom response parsing""" + + +class GetGenresLibraryBadRequest(Exception): + r"""Bad Request - A parameter was not specified, or was specified incorrectly.""" + + data: GetGenresLibraryBadRequestData + + def __init__(self, data: GetGenresLibraryBadRequestData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GetGenresLibraryBadRequestData) diff --git a/src/plex_api_client/models/operations/__init__.py b/src/plex_api_client/models/operations/__init__.py index 78897eb..0f0ebaf 100644 --- a/src/plex_api_client/models/operations/__init__.py +++ b/src/plex_api_client/models/operations/__init__.py @@ -87,6 +87,30 @@ from .get_banner_image import ( GetBannerImageResponse, GetBannerImageResponseTypedDict, ) +from .get_countries_library import ( + GetCountriesLibraryDirectory, + GetCountriesLibraryDirectoryTypedDict, + GetCountriesLibraryMediaContainer, + GetCountriesLibraryMediaContainerTypedDict, + GetCountriesLibraryRequest, + GetCountriesLibraryRequestTypedDict, + GetCountriesLibraryResponse, + GetCountriesLibraryResponseBody, + GetCountriesLibraryResponseBodyTypedDict, + GetCountriesLibraryResponseTypedDict, +) +from .get_genres_library import ( + GetGenresLibraryDirectory, + GetGenresLibraryDirectoryTypedDict, + GetGenresLibraryMediaContainer, + GetGenresLibraryMediaContainerTypedDict, + GetGenresLibraryRequest, + GetGenresLibraryRequestTypedDict, + GetGenresLibraryResponse, + GetGenresLibraryResponseBody, + GetGenresLibraryResponseBodyTypedDict, + GetGenresLibraryResponseTypedDict, +) from .get_library_details import ( GetLibraryDetailsDirectory, GetLibraryDetailsDirectoryTypedDict, @@ -317,10 +341,10 @@ from .get_recently_added import ( from .get_recently_added_library import ( ActiveDirection, DefaultDirection, - Field, + FieldT, + FieldTTypedDict, FieldType, FieldTypeTypedDict, - FieldTypedDict, GetRecentlyAddedLibraryCountry, GetRecentlyAddedLibraryCountryTypedDict, GetRecentlyAddedLibraryDirector, @@ -1150,10 +1174,10 @@ __all__ = [ "EpisodeSort", "Feature", "FeatureTypedDict", - "Field", + "FieldT", + "FieldTTypedDict", "FieldType", "FieldTypeTypedDict", - "FieldTypedDict", "Filter", "FlattenSeasons", "Force", @@ -1209,6 +1233,16 @@ __all__ = [ "GetButlerTasksResponseTypedDict", "GetCompanionsDataResponse", "GetCompanionsDataResponseTypedDict", + "GetCountriesLibraryDirectory", + "GetCountriesLibraryDirectoryTypedDict", + "GetCountriesLibraryMediaContainer", + "GetCountriesLibraryMediaContainerTypedDict", + "GetCountriesLibraryRequest", + "GetCountriesLibraryRequestTypedDict", + "GetCountriesLibraryResponse", + "GetCountriesLibraryResponseBody", + "GetCountriesLibraryResponseBodyTypedDict", + "GetCountriesLibraryResponseTypedDict", "GetDevicesMediaContainer", "GetDevicesMediaContainerTypedDict", "GetDevicesResponse", @@ -1219,6 +1253,16 @@ __all__ = [ "GetFileHashRequestTypedDict", "GetFileHashResponse", "GetFileHashResponseTypedDict", + "GetGenresLibraryDirectory", + "GetGenresLibraryDirectoryTypedDict", + "GetGenresLibraryMediaContainer", + "GetGenresLibraryMediaContainerTypedDict", + "GetGenresLibraryRequest", + "GetGenresLibraryRequestTypedDict", + "GetGenresLibraryResponse", + "GetGenresLibraryResponseBody", + "GetGenresLibraryResponseBodyTypedDict", + "GetGenresLibraryResponseTypedDict", "GetGeoDataGeoData", "GetGeoDataGeoDataTypedDict", "GetGeoDataResponse", diff --git a/src/plex_api_client/models/operations/get_countries_library.py b/src/plex_api_client/models/operations/get_countries_library.py new file mode 100644 index 0000000..8e8f764 --- /dev/null +++ b/src/plex_api_client/models/operations/get_countries_library.py @@ -0,0 +1,135 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from plex_api_client.types import BaseModel +from plex_api_client.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCountriesLibraryRequestTypedDict(TypedDict): + section_key: int + r"""The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + """ + + +class GetCountriesLibraryRequest(BaseModel): + section_key: Annotated[ + int, + pydantic.Field(alias="sectionKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + """ + + +class GetCountriesLibraryDirectoryTypedDict(TypedDict): + fast_key: str + key: str + title: str + + +class GetCountriesLibraryDirectory(BaseModel): + fast_key: Annotated[str, pydantic.Field(alias="fastKey")] + + key: str + + title: str + + +class GetCountriesLibraryMediaContainerTypedDict(TypedDict): + size: float + identifier: str + allow_sync: bool + art: str + content: str + media_tag_prefix: str + media_tag_version: int + nocache: bool + thumb: str + title1: str + title2: str + view_group: str + offset: NotRequired[int] + total_size: NotRequired[int] + directory: NotRequired[List[GetCountriesLibraryDirectoryTypedDict]] + + +class GetCountriesLibraryMediaContainer(BaseModel): + size: float + + identifier: str + + allow_sync: Annotated[bool, pydantic.Field(alias="allowSync")] + + art: str + + content: str + + media_tag_prefix: Annotated[str, pydantic.Field(alias="mediaTagPrefix")] + + media_tag_version: Annotated[int, pydantic.Field(alias="mediaTagVersion")] + + nocache: bool + + thumb: str + + title1: str + + title2: str + + view_group: Annotated[str, pydantic.Field(alias="viewGroup")] + + offset: Optional[int] = None + + total_size: Annotated[Optional[int], pydantic.Field(alias="totalSize")] = None + + directory: Annotated[ + Optional[List[GetCountriesLibraryDirectory]], pydantic.Field(alias="Directory") + ] = None + + +class GetCountriesLibraryResponseBodyTypedDict(TypedDict): + r"""Successful response containing media container data.""" + + media_container: NotRequired[GetCountriesLibraryMediaContainerTypedDict] + + +class GetCountriesLibraryResponseBody(BaseModel): + r"""Successful response containing media container data.""" + + media_container: Annotated[ + Optional[GetCountriesLibraryMediaContainer], + pydantic.Field(alias="MediaContainer"), + ] = None + + +class GetCountriesLibraryResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + object: NotRequired[GetCountriesLibraryResponseBodyTypedDict] + r"""Successful response containing media container data.""" + + +class GetCountriesLibraryResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + object: Optional[GetCountriesLibraryResponseBody] = None + r"""Successful response containing media container data.""" diff --git a/src/plex_api_client/models/operations/get_genres_library.py b/src/plex_api_client/models/operations/get_genres_library.py new file mode 100644 index 0000000..d926eb8 --- /dev/null +++ b/src/plex_api_client/models/operations/get_genres_library.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from plex_api_client.types import BaseModel +from plex_api_client.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetGenresLibraryRequestTypedDict(TypedDict): + section_key: int + r"""The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + """ + + +class GetGenresLibraryRequest(BaseModel): + section_key: Annotated[ + int, + pydantic.Field(alias="sectionKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The unique key of the Plex library. + Note: This is unique in the context of the Plex server. + + """ + + +class GetGenresLibraryDirectoryTypedDict(TypedDict): + fast_key: str + key: str + title: str + type: str + + +class GetGenresLibraryDirectory(BaseModel): + fast_key: Annotated[str, pydantic.Field(alias="fastKey")] + + key: str + + title: str + + type: str + + +class GetGenresLibraryMediaContainerTypedDict(TypedDict): + size: float + identifier: str + allow_sync: bool + art: str + content: str + media_tag_prefix: str + media_tag_version: int + nocache: bool + thumb: str + title1: str + title2: str + view_group: str + offset: NotRequired[int] + total_size: NotRequired[int] + directory: NotRequired[List[GetGenresLibraryDirectoryTypedDict]] + + +class GetGenresLibraryMediaContainer(BaseModel): + size: float + + identifier: str + + allow_sync: Annotated[bool, pydantic.Field(alias="allowSync")] + + art: str + + content: str + + media_tag_prefix: Annotated[str, pydantic.Field(alias="mediaTagPrefix")] + + media_tag_version: Annotated[int, pydantic.Field(alias="mediaTagVersion")] + + nocache: bool + + thumb: str + + title1: str + + title2: str + + view_group: Annotated[str, pydantic.Field(alias="viewGroup")] + + offset: Optional[int] = None + + total_size: Annotated[Optional[int], pydantic.Field(alias="totalSize")] = None + + directory: Annotated[ + Optional[List[GetGenresLibraryDirectory]], pydantic.Field(alias="Directory") + ] = None + + +class GetGenresLibraryResponseBodyTypedDict(TypedDict): + r"""Successful response containing media container data.""" + + media_container: NotRequired[GetGenresLibraryMediaContainerTypedDict] + + +class GetGenresLibraryResponseBody(BaseModel): + r"""Successful response containing media container data.""" + + media_container: Annotated[ + Optional[GetGenresLibraryMediaContainer], pydantic.Field(alias="MediaContainer") + ] = None + + +class GetGenresLibraryResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + object: NotRequired[GetGenresLibraryResponseBodyTypedDict] + r"""Successful response containing media container data.""" + + +class GetGenresLibraryResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + object: Optional[GetGenresLibraryResponseBody] = None + r"""Successful response containing media container data.""" diff --git a/src/plex_api_client/models/operations/get_recently_added_library.py b/src/plex_api_client/models/operations/get_recently_added_library.py index bd15002..d8f50a8 100644 --- a/src/plex_api_client/models/operations/get_recently_added_library.py +++ b/src/plex_api_client/models/operations/get_recently_added_library.py @@ -215,14 +215,14 @@ class Sort(BaseModel): ] = None -class FieldTypedDict(TypedDict): +class FieldTTypedDict(TypedDict): key: str title: str type: str sub_type: NotRequired[str] -class Field(BaseModel): +class FieldT(BaseModel): key: str title: str @@ -239,7 +239,7 @@ class GetRecentlyAddedLibraryTypeTypedDict(TypedDict): active: bool filter_: NotRequired[List[GetRecentlyAddedLibraryFilterTypedDict]] sort: NotRequired[List[SortTypedDict]] - field: NotRequired[List[FieldTypedDict]] + field: NotRequired[List[FieldTTypedDict]] class GetRecentlyAddedLibraryType(BaseModel): @@ -257,7 +257,7 @@ class GetRecentlyAddedLibraryType(BaseModel): sort: Annotated[Optional[List[Sort]], pydantic.Field(alias="Sort")] = None - field: Annotated[Optional[List[Field]], pydantic.Field(alias="Field")] = None + field: Annotated[Optional[List[FieldT]], pydantic.Field(alias="Field")] = None class OperatorTypedDict(TypedDict): diff --git a/src/plex_api_client/playlists.py b/src/plex_api_client/playlists.py index cac1598..1200fa9 100644 --- a/src/plex_api_client/playlists.py +++ b/src/plex_api_client/playlists.py @@ -87,7 +87,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.CreatePlaylistResponse( object=utils.unmarshal_json( @@ -98,17 +98,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CreatePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.CreatePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CreatePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CreatePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.CreatePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CreatePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -200,7 +200,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.CreatePlaylistResponse( object=utils.unmarshal_json( @@ -211,17 +211,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CreatePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.CreatePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CreatePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CreatePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.CreatePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CreatePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -311,7 +311,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistsResponse( object=utils.unmarshal_json( @@ -322,17 +322,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistsBadRequestData ) - data.raw_response = http_res - raise errors.GetPlaylistsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -422,7 +422,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistsResponse( object=utils.unmarshal_json( @@ -433,17 +433,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistsBadRequestData ) - data.raw_response = http_res - raise errors.GetPlaylistsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -532,7 +532,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistResponse( object=utils.unmarshal_json( @@ -543,15 +543,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetPlaylistBadRequestData) - data.raw_response = http_res - raise errors.GetPlaylistBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetPlaylistBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetPlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -640,7 +642,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistResponse( object=utils.unmarshal_json( @@ -651,15 +653,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetPlaylistBadRequestData) - data.raw_response = http_res - raise errors.GetPlaylistBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetPlaylistBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetPlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -747,7 +751,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return operations.DeletePlaylistResponse( status_code=http_res.status_code, @@ -755,17 +759,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeletePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.DeletePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.DeletePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeletePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.DeletePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.DeletePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -853,7 +857,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return operations.DeletePlaylistResponse( status_code=http_res.status_code, @@ -861,17 +865,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeletePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.DeletePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.DeletePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.DeletePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.DeletePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.DeletePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -965,7 +969,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UpdatePlaylistResponse( status_code=http_res.status_code, @@ -973,17 +977,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.UpdatePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.UpdatePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1077,7 +1081,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UpdatePlaylistResponse( status_code=http_res.status_code, @@ -1085,17 +1089,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlaylistBadRequestData ) - data.raw_response = http_res - raise errors.UpdatePlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UpdatePlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.UpdatePlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UpdatePlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1189,7 +1193,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistContentsResponse( object=utils.unmarshal_json( @@ -1200,17 +1204,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.GetPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1304,7 +1308,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaylistContentsResponse( object=utils.unmarshal_json( @@ -1315,17 +1319,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.GetPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1413,7 +1417,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.ClearPlaylistContentsResponse( status_code=http_res.status_code, @@ -1421,17 +1425,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ClearPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.ClearPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.ClearPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ClearPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.ClearPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.ClearPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1519,7 +1523,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.ClearPlaylistContentsResponse( status_code=http_res.status_code, @@ -1527,17 +1531,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ClearPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.ClearPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.ClearPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ClearPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.ClearPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.ClearPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1632,7 +1636,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.AddPlaylistContentsResponse( object=utils.unmarshal_json( @@ -1643,17 +1647,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.AddPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.AddPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.AddPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.AddPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.AddPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.AddPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1748,7 +1752,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.AddPlaylistContentsResponse( object=utils.unmarshal_json( @@ -1759,17 +1763,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.AddPlaylistContentsBadRequestData ) - data.raw_response = http_res - raise errors.AddPlaylistContentsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.AddPlaylistContentsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.AddPlaylistContentsUnauthorizedData ) - data.raw_response = http_res - raise errors.AddPlaylistContentsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.AddPlaylistContentsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1863,7 +1867,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UploadPlaylistResponse( status_code=http_res.status_code, @@ -1871,17 +1875,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UploadPlaylistBadRequestData ) - data.raw_response = http_res - raise errors.UploadPlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UploadPlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UploadPlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.UploadPlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UploadPlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1975,7 +1979,7 @@ class Playlists(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.UploadPlaylistResponse( status_code=http_res.status_code, @@ -1983,17 +1987,17 @@ class Playlists(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UploadPlaylistBadRequestData ) - data.raw_response = http_res - raise errors.UploadPlaylistBadRequest(data=data) + response_data.raw_response = http_res + raise errors.UploadPlaylistBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.UploadPlaylistUnauthorizedData ) - data.raw_response = http_res - raise errors.UploadPlaylistUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.UploadPlaylistUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/plex.py b/src/plex_api_client/plex.py index 57f75f0..96407e4 100644 --- a/src/plex_api_client/plex.py +++ b/src/plex_api_client/plex.py @@ -72,7 +72,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetCompanionsDataResponse( response_bodies=utils.unmarshal_json( @@ -83,17 +83,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetCompanionsDataBadRequestData ) - data.raw_response = http_res - raise errors.GetCompanionsDataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetCompanionsDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetCompanionsDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetCompanionsDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetCompanionsDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -175,7 +175,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetCompanionsDataResponse( response_bodies=utils.unmarshal_json( @@ -186,17 +186,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetCompanionsDataBadRequestData ) - data.raw_response = http_res - raise errors.GetCompanionsDataBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetCompanionsDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetCompanionsDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetCompanionsDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetCompanionsDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -278,7 +278,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetUserFriendsResponse( friends=utils.unmarshal_json( @@ -289,17 +289,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUserFriendsBadRequestData ) - data.raw_response = http_res - raise errors.GetUserFriendsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetUserFriendsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUserFriendsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetUserFriendsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetUserFriendsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -381,7 +381,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetUserFriendsResponse( friends=utils.unmarshal_json( @@ -392,17 +392,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUserFriendsBadRequestData ) - data.raw_response = http_res - raise errors.GetUserFriendsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetUserFriendsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUserFriendsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetUserFriendsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetUserFriendsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -481,7 +481,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetGeoDataResponse( geo_data=utils.unmarshal_json( @@ -492,15 +492,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetGeoDataBadRequestData) - data.raw_response = http_res - raise errors.GetGeoDataBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetGeoDataBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetGeoDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGeoDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetGeoDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetGeoDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -579,7 +581,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetGeoDataResponse( geo_data=utils.unmarshal_json( @@ -590,15 +592,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetGeoDataBadRequestData) - data.raw_response = http_res - raise errors.GetGeoDataBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetGeoDataBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetGeoDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetGeoDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetGeoDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetGeoDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -678,7 +682,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetHomeDataResponse( object=utils.unmarshal_json( @@ -689,15 +693,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetHomeDataBadRequestData) - data.raw_response = http_res - raise errors.GetHomeDataBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetHomeDataBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetHomeDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetHomeDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetHomeDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetHomeDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -777,7 +783,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetHomeDataResponse( object=utils.unmarshal_json( @@ -788,15 +794,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetHomeDataBadRequestData) - data.raw_response = http_res - raise errors.GetHomeDataBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetHomeDataBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetHomeDataBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetHomeDataUnauthorizedData ) - data.raw_response = http_res - raise errors.GetHomeDataUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetHomeDataUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -900,7 +908,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerResourcesResponse( plex_devices=utils.unmarshal_json( @@ -911,17 +919,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerResourcesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerResourcesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerResourcesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerResourcesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerResourcesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerResourcesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1025,7 +1033,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerResourcesResponse( plex_devices=utils.unmarshal_json( @@ -1036,17 +1044,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerResourcesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerResourcesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerResourcesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerResourcesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerResourcesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerResourcesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1132,7 +1140,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return operations.GetPinResponse( auth_pin_container=utils.unmarshal_json( @@ -1143,9 +1151,11 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetPinBadRequestData) - data.raw_response = http_res - raise errors.GetPinBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetPinBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetPinBadRequest(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1231,7 +1241,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return operations.GetPinResponse( auth_pin_container=utils.unmarshal_json( @@ -1242,9 +1252,11 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetPinBadRequestData) - data.raw_response = http_res - raise errors.GetPinBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetPinBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetPinBadRequest(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1333,7 +1345,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTokenByPinIDResponse( auth_pin_container=utils.unmarshal_json( @@ -1344,17 +1356,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenByPinIDBadRequestData ) - data.raw_response = http_res - raise errors.GetTokenByPinIDBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTokenByPinIDBadRequest(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenByPinIDResponseBodyData ) - data.raw_response = http_res - raise errors.GetTokenByPinIDResponseBody(data=data) + response_data.raw_response = http_res + raise errors.GetTokenByPinIDResponseBody(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1443,7 +1455,7 @@ class Plex(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTokenByPinIDResponse( auth_pin_container=utils.unmarshal_json( @@ -1454,17 +1466,17 @@ class Plex(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenByPinIDBadRequestData ) - data.raw_response = http_res - raise errors.GetTokenByPinIDBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTokenByPinIDBadRequest(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTokenByPinIDResponseBodyData ) - data.raw_response = http_res - raise errors.GetTokenByPinIDResponseBody(data=data) + response_data.raw_response = http_res + raise errors.GetTokenByPinIDResponseBody(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/search.py b/src/plex_api_client/search.py index 71e9c59..4a30b35 100644 --- a/src/plex_api_client/search.py +++ b/src/plex_api_client/search.py @@ -95,7 +95,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.PerformSearchResponse( status_code=http_res.status_code, @@ -103,17 +103,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformSearchBadRequestData ) - data.raw_response = http_res - raise errors.PerformSearchBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PerformSearchBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformSearchUnauthorizedData ) - data.raw_response = http_res - raise errors.PerformSearchUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PerformSearchUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -218,7 +218,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.PerformSearchResponse( status_code=http_res.status_code, @@ -226,17 +226,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformSearchBadRequestData ) - data.raw_response = http_res - raise errors.PerformSearchBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PerformSearchBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformSearchUnauthorizedData ) - data.raw_response = http_res - raise errors.PerformSearchUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PerformSearchUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -333,7 +333,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.PerformVoiceSearchResponse( status_code=http_res.status_code, @@ -341,17 +341,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformVoiceSearchBadRequestData ) - data.raw_response = http_res - raise errors.PerformVoiceSearchBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PerformVoiceSearchBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformVoiceSearchUnauthorizedData ) - data.raw_response = http_res - raise errors.PerformVoiceSearchUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PerformVoiceSearchUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -448,7 +448,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.PerformVoiceSearchResponse( status_code=http_res.status_code, @@ -456,17 +456,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformVoiceSearchBadRequestData ) - data.raw_response = http_res - raise errors.PerformVoiceSearchBadRequest(data=data) + response_data.raw_response = http_res + raise errors.PerformVoiceSearchBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.PerformVoiceSearchUnauthorizedData ) - data.raw_response = http_res - raise errors.PerformVoiceSearchUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.PerformVoiceSearchUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -553,7 +553,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchResultsResponse( object=utils.unmarshal_json( @@ -564,17 +564,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchResultsBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchResultsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchResultsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchResultsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchResultsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchResultsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -661,7 +661,7 @@ class Search(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSearchResultsResponse( object=utils.unmarshal_json( @@ -672,17 +672,17 @@ class Search(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchResultsBadRequestData ) - data.raw_response = http_res - raise errors.GetSearchResultsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSearchResultsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSearchResultsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSearchResultsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSearchResultsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/server.py b/src/plex_api_client/server.py index 62b189c..4765b21 100644 --- a/src/plex_api_client/server.py +++ b/src/plex_api_client/server.py @@ -70,7 +70,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerCapabilitiesResponse( object=utils.unmarshal_json( @@ -82,17 +82,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerCapabilitiesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerCapabilitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerCapabilitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerCapabilitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerCapabilitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerCapabilitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -172,7 +172,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerCapabilitiesResponse( object=utils.unmarshal_json( @@ -184,17 +184,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerCapabilitiesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerCapabilitiesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerCapabilitiesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerCapabilitiesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerCapabilitiesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerCapabilitiesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -274,7 +274,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerPreferencesResponse( object=utils.unmarshal_json( @@ -285,17 +285,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerPreferencesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerPreferencesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerPreferencesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerPreferencesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerPreferencesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerPreferencesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -375,7 +375,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerPreferencesResponse( object=utils.unmarshal_json( @@ -386,17 +386,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerPreferencesBadRequestData ) - data.raw_response = http_res - raise errors.GetServerPreferencesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerPreferencesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerPreferencesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerPreferencesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerPreferencesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -476,7 +476,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetAvailableClientsResponse( object=utils.unmarshal_json( @@ -487,17 +487,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAvailableClientsBadRequestData ) - data.raw_response = http_res - raise errors.GetAvailableClientsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetAvailableClientsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAvailableClientsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetAvailableClientsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetAvailableClientsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -577,7 +577,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetAvailableClientsResponse( object=utils.unmarshal_json( @@ -588,17 +588,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAvailableClientsBadRequestData ) - data.raw_response = http_res - raise errors.GetAvailableClientsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetAvailableClientsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetAvailableClientsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetAvailableClientsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetAvailableClientsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -678,7 +678,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetDevicesResponse( object=utils.unmarshal_json( @@ -689,15 +689,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetDevicesBadRequestData) - data.raw_response = http_res - raise errors.GetDevicesBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetDevicesBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetDevicesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetDevicesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetDevicesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetDevicesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -777,7 +779,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetDevicesResponse( object=utils.unmarshal_json( @@ -788,15 +790,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetDevicesBadRequestData) - data.raw_response = http_res - raise errors.GetDevicesBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetDevicesBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetDevicesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetDevicesUnauthorizedData ) - data.raw_response = http_res - raise errors.GetDevicesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetDevicesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -875,7 +879,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerIdentityResponse( object=utils.unmarshal_json( @@ -886,11 +890,11 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "408", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerIdentityRequestTimeoutData ) - data.raw_response = http_res - raise errors.GetServerIdentityRequestTimeout(data=data) + response_data.raw_response = http_res + raise errors.GetServerIdentityRequestTimeout(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -969,7 +973,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerIdentityResponse( object=utils.unmarshal_json( @@ -980,11 +984,11 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "408", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerIdentityRequestTimeoutData ) - data.raw_response = http_res - raise errors.GetServerIdentityRequestTimeout(data=data) + response_data.raw_response = http_res + raise errors.GetServerIdentityRequestTimeout(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1064,7 +1068,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMyPlexAccountResponse( object=utils.unmarshal_json( @@ -1075,17 +1079,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMyPlexAccountBadRequestData ) - data.raw_response = http_res - raise errors.GetMyPlexAccountBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMyPlexAccountBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMyPlexAccountUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMyPlexAccountUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMyPlexAccountUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1165,7 +1169,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMyPlexAccountResponse( object=utils.unmarshal_json( @@ -1176,17 +1180,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMyPlexAccountBadRequestData ) - data.raw_response = http_res - raise errors.GetMyPlexAccountBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMyPlexAccountBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMyPlexAccountUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMyPlexAccountUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMyPlexAccountUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1277,7 +1281,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetResizedPhotoResponse( status_code=http_res.status_code, @@ -1285,17 +1289,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResizedPhotoBadRequestData ) - data.raw_response = http_res - raise errors.GetResizedPhotoBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetResizedPhotoBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResizedPhotoUnauthorizedData ) - data.raw_response = http_res - raise errors.GetResizedPhotoUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetResizedPhotoUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1386,7 +1390,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetResizedPhotoResponse( status_code=http_res.status_code, @@ -1394,17 +1398,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResizedPhotoBadRequestData ) - data.raw_response = http_res - raise errors.GetResizedPhotoBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetResizedPhotoBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResizedPhotoUnauthorizedData ) - data.raw_response = http_res - raise errors.GetResizedPhotoUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetResizedPhotoUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1491,7 +1495,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMediaProvidersResponse( object=utils.unmarshal_json( @@ -1502,17 +1506,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMediaProvidersBadRequestData ) - data.raw_response = http_res - raise errors.GetMediaProvidersBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMediaProvidersBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMediaProvidersUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMediaProvidersUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMediaProvidersUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1599,7 +1603,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetMediaProvidersResponse( object=utils.unmarshal_json( @@ -1610,17 +1614,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMediaProvidersBadRequestData ) - data.raw_response = http_res - raise errors.GetMediaProvidersBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetMediaProvidersBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetMediaProvidersUnauthorizedData ) - data.raw_response = http_res - raise errors.GetMediaProvidersUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetMediaProvidersUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -1700,7 +1704,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerListResponse( object=utils.unmarshal_json( @@ -1711,17 +1715,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerListBadRequestData ) - data.raw_response = http_res - raise errors.GetServerListBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerListBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerListUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerListUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerListUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -1801,7 +1805,7 @@ class Server(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetServerListResponse( object=utils.unmarshal_json( @@ -1812,17 +1816,17 @@ class Server(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerListBadRequestData ) - data.raw_response = http_res - raise errors.GetServerListBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetServerListBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetServerListUnauthorizedData ) - data.raw_response = http_res - raise errors.GetServerListUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetServerListUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/sessions.py b/src/plex_api_client/sessions.py index 936d1cf..67c05f4 100644 --- a/src/plex_api_client/sessions.py +++ b/src/plex_api_client/sessions.py @@ -70,7 +70,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSessionsResponse( object=utils.unmarshal_json( @@ -81,15 +81,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetSessionsBadRequestData) - data.raw_response = http_res - raise errors.GetSessionsBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetSessionsBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetSessionsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSessionsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSessionsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -169,7 +171,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSessionsResponse( object=utils.unmarshal_json( @@ -180,15 +182,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetSessionsBadRequestData) - data.raw_response = http_res - raise errors.GetSessionsBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetSessionsBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetSessionsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSessionsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSessionsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -288,7 +292,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSessionHistoryResponse( object=utils.unmarshal_json( @@ -299,17 +303,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionHistoryBadRequestData ) - data.raw_response = http_res - raise errors.GetSessionHistoryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSessionHistoryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionHistoryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSessionHistoryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSessionHistoryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -409,7 +413,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetSessionHistoryResponse( object=utils.unmarshal_json( @@ -420,17 +424,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionHistoryBadRequestData ) - data.raw_response = http_res - raise errors.GetSessionHistoryBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetSessionHistoryBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetSessionHistoryUnauthorizedData ) - data.raw_response = http_res - raise errors.GetSessionHistoryUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetSessionHistoryUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -510,7 +514,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTranscodeSessionsResponse( object=utils.unmarshal_json( @@ -521,17 +525,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTranscodeSessionsBadRequestData ) - data.raw_response = http_res - raise errors.GetTranscodeSessionsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTranscodeSessionsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTranscodeSessionsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTranscodeSessionsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTranscodeSessionsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -611,7 +615,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetTranscodeSessionsResponse( object=utils.unmarshal_json( @@ -622,17 +626,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTranscodeSessionsBadRequestData ) - data.raw_response = http_res - raise errors.GetTranscodeSessionsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetTranscodeSessionsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTranscodeSessionsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTranscodeSessionsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTranscodeSessionsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -719,7 +723,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return operations.StopTranscodeSessionResponse( status_code=http_res.status_code, @@ -727,17 +731,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopTranscodeSessionBadRequestData ) - data.raw_response = http_res - raise errors.StopTranscodeSessionBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StopTranscodeSessionBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopTranscodeSessionUnauthorizedData ) - data.raw_response = http_res - raise errors.StopTranscodeSessionUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StopTranscodeSessionUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -824,7 +828,7 @@ class Sessions(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return operations.StopTranscodeSessionResponse( status_code=http_res.status_code, @@ -832,17 +836,17 @@ class Sessions(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopTranscodeSessionBadRequestData ) - data.raw_response = http_res - raise errors.StopTranscodeSessionBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StopTranscodeSessionBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StopTranscodeSessionUnauthorizedData ) - data.raw_response = http_res - raise errors.StopTranscodeSessionUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StopTranscodeSessionUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/statistics.py b/src/plex_api_client/statistics.py index 48516b4..3609c28 100644 --- a/src/plex_api_client/statistics.py +++ b/src/plex_api_client/statistics.py @@ -77,7 +77,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetStatisticsResponse( object=utils.unmarshal_json( @@ -88,17 +88,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -185,7 +185,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetStatisticsResponse( object=utils.unmarshal_json( @@ -196,17 +196,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -293,7 +293,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetResourcesStatisticsResponse( object=utils.unmarshal_json( @@ -305,17 +305,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResourcesStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetResourcesStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetResourcesStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResourcesStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetResourcesStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetResourcesStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -402,7 +402,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetResourcesStatisticsResponse( object=utils.unmarshal_json( @@ -414,17 +414,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResourcesStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetResourcesStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetResourcesStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetResourcesStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetResourcesStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetResourcesStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -511,7 +511,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetBandwidthStatisticsResponse( object=utils.unmarshal_json( @@ -523,17 +523,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetBandwidthStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetBandwidthStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetBandwidthStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetBandwidthStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetBandwidthStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetBandwidthStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -620,7 +620,7 @@ class Statistics(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetBandwidthStatisticsResponse( object=utils.unmarshal_json( @@ -632,17 +632,17 @@ class Statistics(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetBandwidthStatisticsBadRequestData ) - data.raw_response = http_res - raise errors.GetBandwidthStatisticsBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetBandwidthStatisticsBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetBandwidthStatisticsUnauthorizedData ) - data.raw_response = http_res - raise errors.GetBandwidthStatisticsUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetBandwidthStatisticsUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/updater.py b/src/plex_api_client/updater.py index b40a17a..b54af75 100644 --- a/src/plex_api_client/updater.py +++ b/src/plex_api_client/updater.py @@ -73,7 +73,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetUpdateStatusResponse( object=utils.unmarshal_json( @@ -84,17 +84,17 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUpdateStatusBadRequestData ) - data.raw_response = http_res - raise errors.GetUpdateStatusBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetUpdateStatusBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUpdateStatusUnauthorizedData ) - data.raw_response = http_res - raise errors.GetUpdateStatusUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetUpdateStatusUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -174,7 +174,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetUpdateStatusResponse( object=utils.unmarshal_json( @@ -185,17 +185,17 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUpdateStatusBadRequestData ) - data.raw_response = http_res - raise errors.GetUpdateStatusBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetUpdateStatusBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetUpdateStatusUnauthorizedData ) - data.raw_response = http_res - raise errors.GetUpdateStatusUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetUpdateStatusUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -282,7 +282,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.CheckForUpdatesResponse( status_code=http_res.status_code, @@ -290,17 +290,17 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CheckForUpdatesBadRequestData ) - data.raw_response = http_res - raise errors.CheckForUpdatesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CheckForUpdatesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CheckForUpdatesUnauthorizedData ) - data.raw_response = http_res - raise errors.CheckForUpdatesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CheckForUpdatesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -387,7 +387,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.CheckForUpdatesResponse( status_code=http_res.status_code, @@ -395,17 +395,17 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CheckForUpdatesBadRequestData ) - data.raw_response = http_res - raise errors.CheckForUpdatesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.CheckForUpdatesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.CheckForUpdatesUnauthorizedData ) - data.raw_response = http_res - raise errors.CheckForUpdatesUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.CheckForUpdatesUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -496,7 +496,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.ApplyUpdatesResponse( status_code=http_res.status_code, @@ -504,23 +504,23 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ApplyUpdatesBadRequestData ) - data.raw_response = http_res - raise errors.ApplyUpdatesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.ApplyUpdatesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ApplyUpdatesUnauthorizedData ) - data.raw_response = http_res - raise errors.ApplyUpdatesUnauthorized(data=data) - if utils.match_response(http_res, ["500", "5XX"], "*"): + response_data.raw_response = http_res + raise errors.ApplyUpdatesUnauthorized(data=response_data) + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res ) - if utils.match_response(http_res, "4XX", "*"): + if utils.match_response(http_res, ["500", "5XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res @@ -605,7 +605,7 @@ class Updater(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.ApplyUpdatesResponse( status_code=http_res.status_code, @@ -613,23 +613,23 @@ class Updater(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ApplyUpdatesBadRequestData ) - data.raw_response = http_res - raise errors.ApplyUpdatesBadRequest(data=data) + response_data.raw_response = http_res + raise errors.ApplyUpdatesBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.ApplyUpdatesUnauthorizedData ) - data.raw_response = http_res - raise errors.ApplyUpdatesUnauthorized(data=data) - if utils.match_response(http_res, ["500", "5XX"], "*"): + response_data.raw_response = http_res + raise errors.ApplyUpdatesUnauthorized(data=response_data) + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res ) - if utils.match_response(http_res, "4XX", "*"): + if utils.match_response(http_res, ["500", "5XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( "API error occurred", http_res.status_code, http_res_text, http_res diff --git a/src/plex_api_client/video.py b/src/plex_api_client/video.py index f41aa09..4915aad 100644 --- a/src/plex_api_client/video.py +++ b/src/plex_api_client/video.py @@ -79,7 +79,7 @@ class Video(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetTimelineResponse( status_code=http_res.status_code, @@ -87,15 +87,17 @@ class Video(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetTimelineBadRequestData) - data.raw_response = http_res - raise errors.GetTimelineBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetTimelineBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetTimelineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTimelineUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTimelineUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTimelineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -184,7 +186,7 @@ class Video(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.GetTimelineResponse( status_code=http_res.status_code, @@ -192,15 +194,17 @@ class Video(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.GetTimelineBadRequestData) - data.raw_response = http_res - raise errors.GetTimelineBadRequest(data=data) + response_data = utils.unmarshal_json( + http_res.text, errors.GetTimelineBadRequestData + ) + response_data.raw_response = http_res + raise errors.GetTimelineBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetTimelineUnauthorizedData ) - data.raw_response = http_res - raise errors.GetTimelineUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetTimelineUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( @@ -292,7 +296,7 @@ class Video(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StartUniversalTranscodeResponse( status_code=http_res.status_code, @@ -300,17 +304,17 @@ class Video(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartUniversalTranscodeBadRequestData ) - data.raw_response = http_res - raise errors.StartUniversalTranscodeBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StartUniversalTranscodeBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartUniversalTranscodeUnauthorizedData ) - data.raw_response = http_res - raise errors.StartUniversalTranscodeUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StartUniversalTranscodeUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -402,7 +406,7 @@ class Video(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "*"): return operations.StartUniversalTranscodeResponse( status_code=http_res.status_code, @@ -410,17 +414,17 @@ class Video(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartUniversalTranscodeBadRequestData ) - data.raw_response = http_res - raise errors.StartUniversalTranscodeBadRequest(data=data) + response_data.raw_response = http_res + raise errors.StartUniversalTranscodeBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.StartUniversalTranscodeUnauthorizedData ) - data.raw_response = http_res - raise errors.StartUniversalTranscodeUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.StartUniversalTranscodeUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( diff --git a/src/plex_api_client/watchlist.py b/src/plex_api_client/watchlist.py index ab00487..dfd9415 100644 --- a/src/plex_api_client/watchlist.py +++ b/src/plex_api_client/watchlist.py @@ -81,7 +81,7 @@ class Watchlist(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWatchListResponse( object=utils.unmarshal_json( @@ -92,17 +92,17 @@ class Watchlist(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetWatchListBadRequestData ) - data.raw_response = http_res - raise errors.GetWatchListBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetWatchListBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetWatchListUnauthorizedData ) - data.raw_response = http_res - raise errors.GetWatchListUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetWatchListUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( @@ -193,7 +193,7 @@ class Watchlist(BaseSDK): retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWatchListResponse( object=utils.unmarshal_json( @@ -204,17 +204,17 @@ class Watchlist(BaseSDK): raw_response=http_res, ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetWatchListBadRequestData ) - data.raw_response = http_res - raise errors.GetWatchListBadRequest(data=data) + response_data.raw_response = http_res + raise errors.GetWatchListBadRequest(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GetWatchListUnauthorizedData ) - data.raw_response = http_res - raise errors.GetWatchListUnauthorized(data=data) + response_data.raw_response = http_res + raise errors.GetWatchListUnauthorized(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError(