mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 12:47:44 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -15,7 +15,7 @@ generation:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
python:
|
||||
version: 0.24.2
|
||||
version: 0.25.0
|
||||
additionalDependencies:
|
||||
dev: {}
|
||||
main: {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.526.6
|
||||
speakeasyVersion: 1.528.1
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -8,19 +8,19 @@ sources:
|
||||
- latest
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
|
||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
||||
sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
|
||||
sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1743442213
|
||||
- speakeasy-sdk-regen-1743724902
|
||||
targets:
|
||||
plexpy:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf
|
||||
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351
|
||||
sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
|
||||
sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
|
||||
codeSamplesNamespace: code-samples-python-plexpy
|
||||
codeSamplesRevisionDigest: sha256:d602934f4341a648a4103c552a490196fb79cd628acf88f190268d7ea57d98e1
|
||||
codeSamplesRevisionDigest: sha256:a778abbffccd815f66b90209260b64dfecf0e7d4fb1d145cec800eabe371a550
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
33
README.md
33
README.md
@@ -49,6 +49,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
|
||||
* [IDE Support](#ide-support)
|
||||
* [SDK Example Usage](#sdk-example-usage)
|
||||
* [Available Resources and Operations](#available-resources-and-operations)
|
||||
* [File uploads](#file-uploads)
|
||||
* [Retries](#retries)
|
||||
* [Error Handling](#error-handling)
|
||||
* [Server Selection](#server-selection)
|
||||
@@ -225,6 +226,10 @@ asyncio.run(main())
|
||||
* [get_actors_library](docs/sdks/library/README.md#get_actors_library) - Get Actors of library media
|
||||
* [get_search_all_libraries](docs/sdks/library/README.md#get_search_all_libraries) - Search All Libraries
|
||||
* [get_media_meta_data](docs/sdks/library/README.md#get_media_meta_data) - Get Media Metadata
|
||||
* [get_media_arts](docs/sdks/library/README.md#get_media_arts) - Get Media Background Artwork
|
||||
* [post_media_arts](docs/sdks/library/README.md#post_media_arts) - Upload Media Background Artwork
|
||||
* [get_media_posters](docs/sdks/library/README.md#get_media_posters) - Get Media Posters
|
||||
* [post_media_poster](docs/sdks/library/README.md#post_media_poster) - Upload Media Poster
|
||||
* [get_metadata_children](docs/sdks/library/README.md#get_metadata_children) - Get Items Children
|
||||
* [get_top_watched_content](docs/sdks/library/README.md#get_top_watched_content) - Get Top Watched Content
|
||||
|
||||
@@ -318,6 +323,34 @@ asyncio.run(main())
|
||||
</details>
|
||||
<!-- End Available Resources and Operations [operations] -->
|
||||
|
||||
<!-- Start File uploads [file-upload] -->
|
||||
## File uploads
|
||||
|
||||
Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
|
||||
>
|
||||
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.post_media_arts(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
<!-- End File uploads [file-upload] -->
|
||||
|
||||
<!-- Start Retries [retries] -->
|
||||
## Retries
|
||||
|
||||
|
||||
10
RELEASES.md
10
RELEASES.md
@@ -979,3 +979,13 @@ Based on:
|
||||
- [python v0.24.2] .
|
||||
### Releases
|
||||
- [PyPI v0.24.2] https://pypi.org/project/plex-api-client/0.24.2 - .
|
||||
|
||||
## 2025-04-04 00:01:27
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [python v0.25.0] .
|
||||
### Releases
|
||||
- [PyPI v0.25.0] https://pypi.org/project/plex-api-client/0.25.0 - .
|
||||
@@ -566,6 +566,44 @@ actions:
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: PlexPy
|
||||
source: |-
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.get_media_arts(rating_key=16099)
|
||||
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: PlexPy
|
||||
source: |-
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.post_media_arts(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
@@ -611,6 +649,44 @@ actions:
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: PlexPy
|
||||
source: |-
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.get_media_posters(rating_key=16099)
|
||||
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
- lang: python
|
||||
label: PlexPy
|
||||
source: |-
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.post_media_poster(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
|
||||
update:
|
||||
x-codeSamples:
|
||||
|
||||
12
docs/models/operations/getmediaartsmediacontainer.md
Normal file
12
docs/models/operations/getmediaartsmediacontainer.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaArtsMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `media_tag_version` | *int* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `media_tag_prefix` | *str* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `identifier` | *str* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `metadata` | List[[operations.GetMediaArtsMetadata](../../models/operations/getmediaartsmetadata.md)] | :heavy_check_mark: | N/A | |
|
||||
12
docs/models/operations/getmediaartsmetadata.md
Normal file
12
docs/models/operations/getmediaartsmetadata.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaArtsMetadata
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `key` | *str* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||
| `rating_key` | *str* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
|
||||
| `selected` | *bool* | :heavy_check_mark: | Whether this is the selected artwork. | true |
|
||||
| `thumb` | *str* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg |
|
||||
| `provider` | *Optional[str]* | :heavy_minus_sign: | The provider of the artwork. | tmdb |
|
||||
8
docs/models/operations/getmediaartsrequest.md
Normal file
8
docs/models/operations/getmediaartsrequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetMediaArtsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||
11
docs/models/operations/getmediaartsresponse.md
Normal file
11
docs/models/operations/getmediaartsresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetMediaArtsResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `object` | [Optional[operations.GetMediaArtsResponseBody]](../../models/operations/getmediaartsresponsebody.md) | :heavy_minus_sign: | The available background artwork for the library item. |
|
||||
10
docs/models/operations/getmediaartsresponsebody.md
Normal file
10
docs/models/operations/getmediaartsresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetMediaArtsResponseBody
|
||||
|
||||
The available background artwork for the library item.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| `media_container` | [Optional[operations.GetMediaArtsMediaContainer]](../../models/operations/getmediaartsmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
12
docs/models/operations/getmediapostersmediacontainer.md
Normal file
12
docs/models/operations/getmediapostersmediacontainer.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaPostersMediaContainer
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `size` | *int* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
|
||||
| `media_tag_version` | *int* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
|
||||
| `media_tag_prefix` | *str* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
|
||||
| `identifier` | *str* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
|
||||
| `metadata` | List[[operations.GetMediaPostersMetadata](../../models/operations/getmediapostersmetadata.md)] | :heavy_check_mark: | N/A | |
|
||||
12
docs/models/operations/getmediapostersmetadata.md
Normal file
12
docs/models/operations/getmediapostersmetadata.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# GetMediaPostersMetadata
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `key` | *str* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||
| `rating_key` | *str* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
|
||||
| `selected` | *bool* | :heavy_check_mark: | Whether this is the selected poster. | true |
|
||||
| `thumb` | *str* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg |
|
||||
| `provider` | *Optional[str]* | :heavy_minus_sign: | The provider of the poster. | tmdb |
|
||||
8
docs/models/operations/getmediapostersrequest.md
Normal file
8
docs/models/operations/getmediapostersrequest.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# GetMediaPostersRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||
11
docs/models/operations/getmediapostersresponse.md
Normal file
11
docs/models/operations/getmediapostersresponse.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# GetMediaPostersResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
| `object` | [Optional[operations.GetMediaPostersResponseBody]](../../models/operations/getmediapostersresponsebody.md) | :heavy_minus_sign: | The available posters for the library item. |
|
||||
10
docs/models/operations/getmediapostersresponsebody.md
Normal file
10
docs/models/operations/getmediapostersresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# GetMediaPostersResponseBody
|
||||
|
||||
The available posters for the library item.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `media_container` | [Optional[operations.GetMediaPostersMediaContainer]](../../models/operations/getmediapostersmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||
10
docs/models/operations/postmediaartsrequest.md
Normal file
10
docs/models/operations/postmediaartsrequest.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaArtsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional[str]* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `request_body` | *Optional[Union[bytes, IO[bytes], io.BufferedReader]]* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
10
docs/models/operations/postmediaartsresponse.md
Normal file
10
docs/models/operations/postmediaartsresponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaArtsResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
10
docs/models/operations/postmediaposterrequest.md
Normal file
10
docs/models/operations/postmediaposterrequest.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaPosterRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional[str]* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `request_body` | *Optional[Union[bytes, IO[bytes], io.BufferedReader]]* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
10
docs/models/operations/postmediaposterresponse.md
Normal file
10
docs/models/operations/postmediaposterresponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# PostMediaPosterResponse
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||
@@ -22,6 +22,10 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [get_actors_library](#get_actors_library) - Get Actors of library media
|
||||
* [get_search_all_libraries](#get_search_all_libraries) - Search All Libraries
|
||||
* [get_media_meta_data](#get_media_meta_data) - Get Media Metadata
|
||||
* [get_media_arts](#get_media_arts) - Get Media Background Artwork
|
||||
* [post_media_arts](#post_media_arts) - Upload Media Background Artwork
|
||||
* [get_media_posters](#get_media_posters) - Get Media Posters
|
||||
* [post_media_poster](#post_media_poster) - Upload Media Poster
|
||||
* [get_metadata_children](#get_metadata_children) - Get Items Children
|
||||
* [get_top_watched_content](#get_top_watched_content) - Get Top Watched Content
|
||||
|
||||
@@ -766,6 +770,170 @@ with PlexAPI(
|
||||
| errors.GetMediaMetaDataUnauthorized | 401 | application/json |
|
||||
| errors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## get_media_arts
|
||||
|
||||
Returns the background artwork for a library item.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.get_media_arts(rating_key=16099)
|
||||
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
**[operations.GetMediaArtsResponse](../../models/operations/getmediaartsresponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## post_media_arts
|
||||
|
||||
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
|
||||
### Example Usage
|
||||
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.post_media_arts(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional[str]* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `request_body` | *Optional[Union[bytes, IO[bytes], io.BufferedReader]]* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
**[operations.PostMediaArtsResponse](../../models/operations/postmediaartsresponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## get_media_posters
|
||||
|
||||
Returns the available posters for a library item.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.get_media_posters(rating_key=16099)
|
||||
|
||||
assert res.object is not None
|
||||
|
||||
# Handle response
|
||||
print(res.object)
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
**[operations.GetMediaPostersResponse](../../models/operations/getmediapostersresponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## post_media_poster
|
||||
|
||||
Uploads a poster to a library item, either from a local file or a remote URL
|
||||
|
||||
### Example Usage
|
||||
|
||||
```python
|
||||
from plex_api_client import PlexAPI
|
||||
|
||||
|
||||
with PlexAPI(
|
||||
access_token="<YOUR_API_KEY_HERE>",
|
||||
) as plex_api:
|
||||
|
||||
res = plex_api.library.post_media_poster(rating_key=2268, url="https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b")
|
||||
|
||||
assert res is not None
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `rating_key` | *int* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
|
||||
| `url` | *Optional[str]* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
|
||||
| `request_body` | *Optional[Union[bytes, IO[bytes], io.BufferedReader]]* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
**[operations.PostMediaPosterResponse](../../models/operations/postmediaposterresponse.md)**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Type | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4XX, 5XX | \*/\* |
|
||||
|
||||
## get_metadata_children
|
||||
|
||||
This endpoint will return the children of of a library item specified with the ratingKey.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "plex-api-client"
|
||||
version = "0.24.2"
|
||||
version = "0.25.0"
|
||||
description = "Python Client SDK Generated by Speakeasy"
|
||||
authors = [{ name = "Speakeasy" },]
|
||||
readme = "README-PYPI.md"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
import importlib.metadata
|
||||
|
||||
__title__: str = "plex-api-client"
|
||||
__version__: str = "0.24.2"
|
||||
__version__: str = "0.25.0"
|
||||
__openapi_doc_version__: str = "0.0.3"
|
||||
__gen_version__: str = "2.563.1"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.24.2 2.563.1 0.0.3 plex-api-client"
|
||||
__gen_version__: str = "2.565.1"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.25.0 2.565.1 0.0.3 plex-api-client"
|
||||
|
||||
try:
|
||||
if __package__ is not None:
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from .basesdk import BaseSDK
|
||||
import io
|
||||
from plex_api_client import utils
|
||||
from plex_api_client._hooks import HookContext
|
||||
from plex_api_client.models import errors, operations
|
||||
from plex_api_client.types import BaseModel, OptionalNullable, UNSET
|
||||
from typing import Any, Mapping, Optional, Union, cast
|
||||
from typing import Any, IO, Mapping, Optional, Union, cast
|
||||
|
||||
|
||||
class Library(BaseSDK):
|
||||
@@ -3355,6 +3356,830 @@ class Library(BaseSDK):
|
||||
http_res,
|
||||
)
|
||||
|
||||
def get_media_arts(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetMediaArtsResponse:
|
||||
r"""Get Media Background Artwork
|
||||
|
||||
Returns the background artwork for a library item.
|
||||
|
||||
:param rating_key: the id of the library item to return the artwork of.
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetMediaArtsRequest(
|
||||
rating_key=rating_key,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/library/metadata/{ratingKey}/arts",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="get-media-arts",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return operations.GetMediaArtsResponse(
|
||||
object=utils.unmarshal_json(
|
||||
http_res.text, Optional[operations.GetMediaArtsResponseBody]
|
||||
),
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
async def get_media_arts_async(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetMediaArtsResponse:
|
||||
r"""Get Media Background Artwork
|
||||
|
||||
Returns the background artwork for a library item.
|
||||
|
||||
:param rating_key: the id of the library item to return the artwork of.
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetMediaArtsRequest(
|
||||
rating_key=rating_key,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/library/metadata/{ratingKey}/arts",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="get-media-arts",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return operations.GetMediaArtsResponse(
|
||||
object=utils.unmarshal_json(
|
||||
http_res.text, Optional[operations.GetMediaArtsResponseBody]
|
||||
),
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
def post_media_arts(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
url: Optional[str] = None,
|
||||
request_body: Optional[Union[bytes, IO[bytes], io.BufferedReader]] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.PostMediaArtsResponse:
|
||||
r"""Upload Media Background Artwork
|
||||
|
||||
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param url: The URL of the image, if uploading a remote image
|
||||
:param request_body: The contents of the image, if uploading a local file
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.PostMediaArtsRequest(
|
||||
rating_key=rating_key,
|
||||
url=url,
|
||||
request_body=request_body,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="POST",
|
||||
path="/library/metadata/{ratingKey}/arts",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="*/*",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
False,
|
||||
True,
|
||||
"raw",
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="post-media-arts",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "*"):
|
||||
return operations.PostMediaArtsResponse(
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
async def post_media_arts_async(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
url: Optional[str] = None,
|
||||
request_body: Optional[Union[bytes, IO[bytes], io.BufferedReader]] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.PostMediaArtsResponse:
|
||||
r"""Upload Media Background Artwork
|
||||
|
||||
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param url: The URL of the image, if uploading a remote image
|
||||
:param request_body: The contents of the image, if uploading a local file
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.PostMediaArtsRequest(
|
||||
rating_key=rating_key,
|
||||
url=url,
|
||||
request_body=request_body,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="POST",
|
||||
path="/library/metadata/{ratingKey}/arts",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="*/*",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
False,
|
||||
True,
|
||||
"raw",
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="post-media-arts",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "*"):
|
||||
return operations.PostMediaArtsResponse(
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
def get_media_posters(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetMediaPostersResponse:
|
||||
r"""Get Media Posters
|
||||
|
||||
Returns the available posters for a library item.
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetMediaPostersRequest(
|
||||
rating_key=rating_key,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/library/metadata/{ratingKey}/posters",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="get-media-posters",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return operations.GetMediaPostersResponse(
|
||||
object=utils.unmarshal_json(
|
||||
http_res.text, Optional[operations.GetMediaPostersResponseBody]
|
||||
),
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
async def get_media_posters_async(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetMediaPostersResponse:
|
||||
r"""Get Media Posters
|
||||
|
||||
Returns the available posters for a library item.
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetMediaPostersRequest(
|
||||
rating_key=rating_key,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/library/metadata/{ratingKey}/posters",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="get-media-posters",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return operations.GetMediaPostersResponse(
|
||||
object=utils.unmarshal_json(
|
||||
http_res.text, Optional[operations.GetMediaPostersResponseBody]
|
||||
),
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
def post_media_poster(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
url: Optional[str] = None,
|
||||
request_body: Optional[Union[bytes, IO[bytes], io.BufferedReader]] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.PostMediaPosterResponse:
|
||||
r"""Upload Media Poster
|
||||
|
||||
Uploads a poster to a library item, either from a local file or a remote URL
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param url: The URL of the image, if uploading a remote image
|
||||
:param request_body: The contents of the image, if uploading a local file
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.PostMediaPosterRequest(
|
||||
rating_key=rating_key,
|
||||
url=url,
|
||||
request_body=request_body,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="POST",
|
||||
path="/library/metadata/{ratingKey}/posters",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="*/*",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
False,
|
||||
True,
|
||||
"raw",
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="post-media-poster",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "*"):
|
||||
return operations.PostMediaPosterResponse(
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
async def post_media_poster_async(
|
||||
self,
|
||||
*,
|
||||
rating_key: int,
|
||||
url: Optional[str] = None,
|
||||
request_body: Optional[Union[bytes, IO[bytes], io.BufferedReader]] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.PostMediaPosterResponse:
|
||||
r"""Upload Media Poster
|
||||
|
||||
Uploads a poster to a library item, either from a local file or a remote URL
|
||||
|
||||
:param rating_key: the id of the library item to return the posters of.
|
||||
:param url: The URL of the image, if uploading a remote image
|
||||
:param request_body: The contents of the image, if uploading a local file
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.PostMediaPosterRequest(
|
||||
rating_key=rating_key,
|
||||
url=url,
|
||||
request_body=request_body,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="POST",
|
||||
path="/library/metadata/{ratingKey}/posters",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="*/*",
|
||||
http_headers=http_headers,
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
False,
|
||||
True,
|
||||
"raw",
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
base_url=base_url or "",
|
||||
operation_id="post-media-poster",
|
||||
oauth2_scopes=[],
|
||||
security_source=self.sdk_configuration.security,
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["404", "4XX", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
if utils.match_response(http_res, "200", "*"):
|
||||
return operations.PostMediaPosterResponse(
|
||||
status_code=http_res.status_code,
|
||||
content_type=http_res.headers.get("Content-Type") or "",
|
||||
raw_response=http_res,
|
||||
)
|
||||
if utils.match_response(http_res, ["404", "4XX"], "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
"API error occurred", http_res.status_code, http_res_text, http_res
|
||||
)
|
||||
|
||||
content_type = http_res.headers.get("Content-Type")
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.SDKError(
|
||||
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
||||
http_res.status_code,
|
||||
http_res_text,
|
||||
http_res,
|
||||
)
|
||||
|
||||
def get_metadata_children(
|
||||
self,
|
||||
*,
|
||||
|
||||
@@ -300,6 +300,18 @@ from .get_library_items import (
|
||||
ShowOrdering,
|
||||
Tag,
|
||||
)
|
||||
from .get_media_arts import (
|
||||
GetMediaArtsMediaContainer,
|
||||
GetMediaArtsMediaContainerTypedDict,
|
||||
GetMediaArtsMetadata,
|
||||
GetMediaArtsMetadataTypedDict,
|
||||
GetMediaArtsRequest,
|
||||
GetMediaArtsRequestTypedDict,
|
||||
GetMediaArtsResponse,
|
||||
GetMediaArtsResponseBody,
|
||||
GetMediaArtsResponseBodyTypedDict,
|
||||
GetMediaArtsResponseTypedDict,
|
||||
)
|
||||
from .get_media_meta_data import (
|
||||
GetMediaMetaDataCountry,
|
||||
GetMediaMetaDataCountryTypedDict,
|
||||
@@ -349,6 +361,18 @@ from .get_media_meta_data import (
|
||||
Ratings,
|
||||
RatingsTypedDict,
|
||||
)
|
||||
from .get_media_posters import (
|
||||
GetMediaPostersMediaContainer,
|
||||
GetMediaPostersMediaContainerTypedDict,
|
||||
GetMediaPostersMetadata,
|
||||
GetMediaPostersMetadataTypedDict,
|
||||
GetMediaPostersRequest,
|
||||
GetMediaPostersRequestTypedDict,
|
||||
GetMediaPostersResponse,
|
||||
GetMediaPostersResponseBody,
|
||||
GetMediaPostersResponseBodyTypedDict,
|
||||
GetMediaPostersResponseTypedDict,
|
||||
)
|
||||
from .get_media_providers import (
|
||||
Action,
|
||||
ActionTypedDict,
|
||||
@@ -1114,6 +1138,18 @@ from .performvoicesearch import (
|
||||
PerformVoiceSearchResponse,
|
||||
PerformVoiceSearchResponseTypedDict,
|
||||
)
|
||||
from .post_media_arts import (
|
||||
PostMediaArtsRequest,
|
||||
PostMediaArtsRequestTypedDict,
|
||||
PostMediaArtsResponse,
|
||||
PostMediaArtsResponseTypedDict,
|
||||
)
|
||||
from .post_media_poster import (
|
||||
PostMediaPosterRequest,
|
||||
PostMediaPosterRequestTypedDict,
|
||||
PostMediaPosterResponse,
|
||||
PostMediaPosterResponseTypedDict,
|
||||
)
|
||||
from .post_users_sign_in_data import (
|
||||
Billing,
|
||||
BillingTypedDict,
|
||||
@@ -1589,6 +1625,16 @@ __all__ = [
|
||||
"GetLibraryItemsUltraBlurColorsTypedDict",
|
||||
"GetLibraryItemsWriter",
|
||||
"GetLibraryItemsWriterTypedDict",
|
||||
"GetMediaArtsMediaContainer",
|
||||
"GetMediaArtsMediaContainerTypedDict",
|
||||
"GetMediaArtsMetadata",
|
||||
"GetMediaArtsMetadataTypedDict",
|
||||
"GetMediaArtsRequest",
|
||||
"GetMediaArtsRequestTypedDict",
|
||||
"GetMediaArtsResponse",
|
||||
"GetMediaArtsResponseBody",
|
||||
"GetMediaArtsResponseBodyTypedDict",
|
||||
"GetMediaArtsResponseTypedDict",
|
||||
"GetMediaMetaDataCountry",
|
||||
"GetMediaMetaDataCountryTypedDict",
|
||||
"GetMediaMetaDataDirector",
|
||||
@@ -1634,6 +1680,16 @@ __all__ = [
|
||||
"GetMediaMetaDataUltraBlurColorsTypedDict",
|
||||
"GetMediaMetaDataWriter",
|
||||
"GetMediaMetaDataWriterTypedDict",
|
||||
"GetMediaPostersMediaContainer",
|
||||
"GetMediaPostersMediaContainerTypedDict",
|
||||
"GetMediaPostersMetadata",
|
||||
"GetMediaPostersMetadataTypedDict",
|
||||
"GetMediaPostersRequest",
|
||||
"GetMediaPostersRequestTypedDict",
|
||||
"GetMediaPostersResponse",
|
||||
"GetMediaPostersResponseBody",
|
||||
"GetMediaPostersResponseBodyTypedDict",
|
||||
"GetMediaPostersResponseTypedDict",
|
||||
"GetMediaProvidersDirectory",
|
||||
"GetMediaProvidersDirectoryTypedDict",
|
||||
"GetMediaProvidersMediaContainer",
|
||||
@@ -2110,6 +2166,14 @@ __all__ = [
|
||||
"PlaylistType",
|
||||
"PlexDevice",
|
||||
"PlexDeviceTypedDict",
|
||||
"PostMediaArtsRequest",
|
||||
"PostMediaArtsRequestTypedDict",
|
||||
"PostMediaArtsResponse",
|
||||
"PostMediaArtsResponseTypedDict",
|
||||
"PostMediaPosterRequest",
|
||||
"PostMediaPosterRequestTypedDict",
|
||||
"PostMediaPosterResponse",
|
||||
"PostMediaPosterResponseTypedDict",
|
||||
"PostUsersSignInDataAuthenticationResponseStatus",
|
||||
"PostUsersSignInDataAuthenticationStatus",
|
||||
"PostUsersSignInDataAuthenticationSubscription",
|
||||
|
||||
120
src/plex_api_client/models/operations/get_media_arts.py
Normal file
120
src/plex_api_client/models/operations/get_media_arts.py
Normal file
@@ -0,0 +1,120 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
import httpx
|
||||
from plex_api_client.types import BaseModel
|
||||
from plex_api_client.utils import FieldMetadata, PathParamMetadata
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetMediaArtsRequestTypedDict(TypedDict):
|
||||
rating_key: int
|
||||
r"""the id of the library item to return the artwork of."""
|
||||
|
||||
|
||||
class GetMediaArtsRequest(BaseModel):
|
||||
rating_key: Annotated[
|
||||
int,
|
||||
pydantic.Field(alias="ratingKey"),
|
||||
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
||||
]
|
||||
r"""the id of the library item to return the artwork of."""
|
||||
|
||||
|
||||
class GetMediaArtsMetadataTypedDict(TypedDict):
|
||||
key: str
|
||||
r"""The URL of the artwork."""
|
||||
rating_key: str
|
||||
r"""The URL of the artwork."""
|
||||
selected: bool
|
||||
r"""Whether this is the selected artwork."""
|
||||
thumb: str
|
||||
r"""The URL of the artwork thumbnail."""
|
||||
provider: NotRequired[str]
|
||||
r"""The provider of the artwork."""
|
||||
|
||||
|
||||
class GetMediaArtsMetadata(BaseModel):
|
||||
key: str
|
||||
r"""The URL of the artwork."""
|
||||
|
||||
rating_key: Annotated[str, pydantic.Field(alias="ratingKey")]
|
||||
r"""The URL of the artwork."""
|
||||
|
||||
selected: bool
|
||||
r"""Whether this is the selected artwork."""
|
||||
|
||||
thumb: str
|
||||
r"""The URL of the artwork thumbnail."""
|
||||
|
||||
provider: Optional[str] = None
|
||||
r"""The provider of the artwork."""
|
||||
|
||||
|
||||
class GetMediaArtsMediaContainerTypedDict(TypedDict):
|
||||
size: int
|
||||
r"""Number of media items returned in this response."""
|
||||
media_tag_version: int
|
||||
r"""The version number for media tags."""
|
||||
media_tag_prefix: str
|
||||
r"""The prefix used for media tag resource paths."""
|
||||
identifier: str
|
||||
r"""An plugin identifier for the media container."""
|
||||
metadata: List[GetMediaArtsMetadataTypedDict]
|
||||
|
||||
|
||||
class GetMediaArtsMediaContainer(BaseModel):
|
||||
size: int
|
||||
r"""Number of media items returned in this response."""
|
||||
|
||||
media_tag_version: Annotated[int, pydantic.Field(alias="mediaTagVersion")]
|
||||
r"""The version number for media tags."""
|
||||
|
||||
media_tag_prefix: Annotated[str, pydantic.Field(alias="mediaTagPrefix")]
|
||||
r"""The prefix used for media tag resource paths."""
|
||||
|
||||
identifier: str
|
||||
r"""An plugin identifier for the media container."""
|
||||
|
||||
metadata: Annotated[List[GetMediaArtsMetadata], pydantic.Field(alias="Metadata")]
|
||||
|
||||
|
||||
class GetMediaArtsResponseBodyTypedDict(TypedDict):
|
||||
r"""The available background artwork for the library item."""
|
||||
|
||||
media_container: NotRequired[GetMediaArtsMediaContainerTypedDict]
|
||||
|
||||
|
||||
class GetMediaArtsResponseBody(BaseModel):
|
||||
r"""The available background artwork for the library item."""
|
||||
|
||||
media_container: Annotated[
|
||||
Optional[GetMediaArtsMediaContainer], pydantic.Field(alias="MediaContainer")
|
||||
] = None
|
||||
|
||||
|
||||
class GetMediaArtsResponseTypedDict(TypedDict):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
object: NotRequired[GetMediaArtsResponseBodyTypedDict]
|
||||
r"""The available background artwork for the library item."""
|
||||
|
||||
|
||||
class GetMediaArtsResponse(BaseModel):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
|
||||
object: Optional[GetMediaArtsResponseBody] = None
|
||||
r"""The available background artwork for the library item."""
|
||||
120
src/plex_api_client/models/operations/get_media_posters.py
Normal file
120
src/plex_api_client/models/operations/get_media_posters.py
Normal file
@@ -0,0 +1,120 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
import httpx
|
||||
from plex_api_client.types import BaseModel
|
||||
from plex_api_client.utils import FieldMetadata, PathParamMetadata
|
||||
import pydantic
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetMediaPostersRequestTypedDict(TypedDict):
|
||||
rating_key: int
|
||||
r"""the id of the library item to return the posters of."""
|
||||
|
||||
|
||||
class GetMediaPostersRequest(BaseModel):
|
||||
rating_key: Annotated[
|
||||
int,
|
||||
pydantic.Field(alias="ratingKey"),
|
||||
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
||||
]
|
||||
r"""the id of the library item to return the posters of."""
|
||||
|
||||
|
||||
class GetMediaPostersMetadataTypedDict(TypedDict):
|
||||
key: str
|
||||
r"""The URL of the poster."""
|
||||
rating_key: str
|
||||
r"""The URL of the poster."""
|
||||
selected: bool
|
||||
r"""Whether this is the selected poster."""
|
||||
thumb: str
|
||||
r"""The URL of the poster thumbnail."""
|
||||
provider: NotRequired[str]
|
||||
r"""The provider of the poster."""
|
||||
|
||||
|
||||
class GetMediaPostersMetadata(BaseModel):
|
||||
key: str
|
||||
r"""The URL of the poster."""
|
||||
|
||||
rating_key: Annotated[str, pydantic.Field(alias="ratingKey")]
|
||||
r"""The URL of the poster."""
|
||||
|
||||
selected: bool
|
||||
r"""Whether this is the selected poster."""
|
||||
|
||||
thumb: str
|
||||
r"""The URL of the poster thumbnail."""
|
||||
|
||||
provider: Optional[str] = None
|
||||
r"""The provider of the poster."""
|
||||
|
||||
|
||||
class GetMediaPostersMediaContainerTypedDict(TypedDict):
|
||||
size: int
|
||||
r"""Number of media items returned in this response."""
|
||||
media_tag_version: int
|
||||
r"""The version number for media tags."""
|
||||
media_tag_prefix: str
|
||||
r"""The prefix used for media tag resource paths."""
|
||||
identifier: str
|
||||
r"""An plugin identifier for the media container."""
|
||||
metadata: List[GetMediaPostersMetadataTypedDict]
|
||||
|
||||
|
||||
class GetMediaPostersMediaContainer(BaseModel):
|
||||
size: int
|
||||
r"""Number of media items returned in this response."""
|
||||
|
||||
media_tag_version: Annotated[int, pydantic.Field(alias="mediaTagVersion")]
|
||||
r"""The version number for media tags."""
|
||||
|
||||
media_tag_prefix: Annotated[str, pydantic.Field(alias="mediaTagPrefix")]
|
||||
r"""The prefix used for media tag resource paths."""
|
||||
|
||||
identifier: str
|
||||
r"""An plugin identifier for the media container."""
|
||||
|
||||
metadata: Annotated[List[GetMediaPostersMetadata], pydantic.Field(alias="Metadata")]
|
||||
|
||||
|
||||
class GetMediaPostersResponseBodyTypedDict(TypedDict):
|
||||
r"""The available posters for the library item."""
|
||||
|
||||
media_container: NotRequired[GetMediaPostersMediaContainerTypedDict]
|
||||
|
||||
|
||||
class GetMediaPostersResponseBody(BaseModel):
|
||||
r"""The available posters for the library item."""
|
||||
|
||||
media_container: Annotated[
|
||||
Optional[GetMediaPostersMediaContainer], pydantic.Field(alias="MediaContainer")
|
||||
] = None
|
||||
|
||||
|
||||
class GetMediaPostersResponseTypedDict(TypedDict):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
object: NotRequired[GetMediaPostersResponseBodyTypedDict]
|
||||
r"""The available posters for the library item."""
|
||||
|
||||
|
||||
class GetMediaPostersResponse(BaseModel):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
|
||||
object: Optional[GetMediaPostersResponseBody] = None
|
||||
r"""The available posters for the library item."""
|
||||
@@ -235,7 +235,7 @@ class PlexDevice(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -382,7 +382,7 @@ class User(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -216,7 +216,7 @@ class GetPinAuthPinContainer(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -209,7 +209,7 @@ class GetTokenByPinIDAuthPinContainer(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -131,7 +131,7 @@ class UserProfile(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -186,7 +186,7 @@ class Services(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -273,7 +273,7 @@ class Subscription(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -356,7 +356,7 @@ class GetTokenDetailsSubscription(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -638,7 +638,7 @@ class GetTokenDetailsUserPlexAccount(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -111,7 +111,7 @@ class Friend(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
65
src/plex_api_client/models/operations/post_media_arts.py
Normal file
65
src/plex_api_client/models/operations/post_media_arts.py
Normal file
@@ -0,0 +1,65 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
import httpx
|
||||
import io
|
||||
from plex_api_client.types import BaseModel
|
||||
from plex_api_client.utils import (
|
||||
FieldMetadata,
|
||||
PathParamMetadata,
|
||||
QueryParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import IO, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class PostMediaArtsRequestTypedDict(TypedDict):
|
||||
rating_key: int
|
||||
r"""the id of the library item to return the posters of."""
|
||||
url: NotRequired[str]
|
||||
r"""The URL of the image, if uploading a remote image"""
|
||||
request_body: NotRequired[Union[bytes, IO[bytes], io.BufferedReader]]
|
||||
r"""The contents of the image, if uploading a local file"""
|
||||
|
||||
|
||||
class PostMediaArtsRequest(BaseModel):
|
||||
rating_key: Annotated[
|
||||
int,
|
||||
pydantic.Field(alias="ratingKey"),
|
||||
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
||||
]
|
||||
r"""the id of the library item to return the posters of."""
|
||||
|
||||
url: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""The URL of the image, if uploading a remote image"""
|
||||
|
||||
request_body: Annotated[
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
FieldMetadata(request=RequestMetadata(media_type="image/*")),
|
||||
] = None
|
||||
r"""The contents of the image, if uploading a local file"""
|
||||
|
||||
|
||||
class PostMediaArtsResponseTypedDict(TypedDict):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
|
||||
|
||||
class PostMediaArtsResponse(BaseModel):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
65
src/plex_api_client/models/operations/post_media_poster.py
Normal file
65
src/plex_api_client/models/operations/post_media_poster.py
Normal file
@@ -0,0 +1,65 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
import httpx
|
||||
import io
|
||||
from plex_api_client.types import BaseModel
|
||||
from plex_api_client.utils import (
|
||||
FieldMetadata,
|
||||
PathParamMetadata,
|
||||
QueryParamMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from typing import IO, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class PostMediaPosterRequestTypedDict(TypedDict):
|
||||
rating_key: int
|
||||
r"""the id of the library item to return the posters of."""
|
||||
url: NotRequired[str]
|
||||
r"""The URL of the image, if uploading a remote image"""
|
||||
request_body: NotRequired[Union[bytes, IO[bytes], io.BufferedReader]]
|
||||
r"""The contents of the image, if uploading a local file"""
|
||||
|
||||
|
||||
class PostMediaPosterRequest(BaseModel):
|
||||
rating_key: Annotated[
|
||||
int,
|
||||
pydantic.Field(alias="ratingKey"),
|
||||
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
||||
]
|
||||
r"""the id of the library item to return the posters of."""
|
||||
|
||||
url: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""The URL of the image, if uploading a remote image"""
|
||||
|
||||
request_body: Annotated[
|
||||
Optional[Union[bytes, IO[bytes], io.BufferedReader]],
|
||||
FieldMetadata(request=RequestMetadata(media_type="image/*")),
|
||||
] = None
|
||||
r"""The contents of the image, if uploading a local file"""
|
||||
|
||||
|
||||
class PostMediaPosterResponseTypedDict(TypedDict):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
|
||||
|
||||
class PostMediaPosterResponse(BaseModel):
|
||||
content_type: str
|
||||
r"""HTTP response content type for this operation"""
|
||||
|
||||
status_code: int
|
||||
r"""HTTP response status code for this operation"""
|
||||
|
||||
raw_response: httpx.Response
|
||||
r"""Raw HTTP response; suitable for custom response parsing"""
|
||||
@@ -225,7 +225,7 @@ class PostUsersSignInDataUserProfile(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -280,7 +280,7 @@ class PostUsersSignInDataServices(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -367,7 +367,7 @@ class PostUsersSignInDataSubscription(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -450,7 +450,7 @@ class PostUsersSignInDataAuthenticationSubscription(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -505,7 +505,7 @@ class Billing(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -597,7 +597,7 @@ class PastSubscription(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
@@ -897,7 +897,7 @@ class PostUsersSignInDataUserPlexAccount(BaseModel):
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in self.model_fields.items():
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
@@ -1,9 +1,49 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
import enum
|
||||
|
||||
import sys
|
||||
|
||||
class OpenEnumMeta(enum.EnumMeta):
|
||||
# The __call__ method `boundary` kwarg was added in 3.11 and must be present
|
||||
# for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622
|
||||
# pylint: disable=unexpected-keyword-arg
|
||||
# The __call__ method `values` varg must be named for pyright.
|
||||
# pylint: disable=keyword-arg-before-vararg
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def __call__(
|
||||
cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None
|
||||
):
|
||||
# The `type` kwarg also happens to be a built-in that pylint flags as
|
||||
# redeclared. Safe to ignore this lint rule with this scope.
|
||||
# pylint: disable=redefined-builtin
|
||||
|
||||
if names is not None:
|
||||
return super().__call__(
|
||||
value,
|
||||
names=names,
|
||||
*values,
|
||||
module=module,
|
||||
qualname=qualname,
|
||||
type=type,
|
||||
start=start,
|
||||
boundary=boundary,
|
||||
)
|
||||
|
||||
try:
|
||||
return super().__call__(
|
||||
value,
|
||||
names=names, # pyright: ignore[reportArgumentType]
|
||||
*values,
|
||||
module=module,
|
||||
qualname=qualname,
|
||||
type=type,
|
||||
start=start,
|
||||
boundary=boundary,
|
||||
)
|
||||
except ValueError:
|
||||
return value
|
||||
else:
|
||||
def __call__(
|
||||
cls, value, names=None, *, module=None, qualname=None, type=None, start=1
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user