## Python SDK Changes:

* `plex_api.library_playlists.add_playlist_items()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_metadata_hubs()`: 
  *  `request.only_transient` **Changed**
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_collections.move_collection_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_collections.delete_collection_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_collections.add_collection_items()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.content.get_sonically_similar()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.butler.stop_task()`:  `request` **Changed** **Breaking** ⚠️
* `plex_api.butler.start_task()`:  `request` **Changed** **Breaking** ⚠️
* `plex_api.content.get_sonic_path()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.download_queue.get_item_decision()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_all_hubs()`: 
  *  `request.only_transient` **Changed**
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_continue_watching()`:  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_promoted_hubs()`:  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.content.get_all_leaves()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_postplay_hubs()`: 
  *  `request.only_transient` **Changed**
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_related_hubs()`: 
  *  `request.only_transient` **Changed**
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.hubs.get_section_hubs()`: 
  *  `request.only_transient` **Changed**
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.content.list_content()`: 
  *  `request` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.content.get_albums()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.search.search_hubs()`:  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.search.voice_search_hubs()`: 
  *  `request.type` **Changed** **Breaking** ⚠️
  *  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_library_items()`: 
  *  `request.media_query` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.ingest_transient_item()`: 
  *  `request` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_library_matches()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.content.get_metadata_item()`: 
  *  `request` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_sections()`:  `response.media_container.directory.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.add_section()`: 
  *  `request` **Changed**
  *  `response.media_container.directory.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_tags()`: 
  *  `request.type` **Changed** **Breaking** ⚠️
* `plex_api.content.get_collection_items()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_all_item_leaves()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.status.list_sessions()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.move_play_queue_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_extras()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.delete_play_queue_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.unshuffle()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.list_matches()`: 
  *  `request.manual` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.list_sonically_similar()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.reset_play_queue()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_related_items()`:  `response.media_container.hub.[].metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.list_similar()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.clear_play_queue()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_item_tree()`:  `response.media_container.metadata_item.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.add_to_play_queue()`: 
  *  `request.next` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.get_play_queue()`: 
  *  `request` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.move_playlist_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_person()`:  `response.media_container.directory.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.list_person_media()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.get_playlist_generator_items()`:  `response.media_container.metadata` **Changed** **Breaking** ⚠️
* `plex_api.library.get_library_details()`: 
  *  `request.include_details` **Changed**
  *  `response.media_container.directory.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.modify_playlist_generator()`: 
  *  `request.item` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.autocomplete()`: 
  *  `request.media_query` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_collections()`: 
  *  `request.media_query` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.get_common()`: 
  *  `request.media_query` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.delete_playlist_item()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.clear_playlist_items()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.play_queue.shuffle()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library_playlists.create_playlist()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.playlist.get_playlist_items()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.playlist.get_playlist()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.collections.create_collection()`: 
  *  `request.type` **Changed** **Breaking** ⚠️
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.dv_rs.tune_channel()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.live_tv.get_sessions()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.live_tv.get_live_tv_session()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.playlist.list_playlists()`:  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.get_all_subscriptions()`: 
  *  `request` **Changed**
  *  `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.create_subscription()`:  `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.get_scheduled_recordings()`:  `response.media_container.media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.get_template()`:  `response.media_container.subscription_template.[].media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.get_subscription()`: 
  *  `request` **Changed**
  *  `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.edit_subscription_preferences()`:  `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.subscriptions.reorder_subscription()`:  `response.media_container.media_subscription.[].media_grab_operation.[].metadata` **Changed** **Breaking** ⚠️
* `plex_api.transcoder.make_decision()`: 
  *  `request` **Changed**
  *  `response.media_container.metadata.[]` **Changed** **Breaking** ⚠️
* `plex_api.library.refresh_items_metadata()`: 
  *  `request.mark_updated` **Changed**
* `plex_api.authentication.post-users-sign-in-data()`: **Added**
* `plex_api.transcoder.start_transcode_session()`:  `request` **Changed**
* `plex_api.devices.modify_device()`: 
  *  `request.enabled` **Changed**
* `plex_api.library.get_media_part()`: 
  *  `request.download` **Changed**
* `plex_api.library.detect_intros()`: 
  *  `request.force` **Changed**
* `plex_api.library.refresh_section()`: 
  *  `request.force` **Changed**
* `plex_api.library_playlists.upload_playlist()`: 
  *  `request.force` **Changed**
* `plex_api.library.delete_media_item()`: 
  *  `request.proxy` **Changed**
* `plex_api.authentication.get_token_details()`: **Added**
* `plex_api.library.get_first_characters()`: 
  *  `request.media_query` **Changed**
* `plex_api.library.update_items()`: 
  *  `request.field.locked` **Changed**
* `plex_api.library.delete_library_section()`: 
  *  `request.async` **Changed**
* `plex_api.library.set_stream_selection()`: 
  *  `request.all_parts` **Changed**
* `plex_api.play_queue.create_play_queue()`:  `request` **Changed**
* `plex_api.library.get_augmentation_status()`: 
  *  `request.wait` **Changed**
* `plex_api.library.detect_voice_activity()`:  `request` **Changed**
* `plex_api.transcoder.transcode_image()`:  `request` **Changed**
* `plex_api.transcoder.transcode_subtitles()`:  `request` **Changed**
* `plex_api.library.add_subtitles()`:  `request` **Changed**
* `plex_api.library.get_stream()`: 
  *  `request.auto_adjust_subtitle` **Changed**
* `plex_api.library.start_bif_generation()`: 
  *  `request.force` **Changed**
* `plex_api.library.detect_credits()`:  `request` **Changed**
* `plex_api.ultra_blur.get_image()`: 
  *  `request.noise` **Changed**
* `plex_api.library.generate_thumbs()`: 
  *  `request.force` **Changed**
* `plex_api.updater.apply_updates()`:  `request` **Changed**
* `plex_api.updater.check_updates()`: 
  *  `request.download` **Changed**
* `plex_api.library.delete_metadata_item()`: 
  *  `request.proxy` **Changed**
* `plex_api.library.optimize_database()`: 
  *  `request.async` **Changed**
* `plex_api.hubs.update_hub_visibility()`:  `request` **Changed**
* `plex_api.hubs.create_custom_hub()`:  `request` **Changed**
* `plex_api.library.get_section_image()`: 
  *  `request.media_query` **Changed**
* `plex_api.download_queue.add_download_queue_items()`:  `request` **Changed**
* `plex_api.timeline.report()`:  `request` **Changed**
* `plex_api.general.get_source_connection_information()`: 
  *  `request.refresh` **Changed**
* `plex_api.plex.get-server-resources()`: **Added**
* `plex_api.users.get-users()`: **Added**
This commit is contained in:
speakeasybot
2025-12-01 00:03:55 +00:00
parent 1d16fd5839
commit d0db038e53
280 changed files with 10483 additions and 2036 deletions

View File

@@ -0,0 +1,126 @@
# Authentication
(*authentication*)
## Overview
### Available Operations
* [get_token_details](#get_token_details) - Get Token Details
* [post_users_sign_in_data](#post_users_sign_in_data) - Get User Sign In Data
## get_token_details
Get the User data from the provided X-Plex-Token
### Example Usage
<!-- UsageSnippet language="python" operationID="getTokenDetails" method="get" path="/user" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
with PlexAPI(
accepts=components.Accepts.APPLICATION_XML,
client_identifier="abc123",
product="Plex for Roku",
version="2.4.1",
platform="Roku",
platform_version="4.3 build 1057",
device="Roku 3",
model="4200X",
device_vendor="Roku",
device_name="Living Room TV",
marketplace="googlePlay",
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.authentication.get_token_details(request={})
assert res.user_plex_account is not None
# Handle response
print(res.user_plex_account)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.GetTokenDetailsRequest](../../models/operations/gettokendetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[operations.GetTokenDetailsResponse](../../models/operations/gettokendetailsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
| errors.GetTokenDetailsBadRequest | 400 | application/json |
| errors.GetTokenDetailsUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |
## post_users_sign_in_data
Sign in user with username and password and return user data with Plex authentication token
### Example Usage
<!-- UsageSnippet language="python" operationID="post-users-sign-in-data" method="post" path="/users/signin" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
with PlexAPI(
accepts=components.Accepts.APPLICATION_XML,
client_identifier="3381b62b-9ab7-4e37-827b-203e9809eb58",
product="Plex for Roku",
version="2.4.1",
platform="Roku",
platform_version="4.3 build 1057",
device="Roku 3",
model="4200X",
device_vendor="Roku",
device_name="Living Room TV",
marketplace="googlePlay",
) as plex_api:
res = plex_api.authentication.post_users_sign_in_data(request={
"request_body": {
"login": "username@email.com",
"password": "password123",
"verification_code": "123456",
},
})
assert res.user_plex_account is not None
# Handle response
print(res.user_plex_account)
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `request` | [operations.PostUsersSignInDataRequest](../../models/operations/postuserssignindatarequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[operations.PostUsersSignInDataResponse](../../models/operations/postuserssignindataresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
| errors.PostUsersSignInDataBadRequest | 400 | application/json |
| errors.PostUsersSignInDataUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

View File

@@ -147,7 +147,7 @@ This endpoint will stop a currently running task by name, or remove it from the
### Example Usage
<!-- UsageSnippet language="python" operationID="stopTask" method="delete" path="/butler/{task}" -->
<!-- UsageSnippet language="python" operationID="stopTask" method="delete" path="/butler/{butlerTask}" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations
@@ -169,7 +169,7 @@ with PlexAPI(
) as plex_api:
res = plex_api.butler.stop_task(request={
"task": operations.Task.CLEAN_OLD_BUNDLES,
"butler_task": operations.ButlerTask.CLEAN_OLD_BUNDLES,
})
assert res is not None
@@ -203,7 +203,7 @@ This endpoint will attempt to start a specific Butler task by name.
### Example Usage
<!-- UsageSnippet language="python" operationID="startTask" method="post" path="/butler/{task}" -->
<!-- UsageSnippet language="python" operationID="startTask" method="post" path="/butler/{butlerTask}" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations
@@ -225,7 +225,7 @@ with PlexAPI(
) as plex_api:
res = plex_api.butler.start_task(request={
"task": operations.PathParamTask.REFRESH_LOCAL_MEDIA,
"butler_task": operations.PathParamButlerTask.REFRESH_LOCAL_MEDIA,
})
assert res is not None

View File

@@ -38,6 +38,7 @@ with PlexAPI(
res = plex_api.collections.create_collection(request={
"section_id": "<id>",
"type": components.MediaType.TV_SHOW,
})
assert res.media_container_with_metadata is not None

View File

@@ -105,14 +105,14 @@ with PlexAPI(
res = plex_api.content.get_metadata_item(request=operations.GetMetadataItemRequest(
ids=[],
async_check_files=components.BoolInt.ONE,
async_refresh_local_media_agent=components.BoolInt.ONE,
async_refresh_analysis=components.BoolInt.ONE,
check_files=components.BoolInt.ONE,
skip_refresh=components.BoolInt.ONE,
check_file_availability=components.BoolInt.ONE,
async_augment_metadata=components.BoolInt.ONE,
augment_count=components.BoolInt.ONE,
async_check_files=components.BoolInt.TRUE,
async_refresh_local_media_agent=components.BoolInt.TRUE,
async_refresh_analysis=components.BoolInt.TRUE,
check_files=components.BoolInt.TRUE,
skip_refresh=components.BoolInt.TRUE,
check_file_availability=components.BoolInt.TRUE,
async_augment_metadata=components.BoolInt.TRUE,
augment_count=components.BoolInt.TRUE,
))
assert res.media_container_with_metadata is not None
@@ -203,7 +203,7 @@ Get the items in a section, potentially filtering them
<!-- UsageSnippet language="python" operationID="listContent" method="get" path="/library/sections/{sectionId}/all" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
from plex_api_client.models import components, operations
with PlexAPI(
@@ -221,9 +221,16 @@ with PlexAPI(
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.content.list_content(request={
"section_id": "<id>",
})
res = plex_api.content.list_content(request=operations.ListContentRequest(
media_query=components.MediaQuery(
type=components.MediaType.EPISODE,
source_type=2,
sort="duration:desc,index",
),
include_meta=components.BoolInt.TRUE,
include_guids=components.BoolInt.TRUE,
section_id="<id>",
))
assert res.media_container_with_metadata is not None

View File

@@ -384,7 +384,7 @@ with PlexAPI(
res = plex_api.devices.modify_device(request={
"device_id": 879135,
"enabled": components.BoolInt.ONE,
"enabled": components.BoolInt.TRUE,
})
assert res.object is not None

View File

@@ -157,13 +157,13 @@ with PlexAPI(
advanced_subtitles=components.AdvancedSubtitles.BURN,
audio_boost=50,
audio_channel_count=5,
auto_adjust_quality=components.BoolInt.ONE,
auto_adjust_subtitle=components.BoolInt.ONE,
direct_play=components.BoolInt.ONE,
direct_stream=components.BoolInt.ONE,
direct_stream_audio=components.BoolInt.ONE,
disable_resolution_rotation=components.BoolInt.ONE,
has_mde=components.BoolInt.ONE,
auto_adjust_quality=components.BoolInt.TRUE,
auto_adjust_subtitle=components.BoolInt.TRUE,
direct_play=components.BoolInt.TRUE,
direct_stream=components.BoolInt.TRUE,
direct_stream_audio=components.BoolInt.TRUE,
disable_resolution_rotation=components.BoolInt.TRUE,
has_mde=components.BoolInt.TRUE,
location=components.Location.WAN,
media_buffer_size=102400,
media_index=0,

View File

@@ -132,7 +132,7 @@ with PlexAPI(
res = plex_api.general.get_source_connection_information(request={
"source": "server://client-identifier",
"refresh": components.BoolInt.ONE,
"refresh": components.BoolInt.TRUE,
})
assert res.object is not None

View File

@@ -50,7 +50,7 @@ with PlexAPI(
) as plex_api:
res = plex_api.hubs.get_all_hubs(request={
"only_transient": components.BoolInt.ONE,
"only_transient": components.BoolInt.TRUE,
})
assert res.object is not None
@@ -271,7 +271,7 @@ with PlexAPI(
res = plex_api.hubs.get_metadata_hubs(request={
"metadata_id": 605482,
"only_transient": components.BoolInt.ONE,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
@@ -327,7 +327,7 @@ with PlexAPI(
res = plex_api.hubs.get_postplay_hubs(request={
"metadata_id": 441419,
"only_transient": components.BoolInt.ONE,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
@@ -383,7 +383,7 @@ with PlexAPI(
res = plex_api.hubs.get_related_hubs(request={
"metadata_id": 8858,
"only_transient": components.BoolInt.ONE,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
@@ -439,7 +439,7 @@ with PlexAPI(
res = plex_api.hubs.get_section_hubs(request={
"section_id": 336924,
"only_transient": components.BoolInt.ONE,
"only_transient": components.BoolInt.TRUE,
})
assert res.object is not None
@@ -606,9 +606,9 @@ with PlexAPI(
res = plex_api.hubs.create_custom_hub(request=operations.CreateCustomHubRequest(
section_id=869922,
metadata_item_id=703843,
promoted_to_recommended=components.BoolInt.ONE,
promoted_to_own_home=components.BoolInt.ONE,
promoted_to_shared_home=components.BoolInt.ONE,
promoted_to_recommended=components.BoolInt.TRUE,
promoted_to_own_home=components.BoolInt.TRUE,
promoted_to_shared_home=components.BoolInt.TRUE,
))
assert res is not None
@@ -777,9 +777,9 @@ with PlexAPI(
res = plex_api.hubs.update_hub_visibility(request=operations.UpdateHubVisibilityRequest(
section_id=341650,
identifier="<value>",
promoted_to_recommended=components.BoolInt.ONE,
promoted_to_own_home=components.BoolInt.ONE,
promoted_to_shared_home=components.BoolInt.ONE,
promoted_to_recommended=components.BoolInt.TRUE,
promoted_to_own_home=components.BoolInt.TRUE,
promoted_to_shared_home=components.BoolInt.TRUE,
))
assert res is not None

View File

@@ -114,7 +114,13 @@ with PlexAPI(
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_library_items(request={})
res = plex_api.library.get_library_items(request={
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res.media_container_with_metadata is not None
@@ -251,8 +257,8 @@ with PlexAPI(
res = plex_api.library.ingest_transient_item(request=operations.IngestTransientItemRequest(
url="file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv",
virtual_file_path="/Avatar.mkv",
compute_hashes=components.BoolInt.ONE,
ingest_non_matches=components.BoolInt.ONE,
compute_hashes=components.BoolInt.TRUE,
ingest_non_matches=components.BoolInt.TRUE,
))
assert res.media_container_with_metadata is not None
@@ -311,9 +317,10 @@ with PlexAPI(
) as plex_api:
res = plex_api.library.get_library_matches(request=operations.GetLibraryMatchesRequest(
include_full_metadata=components.BoolInt.ONE,
include_ancestor_metadata=components.BoolInt.ONE,
include_alternate_metadata_sources=components.BoolInt.ONE,
type=components.MediaType.TV_SHOW,
include_full_metadata=components.BoolInt.TRUE,
include_ancestor_metadata=components.BoolInt.TRUE,
include_alternate_metadata_sources=components.BoolInt.TRUE,
))
assert res.media_container_with_metadata is not None
@@ -368,7 +375,7 @@ with PlexAPI(
) as plex_api:
res = plex_api.library.optimize_database(request={
"async_": components.BoolInt.ONE,
"async_": components.BoolInt.TRUE,
})
assert res is not None
@@ -534,8 +541,8 @@ with PlexAPI(
"O:\fatboy\\Media\\My Music",
],
prefs=operations.QueryParamPrefs(),
relative=components.BoolInt.ONE,
import_fromi_tunes=components.BoolInt.ONE,
relative=components.BoolInt.TRUE,
import_fromi_tunes=components.BoolInt.TRUE,
))
assert res.slash_get_responses_200 is not None
@@ -737,7 +744,9 @@ with PlexAPI(
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.library.get_tags(request={})
res = plex_api.library.get_tags(request={
"type": components.MediaType.TV_SHOW,
})
assert res.object is not None
@@ -792,7 +801,7 @@ with PlexAPI(
res = plex_api.library.delete_metadata_item(request={
"ids": "<value>",
"proxy": components.BoolInt.ONE,
"proxy": components.BoolInt.TRUE,
})
assert res is not None
@@ -1071,7 +1080,7 @@ with PlexAPI(
res = plex_api.library.generate_thumbs(request={
"ids": "<value>",
"force": components.BoolInt.ONE,
"force": components.BoolInt.TRUE,
})
assert res is not None
@@ -1127,8 +1136,8 @@ with PlexAPI(
res = plex_api.library.detect_credits(request=operations.DetectCreditsRequest(
ids="<value>",
force=components.BoolInt.ONE,
manual=components.BoolInt.ONE,
force=components.BoolInt.TRUE,
manual=components.BoolInt.TRUE,
))
assert res is not None
@@ -1350,7 +1359,7 @@ with PlexAPI(
res = plex_api.library.start_bif_generation(request={
"ids": "<value>",
"force": components.BoolInt.ONE,
"force": components.BoolInt.TRUE,
})
assert res is not None
@@ -1406,7 +1415,7 @@ with PlexAPI(
res = plex_api.library.detect_intros(request={
"ids": "<value>",
"force": components.BoolInt.ONE,
"force": components.BoolInt.TRUE,
})
assert res is not None
@@ -1575,7 +1584,7 @@ with PlexAPI(
res = plex_api.library.list_matches(request={
"ids": "<value>",
"manual": components.BoolInt.ONE,
"manual": components.BoolInt.TRUE,
})
assert res.media_container_with_metadata is not None
@@ -1796,7 +1805,7 @@ with PlexAPI(
res = plex_api.library.refresh_items_metadata(request={
"ids": "<value>",
"mark_updated": components.BoolInt.ONE,
"mark_updated": components.BoolInt.TRUE,
})
assert res is not None
@@ -2017,8 +2026,8 @@ with PlexAPI(
res = plex_api.library.add_subtitles(request=operations.AddSubtitlesRequest(
ids="<value>",
forced=components.BoolInt.ONE,
hearing_impaired=components.BoolInt.ONE,
forced=components.BoolInt.TRUE,
hearing_impaired=components.BoolInt.TRUE,
))
assert res is not None
@@ -2239,8 +2248,8 @@ with PlexAPI(
res = plex_api.library.detect_voice_activity(request=operations.DetectVoiceActivityRequest(
ids="<value>",
force=components.BoolInt.ONE,
manual=components.BoolInt.ONE,
force=components.BoolInt.TRUE,
manual=components.BoolInt.TRUE,
))
assert res is not None
@@ -2296,7 +2305,7 @@ with PlexAPI(
res = plex_api.library.get_augmentation_status(request={
"augmentation_id": "<id>",
"wait": components.BoolInt.ONE,
"wait": components.BoolInt.TRUE,
})
assert res is not None
@@ -2352,7 +2361,7 @@ with PlexAPI(
res = plex_api.library.set_stream_selection(request={
"part_id": 360489,
"all_parts": components.BoolInt.ONE,
"all_parts": components.BoolInt.TRUE,
})
assert res is not None
@@ -2518,7 +2527,7 @@ with PlexAPI(
res = plex_api.library.delete_library_section(request={
"section_id": "<id>",
"async_": components.BoolInt.ONE,
"async_": components.BoolInt.TRUE,
})
assert res is not None
@@ -2574,7 +2583,7 @@ with PlexAPI(
res = plex_api.library.get_library_details(request={
"section_id": "<id>",
"include_details": components.BoolInt.ONE,
"include_details": components.BoolInt.TRUE,
})
assert res.object is not None
@@ -2735,7 +2744,7 @@ with PlexAPI(
res = plex_api.library.update_items(request={
"section_id": "<id>",
"field_locked": components.BoolInt.ONE,
"field_locked": components.BoolInt.TRUE,
})
assert res is not None
@@ -2847,6 +2856,11 @@ with PlexAPI(
res = plex_api.library.autocomplete(request={
"section_id": 942007,
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res.media_container_with_metadata is not None
@@ -2902,6 +2916,11 @@ with PlexAPI(
res = plex_api.library.get_collections(request={
"section_id": 348838,
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res.media_container_with_metadata is not None
@@ -2958,6 +2977,11 @@ with PlexAPI(
res = plex_api.library.get_common(request={
"section_id": 298154,
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res.media_container_with_metadata is not None
@@ -3123,6 +3147,11 @@ with PlexAPI(
res = plex_api.library.get_first_characters(request={
"section_id": 3947,
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res.object is not None
@@ -3454,7 +3483,7 @@ with PlexAPI(
res = plex_api.library.refresh_section(request={
"section_id": 450300,
"force": components.BoolInt.ONE,
"force": components.BoolInt.TRUE,
})
assert res is not None
@@ -3961,7 +3990,7 @@ with PlexAPI(
res = plex_api.library.delete_media_item(request={
"ids": "<value>",
"media_item": "<value>",
"proxy": components.BoolInt.ONE,
"proxy": components.BoolInt.TRUE,
})
assert res is not None
@@ -4130,6 +4159,11 @@ with PlexAPI(
res = plex_api.library.get_section_image(request={
"section_id": 925611,
"updated_at": 117413,
"media_query": {
"type": components.MediaType.EPISODE,
"source_type": 2,
"sort": "duration:desc,index",
},
})
assert res is not None
@@ -4242,7 +4276,7 @@ with PlexAPI(
res = plex_api.library.get_stream(request={
"stream_id": 314506,
"ext": "<value>",
"auto_adjust_subtitle": components.BoolInt.ONE,
"auto_adjust_subtitle": components.BoolInt.TRUE,
})
assert res is not None
@@ -4416,7 +4450,7 @@ with PlexAPI(
"part_id": 877105,
"changestamp": 970622,
"filename": "example.file",
"download": components.BoolInt.ONE,
"download": components.BoolInt.TRUE,
})
assert res is not None

View File

@@ -105,7 +105,7 @@ with PlexAPI(
res = plex_api.library_playlists.upload_playlist(request={
"path": "/home/barkley/playlist.m3u",
"force": components.BoolInt.ONE,
"force": components.BoolInt.TRUE,
})
assert res is not None
@@ -556,7 +556,6 @@ with PlexAPI(
"location_id": -1,
"policy": {
"scope": operations.QueryParamScope.ALL,
"unwatched": components.BoolInt.ZERO,
},
"target": "",
"target_tag_id": 1,

View File

@@ -52,11 +52,11 @@ with PlexAPI(
res = plex_api.play_queue.create_play_queue(request=operations.CreatePlayQueueRequest(
type=operations.Type.AUDIO,
shuffle=components.BoolInt.ONE,
repeat=components.BoolInt.ONE,
continuous=components.BoolInt.ONE,
recursive=components.BoolInt.ONE,
on_deck=components.BoolInt.ONE,
shuffle=components.BoolInt.TRUE,
repeat=components.BoolInt.TRUE,
continuous=components.BoolInt.TRUE,
recursive=components.BoolInt.TRUE,
on_deck=components.BoolInt.TRUE,
))
assert res.object is not None
@@ -112,9 +112,9 @@ with PlexAPI(
res = plex_api.play_queue.get_play_queue(request=operations.GetPlayQueueRequest(
play_queue_id=210646,
own=components.BoolInt.ONE,
include_before=components.BoolInt.ONE,
include_after=components.BoolInt.ONE,
own=components.BoolInt.TRUE,
include_before=components.BoolInt.TRUE,
include_after=components.BoolInt.TRUE,
))
assert res.media_container_with_playlist_metadata is not None
@@ -170,7 +170,7 @@ with PlexAPI(
res = plex_api.play_queue.add_to_play_queue(request={
"play_queue_id": 919248,
"next": components.BoolInt.ONE,
"next": components.BoolInt.TRUE,
})
assert res.media_container_with_playlist_metadata is not None

58
docs/sdks/plex/README.md Normal file
View File

@@ -0,0 +1,58 @@
# Plex
(*plex*)
## Overview
### Available Operations
* [get_server_resources](#get_server_resources) - Get Server Resources
## get_server_resources
Get Plex server access tokens and server connections
### Example Usage
<!-- UsageSnippet language="python" operationID="get-server-resources" method="get" path="/resources" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations
with PlexAPI(
accepts=components.Accepts.APPLICATION_XML,
client_identifier="3381b62b-9ab7-4e37-827b-203e9809eb58",
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.plex.get_server_resources(request={
"include_https": operations.IncludeHTTPS.TRUE,
"include_relay": operations.IncludeRelay.TRUE,
"include_i_pv6": operations.IncludeIPv6.TRUE,
})
assert res.plex_devices is not None
# Handle response
print(res.plex_devices)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `request` | [operations.GetServerResourcesRequest](../../models/operations/getserverresourcesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[operations.GetServerResourcesResponse](../../models/operations/getserverresourcesresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| ------------------------------------- | ------------------------------------- | ------------------------------------- |
| errors.GetServerResourcesUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

View File

@@ -114,6 +114,7 @@ with PlexAPI(
res = plex_api.search.voice_search_hubs(request={
"query": "<value>",
"type": components.MediaType.TV_SHOW,
})
assert res.object is not None

View File

@@ -47,8 +47,8 @@ with PlexAPI(
) as plex_api:
res = plex_api.subscriptions.get_all_subscriptions(request=operations.GetAllSubscriptionsRequest(
include_grabs=components.BoolInt.ONE,
include_storage=components.BoolInt.ONE,
include_grabs=components.BoolInt.TRUE,
include_storage=components.BoolInt.TRUE,
))
assert res.media_container_with_subscription is not None
@@ -410,8 +410,8 @@ with PlexAPI(
res = plex_api.subscriptions.get_subscription(request=operations.GetSubscriptionRequest(
subscription_id=186713,
include_grabs=components.BoolInt.ONE,
include_storage=components.BoolInt.ONE,
include_grabs=components.BoolInt.TRUE,
include_storage=components.BoolInt.TRUE,
))
assert res.media_container_with_subscription is not None

View File

@@ -103,9 +103,9 @@ with PlexAPI(
play_queue_item_id="123",
time=0,
duration=10000,
continuing=components.BoolInt.ONE,
continuing=components.BoolInt.TRUE,
updated=14200000,
offline=components.BoolInt.ONE,
offline=components.BoolInt.TRUE,
time_to_first_frame=1000,
time_stalled=1000,
bandwidth=100,

View File

@@ -43,9 +43,9 @@ with PlexAPI(
res = plex_api.transcoder.transcode_image(request=operations.TranscodeImageRequest(
url="/library/metadata/265/thumb/1715112705",
background="#ff5522",
upscale=components.BoolInt.ONE,
min_size=components.BoolInt.ONE,
rotate=components.BoolInt.ONE,
upscale=components.BoolInt.TRUE,
min_size=components.BoolInt.TRUE,
rotate=components.BoolInt.TRUE,
blend_color="#ff5522",
))
@@ -105,13 +105,13 @@ with PlexAPI(
advanced_subtitles=components.AdvancedSubtitles.BURN,
audio_boost=50,
audio_channel_count=5,
auto_adjust_quality=components.BoolInt.ONE,
auto_adjust_subtitle=components.BoolInt.ONE,
direct_play=components.BoolInt.ONE,
direct_stream=components.BoolInt.ONE,
direct_stream_audio=components.BoolInt.ONE,
disable_resolution_rotation=components.BoolInt.ONE,
has_mde=components.BoolInt.ONE,
auto_adjust_quality=components.BoolInt.TRUE,
auto_adjust_subtitle=components.BoolInt.TRUE,
direct_play=components.BoolInt.TRUE,
direct_stream=components.BoolInt.TRUE,
direct_stream_audio=components.BoolInt.TRUE,
disable_resolution_rotation=components.BoolInt.TRUE,
has_mde=components.BoolInt.TRUE,
location=operations.Location.WAN,
media_buffer_size=102400,
media_index=0,
@@ -242,13 +242,13 @@ with PlexAPI(
advanced_subtitles=components.AdvancedSubtitles.BURN,
audio_boost=50,
audio_channel_count=5,
auto_adjust_quality=components.BoolInt.ONE,
auto_adjust_subtitle=components.BoolInt.ONE,
direct_play=components.BoolInt.ONE,
direct_stream=components.BoolInt.ONE,
direct_stream_audio=components.BoolInt.ONE,
disable_resolution_rotation=components.BoolInt.ONE,
has_mde=components.BoolInt.ONE,
auto_adjust_quality=components.BoolInt.TRUE,
auto_adjust_subtitle=components.BoolInt.TRUE,
direct_play=components.BoolInt.TRUE,
direct_stream=components.BoolInt.TRUE,
direct_stream_audio=components.BoolInt.TRUE,
disable_resolution_rotation=components.BoolInt.TRUE,
has_mde=components.BoolInt.TRUE,
location=operations.QueryParamLocation.WAN,
media_buffer_size=102400,
media_index=0,
@@ -325,13 +325,13 @@ with PlexAPI(
advanced_subtitles=components.AdvancedSubtitles.BURN,
audio_boost=50,
audio_channel_count=5,
auto_adjust_quality=components.BoolInt.ONE,
auto_adjust_subtitle=components.BoolInt.ONE,
direct_play=components.BoolInt.ONE,
direct_stream=components.BoolInt.ONE,
direct_stream_audio=components.BoolInt.ONE,
disable_resolution_rotation=components.BoolInt.ONE,
has_mde=components.BoolInt.ONE,
auto_adjust_quality=components.BoolInt.TRUE,
auto_adjust_subtitle=components.BoolInt.TRUE,
direct_play=components.BoolInt.TRUE,
direct_stream=components.BoolInt.TRUE,
direct_stream_audio=components.BoolInt.TRUE,
disable_resolution_rotation=components.BoolInt.TRUE,
has_mde=components.BoolInt.TRUE,
location=operations.StartTranscodeSessionQueryParamLocation.WAN,
media_buffer_size=102400,
media_index=0,

View File

@@ -99,7 +99,7 @@ with PlexAPI(
"bottom_left": "1c425d",
"width": 1920,
"height": 1080,
"noise": components.BoolInt.ONE,
"noise": components.BoolInt.TRUE,
})
assert res.response_stream is not None

View File

@@ -41,8 +41,8 @@ with PlexAPI(
) as plex_api:
res = plex_api.updater.apply_updates(request=operations.ApplyUpdatesRequest(
tonight=components.BoolInt.ONE,
skip=components.BoolInt.ONE,
tonight=components.BoolInt.TRUE,
skip=components.BoolInt.TRUE,
))
assert res is not None
@@ -97,7 +97,7 @@ with PlexAPI(
) as plex_api:
res = plex_api.updater.check_updates(request={
"download": components.BoolInt.ONE,
"download": components.BoolInt.TRUE,
})
assert res is not None

64
docs/sdks/users/README.md Normal file
View File

@@ -0,0 +1,64 @@
# Users
(*users*)
## Overview
### Available Operations
* [get_users](#get_users) - Get list of all connected users
## get_users
Get list of all users that are friends and have library access with the provided Plex authentication token
### Example Usage
<!-- UsageSnippet language="python" operationID="get-users" method="get" path="/users" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
with PlexAPI(
accepts=components.Accepts.APPLICATION_XML,
client_identifier="3381b62b-9ab7-4e37-827b-203e9809eb58",
product="Plex for Roku",
version="2.4.1",
platform="Roku",
platform_version="4.3 build 1057",
device="Roku 3",
model="4200X",
device_vendor="Roku",
device_name="Chrome",
marketplace="googlePlay",
token="<YOUR_API_KEY_HERE>",
) as plex_api:
res = plex_api.users.get_users(request={})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `request` | [operations.GetUsersRequest](../../models/operations/getusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[operations.GetUsersResponse](../../models/operations/getusersresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------- | --------------------------- | --------------------------- |
| errors.GetUsersBadRequest | 400 | application/json |
| errors.GetUsersUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |