ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1

This commit is contained in:
speakeasybot
2024-01-07 00:54:49 +00:00
parent 658f41b15a
commit f8c0df2c69
427 changed files with 206307 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetServerActivitiesResponse)](../../models/operations/getserveractivitiesresponse.md)**
## cancel_server_activities
Cancel Server Activities
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::CancelServerActivitiesRequest.new(
activity_uuid="string",
)
res = s.activities.cancel_server_activities(activity_uuid="string")
if res.status == 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(Operations::CancelServerActivitiesResponse)](../../models/operations/cancelserveractivitiesresponse.md)**

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

@@ -0,0 +1,207 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.butler.start_all_tasks()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.butler.stop_all_tasks()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::StartTaskRequest.new(
task_name=Operations::TaskName::CLEAN_OLD_BUNDLES,
)
res = s.butler.start_task(task_name=Operations::TaskName::REFRESH_PERIODIC_METADATA)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `task_name` | [Operations::TaskName](../../models/operations/taskname.md) | :heavy_check_mark: | the name of the task to be started. |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::StopTaskRequest.new(
task_name=Operations::PathParamTaskName::BACKUP_DATABASE,
)
res = s.butler.stop_task(task_name=Operations::PathParamTaskName::BUILD_GRACENOTE_COLLECTIONS)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `task_name` | [Operations::PathParamTaskName](../../models/operations/pathparamtaskname.md) | :heavy_check_mark: | The name of the task to be started. |
### Response
**[T.nilable(Operations::StopTaskResponse)](../../models/operations/stoptaskresponse.md)**

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

@@ -0,0 +1,98 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetGlobalHubsRequest.new()
res = s.hubs.get_global_hubs(count=1262.49, only_transient=Operations::OnlyTransient::ONE)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `count` | *Float* | :heavy_minus_sign: | The number of items to return with each hub. |
| `only_transient` | [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(Operations::GetGlobalHubsResponse)](../../models/operations/getglobalhubsresponse.md)**
## get_library_hubs
This endpoint will return a list of library specific hubs
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetLibraryHubsRequest.new(
section_id=6728.76,
)
res = s.hubs.get_library_hubs(section_id=9010.22, count=639.24, only_transient=Operations::QueryParamOnlyTransient::ONE)
if res.status == 200
# 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` | [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(Operations::GetLibraryHubsResponse)](../../models/operations/getlibraryhubsresponse.md)**

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

@@ -0,0 +1,539 @@
# 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
* [get_latest_library_items](#get_latest_library_items) - Get Latest Library Items
* [get_common_library_items](#get_common_library_items) - Get Common Library Items
* [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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetFileHashRequest.new(
url="file://C:\Image.png&type=13",
)
res = s.library.get_file_hash(url="file://C:\Image.png&type=13", type=4462.17)
if res.status == 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(Operations::GetFileHashResponse)](../../models/operations/getfilehashresponse.md)**
## get_recently_added
This endpoint will return the recently added content.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.library.get_libraries()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::GetLibrariesResponse)](../../models/operations/getlibrariesresponse.md)**
## 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.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetLibraryRequest.new(
section_id=1000,
)
res = s.library.get_library(section_id=1000, include_details=Operations::IncludeDetails::ZERO)
if res.status == 200
# 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` | [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(Operations::GetLibraryResponse)](../../models/operations/getlibraryresponse.md)**
## delete_library
Delate a library using a specific section
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::DeleteLibraryRequest.new(
section_id=1000,
)
res = s.library.delete_library(section_id=1000)
if res.status == 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(Operations::DeleteLibraryResponse)](../../models/operations/deletelibraryresponse.md)**
## get_library_items
This endpoint will return a list of library items filtered by the filter and type provided
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetLibraryItemsRequest.new(
section_id=4510.92,
)
res = s.library.get_library_items(section_id=760.66, type=9382.75, filter="string")
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `section_id` | *Float* | :heavy_check_mark: | the Id of the library to query |
| `type` | *Float* | :heavy_minus_sign: | item type |
| `filter` | *String* | :heavy_minus_sign: | the filter parameter |
### Response
**[T.nilable(Operations::GetLibraryItemsResponse)](../../models/operations/getlibraryitemsresponse.md)**
## refresh_library
This endpoint Refreshes the library.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::RefreshLibraryRequest.new(
section_id=934.16,
)
res = s.library.refresh_library(section_id=1769.3)
if res.status == 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(Operations::RefreshLibraryResponse)](../../models/operations/refreshlibraryresponse.md)**
## get_latest_library_items
This endpoint will return a list of the latest library items filtered by the filter and type provided
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetLatestLibraryItemsRequest.new(
section_id=7171.54,
type=8015.12,
)
res = s.library.get_latest_library_items(section_id=5399.44, type=5981.61, filter="string")
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `section_id` | *Float* | :heavy_check_mark: | the Id of the library to query |
| `type` | *Float* | :heavy_check_mark: | item type |
| `filter` | *String* | :heavy_minus_sign: | the filter parameter |
### Response
**[T.nilable(Operations::GetLatestLibraryItemsResponse)](../../models/operations/getlatestlibraryitemsresponse.md)**
## get_common_library_items
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetCommonLibraryItemsRequest.new(
section_id=2710.37,
type=2760.31,
)
res = s.library.get_common_library_items(section_id=5910.76, type=2604.71, filter="string")
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ |
| `section_id` | *Float* | :heavy_check_mark: | the Id of the library to query |
| `type` | *Float* | :heavy_check_mark: | item type |
| `filter` | *String* | :heavy_minus_sign: | the filter parameter |
### Response
**[T.nilable(Operations::GetCommonLibraryItemsResponse)](../../models/operations/getcommonlibraryitemsresponse.md)**
## get_metadata
This endpoint will return the metadata of a library item specified with the ratingKey.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetMetadataRequest.new(
rating_key=8382.31,
)
res = s.library.get_metadata(rating_key=7526.16)
if res.status == 200
# 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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetMetadataChildrenRequest.new(
rating_key=1539.14,
)
res = s.library.get_metadata_children(rating_key=8449.64)
if res.status == 200
# 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(Operations::GetMetadataChildrenResponse)](../../models/operations/getmetadatachildrenresponse.md)**
## get_on_deck
This endpoint will return the on deck content.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetOnDeckResponse)](../../models/operations/getondeckresponse.md)**

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

@@ -0,0 +1,126 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::LogLineRequest.new(
level=Operations::Level::THREE,
message="string",
source="string",
)
res = s.log.log_line(level=Operations::Level::THREE, message="string", source="string")
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `level` | [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. | |
| `source` | *String* | :heavy_check_mark: | a string indicating the source of the message. | |
### Response
**[T.nilable(Operations::LogLineResponse)](../../models/operations/loglineresponse.md)**
## log_multi_line
This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.log.log_multi_line()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.log.enable_paper_trail()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::EnablePaperTrailResponse)](../../models/operations/enablepapertrailresponse.md)**

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

@@ -0,0 +1,144 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::MarkPlayedRequest.new(
key=59398,
)
res = s.media.mark_played(key=59398)
if res.status == 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(Operations::MarkPlayedResponse)](../../models/operations/markplayedresponse.md)**
## mark_unplayed
This will mark the provided media key as Unplayed.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::MarkUnplayedRequest.new(
key=59398,
)
res = s.media.mark_unplayed(key=59398)
if res.status == 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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::UpdatePlayProgressRequest.new(
key="<key>",
time=6900.91,
state="string",
)
res = s.media.update_play_progress(key="string", time=8015.87, state="string")
if res.status == 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(Operations::UpdatePlayProgressResponse)](../../models/operations/updateplayprogressresponse.md)**

View File

@@ -0,0 +1,424 @@
# 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. `library://...`).
- `playQueueID` - To create a playlist from an existing play queue.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::CreatePlaylistRequest.new(
title="string",
type=Operations::Type::PHOTO,
smart=Operations::Smart::ONE,
)
res = s.playlists.create_playlist(req)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `request` | [Operations::CreatePlaylistRequest](../../models/operations/createplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(Operations::CreatePlaylistResponse)](../../models/operations/createplaylistresponse.md)**
## get_playlists
Get All Playlists given the specified filters.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetPlaylistsRequest.new()
res = s.playlists.get_playlists(playlist_type=Operations::PlaylistType::AUDIO, smart=Operations::QueryParamSmart::ZERO)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `playlist_type` | [Operations::PlaylistType](../../models/operations/playlisttype.md) | :heavy_minus_sign: | limit to a type of playlist. |
| `smart` | [Operations::QueryParamSmart](../../models/operations/queryparamsmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetPlaylistRequest.new(
playlist_id=4109.48,
)
res = s.playlists.get_playlist(playlist_id=648.65)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(Operations::GetPlaylistResponse)](../../models/operations/getplaylistresponse.md)**
## delete_playlist
This endpoint will delete a playlist
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::DeletePlaylistRequest.new(
playlist_id=216.22,
)
res = s.playlists.delete_playlist(playlist_id=7940.39)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::UpdatePlaylistRequest.new(
playlist_id=3915,
)
res = s.playlists.update_playlist(playlist_id=4392.64)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetPlaylistContentsRequest.new(
playlist_id=5004.46,
type=9403.59,
)
res = s.playlists.get_playlist_contents(playlist_id=2778.32, type=9553.81)
if res.status == 200
# 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(Operations::GetPlaylistContentsResponse)](../../models/operations/getplaylistcontentsresponse.md)**
## clear_playlist_contents
Clears a playlist, only works with dumb playlists. Returns the playlist.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::ClearPlaylistContentsRequest.new(
playlist_id=1893.18,
)
res = s.playlists.clear_playlist_contents(playlist_id=5454.46)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| `playlist_id` | *Float* | :heavy_check_mark: | the ID of the playlist |
### Response
**[T.nilable(Operations::ClearPlaylistContentsResponse)](../../models/operations/clearplaylistcontentsresponse.md)**
## add_playlist_contents
Adds a generator to a playlist, same parameters as the POST above. 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::AddPlaylistContentsRequest.new(
playlist_id=8502.01,
uri="library://..",
play_queue_id=123,
)
res = s.playlists.add_playlist_contents(playlist_id=9815.72, uri="library://..", play_queue_id=123)
if res.status == 200
# 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 | library://.. |
| `play_queue_id` | *Float* | :heavy_check_mark: | the play queue to add to a playlist | 123 |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::UploadPlaylistRequest.new(
path="/home/barkley/playlist.m3u",
force=Operations::Force::ZERO,
)
res = s.playlists.upload_playlist(path="/home/barkley/playlist.m3u", force=Operations::Force::ZERO)
if res.status == 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` | [Operations::Force](../../models/operations/force.md) | :heavy_check_mark: | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>The `force` argument is used to disable overwriting. 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(Operations::UploadPlaylistResponse)](../../models/operations/uploadplaylistresponse.md)**

View File

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

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

@@ -0,0 +1,161 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::PerformSearchRequest.new(
query="dylan",
limit=5,
)
res = s.search.perform_search(query="arnold", section_id=9372.7, limit=5)
if res.status == 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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::PerformVoiceSearchRequest.new(
query="dead+poop",
limit=5,
)
res = s.search.perform_voice_search(query="dead+poop", section_id=4094.8, limit=5)
if res.status == 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(Operations::PerformVoiceSearchResponse)](../../models/operations/performvoicesearchresponse.md)**
## get_search_results
This will search the database for the string provided.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetSearchResultsRequest.new(
query="110",
)
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(Operations::GetSearchResultsResponse)](../../models/operations/getsearchresultsresponse.md)**

View File

@@ -0,0 +1,101 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetTransientTokenRequest.new(
type=Operations::QueryParamType::DELEGATION,
scope=Operations::Scope::ALL,
)
res = s.security.get_transient_token(type=Operations::QueryParamType::DELEGATION, scope=Operations::Scope::ALL)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `type` | [Operations::QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `scope` | [Operations::Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetSourceConnectionInformationRequest.new(
source="server://client-identifier",
)
res = s.security.get_source_connection_information(source="server://client-identifier")
if res.status == 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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetServerCapabilitiesResponse)](../../models/operations/getservercapabilitiesresponse.md)**
## get_server_preferences
Get Server Preferences
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_server_preferences()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::GetServerPreferencesResponse)](../../models/operations/getserverpreferencesresponse.md)**
## get_available_clients
Get Available Clients
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.server.get_available_clients()
if ! res.response_bodies.nil?
# handle response
end
```
### Response
**[T.nilable(Operations::GetAvailableClientsResponse)](../../models/operations/getavailableclientsresponse.md)**
## get_devices
Get Devices
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetDevicesResponse)](../../models/operations/getdevicesresponse.md)**
## get_server_identity
Get Server Identity
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetServerIdentityResponse)](../../models/operations/getserveridentityresponse.md)**
## get_my_plex_account
Returns MyPlex Account Information
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetResizedPhotoRequest.new(
width=110,
height=165,
opacity=643869,
blur=4000,
min_size=Operations::MinSize::ZERO,
upscale=Operations::Upscale::ZERO,
url="/library/metadata/49564/thumb/1654258204",
)
res = s.server.get_resized_photo(req)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `request` | [Operations::GetResizedPhotoRequest](../../models/operations/getresizedphotorequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(Operations::GetResizedPhotoResponse)](../../models/operations/getresizedphotoresponse.md)**
## get_server_list
Get Server List
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetServerListResponse)](../../models/operations/getserverlistresponse.md)**

View File

@@ -0,0 +1,152 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.get_sessions()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::GetSessionsResponse)](../../models/operations/getsessionsresponse.md)**
## get_session_history
This will Retrieve a listing of all history views.
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.sessions.get_session_history()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::GetSessionHistoryResponse)](../../models/operations/getsessionhistoryresponse.md)**
## get_transcode_sessions
Get Transcode Sessions
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=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(Operations::GetTranscodeSessionsResponse)](../../models/operations/gettranscodesessionsresponse.md)**
## stop_transcode_session
Stop a Transcode Session
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::StopTranscodeSessionRequest.new(
session_key="zz7llzqlx8w9vnrsbnwhbmep",
)
res = s.sessions.stop_transcode_session(session_key="zz7llzqlx8w9vnrsbnwhbmep")
if res.status == 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(Operations::StopTranscodeSessionResponse)](../../models/operations/stoptranscodesessionresponse.md)**

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

@@ -0,0 +1,128 @@
# 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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
res = s.updater.get_update_status()
if res.status == 200
# handle response
end
```
### Response
**[T.nilable(Operations::GetUpdateStatusResponse)](../../models/operations/getupdatestatusresponse.md)**
## check_for_updates
Checking for updates
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::CheckForUpdatesRequest.new()
res = s.updater.check_for_updates(download=Operations::Download::ONE)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `download` | [Operations::Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. |
### Response
**[T.nilable(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_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::ApplyUpdatesRequest.new()
res = s.updater.apply_updates(tonight=Operations::Tonight::ONE, skip=Operations::Skip::ZERO)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tonight` | [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` | [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(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
* [start_universal_transcode](#start_universal_transcode) - Start Universal Transcode
* [get_timeline](#get_timeline) - Get the timeline for a media item
## start_universal_transcode
Begin a Universal Transcode Session
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::StartUniversalTranscodeRequest.new(
has_mde=8924.99,
path="/etc/mail",
media_index=9962.95,
part_index=1232.82,
protocol="string",
)
res = s.video.start_universal_transcode(req)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `request` | [Operations::StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(Operations::StartUniversalTranscodeResponse)](../../models/operations/startuniversaltranscoderesponse.md)**
## get_timeline
Get the timeline for a media item
### Example Usage
```ruby
require_relative plexruby
s = OpenApiSDK::PlexAPI.new
s.config_security(
security=Shared::Security.new(
access_token="<YOUR_API_KEY_HERE>",
)
)
req = Operations::GetTimelineRequest.new(
rating_key=716.56,
key="<key>",
state=Operations::State::PAUSED,
has_mde=7574.33,
time=3327.51,
duration=7585.39,
context="string",
play_queue_item_id=1406.21,
play_back_time=2699.34,
row=3536.42,
)
res = s.video.get_timeline(req)
if res.status == 200
# handle response
end
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `request` | [Operations::GetTimelineRequest](../../models/operations/gettimelinerequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[T.nilable(Operations::GetTimelineResponse)](../../models/operations/gettimelineresponse.md)**