Initial Commit

This commit is contained in:
Luke Hagar
2024-01-01 15:47:37 -06:00
parent 203c48ae7c
commit f91c1e6f54
4519 changed files with 88021 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import SDKPicker from '/src/components/SDKPicker';
We offer native client SDKs in the following languages. Select a language to view documentation and usage examples for that language.
<SDKPicker />

View File

@@ -0,0 +1,3 @@
## Client SDKs
{/* render client_sdks */}

View File

@@ -0,0 +1,13 @@
{/* Start Python Custom HTTP Client */}
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
For example, you could specify a header for every request that this sdk makes as follows:
```python
import sdk
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = sdk.SDK(client: http_client)
```
{/* End Python Custom HTTP Client */}

View File

@@ -0,0 +1,3 @@
## Custom HTTP Client
{/* render custom_http_client */}

View File

@@ -0,0 +1,31 @@
{/* Start Python Errors */}
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
### Example
```python
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = None
try:
res = s.server.get_server_capabilities()
except errors.GetServerCapabilitiesResponseBody as e:
print(e) # handle exception
raise(e)
except errors.SDKError as e:
print(e) # handle exception
raise(e)
if res.object is not None:
# handle response
pass
```
{/* End Python Errors */}

View File

@@ -0,0 +1,3 @@
## Errors
{/* render errors */}

View File

@@ -0,0 +1,5 @@
{/* Start Python Installation */}
```bash
pip install openapi
```
{/* End Python Installation */}

View File

@@ -0,0 +1,3 @@
## Installation
{/* render installation */}

View File

@@ -0,0 +1,42 @@
# API and SDK reference
{/* Start Imports */}
import ClientSDKs from "./client_sdks/client_sdks.mdx";
import Installation from "./installation/installation.mdx";
import CustomClient from "./custom_http_client/custom_http_client.mdx";
import SecurityOptions from "./security_options/security_options.mdx";
import Errors from "./errors/errors.mdx";
import ServerOptions from "./server_options/server_options.mdx";
import Resources from "./resources/resources.mdx";
{/* End Imports */}
{/* Start Sections */}
<ClientSDKs/>
---
<Installation/>
---
<CustomClient/>
---
<SecurityOptions/>
---
<Errors/>
---
<ServerOptions/>
---
<Resources/>
{/* End Sections */}

View File

@@ -0,0 +1,23 @@
import GetServerActivities from "./get_server_activities/get_server_activities.mdx";
import CancelServerActivities from "./cancel_server_activities/cancel_server_activities.mdx";
## Activities
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real\-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities are associated with HTTP replies via a special `X\-Plex\-Activity` header which contains the UUID of the activity.
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
\- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
\- They must contain an `type` which is used by clients to distinguish the specific activity.
\- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
\- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
### Available Operations
* [Get Server Activities](/python/activities/get_server_activities) - Get Server Activities
* [Cancel Server Activities](/python/activities/cancel_server_activities) - Cancel Server Activities
---
<GetServerActivities />
---
<CancelServerActivities />

View File

@@ -0,0 +1,3 @@
## Cancel Server Activities
Cancel Server Activities

View File

@@ -0,0 +1,5 @@
{/* Autogenerated DO NOT EDIT */}
##### `activity_uuid` *{`str`}*
The UUID of the activity to cancel.

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import CancelServerActivitiesResponse from "/content/types/models/operations/cancel_server_activities_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.CancelServerActivitiesResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<CancelServerActivitiesResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python CancelServerActivities.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.activities.cancel_server_activities(activity_uuid='string')
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Activities*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Server Activities
Get Server Activities

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetServerActivitiesResponse from "/content/types/models/operations/get_server_activities_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetServerActivitiesResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetServerActivitiesResponse/>
</Collapsible>

View File

@@ -0,0 +1,40 @@
<CH.Code>
```python GetServerActivities.py
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.activities.get_server_activities()
if res.object is not None:
# handle response
pass
```
---
```json Example Response
{
"MediaContainer": {
"size": 6235.64,
"Activity": [
{
"uuid": "string",
"type": "string",
"cancellable": false,
"userID": 6458.94,
"title": "string",
"subtitle": "string",
"progress": 3843.82,
"Context": {
"librarySectionID": "string"
}
}
]
}
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Activities*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,32 @@
import GetButlerTasks from "./get_butler_tasks/get_butler_tasks.mdx";
import StartAllTasks from "./start_all_tasks/start_all_tasks.mdx";
import StopAllTasks from "./stop_all_tasks/stop_all_tasks.mdx";
import StartTask from "./start_task/start_task.mdx";
import StopTask from "./stop_task/stop_task.mdx";
## Butler
Butler is the task manager of the Plex Media Server Ecosystem.
### Available Operations
* [Get Butler Tasks](/python/butler/get_butler_tasks) - Get Butler tasks
* [Start All Tasks](/python/butler/start_all_tasks) - Start all Butler tasks
* [Stop All Tasks](/python/butler/stop_all_tasks) - Stop all Butler tasks
* [Start Task](/python/butler/start_task) - Start a single Butler task
* [Stop Task](/python/butler/stop_task) - Stop a single Butler task
---
<GetButlerTasks />
---
<StartAllTasks />
---
<StopAllTasks />
---
<StartTask />
---
<StopTask />

View File

@@ -0,0 +1,3 @@
## Get Butler Tasks
Returns a list of butler tasks

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetButlerTasksResponse from "/content/types/models/operations/get_butler_tasks_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetButlerTasksResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetButlerTasksResponse/>
</Collapsible>

View File

@@ -0,0 +1,35 @@
<CH.Code>
```python GetButlerTasks.py
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.butler.get_butler_tasks()
if res.object is not None:
# handle response
pass
```
---
```json Example Response
{
"ButlerTasks": {
"ButlerTask": [
{
"name": "BackupDatabase",
"interval": 3,
"scheduleRandomized": false,
"enabled": false,
"title": "Backup Database",
"description": "Create a backup copy of the server's database in the configured backup directory"
}
]
}
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,7 @@
## Start All Tasks
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import StartAllTasksResponse from "/content/types/models/operations/start_all_tasks_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.StartAllTasksResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<StartAllTasksResponse/>
</Collapsible>

View File

@@ -0,0 +1,30 @@
<CH.Code>
```python StartAllTasks.py
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.butler.start_all_tasks()
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,7 @@
## Start Task
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.

View File

@@ -0,0 +1,12 @@
{/* Autogenerated DO NOT EDIT */}
import TaskName from "/content/types/models/operations/task_name/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `task_name` *{`operations.TaskName`}*
the name of the task to be started.
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<TaskName/>
</Collapsible>

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import StartTaskResponse from "/content/types/models/operations/start_task_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.StartTaskResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<StartTaskResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python StartTask.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.butler.start_task(task_name=operations.TaskName.REFRESH_PERIODIC_METADATA)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Stop All Tasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import StopAllTasksResponse from "/content/types/models/operations/stop_all_tasks_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.StopAllTasksResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<StopAllTasksResponse/>
</Collapsible>

View File

@@ -0,0 +1,30 @@
<CH.Code>
```python StopAllTasks.py
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.butler.stop_all_tasks()
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Stop Task
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.

View File

@@ -0,0 +1,12 @@
{/* Autogenerated DO NOT EDIT */}
import PathParamTaskName from "/content/types/models/operations/path_param_task_name/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `task_name` *{`operations.PathParamTaskName`}*
The name of the task to be started.
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<PathParamTaskName/>
</Collapsible>

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import StopTaskResponse from "/content/types/models/operations/stop_task_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.StopTaskResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<StopTaskResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python StopTask.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.butler.stop_task(task_name=operations.PathParamTaskName.GENERATE_CHAPTER_THUMBS)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Global Hubs
Get Global Hubs filtered by the parameters provided.

View File

@@ -0,0 +1,16 @@
{/* Autogenerated DO NOT EDIT */}
import OnlyTransient from "/content/types/models/operations/only_transient/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `count` *{`Optional[float]`}*
The number of items to return with each hub.
---
##### `only_transient` *{`Optional[operations.OnlyTransient]`}*
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<OnlyTransient/>
</Collapsible>

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetGlobalHubsResponse from "/content/types/models/operations/get_global_hubs_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetGlobalHubsResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetGlobalHubsResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetGlobalHubs.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.hubs.get_global_hubs(count=8472.52, only_transient=operations.OnlyTransient.ZERO)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Hubs*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Library Hubs
This endpoint will return a list of library specific hubs

View File

@@ -0,0 +1,20 @@
{/* Autogenerated DO NOT EDIT */}
import QueryParamOnlyTransient from "/content/types/models/operations/query_param_only_transient/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `section_id` *{`float`}*
the Id of the library to query
---
##### `count` *{`Optional[float]`}*
The number of items to return with each hub.
---
##### `only_transient` *{`Optional[operations.QueryParamOnlyTransient]`}*
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<QueryParamOnlyTransient/>
</Collapsible>

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetLibraryHubsResponse from "/content/types/models/operations/get_library_hubs_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetLibraryHubsResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetLibraryHubsResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetLibraryHubs.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.hubs.get_library_hubs(section_id=6235.64, count=6458.94, only_transient=operations.QueryParamOnlyTransient.ZERO)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Hubs*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,17 @@
import GetGlobalHubs from "./get_global_hubs/get_global_hubs.mdx";
import GetLibraryHubs from "./get_library_hubs/get_library_hubs.mdx";
## Hubs
Hubs are a structured two\-dimensional container for media, generally represented by multiple horizontal rows.
### Available Operations
* [Get Global Hubs](/python/hubs/get_global_hubs) - Get Global Hubs
* [Get Library Hubs](/python/hubs/get_library_hubs) - Get library specific hubs
---
<GetGlobalHubs />
---
<GetLibraryHubs />

View File

@@ -0,0 +1,3 @@
## Delete Library
Delate a library using a specific section

View File

@@ -0,0 +1,7 @@
{/* Autogenerated DO NOT EDIT */}
##### `section_id` *{`float`}*
the Id of the library to query
<br/>
**Example:** `1000`

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import DeleteLibraryResponse from "/content/types/models/operations/delete_library_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.DeleteLibraryResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<DeleteLibraryResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python DeleteLibrary.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.delete_library(section_id=1000)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Common Library Items
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter

View File

@@ -0,0 +1,13 @@
{/* Autogenerated DO NOT EDIT */}
##### `section_id` *{`float`}*
the Id of the library to query
---
##### `type` *{`float`}*
item type
---
##### `filter_` *{`Optional[str]`}*
the filter parameter

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetCommonLibraryItemsResponse from "/content/types/models/operations/get_common_library_items_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetCommonLibraryItemsResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetCommonLibraryItemsResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetCommonLibraryItems.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_common_library_items(section_id=5288.95, type=4799.77, filter_='string')
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get File Hash
This resource returns hash values for local files

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
##### `url` *{`str`}*
This is the path to the local file, must be prefixed by `file://`
<br/>
**Example:** `file://C:\Image.png&type=13`
---
##### `type` *{`Optional[float]`}*
Item type

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetFileHashResponse from "/content/types/models/operations/get_file_hash_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetFileHashResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetFileHashResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetFileHash.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_file_hash(url='file://C:\Image.png&type=13', type=567.13)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Latest Library Items
This endpoint will return a list of the latest library items filtered by the filter and type provided

View File

@@ -0,0 +1,13 @@
{/* Autogenerated DO NOT EDIT */}
##### `section_id` *{`float`}*
the Id of the library to query
---
##### `type` *{`float`}*
item type
---
##### `filter_` *{`Optional[str]`}*
the filter parameter

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetLatestLibraryItemsResponse from "/content/types/models/operations/get_latest_library_items_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetLatestLibraryItemsResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetLatestLibraryItemsResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetLatestLibraryItems.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_latest_library_items(section_id=7917.25, type=8121.69, filter_='string')
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,8 @@
## Get Libraries
A library section (commonly referred to as just a library) is a collection of media.
Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media.
For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts.
This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetLibrariesResponse from "/content/types/models/operations/get_libraries_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetLibrariesResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetLibrariesResponse/>
</Collapsible>

View File

@@ -0,0 +1,30 @@
<CH.Code>
```python GetLibraries.py
import sdk
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_libraries()
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,21 @@
## Get Library
Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:
- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:
- Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.
- Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.
- Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly.
- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:
- `key`: This provides the root endpoint returning the actual media list for the type.
- `type`: This is the metadata type for the type (if a standard Plex type).
- `title`: The title for for the content of this type (e.g. "Movies").
- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.
- `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.
- `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
- `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
- `title`: The title for the filter.
- Each `Sort` object contains a description of the sort field.
- `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).
- `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.
- `title`: The title of the field.

View File

@@ -0,0 +1,20 @@
{/* Autogenerated DO NOT EDIT */}
import IncludeDetails from "/content/types/models/operations/include_details/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `section_id` *{`float`}*
the Id of the library to query
<br/>
**Example:** `1000`
---
##### `include_details` *{`Optional[operations.IncludeDetails]`}*
Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<IncludeDetails/>
</Collapsible>

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetLibraryResponse from "/content/types/models/operations/get_library_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetLibraryResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetLibraryResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetLibrary.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_library(section_id=1000, include_details=operations.IncludeDetails.ONE)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Library Items
This endpoint will return a list of library items filtered by the filter and type provided

View File

@@ -0,0 +1,13 @@
{/* Autogenerated DO NOT EDIT */}
##### `section_id` *{`float`}*
the Id of the library to query
---
##### `type` *{`Optional[float]`}*
item type
---
##### `filter_` *{`Optional[str]`}*
the filter parameter

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetLibraryItemsResponse from "/content/types/models/operations/get_library_items_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetLibraryItemsResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetLibraryItemsResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetLibraryItems.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_library_items(section_id=2726.56, type=3834.41, filter_='string')
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Metadata
This endpoint will return the metadata of a library item specified with the ratingKey.

View File

@@ -0,0 +1,5 @@
{/* Autogenerated DO NOT EDIT */}
##### `rating_key` *{`float`}*
the id of the library item to return the children of.

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetMetadataResponse from "/content/types/models/operations/get_metadata_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetMetadataResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetMetadataResponse/>
</Collapsible>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```python GetMetadata.py
import sdk
from sdk.models import operations
s = sdk.SDK(
access_token="<YOUR_API_KEY_HERE>",
)
res = s.library.get_metadata(rating_key=5680.45)
if res.status_code == 200:
# handle response
pass
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,3 @@
## Get Metadata Children
This endpoint will return the children of of a library item specified with the ratingKey.

View File

@@ -0,0 +1,5 @@
{/* Autogenerated DO NOT EDIT */}
##### `rating_key` *{`float`}*
the id of the library item to return the children of.

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
import GetMetadataChildrenResponse from "/content/types/models/operations/get_metadata_children_response/python.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### *{`operations.GetMetadataChildrenResponse`}*
<Collapsible defaultOpen openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetMetadataChildrenResponse/>
</Collapsible>

Some files were not shown because too many files have changed in this diff Show More