ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.193.0

This commit is contained in:
speakeasybot
2024-02-23 15:38:37 +00:00
parent 68c1acd813
commit 7d08e2c44d
888 changed files with 216789 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
# Activities
## Overview
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](#get_server_activities) - Get Server Activities
* [cancel_server_activities](#cancel_server_activities) - Cancel Server Activities
## get_server_activities
Get Server Activities
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.activities.get_server_activities()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetServerActivitiesResponse)](../../models/operations/getserveractivitiesresponse.md)**
## cancel_server_activities
Cancel Server Activities
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.activities.cancel_server_activities(activity_uuid="<value>")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `activity_uuid` | *::String* | :heavy_check_mark: | The UUID of the activity to cancel. |
### Response
**[T.nilable(::OpenApiSDK::Operations::CancelServerActivitiesResponse)](../../models/operations/cancelserveractivitiesresponse.md)**

199
docs/sdks/butler/README.md Normal file
View File

@@ -0,0 +1,199 @@
# Butler
## Overview
Butler is the task manager of the Plex Media Server Ecosystem.
### Available Operations
* [get_butler_tasks](#get_butler_tasks) - Get Butler tasks
* [start_all_tasks](#start_all_tasks) - Start all Butler tasks
* [stop_all_tasks](#stop_all_tasks) - Stop all Butler tasks
* [start_task](#start_task) - Start a single Butler task
* [stop_task](#stop_task) - Stop a single Butler task
## get_butler_tasks
Returns a list of butler tasks
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.get_butler_tasks()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetButlerTasksResponse)](../../models/operations/getbutlertasksresponse.md)**
## 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.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.start_all_tasks()
if res.status_code == 200
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::StartAllTasksResponse)](../../models/operations/startalltasksresponse.md)**
## stop_all_tasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.stop_all_tasks()
if res.status_code == 200
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::StopAllTasksResponse)](../../models/operations/stopalltasksresponse.md)**
## 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.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.start_task(task_name=::OpenApiSDK::Operations::TaskName::CLEAN_OLD_BUNDLES)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `task_name` | [::OpenApiSDK::Operations::TaskName](../../models/operations/taskname.md) | :heavy_check_mark: | the name of the task to be started. |
### Response
**[T.nilable(::OpenApiSDK::Operations::StartTaskResponse)](../../models/operations/starttaskresponse.md)**
## 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.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.butler.stop_task(task_name=::OpenApiSDK::Operations::PathParamTaskName::BACKUP_DATABASE)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `task_name` | [::OpenApiSDK::Operations::PathParamTaskName](../../models/operations/pathparamtaskname.md) | :heavy_check_mark: | The name of the task to be started. |
### Response
**[T.nilable(::OpenApiSDK::Operations::StopTaskResponse)](../../models/operations/stoptaskresponse.md)**

92
docs/sdks/hubs/README.md Normal file
View File

@@ -0,0 +1,92 @@
# Hubs
## Overview
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
### Available Operations
* [get_global_hubs](#get_global_hubs) - Get Global Hubs
* [get_library_hubs](#get_library_hubs) - Get library specific hubs
## get_global_hubs
Get Global Hubs filtered by the parameters provided.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.hubs.get_global_hubs(count=1262.49, only_transient=::OpenApiSDK::Operations::OnlyTransient::ONE)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `count` | *::Float* | :heavy_minus_sign: | The number of items to return with each hub. |
| `only_transient` | [::OpenApiSDK::Operations::OnlyTransient](../../models/operations/onlytransient.md) | :heavy_minus_sign: | 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). |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetGlobalHubsResponse)](../../models/operations/getglobalhubsresponse.md)**
## get_library_hubs
This endpoint will return a list of library specific hubs
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.hubs.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=::OpenApiSDK::Operations::QueryParamOnlyTransient::ZERO)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `section_id` | *::Float* | :heavy_check_mark: | the Id of the library to query |
| `count` | *::Float* | :heavy_minus_sign: | The number of items to return with each hub. |
| `only_transient` | [::OpenApiSDK::Operations::QueryParamOnlyTransient](../../models/operations/queryparamonlytransient.md) | :heavy_minus_sign: | 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). |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetLibraryHubsResponse)](../../models/operations/getlibraryhubsresponse.md)**

513
docs/sdks/library/README.md Normal file
View File

@@ -0,0 +1,513 @@
# Library
## Overview
API Calls interacting with Plex Media Server Libraries
### Available Operations
* [get_file_hash](#get_file_hash) - Get Hash Value
* [get_recently_added](#get_recently_added) - Get Recently Added
* [get_libraries](#get_libraries) - Get All Libraries
* [get_library](#get_library) - Get Library Details
* [delete_library](#delete_library) - Delete Library Section
* [get_library_items](#get_library_items) - Get Library Items
* [refresh_library](#refresh_library) - Refresh Library
* [search_library](#search_library) - Search Library
* [get_metadata](#get_metadata) - Get Items Metadata
* [get_metadata_children](#get_metadata_children) - Get Items Children
* [get_on_deck](#get_on_deck) - Get On Deck
## get_file_hash
This resource returns hash values for local files
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_file_hash(url="file://C:\Image.png&type=13", type=4462.17)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `url` | *::String* | :heavy_check_mark: | This is the path to the local file, must be prefixed by `file://` | file://C:\Image.png&type=13 |
| `type` | *::Float* | :heavy_minus_sign: | Item type | |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetFileHashResponse)](../../models/operations/getfilehashresponse.md)**
## get_recently_added
This endpoint will return the recently added content.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_recently_added()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetRecentlyAddedResponse)](../../models/operations/getrecentlyaddedresponse.md)**
## 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).
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_libraries()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetLibrariesResponse)](../../models/operations/getlibrariesresponse.md)**
## get_library
## Library Details Endpoint
This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
The details include:
### Directories
Organized into three categories:
- **Primary Directories**:
- Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
- Most can be replicated via media queries.
- Customizable by users.
- **Secondary Directories**:
- Marked with `secondary="1"`.
- Used in older clients for structured navigation.
- **Special Directories**:
- Includes a "By Folder" entry for filesystem-based browsing.
- Contains an obsolete `search="1"` entry for on-the-fly search dialog creation.
### Types
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
- **Type Object Attributes**:
- `key`: Endpoint for the media list of this type.
- `type`: Metadata type (if standard Plex type).
- `title`: Title for this content type (e.g., "Movies").
- **Filter Objects**:
- Subset of the media query language.
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
- **Sort Objects**:
- Description of sort fields.
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_library(section_id=1000.0, include_details=::OpenApiSDK::Operations::IncludeDetails::ZERO)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `section_id` | *::Float* | :heavy_check_mark: | the Id of the library to query | 1000 |
| `include_details` | [::OpenApiSDK::Operations::IncludeDetails](../../models/operations/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetLibraryResponse)](../../models/operations/getlibraryresponse.md)**
## delete_library
Delate a library using a specific section
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.delete_library(section_id=1000.0)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `section_id` | *::Float* | :heavy_check_mark: | the Id of the library to query | 1000 |
### Response
**[T.nilable(::OpenApiSDK::Operations::DeleteLibraryResponse)](../../models/operations/deletelibraryresponse.md)**
## get_library_items
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
- `all`: All items in the section.
- `unwatched`: Items that have not been played.
- `newest`: Items that are recently released.
- `recentlyAdded`: Items that are recently added to the library.
- `recentlyViewed`: Items that were recently viewed.
- `onDeck`: Items to continue watching.
- `collection`: Items categorized by collection.
- `edition`: Items categorized by edition.
- `genre`: Items categorized by genre.
- `year`: Items categorized by year of release.
- `decade`: Items categorized by decade.
- `director`: Items categorized by director.
- `actor`: Items categorized by starring actor.
- `country`: Items categorized by country of origin.
- `contentRating`: Items categorized by content rating.
- `rating`: Items categorized by rating.
- `resolution`: Items categorized by resolution.
- `firstCharacter`: Items categorized by the first letter.
- `folder`: Items categorized by folder.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_library_items(section_id=451092, tag=::OpenApiSDK::Operations::Tag::UNWATCHED)
if ! res.object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `section_id` | *::Integer* | :heavy_check_mark: | the Id of the library to query |
| `tag` | [::OpenApiSDK::Operations::Tag](../../models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetLibraryItemsResponse)](../../models/operations/getlibraryitemsresponse.md)**
## refresh_library
This endpoint Refreshes the library.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.refresh_library(section_id=934.16)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
| `section_id` | *::Float* | :heavy_check_mark: | the Id of the library to refresh |
### Response
**[T.nilable(::OpenApiSDK::Operations::RefreshLibraryResponse)](../../models/operations/refreshlibraryresponse.md)**
## search_library
Search for content within a specific section of the library.
### Types
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
- **Type Object Attributes**:
- `type`: Metadata type (if standard Plex type).
- `title`: Title for this content type (e.g., "Movies").
- **Filter Objects**:
- Subset of the media query language.
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
- **Sort Objects**:
- Description of sort fields.
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.search_library(section_id=933505, type=::OpenApiSDK::Operations::Type::FOUR)
if ! res.object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| `section_id` | *::Integer* | :heavy_check_mark: | the Id of the library to query |
| `type` | [::OpenApiSDK::Operations::Type](../../models/operations/type.md) | :heavy_check_mark: | Plex content type to search for |
### Response
**[T.nilable(::OpenApiSDK::Operations::SearchLibraryResponse)](../../models/operations/searchlibraryresponse.md)**
## get_metadata
This endpoint will return the metadata of a library item specified with the ratingKey.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_metadata(rating_key=8382.31)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `rating_key` | *::Float* | :heavy_check_mark: | the id of the library item to return the children of. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetMetadataResponse)](../../models/operations/getmetadataresponse.md)**
## get_metadata_children
This endpoint will return the children of of a library item specified with the ratingKey.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_metadata_children(rating_key=1539.14)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `rating_key` | *::Float* | :heavy_check_mark: | the id of the library item to return the children of. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetMetadataChildrenResponse)](../../models/operations/getmetadatachildrenresponse.md)**
## get_on_deck
This endpoint will return the on deck content.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_on_deck()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetOnDeckResponse)](../../models/operations/getondeckresponse.md)**

150
docs/sdks/log/README.md Normal file
View File

@@ -0,0 +1,150 @@
# Log
## Overview
Submit logs to the Log Handler for Plex Media Server
### Available Operations
* [log_line](#log_line) - Logging a single line message.
* [log_multi_line](#log_multi_line) - Logging a multi-line message
* [enable_paper_trail](#enable_paper_trail) - Enabling Papertrail
## log_line
This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.log.log_line(level=::OpenApiSDK::Operations::Level::THREE, message="Test log message", source="Postman")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `level` | [::OpenApiSDK::Operations::Level](../../models/operations/level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with. <br/>0: Error <br/>1: Warning <br/>2: Info <br/>3: Debug <br/>4: Verbose<br/> | |
| `message` | *::String* | :heavy_check_mark: | The text of the message to write to the log. | Test log message |
| `source` | *::String* | :heavy_check_mark: | a string indicating the source of the message. | Postman |
### Response
**[T.nilable(::OpenApiSDK::Operations::LogLineResponse)](../../models/operations/loglineresponse.md)**
## log_multi_line
This endpoint allows for the batch addition of log entries to the main Plex Media Server log.
It accepts a text/plain request body, where each line represents a distinct log entry.
Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.
Log entries are separated by a newline character (`\n`).
Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.
This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.
The 'level' parameter specifies the log entry's severity or importance, with the following integer values:
- `0`: Error - Critical issues that require immediate attention.
- `1`: Warning - Important events that are not critical but may indicate potential issues.
- `2`: Info - General informational messages about system operation.
- `3`: Debug - Detailed information useful for debugging purposes.
- `4`: Verbose - Highly detailed diagnostic information for in-depth analysis.
The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module).
Example of a single log entry format:
`level=4&message=Sample%20log%20entry&source=applicationName`
Ensure each parameter is properly URL-encoded to avoid interpretation issues.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = "level=4&message=Test%20message%201&source=postman
level=3&message=Test%20message%202&source=postman
level=1&message=Test%20message%203&source=postman"
res = s.log.log_multi_line(req)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| `request` | [::String](../../models//.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(::OpenApiSDK::Operations::LogMultiLineResponse)](../../models/operations/logmultilineresponse.md)**
## enable_paper_trail
This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.log.enable_paper_trail()
if res.status_code == 200
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::EnablePaperTrailResponse)](../../models/operations/enablepapertrailresponse.md)**

130
docs/sdks/media/README.md Normal file
View File

@@ -0,0 +1,130 @@
# Media
## Overview
API Calls interacting with Plex Media Server Media
### Available Operations
* [mark_played](#mark_played) - Mark Media Played
* [mark_unplayed](#mark_unplayed) - Mark Media Unplayed
* [update_play_progress](#update_play_progress) - Update Media Play Progress
## mark_played
This will mark the provided media key as Played.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.mark_played(key=59398.0)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `key` | *::Float* | :heavy_check_mark: | The media key to mark as played | 59398 |
### Response
**[T.nilable(::OpenApiSDK::Operations::MarkPlayedResponse)](../../models/operations/markplayedresponse.md)**
## mark_unplayed
This will mark the provided media key as Unplayed.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.mark_unplayed(key=59398.0)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
| `key` | *::Float* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 |
### Response
**[T.nilable(::OpenApiSDK::Operations::MarkUnplayedResponse)](../../models/operations/markunplayedresponse.md)**
## update_play_progress
This API command can be used to update the play progress of a media item.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.update_play_progress(key="<value>", time=6900.91, state="<value>")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `key` | *::String* | :heavy_check_mark: | the media key |
| `time` | *::Float* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. |
| `state` | *::String* | :heavy_check_mark: | The playback state of the media item. |
### Response
**[T.nilable(::OpenApiSDK::Operations::UpdatePlayProgressResponse)](../../models/operations/updateplayprogressresponse.md)**

View File

@@ -0,0 +1,393 @@
# Playlists
## Overview
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017").
They can be organized in (optionally nesting) folders.
Retrieving a playlist, or its items, will trigger a refresh of its metadata.
This may cause the duration and number of items to change.
### Available Operations
* [create_playlist](#create_playlist) - Create a Playlist
* [get_playlists](#get_playlists) - Get All Playlists
* [get_playlist](#get_playlist) - Retrieve Playlist
* [delete_playlist](#delete_playlist) - Deletes a Playlist
* [update_playlist](#update_playlist) - Update a Playlist
* [get_playlist_contents](#get_playlist_contents) - Retrieve Playlist Contents
* [clear_playlist_contents](#clear_playlist_contents) - Delete Playlist Contents
* [add_playlist_contents](#add_playlist_contents) - Adding to a Playlist
* [upload_playlist](#upload_playlist) - Upload Playlist
## create_playlist
Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass:
- `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`).
- `playQueueID` - To create a playlist from an existing play queue.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::OpenApiSDK::Operations::CreatePlaylistRequest.new(
title: "<value>",
type: ::OpenApiSDK::Operations::QueryParamType::PHOTO,
smart: ::OpenApiSDK::Operations::Smart::ONE,
uri: "https://inborn-brochure.biz",
)
res = s.playlists.create_playlist(req)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `request` | [::OpenApiSDK::Operations::CreatePlaylistRequest](../../models/operations/createplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(::OpenApiSDK::Operations::CreatePlaylistResponse)](../../models/operations/createplaylistresponse.md)**
## get_playlists
Get All Playlists given the specified filters.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.get_playlists(playlist_type=::OpenApiSDK::Operations::PlaylistType::AUDIO, smart=::OpenApiSDK::Operations::QueryParamSmart::ZERO)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `playlist_type` | [::OpenApiSDK::Operations::PlaylistType](../../models/operations/playlisttype.md) | :heavy_minus_sign: | limit to a type of playlist. |
| `smart` | [::OpenApiSDK::Operations::QueryParamSmart](../../models/operations/queryparamsmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetPlaylistsResponse)](../../models/operations/getplaylistsresponse.md)**
## get_playlist
Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.get_playlist(playlist_id=4109.48)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetPlaylistResponse)](../../models/operations/getplaylistresponse.md)**
## delete_playlist
This endpoint will delete a playlist
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.delete_playlist(playlist_id=216.22)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(::OpenApiSDK::Operations::DeletePlaylistResponse)](../../models/operations/deleteplaylistresponse.md)**
## update_playlist
From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.update_playlist(playlist_id=3915, title="<value>", summary="<value>")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist |
| `title` | *::String* | :heavy_minus_sign: | name of the playlist |
| `summary` | *::String* | :heavy_minus_sign: | summary description of the playlist |
### Response
**[T.nilable(::OpenApiSDK::Operations::UpdatePlaylistResponse)](../../models/operations/updateplaylistresponse.md)**
## get_playlist_contents
Gets the contents of a playlist. Should be paged by clients via standard mechanisms.
By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter.
For example, you could use this to display a list of recently added albums vis a smart playlist.
Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist |
| `type` | *::Float* | :heavy_check_mark: | the metadata type of the item to return |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetPlaylistContentsResponse)](../../models/operations/getplaylistcontentsresponse.md)**
## clear_playlist_contents
Clears a playlist, only works with dumb playlists. Returns the playlist.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.clear_playlist_contents(playlist_id=1893.18)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(::OpenApiSDK::Operations::ClearPlaylistContentsResponse)](../../models/operations/clearplaylistcontentsresponse.md)**
## add_playlist_contents
Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.add_playlist_contents(playlist_id=8502.01, uri="server://12345/com.plexapp.plugins.library/library/metadata/1", play_queue_id=123.0)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| `playlist_id` | *::Float* | :heavy_check_mark: | the ID of the playlist | |
| `uri` | *::String* | :heavy_check_mark: | the content URI for the playlist | server://12345/com.plexapp.plugins.library/library/metadata/1 |
| `play_queue_id` | *::Float* | :heavy_minus_sign: | the play queue to add to a playlist | 123 |
### Response
**[T.nilable(::OpenApiSDK::Operations::AddPlaylistContentsResponse)](../../models/operations/addplaylistcontentsresponse.md)**
## upload_playlist
Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=::OpenApiSDK::Operations::Force::ZERO)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path` | *::String* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. <br/>If the `path` argument is a directory, that path will be scanned for playlist files to be processed. <br/>Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename. <br/>If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. <br/>The GUID of each playlist is based on the filename.<br/> | /home/barkley/playlist.m3u |
| `force` | [::OpenApiSDK::Operations::Force](../../models/operations/force.md) | :heavy_check_mark: | Force overwriting of duplicate playlists. <br/>By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. <br/>If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/> | |
### Response
**[T.nilable(::OpenApiSDK::Operations::UploadPlaylistResponse)](../../models/operations/uploadplaylistresponse.md)**

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

@@ -0,0 +1,92 @@
# Plex
## Overview
API Calls that perform operations directly against https://Plex.tv
### Available Operations
* [get_pin](#get_pin) - Get a Pin
* [get_token](#get_token) - Get Access Token
## get_pin
Retrieve a Pin from Plex.tv for authentication flows
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.plex.get_pin(x_plex_client_identifier="<value>", strong=false)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `x_plex_client_identifier` | *::String* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
| `strong` | *T::Boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> |
| `server_url` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetPinResponse)](../../models/operations/getpinresponse.md)**
## get_token
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.plex.get_token(pin_id="<value>", x_plex_client_identifier="<value>")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pin_id` | *::String* | :heavy_check_mark: | The PinID to retrieve an access token for |
| `x_plex_client_identifier` | *::String* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
| `server_url` | *String* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetTokenResponse)](../../models/operations/gettokenresponse.md)**

View File

@@ -0,0 +1,9 @@
# PlexAPI SDK
## Overview
An Open API Spec for interacting with Plex.tv and Plex Servers
### Available Operations

147
docs/sdks/search/README.md Normal file
View File

@@ -0,0 +1,147 @@
# Search
## Overview
API Calls that perform search operations with Plex Media Server
### Available Operations
* [perform_search](#perform_search) - Perform a search
* [perform_voice_search](#perform_voice_search) - Perform a voice search
* [get_search_results](#get_search_results) - Get Search Results
## perform_search
This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
- `reason`: The reason for the result, if not because of a direct search term match; can be either:
- `section`: There are multiple identical results from different sections.
- `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).
- `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor`
- `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold").
- `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
This request is intended to be very fast, and called as the user types.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.search.perform_search(query="dylan", section_id=1516.53, limit=5.0)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `query` | *::String* | :heavy_check_mark: | The query term | arnold |
| `section_id` | *::Float* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
| `limit` | *::Float* | :heavy_minus_sign: | The number of items to return per hub | 5 |
### Response
**[T.nilable(::OpenApiSDK::Operations::PerformSearchResponse)](../../models/operations/performsearchresponse.md)**
## perform_voice_search
This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint.
It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint.
Whenever possible, clients should limit the search to the appropriate type.
Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.search.perform_voice_search(query="dead+poop", section_id=4094.8, limit=5.0)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `query` | *::String* | :heavy_check_mark: | The query term | dead+poop |
| `section_id` | *::Float* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | |
| `limit` | *::Float* | :heavy_minus_sign: | The number of items to return per hub | 5 |
### Response
**[T.nilable(::OpenApiSDK::Operations::PerformVoiceSearchResponse)](../../models/operations/performvoicesearchresponse.md)**
## get_search_results
This will search the database for the string provided.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.search.get_search_results(query="110")
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `query` | *::String* | :heavy_check_mark: | The search query string to use | 110 |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetSearchResultsResponse)](../../models/operations/getsearchresultsresponse.md)**

View File

@@ -0,0 +1,92 @@
# Security
## Overview
API Calls against Security for Plex Media Server
### Available Operations
* [get_transient_token](#get_transient_token) - Get a Transient Token.
* [get_source_connection_information](#get_source_connection_information) - Get Source Connection Information
## get_transient_token
This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.security.get_transient_token(type=::OpenApiSDK::Operations::GetTransientTokenQueryParamType::DELEGATION, scope=::OpenApiSDK::Operations::Scope::ALL)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `type` | [::OpenApiSDK::Operations::GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `scope` | [::OpenApiSDK::Operations::Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetTransientTokenResponse)](../../models/operations/gettransienttokenresponse.md)**
## get_source_connection_information
If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
Note: requires Plex Media Server >= 1.15.4.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.security.get_source_connection_information(source="server://client-identifier")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `source` | *::String* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetSourceConnectionInformationResponse)](../../models/operations/getsourceconnectioninformationresponse.md)**

291
docs/sdks/server/README.md Normal file
View File

@@ -0,0 +1,291 @@
# Server
## Overview
Operations against the Plex Media Server System.
### Available Operations
* [get_server_capabilities](#get_server_capabilities) - Server Capabilities
* [get_server_preferences](#get_server_preferences) - Get Server Preferences
* [get_available_clients](#get_available_clients) - Get Available Clients
* [get_devices](#get_devices) - Get Devices
* [get_server_identity](#get_server_identity) - Get Server Identity
* [get_my_plex_account](#get_my_plex_account) - Get MyPlex Account
* [get_resized_photo](#get_resized_photo) - Get a Resized Photo
* [get_server_list](#get_server_list) - Get Server List
## get_server_capabilities
Server Capabilities
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_server_capabilities()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetServerCapabilitiesResponse)](../../models/operations/getservercapabilitiesresponse.md)**
## get_server_preferences
Get Server Preferences
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_server_preferences()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetServerPreferencesResponse)](../../models/operations/getserverpreferencesresponse.md)**
## get_available_clients
Get Available Clients
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_available_clients()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetAvailableClientsResponse)](../../models/operations/getavailableclientsresponse.md)**
## get_devices
Get Devices
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_devices()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetDevicesResponse)](../../models/operations/getdevicesresponse.md)**
## get_server_identity
Get Server Identity
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_server_identity()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetServerIdentityResponse)](../../models/operations/getserveridentityresponse.md)**
## get_my_plex_account
Returns MyPlex Account Information
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_my_plex_account()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetMyPlexAccountResponse)](../../models/operations/getmyplexaccountresponse.md)**
## get_resized_photo
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::OpenApiSDK::Operations::GetResizedPhotoRequest.new(
width: 110.0,
height: 165.0,
opacity: 643869,
blur: 4000.0,
min_size: ::OpenApiSDK::Operations::MinSize::ZERO,
upscale: ::OpenApiSDK::Operations::Upscale::ZERO,
url: "/library/metadata/49564/thumb/1654258204",
)
res = s.server.get_resized_photo(req)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `request` | [::OpenApiSDK::Operations::GetResizedPhotoRequest](../../models/operations/getresizedphotorequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetResizedPhotoResponse)](../../models/operations/getresizedphotoresponse.md)**
## get_server_list
Get Server List
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_server_list()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetServerListResponse)](../../models/operations/getserverlistresponse.md)**

View File

@@ -0,0 +1,148 @@
# Sessions
## Overview
API Calls that perform search operations with Plex Media Server Sessions
### Available Operations
* [get_sessions](#get_sessions) - Get Active Sessions
* [get_session_history](#get_session_history) - Get Session History
* [get_transcode_sessions](#get_transcode_sessions) - Get Transcode Sessions
* [stop_transcode_session](#stop_transcode_session) - Stop a Transcode Session
## get_sessions
This will retrieve the "Now Playing" Information of the PMS.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.get_sessions()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetSessionsResponse)](../../models/operations/getsessionsresponse.md)**
## get_session_history
This will Retrieve a listing of all history views.
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.get_session_history()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetSessionHistoryResponse)](../../models/operations/getsessionhistoryresponse.md)**
## get_transcode_sessions
Get Transcode Sessions
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.get_transcode_sessions()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetTranscodeSessionsResponse)](../../models/operations/gettranscodesessionsresponse.md)**
## stop_transcode_session
Stop a Transcode Session
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `session_key` | *::String* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep |
### Response
**[T.nilable(::OpenApiSDK::Operations::StopTranscodeSessionResponse)](../../models/operations/stoptranscodesessionresponse.md)**

View File

@@ -0,0 +1,49 @@
# Statistics
## Overview
API Calls that perform operations with Plex Media Server Statistics
### Available Operations
* [get_statistics](#get_statistics) - Get Media Statistics
## get_statistics
This will return the media statistics for the server
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.statistics.get_statistics(timespan=411769)
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `timespan` | *::Integer* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetStatisticsResponse)](../../models/operations/getstatisticsresponse.md)**

124
docs/sdks/updater/README.md Normal file
View File

@@ -0,0 +1,124 @@
# Updater
## Overview
This describes the API for searching and applying updates to the Plex Media Server.
Updates to the status can be observed via the Event API.
### Available Operations
* [get_update_status](#get_update_status) - Querying status of updates
* [check_for_updates](#check_for_updates) - Checking for updates
* [apply_updates](#apply_updates) - Apply Updates
## get_update_status
Querying status of updates
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.updater.get_update_status()
if ! res.two_hundred_application_json_object.nil?
# handle response
end
```
### Response
**[T.nilable(::OpenApiSDK::Operations::GetUpdateStatusResponse)](../../models/operations/getupdatestatusresponse.md)**
## check_for_updates
Checking for updates
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.updater.check_for_updates(download=::OpenApiSDK::Operations::Download::ONE)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `download` | [::OpenApiSDK::Operations::Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. |
### Response
**[T.nilable(::OpenApiSDK::Operations::CheckForUpdatesResponse)](../../models/operations/checkforupdatesresponse.md)**
## apply_updates
Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.updater.apply_updates(tonight=::OpenApiSDK::Operations::Tonight::ONE, skip=::OpenApiSDK::Operations::Skip::ZERO)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tonight` | [::OpenApiSDK::Operations::Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install |
| `skip` | [::OpenApiSDK::Operations::Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`. |
### Response
**[T.nilable(::OpenApiSDK::Operations::ApplyUpdatesResponse)](../../models/operations/applyupdatesresponse.md)**

109
docs/sdks/video/README.md Normal file
View File

@@ -0,0 +1,109 @@
# Video
## Overview
API Calls that perform operations with Plex Media Server Videos
### Available Operations
* [get_timeline](#get_timeline) - Get the timeline for a media item
* [start_universal_transcode](#start_universal_transcode) - Start Universal Transcode
## get_timeline
Get the timeline for a media item
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::OpenApiSDK::Operations::GetTimelineRequest.new(
rating_key: 716.56,
key: "<key>",
state: ::OpenApiSDK::Operations::State::PAUSED,
has_mde: 7574.33,
time: 3327.51,
duration: 7585.39,
context: "<value>",
play_queue_item_id: 1406.21,
play_back_time: 2699.34,
row: 3536.42,
)
res = s.video.get_timeline(req)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `request` | [::OpenApiSDK::Operations::GetTimelineRequest](../../models/operations/gettimelinerequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(::OpenApiSDK::Operations::GetTimelineResponse)](../../models/operations/gettimelineresponse.md)**
## start_universal_transcode
Begin a Universal Transcode Session
### Example Usage
```ruby
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::OpenApiSDK::Operations::StartUniversalTranscodeRequest.new(
has_mde: 8924.99,
path: "/etc/mail",
media_index: 9962.95,
part_index: 1232.82,
protocol: "<value>",
)
res = s.video.start_universal_transcode(req)
if res.status_code == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `request` | [::OpenApiSDK::Operations::StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(::OpenApiSDK::Operations::StartUniversalTranscodeResponse)](../../models/operations/startuniversaltranscoderesponse.md)**