Files
plexpy/docs/sdks/hubs/README.md
speakeasybot d0db038e53 ## 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**
2025-12-01 00:03:55 +00:00

807 lines
37 KiB
Markdown

# Hubs
(*hubs*)
## Overview
The hubs within a media provider
### Available Operations
* [get_all_hubs](#get_all_hubs) - Get global hubs
* [get_continue_watching](#get_continue_watching) - Get the continue watching hub
* [get_hub_items](#get_hub_items) - Get a hub's items
* [get_promoted_hubs](#get_promoted_hubs) - Get the hubs which are promoted
* [get_metadata_hubs](#get_metadata_hubs) - Get hubs for section by metadata item
* [get_postplay_hubs](#get_postplay_hubs) - Get postplay hubs
* [get_related_hubs](#get_related_hubs) - Get related hubs
* [get_section_hubs](#get_section_hubs) - Get section hubs
* [reset_section_defaults](#reset_section_defaults) - Reset hubs to defaults
* [list_hubs](#list_hubs) - Get hubs
* [create_custom_hub](#create_custom_hub) - Create a custom hub
* [move_hub](#move_hub) - Move Hub
* [delete_custom_hub](#delete_custom_hub) - Delete a custom hub
* [update_hub_visibility](#update_hub_visibility) - Change hub visibility
## get_all_hubs
Get the global hubs in this PMS
### Example Usage
<!-- UsageSnippet language="python" operationID="getAllHubs" method="get" path="/hubs" -->
```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.hubs.get_all_hubs(request={
"only_transient": components.BoolInt.TRUE,
})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `request` | [operations.GetAllHubsRequest](../../models/operations/getallhubsrequest.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. |
### Response
**[operations.GetAllHubsResponse](../../models/operations/getallhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_continue_watching
Get the global continue watching hub
### Example Usage
<!-- UsageSnippet language="python" operationID="getContinueWatching" method="get" path="/hubs/continueWatching" -->
```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.hubs.get_continue_watching(request={})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `request` | [operations.GetContinueWatchingRequest](../../models/operations/getcontinuewatchingrequest.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. |
### Response
**[operations.GetContinueWatchingResponse](../../models/operations/getcontinuewatchingresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_hub_items
Get the items within a single hub specified by identifier
### Example Usage
<!-- UsageSnippet language="python" operationID="getHubItems" method="get" path="/hubs/items" -->
```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.hubs.get_hub_items(request={
"identifier": [
"<value 1>",
"<value 2>",
"<value 3>",
],
})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `request` | [operations.GetHubItemsRequest](../../models/operations/gethubitemsrequest.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. |
### Response
**[operations.GetHubItemsResponse](../../models/operations/gethubitemsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_promoted_hubs
Get the global hubs which are promoted (should be displayed on the home screen)
### Example Usage
<!-- UsageSnippet language="python" operationID="getPromotedHubs" method="get" path="/hubs/promoted" -->
```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.hubs.get_promoted_hubs(request={})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.GetPromotedHubsRequest](../../models/operations/getpromotedhubsrequest.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. |
### Response
**[operations.GetPromotedHubsResponse](../../models/operations/getpromotedhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_metadata_hubs
Get the hubs for a section by metadata item. Currently only for music sections
### Example Usage
<!-- UsageSnippet language="python" operationID="getMetadataHubs" method="get" path="/hubs/metadata/{metadataId}" -->
```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.hubs.get_metadata_hubs(request={
"metadata_id": 605482,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
# Handle response
print(res.media_container_with_hubs)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.GetMetadataHubsRequest](../../models/operations/getmetadatahubsrequest.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. |
### Response
**[operations.GetMetadataHubsResponse](../../models/operations/getmetadatahubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_postplay_hubs
Get the hubs for a metadata to be displayed in post play
### Example Usage
<!-- UsageSnippet language="python" operationID="getPostplayHubs" method="get" path="/hubs/metadata/{metadataId}/postplay" -->
```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.hubs.get_postplay_hubs(request={
"metadata_id": 441419,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
# Handle response
print(res.media_container_with_hubs)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.GetPostplayHubsRequest](../../models/operations/getpostplayhubsrequest.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. |
### Response
**[operations.GetPostplayHubsResponse](../../models/operations/getpostplayhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_related_hubs
Get the hubs for a metadata related to the provided metadata item
### Example Usage
<!-- UsageSnippet language="python" operationID="getRelatedHubs" method="get" path="/hubs/metadata/{metadataId}/related" -->
```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.hubs.get_related_hubs(request={
"metadata_id": 8858,
"only_transient": components.BoolInt.TRUE,
})
assert res.media_container_with_hubs is not None
# Handle response
print(res.media_container_with_hubs)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `request` | [operations.GetRelatedHubsRequest](../../models/operations/getrelatedhubsrequest.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. |
### Response
**[operations.GetRelatedHubsResponse](../../models/operations/getrelatedhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## get_section_hubs
Get the hubs for a single section
### Example Usage
<!-- UsageSnippet language="python" operationID="getSectionHubs" method="get" path="/hubs/sections/{sectionId}" -->
```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.hubs.get_section_hubs(request={
"section_id": 336924,
"only_transient": components.BoolInt.TRUE,
})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `request` | [operations.GetSectionHubsRequest](../../models/operations/getsectionhubsrequest.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. |
### Response
**[operations.GetSectionHubsResponse](../../models/operations/getsectionhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## reset_section_defaults
Reset hubs for this section to defaults and delete custom hubs
### Example Usage
<!-- UsageSnippet language="python" operationID="resetSectionDefaults" method="delete" path="/hubs/sections/{sectionId}/manage" -->
```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.hubs.reset_section_defaults(request={
"section_id": 383022,
})
assert res is not None
# Handle response
print(res)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `request` | [operations.ResetSectionDefaultsRequest](../../models/operations/resetsectiondefaultsrequest.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. |
### Response
**[operations.ResetSectionDefaultsResponse](../../models/operations/resetsectiondefaultsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## list_hubs
Get the list of hubs including both built-in and custom
### Example Usage
<!-- UsageSnippet language="python" operationID="listHubs" method="get" path="/hubs/sections/{sectionId}/manage" -->
```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.hubs.list_hubs(request={
"section_id": 442546,
})
assert res.object is not None
# Handle response
print(res.object)
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `request` | [operations.ListHubsRequest](../../models/operations/listhubsrequest.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. |
### Response
**[operations.ListHubsResponse](../../models/operations/listhubsresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## create_custom_hub
Create a custom hub based on a metadata item
### Example Usage
<!-- UsageSnippet language="python" operationID="createCustomHub" method="post" path="/hubs/sections/{sectionId}/manage" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations
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.hubs.create_custom_hub(request=operations.CreateCustomHubRequest(
section_id=869922,
metadata_item_id=703843,
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
# Handle response
print(res)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.CreateCustomHubRequest](../../models/operations/createcustomhubrequest.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. |
### Response
**[operations.CreateCustomHubResponse](../../models/operations/createcustomhubresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## move_hub
Changed the ordering of a hub among others hubs
### Example Usage
<!-- UsageSnippet language="python" operationID="moveHub" method="put" path="/hubs/sections/{sectionId}/manage/move" -->
```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.hubs.move_hub(request={
"section_id": 755710,
"identifier": "<value>",
})
assert res.get_responses_200 is not None
# Handle response
print(res.get_responses_200)
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `request` | [operations.MoveHubRequest](../../models/operations/movehubrequest.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. |
### Response
**[operations.MoveHubResponse](../../models/operations/movehubresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## delete_custom_hub
Delete a custom hub from the server
### Example Usage
<!-- UsageSnippet language="python" operationID="deleteCustomHub" method="delete" path="/hubs/sections/{sectionId}/manage/{identifier}" -->
```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.hubs.delete_custom_hub(request={
"section_id": 625677,
"identifier": "<value>",
})
assert res is not None
# Handle response
print(res)
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `request` | [operations.DeleteCustomHubRequest](../../models/operations/deletecustomhubrequest.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. |
### Response
**[operations.DeleteCustomHubResponse](../../models/operations/deletecustomhubresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## update_hub_visibility
Changed the visibility of a hub for both the admin and shared users
### Example Usage
<!-- UsageSnippet language="python" operationID="updateHubVisibility" method="put" path="/hubs/sections/{sectionId}/manage/{identifier}" -->
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations
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.hubs.update_hub_visibility(request=operations.UpdateHubVisibilityRequest(
section_id=341650,
identifier="<value>",
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
# Handle response
print(res)
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `request` | [operations.UpdateHubVisibilityRequest](../../models/operations/updatehubvisibilityrequest.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. |
### Response
**[operations.UpdateHubVisibilityResponse](../../models/operations/updatehubvisibilityresponse.md)**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |