ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.0

This commit is contained in:
speakeasybot
2025-01-25 00:02:55 +00:00
parent f1f4ba1876
commit fcf010c65b
56 changed files with 2230 additions and 1184 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.speakeasy/reports
.venv/
pyrightconfig.json
README-PYPI.md

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
python:
version: 0.20.1
version: 0.21.0
additionalDependencies:
dev: {}
main: {}
@@ -23,6 +23,7 @@ python:
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
description: Python Client SDK Generated by Speakeasy
enableCustomCodeRegions: false
enumFormat: enum
fixFlags:
responseRequiredSep2024: false

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.459.2
speakeasyVersion: 1.476.0
sources:
my-source:
sourceNamespace: my-source
@@ -8,19 +8,19 @@ sources:
- latest
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:28e2213b78ff9c789846a4a0b7ab9fb219079a1699d44b22d28474efc4f48eac
sourceBlobDigest: sha256:fa76c39de0ff801844dd56a76c26ab6ca88695fc9b42bb9ff9a8aab5b2b21277
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
tags:
- latest
- speakeasy-sdk-regen-1734912075
- speakeasy-sdk-regen-1737763301
targets:
plexpy:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:28e2213b78ff9c789846a4a0b7ab9fb219079a1699d44b22d28474efc4f48eac
sourceBlobDigest: sha256:fa76c39de0ff801844dd56a76c26ab6ca88695fc9b42bb9ff9a8aab5b2b21277
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
codeSamplesNamespace: code-samples-python-plexpy
codeSamplesRevisionDigest: sha256:b36e3f231c3498bc845baf97f563835cf4f034c32f97ff2e8045c36af3d6c2e9
codeSamplesRevisionDigest: sha256:b261ae23357a0df82454126aa5b040e1e31fd57075678a206cf19492da6ec6c8
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -54,6 +54,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Authentication](#authentication)
* [Resource Management](#resource-management)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
@@ -64,6 +65,11 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
<!-- Start SDK Installation [installation] -->
## SDK Installation
> [!NOTE]
> **Python version upgrade policy**
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
The SDK can be installed with either *pip* or *poetry* package managers.
### PIP
@@ -529,6 +535,31 @@ with PlexAPI(
```
<!-- End Authentication [security] -->
<!-- Start Resource Management [resource-management] -->
## Resource Management
The `PlexAPI` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
```python
from plex_api_client import PlexAPI
def main():
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
# Rest of application here...
# Or when using async:
async def amain():
async with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
# Rest of application here...
```
<!-- End Resource Management [resource-management] -->
<!-- Start Debugging [debug] -->
## Debugging

View File

@@ -889,3 +889,13 @@ Based on:
- [python v0.20.1] .
### Releases
- [PyPI v0.20.1] https://pypi.org/project/plex-api-client/0.20.1 - .
## 2025-01-25 00:01:26
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.476.0 (2.496.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.21.0] .
### Releases
- [PyPI v0.21.0] https://pypi.org/project/plex-api-client/0.21.0 - .

View File

@@ -563,7 +563,7 @@ actions:
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_metadata_children(rating_key=1539.15, include_elements="Stream")
res = plex_api.library.get_metadata_children(rating_key=1539.14, include_elements="Stream")
assert res.object is not None
@@ -746,12 +746,13 @@ actions:
label: details
source: |-
from plex_api_client import PlexAPI
from plex_api_client.models import operations
with PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_details(section_key=9518)
res = plex_api.library.get_library_details(section_key=9518, include_details=operations.IncludeDetails.ZERO)
assert res.object is not None
@@ -953,6 +954,7 @@ 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",
@@ -1096,7 +1098,7 @@ actions:
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.update_playlist(playlist_id=3915.00)
res = plex_api.playlists.update_playlist(playlist_id=3915)
assert res is not None
@@ -1151,7 +1153,7 @@ actions:
access_token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.playlists.add_playlist_contents(playlist_id=8502.00, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
res = plex_api.playlists.add_playlist_contents(playlist_id=8502.01, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123)
assert res.object is not None
@@ -1468,6 +1470,7 @@ actions:
"request_body": {
"login": "username@email.com",
"password": "password123",
"remember_me": False,
"verification_code": "123456",
},
})

View File

@@ -0,0 +1,11 @@
# EnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `DISABLED` | 0 |

View File

@@ -0,0 +1,12 @@
# EpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `OLDEST_FIRST` | 0 |
| `NEWEST_FIRST` | 1 |

View File

@@ -1,9 +1,12 @@
# FlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values
| Name | Value |
| ------- | ------- |
| `FALSE` | 0 |
| `TRUE` | 1 |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `HIDE` | 0 |
| `SHOW` | 1 |

View File

@@ -0,0 +1,11 @@
# GetLibraryItemsEnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `DISABLED` | 0 |

View File

@@ -0,0 +1,12 @@
# GetLibraryItemsEpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `OLDEST_FIRST` | 0 |
| `NEWEST_FIRST` | 1 |

View File

@@ -1,9 +1,12 @@
# GetLibraryItemsFlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values
| Name | Value |
| ------- | ------- |
| `FALSE` | 0 |
| `TRUE` | 1 |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `HIDE` | 0 |
| `SHOW` | 1 |

View File

@@ -24,7 +24,9 @@
| `year` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `season_count` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional[str]* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flatten_seasons` | [Optional[operations.GetLibraryItemsFlattenSeasons]](../../models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
| `flatten_seasons` | [Optional[operations.GetLibraryItemsFlattenSeasons]](../../models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `episode_sort` | [Optional[operations.GetLibraryItemsEpisodeSort]](../../models/operations/getlibraryitemsepisodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enable_credits_marker_generation` | [Optional[operations.GetLibraryItemsEnableCreditsMarkerGeneration]](../../models/operations/getlibraryitemsenablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `show_ordering` | [Optional[operations.GetLibraryItemsShowOrdering]](../../models/operations/getlibraryitemsshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |

View File

@@ -24,7 +24,9 @@
| `year` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `season_count` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional[str]* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flatten_seasons` | [Optional[operations.FlattenSeasons]](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
| `flatten_seasons` | [Optional[operations.FlattenSeasons]](../../models/operations/flattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `episode_sort` | [Optional[operations.EpisodeSort]](../../models/operations/episodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enable_credits_marker_generation` | [Optional[operations.EnableCreditsMarkerGeneration]](../../models/operations/enablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `show_ordering` | [Optional[operations.ShowOrdering]](../../models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesEnableCreditsMarkerGeneration
Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `DISABLED` | 0 |

View File

@@ -0,0 +1,12 @@
# GetSearchAllLibrariesEpisodeSort
Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
## Values
| Name | Value |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `OLDEST_FIRST` | 0 |
| `NEWEST_FIRST` | 1 |

View File

@@ -1,9 +1,12 @@
# GetSearchAllLibrariesFlattenSeasons
Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
## Values
| Name | Value |
| ------- | ------- |
| `FALSE` | 0 |
| `TRUE` | 1 |
| ----------------- | ----------------- |
| `LIBRARY_DEFAULT` | -1 |
| `HIDE` | 0 |
| `SHOW` | 1 |

View File

@@ -24,7 +24,9 @@
| `year` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `season_count` | *Optional[int]* | :heavy_minus_sign: | N/A | 2022 |
| `tagline` | *Optional[str]* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `flatten_seasons` | [Optional[operations.GetSearchAllLibrariesFlattenSeasons]](../../models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | N/A | 1 |
| `flatten_seasons` | [Optional[operations.GetSearchAllLibrariesFlattenSeasons]](../../models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). | 1 |
| `episode_sort` | [Optional[operations.GetSearchAllLibrariesEpisodeSort]](../../models/operations/getsearchalllibrariesepisodesort.md) | :heavy_minus_sign: | Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first). | 0 |
| `enable_credits_marker_generation` | [Optional[operations.GetSearchAllLibrariesEnableCreditsMarkerGeneration]](../../models/operations/getsearchalllibrariesenablecreditsmarkergeneration.md) | :heavy_minus_sign: | Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled). | -1 |
| `show_ordering` | [Optional[operations.GetSearchAllLibrariesShowOrdering]](../../models/operations/getsearchalllibrariesshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show<br/>None = Library default,<br/>tmdbAiring = The Movie Database (Aired),<br/>tvdbAiring = TheTVDB (Aired),<br/>tvdbDvd = TheTVDB (DVD),<br/>tvdbAbsolute = TheTVDB (Absolute)).<br/> | tvdbDvd |
| `thumb` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `art` | *Optional[str]* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |

View File

@@ -10,4 +10,4 @@
| `timespan` | *Optional[int]* | :heavy_minus_sign: | N/A | 6 |
| `at` | *Optional[int]* | :heavy_minus_sign: | N/A | 1718387650 |
| `lan` | *Optional[bool]* | :heavy_minus_sign: | N/A | true |
| `bytes` | *Optional[int]* | :heavy_minus_sign: | N/A | 22 |
| `bytes_` | *Optional[int]* | :heavy_minus_sign: | N/A | 22 |

View File

@@ -161,6 +161,7 @@ with PlexAPI() as plex_api:
"request_body": {
"login": "username@email.com",
"password": "password123",
"remember_me": False,
"verification_code": "123456",
},
})

View File

@@ -221,12 +221,13 @@ 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="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_details(section_key=9518)
res = plex_api.library.get_library_details(section_key=9518, include_details=operations.IncludeDetails.ZERO)
assert res.object is not None

View File

@@ -42,7 +42,7 @@ with PlexAPI(
"title": "<value>",
"type": operations.CreatePlaylistQueryParamType.PHOTO,
"smart": operations.Smart.ONE,
"uri": "https://inborn-brochure.biz",
"uri": "https://hoarse-testing.info/",
})
assert res.object is not None

View File

@@ -236,6 +236,7 @@ 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",

119
poetry.lock generated
View File

@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand.
[[package]]
name = "annotated-types"
@@ -6,20 +6,19 @@ version = "0.7.0"
description = "Reusable constraint types to use with typing.Annotated"
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},
{file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},
]
[package.dependencies]
typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""}
[[package]]
name = "anyio"
version = "4.4.0"
description = "High level compatibility layer for multiple asynchronous event loop implementations"
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"},
{file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"},
@@ -42,6 +41,7 @@ version = "3.2.4"
description = "An abstract syntax tree for Python with inference support."
optional = false
python-versions = ">=3.8.0"
groups = ["dev"]
files = [
{file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"},
{file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"},
@@ -56,6 +56,7 @@ version = "2024.8.30"
description = "Python package for providing Mozilla's CA Bundle."
optional = false
python-versions = ">=3.6"
groups = ["main"]
files = [
{file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"},
{file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"},
@@ -67,6 +68,8 @@ version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
groups = ["dev"]
markers = "sys_platform == \"win32\""
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
@@ -78,6 +81,7 @@ version = "0.3.8"
description = "serialize all of Python"
optional = false
python-versions = ">=3.8"
groups = ["dev"]
files = [
{file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"},
{file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"},
@@ -93,6 +97,7 @@ version = "0.2.0"
description = "Like `typing._eval_type`, but lets older Python versions use newer typing features."
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"},
{file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"},
@@ -107,6 +112,8 @@ version = "1.2.2"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
groups = ["main"]
markers = "python_version < \"3.11\""
files = [
{file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
{file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
@@ -121,6 +128,7 @@ version = "0.14.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
optional = false
python-versions = ">=3.7"
groups = ["main"]
files = [
{file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"},
{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
@@ -132,6 +140,7 @@ version = "1.0.5"
description = "A minimal low-level HTTP client."
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"},
{file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"},
@@ -153,6 +162,7 @@ version = "0.28.1"
description = "The next generation HTTP client."
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"},
{file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"},
@@ -177,6 +187,7 @@ version = "3.8"
description = "Internationalized Domain Names in Applications (IDNA)"
optional = false
python-versions = ">=3.6"
groups = ["main"]
files = [
{file = "idna-3.8-py3-none-any.whl", hash = "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac"},
{file = "idna-3.8.tar.gz", hash = "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603"},
@@ -188,6 +199,7 @@ version = "5.13.2"
description = "A Python utility / library to sort Python imports."
optional = false
python-versions = ">=3.8.0"
groups = ["dev"]
files = [
{file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"},
{file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"},
@@ -202,6 +214,7 @@ 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"},
@@ -213,6 +226,7 @@ version = "0.7.0"
description = "McCabe checker, plugin for flake8"
optional = false
python-versions = ">=3.6"
groups = ["dev"]
files = [
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
@@ -220,49 +234,56 @@ files = [
[[package]]
name = "mypy"
version = "1.13.0"
version = "1.14.1"
description = "Optional static typing for Python"
optional = false
python-versions = ">=3.8"
groups = ["dev"]
files = [
{file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"},
{file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"},
{file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"},
{file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"},
{file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"},
{file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"},
{file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"},
{file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"},
{file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"},
{file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"},
{file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"},
{file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"},
{file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"},
{file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"},
{file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"},
{file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"},
{file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"},
{file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"},
{file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"},
{file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"},
{file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"},
{file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"},
{file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"},
{file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"},
{file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"},
{file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"},
{file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"},
{file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"},
{file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"},
{file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"},
{file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"},
{file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"},
{file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"},
{file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"},
{file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d"},
{file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b"},
{file = "mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427"},
{file = "mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f"},
{file = "mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c"},
{file = "mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1"},
{file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8"},
{file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f"},
{file = "mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1"},
{file = "mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae"},
{file = "mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14"},
{file = "mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9"},
{file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11"},
{file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e"},
{file = "mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89"},
{file = "mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b"},
{file = "mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255"},
{file = "mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34"},
{file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a"},
{file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9"},
{file = "mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd"},
{file = "mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107"},
{file = "mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31"},
{file = "mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6"},
{file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319"},
{file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac"},
{file = "mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b"},
{file = "mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837"},
{file = "mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35"},
{file = "mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc"},
{file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9"},
{file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb"},
{file = "mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60"},
{file = "mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c"},
{file = "mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1"},
{file = "mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6"},
]
[package.dependencies]
mypy-extensions = ">=1.0.0"
mypy_extensions = ">=1.0.0"
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
typing-extensions = ">=4.6.0"
typing_extensions = ">=4.6.0"
[package.extras]
dmypy = ["psutil (>=4.0)"]
@@ -277,6 +298,7 @@ version = "1.0.0"
description = "Type system extensions for programs checked with the mypy type checker."
optional = false
python-versions = ">=3.5"
groups = ["main", "dev"]
files = [
{file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"},
{file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"},
@@ -288,6 +310,7 @@ version = "4.3.2"
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`."
optional = false
python-versions = ">=3.8"
groups = ["dev"]
files = [
{file = "platformdirs-4.3.2-py3-none-any.whl", hash = "sha256:eb1c8582560b34ed4ba105009a4badf7f6f85768b30126f351328507b2beb617"},
{file = "platformdirs-4.3.2.tar.gz", hash = "sha256:9e5e27a08aa095dd127b9f2e764d74254f482fef22b0970773bfba79d091ab8c"},
@@ -304,6 +327,7 @@ version = "2.10.4"
description = "Data validation using Python type hints"
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "pydantic-2.10.4-py3-none-any.whl", hash = "sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d"},
{file = "pydantic-2.10.4.tar.gz", hash = "sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06"},
@@ -324,6 +348,7 @@ version = "2.27.2"
description = "Core functionality for Pydantic validation and serialization"
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"},
{file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"},
@@ -436,6 +461,7 @@ version = "3.2.3"
description = "python code static checker"
optional = false
python-versions = ">=3.8.0"
groups = ["dev"]
files = [
{file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"},
{file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"},
@@ -466,6 +492,7 @@ version = "2.8.2"
description = "Extensions to the standard Python datetime module"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
groups = ["main"]
files = [
{file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"},
{file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
@@ -480,6 +507,7 @@ version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
groups = ["main"]
files = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
@@ -491,6 +519,7 @@ version = "1.3.1"
description = "Sniff out which async library your code is running under"
optional = false
python-versions = ">=3.7"
groups = ["main"]
files = [
{file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"},
{file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
@@ -502,6 +531,8 @@ version = "2.0.1"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.7"
groups = ["dev"]
markers = "python_version < \"3.11\""
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
@@ -513,6 +544,7 @@ version = "0.13.2"
description = "Style preserving TOML library"
optional = false
python-versions = ">=3.8"
groups = ["dev"]
files = [
{file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"},
{file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"},
@@ -524,6 +556,7 @@ version = "2.9.0.20240906"
description = "Typing stubs for python-dateutil"
optional = false
python-versions = ">=3.8"
groups = ["dev"]
files = [
{file = "types-python-dateutil-2.9.0.20240906.tar.gz", hash = "sha256:9706c3b68284c25adffc47319ecc7947e5bb86b3773f843c73906fd598bc176e"},
{file = "types_python_dateutil-2.9.0.20240906-py3-none-any.whl", hash = "sha256:27c8cc2d058ccb14946eebcaaa503088f4f6dbc4fb6093d3d456a49aef2753f6"},
@@ -535,6 +568,7 @@ version = "4.12.2"
description = "Backported and Experimental Type Hints for Python 3.8+"
optional = false
python-versions = ">=3.8"
groups = ["main", "dev"]
files = [
{file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},
{file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
@@ -546,6 +580,7 @@ version = "0.9.0"
description = "Runtime inspection utilities for typing module."
optional = false
python-versions = "*"
groups = ["main"]
files = [
{file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"},
{file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"},
@@ -556,6 +591,6 @@ mypy-extensions = ">=0.3.0"
typing-extensions = ">=3.7.4"
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "231d09484040ca8e2e4ea801ceedb0b672113dd483caa7cb13d217c3e92d7655"
lock-version = "2.1"
python-versions = ">=3.9"
content-hash = "17ee8ce85dd5ac9f352e21dba9eb0fd4cf2c084fd797ca222e426ba7d39002ef"

View File

@@ -89,7 +89,7 @@ persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.8
py-version=3.9
# Discover python modules and packages in the file system subtree.
recursive=no

View File

@@ -1,9 +1,20 @@
[tool.poetry]
[project]
name = "plex-api-client"
version = "0.20.1"
version = "0.21.0"
description = "Python Client SDK Generated by Speakeasy"
authors = ["Speakeasy",]
authors = [{ name = "Speakeasy" },]
readme = "README-PYPI.md"
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",
]
[tool.poetry]
repository = "https://github.com/LukeHagar/plexpy.git"
packages = [
{ include = "plex_api_client", from = "src" }
@@ -16,17 +27,8 @@ include = ["py.typed", "src/plex_api_client/py.typed"]
[virtualenvs]
in-project = true
[tool.poetry.dependencies]
python = "^3.8"
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"
[tool.poetry.group.dev.dependencies]
mypy = "==1.13.0"
mypy = "==1.14.1"
pylint = "==3.2.3"
types-python-dateutil = "^2.9.0.20240316"

View File

@@ -1,8 +1,17 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from ._version import __title__, __version__
from ._version import (
__title__,
__version__,
__openapi_doc_version__,
__gen_version__,
__user_agent__,
)
from .sdk import *
from .sdkconfiguration import *
VERSION: str = __version__
OPENAPI_DOC_VERSION = __openapi_doc_version__
SPEAKEASY_GENERATOR_VERSION = __gen_version__
USER_AGENT = __user_agent__

View File

@@ -3,7 +3,10 @@
import importlib.metadata
__title__: str = "plex-api-client"
__version__: str = "0.20.1"
__version__: str = "0.21.0"
__openapi_doc_version__: str = "0.0.3"
__gen_version__: str = "2.496.0"
__user_agent__: str = "speakeasy-sdk/python 0.21.0 2.496.0 0.0.3 plex-api-client"
try:
if __package__ is not None:

View File

@@ -43,7 +43,7 @@ class Activities(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/activities",
base_url=base_url,
@@ -100,7 +100,12 @@ class Activities(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerActivitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -139,7 +144,7 @@ class Activities(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/activities",
base_url=base_url,
@@ -196,7 +201,12 @@ class Activities(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerActivitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -242,7 +252,7 @@ class Activities(BaseSDK):
activity_uuid=activity_uuid,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/activities/{activityUUID}",
base_url=base_url,
@@ -296,7 +306,12 @@ class Activities(BaseSDK):
)
data.raw_response = http_res
raise errors.CancelServerActivitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -342,7 +357,7 @@ class Activities(BaseSDK):
activity_uuid=activity_uuid,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/activities/{activityUUID}",
base_url=base_url,
@@ -396,7 +411,12 @@ class Activities(BaseSDK):
)
data.raw_response = http_res
raise errors.CancelServerActivitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -46,7 +46,7 @@ class Authentication(BaseSDK):
scope=scope,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/security/token",
base_url=base_url,
@@ -100,7 +100,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTransientTokenUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -150,7 +155,7 @@ class Authentication(BaseSDK):
scope=scope,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/security/token",
base_url=base_url,
@@ -204,7 +209,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTransientTokenUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -252,7 +262,7 @@ class Authentication(BaseSDK):
source=source,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/security/resources",
base_url=base_url,
@@ -306,7 +316,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSourceConnectionInformationUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -354,7 +369,7 @@ class Authentication(BaseSDK):
source=source,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/security/resources",
base_url=base_url,
@@ -408,7 +423,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSourceConnectionInformationUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -449,7 +469,7 @@ class Authentication(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_TOKEN_DETAILS_SERVERS[0]
req = self.build_request(
req = self._build_request(
method="GET",
path="/user",
base_url=base_url,
@@ -506,7 +526,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTokenDetailsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -547,7 +572,7 @@ class Authentication(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_TOKEN_DETAILS_SERVERS[0]
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/user",
base_url=base_url,
@@ -604,7 +629,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTokenDetailsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -655,7 +685,7 @@ class Authentication(BaseSDK):
request = utils.unmarshal(request, operations.PostUsersSignInDataRequest)
request = cast(operations.PostUsersSignInDataRequest, request)
req = self.build_request(
req = self._build_request(
method="POST",
path="/users/signin",
base_url=base_url,
@@ -719,7 +749,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.PostUsersSignInDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -770,7 +805,7 @@ class Authentication(BaseSDK):
request = utils.unmarshal(request, operations.PostUsersSignInDataRequest)
request = cast(operations.PostUsersSignInDataRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/users/signin",
base_url=base_url,
@@ -834,7 +869,12 @@ class Authentication(BaseSDK):
)
data.raw_response = http_res
raise errors.PostUsersSignInDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -20,7 +20,7 @@ class BaseSDK:
def __init__(self, sdk_config: SDKConfiguration) -> None:
self.sdk_configuration = sdk_config
def get_url(self, base_url, url_variables):
def _get_url(self, base_url, url_variables):
sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
if base_url is None:
@@ -31,7 +31,7 @@ class BaseSDK:
return utils.template_url(base_url, url_variables)
def build_request_async(
def _build_request_async(
self,
method,
path,
@@ -53,7 +53,7 @@ class BaseSDK:
http_headers: Optional[Mapping[str, str]] = None,
) -> httpx.Request:
client = self.sdk_configuration.async_client
return self.build_request_with_client(
return self._build_request_with_client(
client,
method,
path,
@@ -73,7 +73,7 @@ class BaseSDK:
http_headers,
)
def build_request(
def _build_request(
self,
method,
path,
@@ -95,7 +95,7 @@ class BaseSDK:
http_headers: Optional[Mapping[str, str]] = None,
) -> httpx.Request:
client = self.sdk_configuration.client
return self.build_request_with_client(
return self._build_request_with_client(
client,
method,
path,
@@ -115,7 +115,7 @@ class BaseSDK:
http_headers,
)
def build_request_with_client(
def _build_request_with_client(
self,
client,
method,
@@ -142,7 +142,7 @@ class BaseSDK:
url = url_override
if url is None:
url = utils.generate_url(
self.get_url(base_url, url_variables),
self._get_url(base_url, url_variables),
path,
request if request_has_path_params else None,
_globals if request_has_path_params else None,

View File

@@ -35,7 +35,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/butler",
base_url=base_url,
@@ -92,7 +92,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.GetButlerTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -131,7 +136,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/butler",
base_url=base_url,
@@ -188,7 +193,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.GetButlerTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -232,7 +242,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="POST",
path="/butler",
base_url=base_url,
@@ -286,7 +296,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.StartAllTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -330,7 +345,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/butler",
base_url=base_url,
@@ -384,7 +399,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.StartAllTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -424,7 +444,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/butler",
base_url=base_url,
@@ -478,7 +498,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.StopAllTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -518,7 +543,7 @@ class Butler(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/butler",
base_url=base_url,
@@ -572,7 +597,12 @@ class Butler(BaseSDK):
)
data.raw_response = http_res
raise errors.StopAllTasksUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -623,7 +653,7 @@ class Butler(BaseSDK):
task_name=task_name,
)
req = self.build_request(
req = self._build_request(
method="POST",
path="/butler/{taskName}",
base_url=base_url,
@@ -673,7 +703,12 @@ class Butler(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.StartTaskUnauthorizedData)
data.raw_response = http_res
raise errors.StartTaskUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -724,7 +759,7 @@ class Butler(BaseSDK):
task_name=task_name,
)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/butler/{taskName}",
base_url=base_url,
@@ -774,7 +809,12 @@ class Butler(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.StartTaskUnauthorizedData)
data.raw_response = http_res
raise errors.StartTaskUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -821,7 +861,7 @@ class Butler(BaseSDK):
task_name=task_name,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/butler/{taskName}",
base_url=base_url,
@@ -871,7 +911,12 @@ class Butler(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.StopTaskUnauthorizedData)
data.raw_response = http_res
raise errors.StopTaskUnauthorized(data=data)
if utils.match_response(http_res, ["404", "4XX", "5XX"], "*"):
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
@@ -918,7 +963,7 @@ class Butler(BaseSDK):
task_name=task_name,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/butler/{taskName}",
base_url=base_url,
@@ -968,7 +1013,12 @@ class Butler(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.StopTaskUnauthorizedData)
data.raw_response = http_res
raise errors.StopTaskUnauthorized(data=data)
if utils.match_response(http_res, ["404", "4XX", "5XX"], "*"):
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

View File

@@ -1,6 +1,8 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# pyright: reportReturnType = false
import asyncio
from concurrent.futures import ThreadPoolExecutor
from typing_extensions import Protocol, runtime_checkable
import httpx
from typing import Any, Optional, Union
@@ -82,3 +84,51 @@ class AsyncHttpClient(Protocol):
async def aclose(self) -> None:
pass
class ClientOwner(Protocol):
client: Union[HttpClient, None]
async_client: Union[AsyncHttpClient, None]
def close_clients(
owner: ClientOwner,
sync_client: Union[HttpClient, None],
async_client: Union[AsyncHttpClient, None],
) -> None:
"""
A finalizer function that is meant to be used with weakref.finalize to close
httpx clients used by an SDK so that underlying resources can be garbage
collected.
"""
# Unset the client/async_client properties so there are no more references
# to them from the owning SDK instance and they can be reaped.
owner.client = None
owner.async_client = None
if sync_client is not None:
try:
sync_client.close()
except Exception:
pass
if async_client is not None:
is_async = False
try:
asyncio.get_running_loop()
is_async = True
except RuntimeError:
pass
try:
# If this function is called in an async loop then start another
# loop in a separate thread to close the async http client.
if is_async:
with ThreadPoolExecutor(max_workers=1) as executor:
future = executor.submit(asyncio.run, async_client.aclose())
future.result()
else:
asyncio.run(async_client.aclose())
except Exception:
pass

View File

@@ -45,7 +45,7 @@ class Hubs(BaseSDK):
only_transient=only_transient,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/hubs",
base_url=base_url,
@@ -102,7 +102,12 @@ class Hubs(BaseSDK):
)
data.raw_response = http_res
raise errors.GetGlobalHubsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -151,7 +156,7 @@ class Hubs(BaseSDK):
only_transient=only_transient,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/hubs",
base_url=base_url,
@@ -208,7 +213,12 @@ class Hubs(BaseSDK):
)
data.raw_response = http_res
raise errors.GetGlobalHubsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -258,7 +268,7 @@ class Hubs(BaseSDK):
request = utils.unmarshal(request, operations.GetRecentlyAddedRequest)
request = cast(operations.GetRecentlyAddedRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/hubs/home/recentlyAdded",
base_url=base_url,
@@ -302,7 +312,12 @@ class Hubs(BaseSDK):
content_type=http_res.headers.get("Content-Type") or "",
raw_response=http_res,
)
if utils.match_response(http_res, ["400", "401", "4XX", "5XX"], "*"):
if utils.match_response(http_res, ["400", "401", "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
@@ -352,7 +367,7 @@ class Hubs(BaseSDK):
request = utils.unmarshal(request, operations.GetRecentlyAddedRequest)
request = cast(operations.GetRecentlyAddedRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/hubs/home/recentlyAdded",
base_url=base_url,
@@ -396,7 +411,12 @@ class Hubs(BaseSDK):
content_type=http_res.headers.get("Content-Type") or "",
raw_response=http_res,
)
if utils.match_response(http_res, ["400", "401", "4XX", "5XX"], "*"):
if utils.match_response(http_res, ["400", "401", "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
@@ -449,7 +469,7 @@ class Hubs(BaseSDK):
only_transient=only_transient,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/hubs/sections/{sectionId}",
base_url=base_url,
@@ -506,7 +526,12 @@ class Hubs(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryHubsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -559,7 +584,7 @@ class Hubs(BaseSDK):
only_transient=only_transient,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/hubs/sections/{sectionId}",
base_url=base_url,
@@ -616,7 +641,12 @@ class Hubs(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryHubsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -45,7 +45,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/hashes",
base_url=base_url,
@@ -97,7 +97,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetFileHashUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -146,7 +151,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/hashes",
base_url=base_url,
@@ -198,7 +203,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetFileHashUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -250,7 +260,7 @@ class Library(BaseSDK):
)
request = cast(operations.GetRecentlyAddedLibraryRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/recentlyAdded",
base_url=base_url,
@@ -308,7 +318,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetRecentlyAddedLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -360,7 +375,7 @@ class Library(BaseSDK):
)
request = cast(operations.GetRecentlyAddedLibraryRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/recentlyAdded",
base_url=base_url,
@@ -418,7 +433,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetRecentlyAddedLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -463,7 +483,7 @@ class Library(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections",
base_url=base_url,
@@ -520,7 +540,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetAllLibrariesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -565,7 +590,7 @@ class Library(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections",
base_url=base_url,
@@ -622,7 +647,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetAllLibrariesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -712,7 +742,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections/{sectionKey}",
base_url=base_url,
@@ -769,7 +799,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryDetailsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -859,7 +894,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections/{sectionKey}",
base_url=base_url,
@@ -916,7 +951,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryDetailsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -962,7 +1002,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/library/sections/{sectionKey}",
base_url=base_url,
@@ -1016,7 +1056,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.DeleteLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1062,7 +1107,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/library/sections/{sectionKey}",
base_url=base_url,
@@ -1116,7 +1161,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.DeleteLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1186,7 +1236,7 @@ class Library(BaseSDK):
request = utils.unmarshal(request, operations.GetLibraryItemsRequest)
request = cast(operations.GetLibraryItemsRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections/{sectionKey}/{tag}",
base_url=base_url,
@@ -1243,7 +1293,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryItemsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1313,7 +1368,7 @@ class Library(BaseSDK):
request = utils.unmarshal(request, operations.GetLibraryItemsRequest)
request = cast(operations.GetLibraryItemsRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections/{sectionKey}/{tag}",
base_url=base_url,
@@ -1370,7 +1425,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetLibraryItemsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1420,7 +1480,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections/{sectionKey}/refresh",
base_url=base_url,
@@ -1474,7 +1534,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetRefreshLibraryMetadataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1524,7 +1589,7 @@ class Library(BaseSDK):
section_key=section_key,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections/{sectionKey}/refresh",
base_url=base_url,
@@ -1578,7 +1643,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetRefreshLibraryMetadataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1645,7 +1715,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections/{sectionKey}/search",
base_url=base_url,
@@ -1702,7 +1772,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1769,7 +1844,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections/{sectionKey}/search",
base_url=base_url,
@@ -1826,7 +1901,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchLibraryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1876,7 +1956,7 @@ class Library(BaseSDK):
request = utils.unmarshal(request, operations.GetSearchAllLibrariesRequest)
request = cast(operations.GetSearchAllLibrariesRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/search",
base_url=base_url,
@@ -1934,7 +2014,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchAllLibrariesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1984,7 +2069,7 @@ class Library(BaseSDK):
request = utils.unmarshal(request, operations.GetSearchAllLibrariesRequest)
request = cast(operations.GetSearchAllLibrariesRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/search",
base_url=base_url,
@@ -2042,7 +2127,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchAllLibrariesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2089,7 +2179,7 @@ class Library(BaseSDK):
rating_key=rating_key,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/metadata/{ratingKey}",
base_url=base_url,
@@ -2147,7 +2237,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMetaDataByRatingKeyUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2194,7 +2289,7 @@ class Library(BaseSDK):
rating_key=rating_key,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/metadata/{ratingKey}",
base_url=base_url,
@@ -2252,7 +2347,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMetaDataByRatingKeyUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2302,7 +2402,7 @@ class Library(BaseSDK):
include_elements=include_elements,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/metadata/{ratingKey}/children",
base_url=base_url,
@@ -2359,7 +2459,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMetadataChildrenUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2409,7 +2514,7 @@ class Library(BaseSDK):
include_elements=include_elements,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/metadata/{ratingKey}/children",
base_url=base_url,
@@ -2466,7 +2571,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMetadataChildrenUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2516,7 +2626,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/all/top",
base_url=base_url,
@@ -2573,7 +2683,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTopWatchedContentUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2623,7 +2738,7 @@ class Library(BaseSDK):
type=type_,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/all/top",
base_url=base_url,
@@ -2680,7 +2795,12 @@ class Library(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTopWatchedContentUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2720,7 +2840,7 @@ class Library(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/onDeck",
base_url=base_url,
@@ -2773,7 +2893,12 @@ class Library(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.GetOnDeckUnauthorizedData)
data.raw_response = http_res
raise errors.GetOnDeckUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -2813,7 +2938,7 @@ class Library(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/onDeck",
base_url=base_url,
@@ -2866,7 +2991,12 @@ class Library(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.GetOnDeckUnauthorizedData)
data.raw_response = http_res
raise errors.GetOnDeckUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -49,7 +49,7 @@ class Log(BaseSDK):
source=source,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/log",
base_url=base_url,
@@ -99,7 +99,12 @@ class Log(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.LogLineUnauthorizedData)
data.raw_response = http_res
raise errors.LogLineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -152,7 +157,7 @@ class Log(BaseSDK):
source=source,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/log",
base_url=base_url,
@@ -202,7 +207,12 @@ class Log(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.LogLineUnauthorizedData)
data.raw_response = http_res
raise errors.LogLineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -265,7 +275,7 @@ class Log(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="POST",
path="/log",
base_url=base_url,
@@ -322,7 +332,12 @@ class Log(BaseSDK):
)
data.raw_response = http_res
raise errors.LogMultiLineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -385,7 +400,7 @@ class Log(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/log",
base_url=base_url,
@@ -442,7 +457,12 @@ class Log(BaseSDK):
)
data.raw_response = http_res
raise errors.LogMultiLineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -482,7 +502,7 @@ class Log(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/log/networked",
base_url=base_url,
@@ -536,7 +556,12 @@ class Log(BaseSDK):
)
data.raw_response = http_res
raise errors.EnablePaperTrailUnauthorized(data=data)
if utils.match_response(http_res, ["403", "4XX", "5XX"], "*"):
if utils.match_response(http_res, ["403", "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
@@ -576,7 +601,7 @@ class Log(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/log/networked",
base_url=base_url,
@@ -630,7 +655,12 @@ class Log(BaseSDK):
)
data.raw_response = http_res
raise errors.EnablePaperTrailUnauthorized(data=data)
if utils.match_response(http_res, ["403", "4XX", "5XX"], "*"):
if utils.match_response(http_res, ["403", "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

View File

@@ -42,7 +42,7 @@ class Media(BaseSDK):
key=key,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/:/scrobble",
base_url=base_url,
@@ -94,7 +94,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.MarkPlayedUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -140,7 +145,7 @@ class Media(BaseSDK):
key=key,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/:/scrobble",
base_url=base_url,
@@ -192,7 +197,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.MarkPlayedUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -238,7 +248,7 @@ class Media(BaseSDK):
key=key,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/:/unscrobble",
base_url=base_url,
@@ -292,7 +302,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.MarkUnplayedUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -338,7 +353,7 @@ class Media(BaseSDK):
key=key,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/:/unscrobble",
base_url=base_url,
@@ -392,7 +407,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.MarkUnplayedUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -445,7 +465,7 @@ class Media(BaseSDK):
state=state,
)
req = self.build_request(
req = self._build_request(
method="POST",
path="/:/progress",
base_url=base_url,
@@ -499,7 +519,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.UpdatePlayProgressUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -552,7 +577,7 @@ class Media(BaseSDK):
state=state,
)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/:/progress",
base_url=base_url,
@@ -606,7 +631,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.UpdatePlayProgressUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -654,7 +684,7 @@ class Media(BaseSDK):
request = utils.unmarshal(request, operations.GetBannerImageRequest)
request = cast(operations.GetBannerImageRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/metadata/{ratingKey}/banner",
base_url=base_url,
@@ -713,7 +743,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.GetBannerImageUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -761,7 +796,7 @@ class Media(BaseSDK):
request = utils.unmarshal(request, operations.GetBannerImageRequest)
request = cast(operations.GetBannerImageRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/metadata/{ratingKey}/banner",
base_url=base_url,
@@ -820,7 +855,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.GetBannerImageUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -868,7 +908,7 @@ class Media(BaseSDK):
request = utils.unmarshal(request, operations.GetThumbImageRequest)
request = cast(operations.GetThumbImageRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/metadata/{ratingKey}/thumb",
base_url=base_url,
@@ -927,7 +967,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.GetThumbImageUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -975,7 +1020,7 @@ class Media(BaseSDK):
request = utils.unmarshal(request, operations.GetThumbImageRequest)
request = cast(operations.GetThumbImageRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/metadata/{ratingKey}/thumb",
base_url=base_url,
@@ -1034,7 +1079,12 @@ class Media(BaseSDK):
)
data.raw_response = http_res
raise errors.GetThumbImageUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -2,4 +2,5 @@
from .security import Security, SecurityTypedDict
__all__ = ["Security", "SecurityTypedDict"]

View File

@@ -742,6 +742,7 @@ from .uploadplaylist import (
UploadPlaylistUnauthorizedData,
)
__all__ = [
"AddPlaylistContentsBadRequest",
"AddPlaylistContentsBadRequestData",

View File

@@ -121,6 +121,8 @@ from .get_library_items import (
GetLibraryItemsDefaultDirection,
GetLibraryItemsDirector,
GetLibraryItemsDirectorTypedDict,
GetLibraryItemsEnableCreditsMarkerGeneration,
GetLibraryItemsEpisodeSort,
GetLibraryItemsField,
GetLibraryItemsFieldType,
GetLibraryItemsFieldTypeTypedDict,
@@ -253,6 +255,8 @@ from .get_recently_added import (
CountryTypedDict,
Director,
DirectorTypedDict,
EnableCreditsMarkerGeneration,
EpisodeSort,
FlattenSeasons,
Genre,
GenreTypedDict,
@@ -366,6 +370,8 @@ from .get_search_all_libraries import (
GetSearchAllLibrariesCountryTypedDict,
GetSearchAllLibrariesDirector,
GetSearchAllLibrariesDirectorTypedDict,
GetSearchAllLibrariesEnableCreditsMarkerGeneration,
GetSearchAllLibrariesEpisodeSort,
GetSearchAllLibrariesFlattenSeasons,
GetSearchAllLibrariesGenre,
GetSearchAllLibrariesGenreTypedDict,
@@ -1059,6 +1065,7 @@ from .uploadplaylist import (
UploadPlaylistResponseTypedDict,
)
__all__ = [
"Account",
"AccountTypedDict",
@@ -1137,8 +1144,10 @@ __all__ = [
"Directory",
"DirectoryTypedDict",
"Download",
"EnableCreditsMarkerGeneration",
"EnablePaperTrailResponse",
"EnablePaperTrailResponseTypedDict",
"EpisodeSort",
"Feature",
"FeatureTypedDict",
"Field",
@@ -1284,6 +1293,8 @@ __all__ = [
"GetLibraryItemsDefaultDirection",
"GetLibraryItemsDirector",
"GetLibraryItemsDirectorTypedDict",
"GetLibraryItemsEnableCreditsMarkerGeneration",
"GetLibraryItemsEpisodeSort",
"GetLibraryItemsField",
"GetLibraryItemsFieldType",
"GetLibraryItemsFieldTypeTypedDict",
@@ -1549,6 +1560,8 @@ __all__ = [
"GetSearchAllLibrariesCountryTypedDict",
"GetSearchAllLibrariesDirector",
"GetSearchAllLibrariesDirectorTypedDict",
"GetSearchAllLibrariesEnableCreditsMarkerGeneration",
"GetSearchAllLibrariesEpisodeSort",
"GetSearchAllLibrariesFlattenSeasons",
"GetSearchAllLibrariesGenre",
"GetSearchAllLibrariesGenreTypedDict",

View File

@@ -342,8 +342,26 @@ class GetLibraryItemsLibraryType(str, Enum):
class GetLibraryItemsFlattenSeasons(str, Enum):
FALSE = "0"
TRUE = "1"
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
LIBRARY_DEFAULT = "-1"
HIDE = "0"
SHOW = "1"
class GetLibraryItemsEpisodeSort(str, Enum):
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
LIBRARY_DEFAULT = "-1"
OLDEST_FIRST = "0"
NEWEST_FIRST = "1"
class GetLibraryItemsEnableCreditsMarkerGeneration(str, Enum):
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
LIBRARY_DEFAULT = "-1"
DISABLED = "0"
class GetLibraryItemsShowOrdering(str, Enum):
@@ -896,6 +914,13 @@ class GetLibraryItemsMetadataTypedDict(TypedDict):
season_count: NotRequired[int]
tagline: NotRequired[str]
flatten_seasons: NotRequired[GetLibraryItemsFlattenSeasons]
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: NotRequired[GetLibraryItemsEpisodeSort]
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: NotRequired[
GetLibraryItemsEnableCreditsMarkerGeneration
]
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: NotRequired[GetLibraryItemsShowOrdering]
r"""Setting that indicates the episode ordering for the show
None = Library default,
@@ -1031,7 +1056,19 @@ class GetLibraryItemsMetadata(BaseModel):
flatten_seasons: Annotated[
Optional[GetLibraryItemsFlattenSeasons], pydantic.Field(alias="flattenSeasons")
] = GetLibraryItemsFlattenSeasons.FALSE
] = None
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: Annotated[
Optional[GetLibraryItemsEpisodeSort], pydantic.Field(alias="episodeSort")
] = None
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: Annotated[
Optional[GetLibraryItemsEnableCreditsMarkerGeneration],
pydantic.Field(alias="enableCreditsMarkerGeneration"),
] = None
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: Annotated[
Optional[GetLibraryItemsShowOrdering], pydantic.Field(alias="showOrdering")

View File

@@ -322,8 +322,26 @@ class GetRecentlyAddedHubsType(str, Enum):
class FlattenSeasons(str, Enum):
FALSE = "0"
TRUE = "1"
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
LIBRARY_DEFAULT = "-1"
HIDE = "0"
SHOW = "1"
class EpisodeSort(str, Enum):
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
LIBRARY_DEFAULT = "-1"
OLDEST_FIRST = "0"
NEWEST_FIRST = "1"
class EnableCreditsMarkerGeneration(str, Enum):
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
LIBRARY_DEFAULT = "-1"
DISABLED = "0"
class ShowOrdering(str, Enum):
@@ -873,6 +891,11 @@ class GetRecentlyAddedMetadataTypedDict(TypedDict):
season_count: NotRequired[int]
tagline: NotRequired[str]
flatten_seasons: NotRequired[FlattenSeasons]
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: NotRequired[EpisodeSort]
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: NotRequired[EnableCreditsMarkerGeneration]
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: NotRequired[ShowOrdering]
r"""Setting that indicates the episode ordering for the show
None = Library default,
@@ -1008,7 +1031,19 @@ class GetRecentlyAddedMetadata(BaseModel):
flatten_seasons: Annotated[
Optional[FlattenSeasons], pydantic.Field(alias="flattenSeasons")
] = FlattenSeasons.FALSE
] = None
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: Annotated[
Optional[EpisodeSort], pydantic.Field(alias="episodeSort")
] = None
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: Annotated[
Optional[EnableCreditsMarkerGeneration],
pydantic.Field(alias="enableCreditsMarkerGeneration"),
] = None
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: Annotated[
Optional[ShowOrdering], pydantic.Field(alias="showOrdering")

View File

@@ -103,8 +103,26 @@ class GetSearchAllLibrariesType(str, Enum):
class GetSearchAllLibrariesFlattenSeasons(str, Enum):
FALSE = "0"
TRUE = "1"
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
LIBRARY_DEFAULT = "-1"
HIDE = "0"
SHOW = "1"
class GetSearchAllLibrariesEpisodeSort(str, Enum):
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
LIBRARY_DEFAULT = "-1"
OLDEST_FIRST = "0"
NEWEST_FIRST = "1"
class GetSearchAllLibrariesEnableCreditsMarkerGeneration(str, Enum):
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
LIBRARY_DEFAULT = "-1"
DISABLED = "0"
class GetSearchAllLibrariesShowOrdering(str, Enum):
@@ -658,6 +676,13 @@ class GetSearchAllLibrariesMetadataTypedDict(TypedDict):
season_count: NotRequired[int]
tagline: NotRequired[str]
flatten_seasons: NotRequired[GetSearchAllLibrariesFlattenSeasons]
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: NotRequired[GetSearchAllLibrariesEpisodeSort]
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: NotRequired[
GetSearchAllLibrariesEnableCreditsMarkerGeneration
]
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: NotRequired[GetSearchAllLibrariesShowOrdering]
r"""Setting that indicates the episode ordering for the show
None = Library default,
@@ -794,7 +819,19 @@ class GetSearchAllLibrariesMetadata(BaseModel):
flatten_seasons: Annotated[
Optional[GetSearchAllLibrariesFlattenSeasons],
pydantic.Field(alias="flattenSeasons"),
] = GetSearchAllLibrariesFlattenSeasons.FALSE
] = None
r"""Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show)."""
episode_sort: Annotated[
Optional[GetSearchAllLibrariesEpisodeSort], pydantic.Field(alias="episodeSort")
] = None
r"""Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first)."""
enable_credits_marker_generation: Annotated[
Optional[GetSearchAllLibrariesEnableCreditsMarkerGeneration],
pydantic.Field(alias="enableCreditsMarkerGeneration"),
] = None
r"""Setting that indicates if credits markers detection is enabled. (-1 = Library default, 0 = Disabled)."""
show_ordering: Annotated[
Optional[GetSearchAllLibrariesShowOrdering],

View File

@@ -91,7 +91,7 @@ class StatisticsBandwidthTypedDict(TypedDict):
timespan: NotRequired[int]
at: NotRequired[int]
lan: NotRequired[bool]
bytes: NotRequired[int]
bytes_: NotRequired[int]
class StatisticsBandwidth(BaseModel):
@@ -105,7 +105,7 @@ class StatisticsBandwidth(BaseModel):
lan: Optional[bool] = None
bytes: Optional[int] = None
bytes_: Annotated[Optional[int], pydantic.Field(alias="bytes")] = None
class GetBandwidthStatisticsMediaContainerTypedDict(TypedDict):

View File

@@ -52,7 +52,7 @@ class Playlists(BaseSDK):
request = utils.unmarshal(request, operations.CreatePlaylistRequest)
request = cast(operations.CreatePlaylistRequest, request)
req = self.build_request(
req = self._build_request(
method="POST",
path="/playlists",
base_url=base_url,
@@ -109,7 +109,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.CreatePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -160,7 +165,7 @@ class Playlists(BaseSDK):
request = utils.unmarshal(request, operations.CreatePlaylistRequest)
request = cast(operations.CreatePlaylistRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/playlists",
base_url=base_url,
@@ -217,7 +222,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.CreatePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -266,7 +276,7 @@ class Playlists(BaseSDK):
smart=smart,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/playlists",
base_url=base_url,
@@ -323,7 +333,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -372,7 +387,7 @@ class Playlists(BaseSDK):
smart=smart,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/playlists",
base_url=base_url,
@@ -429,7 +444,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -477,7 +497,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -532,7 +552,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -580,7 +605,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -635,7 +660,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -682,7 +712,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -736,7 +766,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.DeletePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -783,7 +818,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -837,7 +872,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.DeletePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -890,7 +930,7 @@ class Playlists(BaseSDK):
summary=summary,
)
req = self.build_request(
req = self._build_request(
method="PUT",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -944,7 +984,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.UpdatePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -997,7 +1042,7 @@ class Playlists(BaseSDK):
summary=summary,
)
req = self.build_request_async(
req = self._build_request_async(
method="PUT",
path="/playlists/{playlistID}",
base_url=base_url,
@@ -1051,7 +1096,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.UpdatePlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1104,7 +1154,7 @@ class Playlists(BaseSDK):
type=type_,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1161,7 +1211,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1214,7 +1269,7 @@ class Playlists(BaseSDK):
type=type_,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1271,7 +1326,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.GetPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1318,7 +1378,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1372,7 +1432,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.ClearPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1419,7 +1484,7 @@ class Playlists(BaseSDK):
playlist_id=playlist_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1473,7 +1538,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.ClearPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1527,7 +1597,7 @@ class Playlists(BaseSDK):
play_queue_id=play_queue_id,
)
req = self.build_request(
req = self._build_request(
method="PUT",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1584,7 +1654,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.AddPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1638,7 +1713,7 @@ class Playlists(BaseSDK):
play_queue_id=play_queue_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="PUT",
path="/playlists/{playlistID}/items",
base_url=base_url,
@@ -1695,7 +1770,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.AddPlaylistContentsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1748,7 +1828,7 @@ class Playlists(BaseSDK):
section_id=section_id,
)
req = self.build_request(
req = self._build_request(
method="POST",
path="/playlists/upload",
base_url=base_url,
@@ -1802,7 +1882,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.UploadPlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1855,7 +1940,7 @@ class Playlists(BaseSDK):
section_id=section_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/playlists/upload",
base_url=base_url,
@@ -1909,7 +1994,12 @@ class Playlists(BaseSDK):
)
data.raw_response = http_res
raise errors.UploadPlaylistUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -37,7 +37,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_COMPANIONS_DATA_SERVERS[0]
req = self.build_request(
req = self._build_request(
method="GET",
path="/companions",
base_url=base_url,
@@ -94,7 +94,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetCompanionsDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -135,7 +140,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_COMPANIONS_DATA_SERVERS[0]
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/companions",
base_url=base_url,
@@ -192,7 +197,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetCompanionsDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -233,7 +243,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_USER_FRIENDS_SERVERS[0]
req = self.build_request(
req = self._build_request(
method="GET",
path="/friends",
base_url=base_url,
@@ -290,7 +300,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetUserFriendsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -331,7 +346,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_USER_FRIENDS_SERVERS[0]
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/friends",
base_url=base_url,
@@ -388,7 +403,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetUserFriendsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -429,7 +449,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_GEO_DATA_SERVERS[0]
req = self.build_request(
req = self._build_request(
method="GET",
path="/geoip",
base_url=base_url,
@@ -481,7 +501,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetGeoDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -522,7 +547,7 @@ class Plex(BaseSDK):
base_url = server_url
else:
base_url = operations.GET_GEO_DATA_SERVERS[0]
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/geoip",
base_url=base_url,
@@ -574,7 +599,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetGeoDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -613,7 +643,7 @@ class Plex(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/home",
base_url=base_url,
@@ -668,7 +698,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetHomeDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -707,7 +742,7 @@ class Plex(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/home",
base_url=base_url,
@@ -762,7 +797,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetHomeDataUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -825,7 +865,7 @@ class Plex(BaseSDK):
client_id=client_id,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/resources",
base_url=base_url,
@@ -882,7 +922,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerResourcesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -945,7 +990,7 @@ class Plex(BaseSDK):
client_id=client_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/resources",
base_url=base_url,
@@ -1002,7 +1047,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerResourcesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1050,7 +1100,7 @@ class Plex(BaseSDK):
request = utils.unmarshal(request, operations.GetPinRequest)
request = cast(operations.GetPinRequest, request)
req = self.build_request(
req = self._build_request(
method="POST",
path="/pins",
base_url=base_url,
@@ -1096,7 +1146,12 @@ class Plex(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.GetPinBadRequestData)
data.raw_response = http_res
raise errors.GetPinBadRequest(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1144,7 +1199,7 @@ class Plex(BaseSDK):
request = utils.unmarshal(request, operations.GetPinRequest)
request = cast(operations.GetPinRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="POST",
path="/pins",
base_url=base_url,
@@ -1190,7 +1245,12 @@ class Plex(BaseSDK):
data = utils.unmarshal_json(http_res.text, errors.GetPinBadRequestData)
data.raw_response = http_res
raise errors.GetPinBadRequest(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1241,7 +1301,7 @@ class Plex(BaseSDK):
request = utils.unmarshal(request, operations.GetTokenByPinIDRequest)
request = cast(operations.GetTokenByPinIDRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/pins/{pinID}",
base_url=base_url,
@@ -1295,7 +1355,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTokenByPinIDResponseBody(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1346,7 +1411,7 @@ class Plex(BaseSDK):
request = utils.unmarshal(request, operations.GetTokenByPinIDRequest)
request = cast(operations.GetTokenByPinIDRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/pins/{pinID}",
base_url=base_url,
@@ -1400,7 +1465,12 @@ class Plex(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTokenByPinIDResponseBody(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -1,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from .basesdk import BaseSDK
from .httpclient import AsyncHttpClient, HttpClient
from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients
from .sdkconfiguration import SDKConfiguration, ServerProtocol
from .utils.logger import Logger, get_default_logger
from .utils.retries import RetryConfig
@@ -26,7 +26,8 @@ from plex_api_client.types import OptionalNullable, UNSET
from plex_api_client.updater import Updater
from plex_api_client.video import Video
from plex_api_client.watchlist import Watchlist
from typing import Any, Callable, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Optional, Union, cast
import weakref
class PlexAPI(BaseSDK):
@@ -184,7 +185,8 @@ class PlexAPI(BaseSDK):
security: Any = None
if callable(access_token):
security = lambda: components.Security(access_token=access_token()) # pylint: disable=unnecessary-lambda-assignment
# pylint: disable=unnecessary-lambda-assignment
security = lambda: components.Security(access_token=access_token())
else:
security = components.Security(access_token=access_token)
@@ -226,6 +228,14 @@ class PlexAPI(BaseSDK):
# pylint: disable=protected-access
self.sdk_configuration.__dict__["_hooks"] = hooks
weakref.finalize(
self,
close_clients,
cast(ClientOwner, self.sdk_configuration),
self.sdk_configuration.client,
self.sdk_configuration.async_client,
)
self._init_sdks()
def _init_sdks(self):

View File

@@ -1,6 +1,12 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from ._hooks import SDKHooks
from ._version import (
__gen_version__,
__openapi_doc_version__,
__user_agent__,
__version__,
)
from .httpclient import AsyncHttpClient, HttpClient
from .utils import Logger, RetryConfig, remove_suffix
from dataclasses import dataclass, field
@@ -37,10 +43,10 @@ class SDKConfiguration:
server_idx: Optional[int] = 0
server_defaults: List[Dict[str, str]] = field(default_factory=List)
language: str = "python"
openapi_doc_version: str = "0.0.3"
sdk_version: str = "0.20.1"
gen_version: str = "2.483.1"
user_agent: str = "speakeasy-sdk/python 0.20.1 2.483.1 0.0.3 plex-api-client"
openapi_doc_version: str = __openapi_doc_version__
sdk_version: str = __version__
gen_version: str = __gen_version__
user_agent: str = __user_agent__
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
timeout_ms: Optional[int] = None

View File

@@ -60,7 +60,7 @@ class Search(BaseSDK):
limit=limit,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/hubs/search",
base_url=base_url,
@@ -114,7 +114,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.PerformSearchUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -178,7 +183,7 @@ class Search(BaseSDK):
limit=limit,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/hubs/search",
base_url=base_url,
@@ -232,7 +237,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.PerformSearchUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -288,7 +298,7 @@ class Search(BaseSDK):
limit=limit,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/hubs/search/voice",
base_url=base_url,
@@ -342,7 +352,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.PerformVoiceSearchUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -398,7 +413,7 @@ class Search(BaseSDK):
limit=limit,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/hubs/search/voice",
base_url=base_url,
@@ -452,7 +467,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.PerformVoiceSearchUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -498,7 +518,7 @@ class Search(BaseSDK):
query=query,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/search",
base_url=base_url,
@@ -555,7 +575,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchResultsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -601,7 +626,7 @@ class Search(BaseSDK):
query=query,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/search",
base_url=base_url,
@@ -658,7 +683,12 @@ class Search(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSearchResultsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -35,7 +35,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/",
base_url=base_url,
@@ -93,7 +93,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerCapabilitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -132,7 +137,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/",
base_url=base_url,
@@ -190,7 +195,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerCapabilitiesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -229,7 +239,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/:/prefs",
base_url=base_url,
@@ -286,7 +296,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerPreferencesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -325,7 +340,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/:/prefs",
base_url=base_url,
@@ -382,7 +397,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerPreferencesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -421,7 +441,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/clients",
base_url=base_url,
@@ -478,7 +498,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetAvailableClientsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -517,7 +542,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/clients",
base_url=base_url,
@@ -574,7 +599,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetAvailableClientsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -613,7 +643,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/devices",
base_url=base_url,
@@ -668,7 +698,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetDevicesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -707,7 +742,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/devices",
base_url=base_url,
@@ -762,7 +797,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetDevicesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -801,7 +841,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/identity",
base_url=base_url,
@@ -851,7 +891,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerIdentityRequestTimeout(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -890,7 +935,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/identity",
base_url=base_url,
@@ -940,7 +985,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerIdentityRequestTimeout(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -979,7 +1029,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/myplex/account",
base_url=base_url,
@@ -1036,7 +1086,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMyPlexAccountUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1075,7 +1130,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/myplex/account",
base_url=base_url,
@@ -1132,7 +1187,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMyPlexAccountUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1182,7 +1242,7 @@ class Server(BaseSDK):
request = utils.unmarshal(request, operations.GetResizedPhotoRequest)
request = cast(operations.GetResizedPhotoRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/photo/:/transcode",
base_url=base_url,
@@ -1236,7 +1296,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetResizedPhotoUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1286,7 +1351,7 @@ class Server(BaseSDK):
request = utils.unmarshal(request, operations.GetResizedPhotoRequest)
request = cast(operations.GetResizedPhotoRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/photo/:/transcode",
base_url=base_url,
@@ -1340,7 +1405,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetResizedPhotoUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1386,7 +1456,7 @@ class Server(BaseSDK):
x_plex_token=x_plex_token,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/media/providers",
base_url=base_url,
@@ -1443,7 +1513,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMediaProvidersUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1489,7 +1564,7 @@ class Server(BaseSDK):
x_plex_token=x_plex_token,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/media/providers",
base_url=base_url,
@@ -1546,7 +1621,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetMediaProvidersUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1585,7 +1665,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/servers",
base_url=base_url,
@@ -1642,7 +1722,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerListUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -1681,7 +1766,7 @@ class Server(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/servers",
base_url=base_url,
@@ -1738,7 +1823,12 @@ class Server(BaseSDK):
)
data.raw_response = http_res
raise errors.GetServerListUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -35,7 +35,7 @@ class Sessions(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/status/sessions",
base_url=base_url,
@@ -90,7 +90,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSessionsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -129,7 +134,7 @@ class Sessions(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/status/sessions",
base_url=base_url,
@@ -184,7 +189,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSessionsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -243,7 +253,7 @@ class Sessions(BaseSDK):
library_section_id=library_section_id,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/status/sessions/history/all",
base_url=base_url,
@@ -300,7 +310,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSessionHistoryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -359,7 +374,7 @@ class Sessions(BaseSDK):
library_section_id=library_section_id,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/status/sessions/history/all",
base_url=base_url,
@@ -416,7 +431,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetSessionHistoryUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -455,7 +475,7 @@ class Sessions(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/transcode/sessions",
base_url=base_url,
@@ -512,7 +532,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTranscodeSessionsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -551,7 +576,7 @@ class Sessions(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/transcode/sessions",
base_url=base_url,
@@ -608,7 +633,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTranscodeSessionsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -654,7 +684,7 @@ class Sessions(BaseSDK):
session_key=session_key,
)
req = self.build_request(
req = self._build_request(
method="DELETE",
path="/transcode/sessions/{sessionKey}",
base_url=base_url,
@@ -708,7 +738,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.StopTranscodeSessionUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -754,7 +789,7 @@ class Sessions(BaseSDK):
session_key=session_key,
)
req = self.build_request_async(
req = self._build_request_async(
method="DELETE",
path="/transcode/sessions/{sessionKey}",
base_url=base_url,
@@ -808,7 +843,12 @@ class Sessions(BaseSDK):
)
data.raw_response = http_res
raise errors.StopTranscodeSessionUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -42,7 +42,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/statistics/media",
base_url=base_url,
@@ -99,7 +99,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -145,7 +150,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/statistics/media",
base_url=base_url,
@@ -202,7 +207,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -248,7 +258,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/statistics/resources",
base_url=base_url,
@@ -306,7 +316,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetResourcesStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -352,7 +367,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/statistics/resources",
base_url=base_url,
@@ -410,7 +425,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetResourcesStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -456,7 +476,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request(
req = self._build_request(
method="GET",
path="/statistics/bandwidth",
base_url=base_url,
@@ -514,7 +534,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetBandwidthStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -560,7 +585,7 @@ class Statistics(BaseSDK):
timespan=timespan,
)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/statistics/bandwidth",
base_url=base_url,
@@ -618,7 +643,12 @@ class Statistics(BaseSDK):
)
data.raw_response = http_res
raise errors.GetBandwidthStatisticsUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -38,7 +38,7 @@ class Updater(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request(
req = self._build_request(
method="GET",
path="/updater/status",
base_url=base_url,
@@ -95,7 +95,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.GetUpdateStatusUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -134,7 +139,7 @@ class Updater(BaseSDK):
if server_url is not None:
base_url = server_url
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/updater/status",
base_url=base_url,
@@ -191,7 +196,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.GetUpdateStatusUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -237,7 +247,7 @@ class Updater(BaseSDK):
download=download,
)
req = self.build_request(
req = self._build_request(
method="PUT",
path="/updater/check",
base_url=base_url,
@@ -291,7 +301,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.CheckForUpdatesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -337,7 +352,7 @@ class Updater(BaseSDK):
download=download,
)
req = self.build_request_async(
req = self._build_request_async(
method="PUT",
path="/updater/check",
base_url=base_url,
@@ -391,7 +406,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.CheckForUpdatesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -441,7 +461,7 @@ class Updater(BaseSDK):
skip=skip,
)
req = self.build_request(
req = self._build_request(
method="PUT",
path="/updater/apply",
base_url=base_url,
@@ -495,7 +515,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.ApplyUpdatesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "500", "5XX"], "*"):
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
)
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
@@ -545,7 +570,7 @@ class Updater(BaseSDK):
skip=skip,
)
req = self.build_request_async(
req = self._build_request_async(
method="PUT",
path="/updater/apply",
base_url=base_url,
@@ -599,7 +624,12 @@ class Updater(BaseSDK):
)
data.raw_response = http_res
raise errors.ApplyUpdatesUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "500", "5XX"], "*"):
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
)
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

View File

@@ -44,7 +44,7 @@ class Video(BaseSDK):
request = utils.unmarshal(request, operations.GetTimelineRequest)
request = cast(operations.GetTimelineRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/:/timeline",
base_url=base_url,
@@ -96,7 +96,12 @@ class Video(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTimelineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -144,7 +149,7 @@ class Video(BaseSDK):
request = utils.unmarshal(request, operations.GetTimelineRequest)
request = cast(operations.GetTimelineRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/:/timeline",
base_url=base_url,
@@ -196,7 +201,12 @@ class Video(BaseSDK):
)
data.raw_response = http_res
raise errors.GetTimelineUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -247,7 +257,7 @@ class Video(BaseSDK):
)
request = cast(operations.StartUniversalTranscodeRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/video/:/transcode/universal/start.mpd",
base_url=base_url,
@@ -301,7 +311,12 @@ class Video(BaseSDK):
)
data.raw_response = http_res
raise errors.StartUniversalTranscodeUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -352,7 +367,7 @@ class Video(BaseSDK):
)
request = cast(operations.StartUniversalTranscodeRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/video/:/transcode/universal/start.mpd",
base_url=base_url,
@@ -406,7 +421,12 @@ class Video(BaseSDK):
)
data.raw_response = http_res
raise errors.StartUniversalTranscodeUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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

View File

@@ -46,7 +46,7 @@ class Watchlist(BaseSDK):
request = utils.unmarshal(request, operations.GetWatchListRequest)
request = cast(operations.GetWatchListRequest, request)
req = self.build_request(
req = self._build_request(
method="GET",
path="/library/sections/watchlist/{filter}",
base_url=base_url,
@@ -103,7 +103,12 @@ class Watchlist(BaseSDK):
)
data.raw_response = http_res
raise errors.GetWatchListUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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
@@ -153,7 +158,7 @@ class Watchlist(BaseSDK):
request = utils.unmarshal(request, operations.GetWatchListRequest)
request = cast(operations.GetWatchListRequest, request)
req = self.build_request_async(
req = self._build_request_async(
method="GET",
path="/library/sections/watchlist/{filter}",
base_url=base_url,
@@ -210,7 +215,12 @@ class Watchlist(BaseSDK):
)
data.raw_response = http_res
raise errors.GetWatchListUnauthorized(data=data)
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
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, "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