mirror of
https://github.com/LukeHagar/plexswift.git
synced 2025-12-06 12:47:44 +00:00
981 lines
49 KiB
Swift
981 lines
49 KiB
Swift
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
import Foundation
|
|
|
|
/// Defines the operations supported by the API.
|
|
///
|
|
/// This protocol defines all of the operations supported by the API. It is implemented by ``Client`` which can be used to make these API requests and handle their responses.
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// These methods allow you to make requests to the API.
|
|
///
|
|
///
|
|
/// ### Scoped API calls
|
|
///
|
|
/// These properties logically group other parts of the API.
|
|
///
|
|
/// - ``server``
|
|
/// - ``media``
|
|
/// - ``video``
|
|
/// - ``activities``
|
|
/// - ``butler``
|
|
/// - ``hubs``
|
|
/// - ``search``
|
|
/// - ``library``
|
|
/// - ``log``
|
|
/// - ``plex``
|
|
/// - ``playlists``
|
|
/// - ``authentication``
|
|
/// - ``statistics``
|
|
/// - ``sessions``
|
|
/// - ``updater``
|
|
///
|
|
public protocol PlexswiftAPI {
|
|
|
|
// MARK: - Scoped APIs
|
|
/// Operations against the Plex Media Server System.
|
|
///
|
|
var server: ServerAPI { get }
|
|
/// API Calls interacting with Plex Media Server Media
|
|
///
|
|
var media: MediaAPI { get }
|
|
/// API Calls that perform operations with Plex Media Server Videos
|
|
///
|
|
var video: VideoAPI { get }
|
|
/// 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.
|
|
///
|
|
var activities: ActivitiesAPI { get }
|
|
/// Butler is the task manager of the Plex Media Server Ecosystem.
|
|
///
|
|
var butler: ButlerAPI { get }
|
|
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
|
///
|
|
var hubs: HubsAPI { get }
|
|
/// API Calls that perform search operations with Plex Media Server
|
|
///
|
|
var search: SearchAPI { get }
|
|
/// API Calls interacting with Plex Media Server Libraries
|
|
///
|
|
var library: LibraryAPI { get }
|
|
/// Submit logs to the Log Handler for Plex Media Server
|
|
///
|
|
var log: LogAPI { get }
|
|
/// API Calls that perform operations directly against https://Plex.tv
|
|
///
|
|
var plex: PlexAPI { get }
|
|
/// 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.
|
|
///
|
|
var playlists: PlaylistsAPI { get }
|
|
/// API Calls regarding authentication for Plex Media Server
|
|
///
|
|
var authentication: AuthenticationAPI { get }
|
|
/// API Calls that perform operations with Plex Media Server Statistics
|
|
///
|
|
var statistics: StatisticsAPI { get }
|
|
/// API Calls that perform search operations with Plex Media Server Sessions
|
|
///
|
|
var sessions: SessionsAPI { get }
|
|
/// 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.
|
|
///
|
|
var updater: UpdaterAPI { get }
|
|
}
|
|
|
|
// MARK: - ServerAPI
|
|
|
|
/// Operations against the Plex Media Server System.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getServerCapabilities()``
|
|
/// - ``getServerPreferences()``
|
|
/// - ``getAvailableClients()``
|
|
/// - ``getDevices()``
|
|
/// - ``getServerIdentity()``
|
|
/// - ``getMyPlexAccount()``
|
|
/// - ``getResizedPhoto(request:)``
|
|
/// - ``getServerList()``
|
|
///
|
|
public protocol ServerAPI {
|
|
/// Server Capabilities
|
|
///
|
|
/// - Returns: A ``Operations/GetServerCapabilitiesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getServerCapabilities() async throws -> Response<Operations.GetServerCapabilitiesResponse>
|
|
|
|
/// Get Server Preferences
|
|
///
|
|
/// - Returns: A ``Operations/GetServerPreferencesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getServerPreferences() async throws -> Response<Operations.GetServerPreferencesResponse>
|
|
|
|
/// Get Available Clients
|
|
///
|
|
/// - Returns: A ``Operations/GetAvailableClientsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getAvailableClients() async throws -> Response<Operations.GetAvailableClientsResponse>
|
|
|
|
/// Get Devices
|
|
///
|
|
/// - Returns: A ``Operations/GetDevicesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getDevices() async throws -> Response<Operations.GetDevicesResponse>
|
|
|
|
/// Get Server Identity
|
|
///
|
|
/// - Returns: A ``Operations/GetServerIdentityResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getServerIdentity() async throws -> Response<Operations.GetServerIdentityResponse>
|
|
|
|
/// Returns MyPlex Account Information
|
|
///
|
|
/// - Returns: A ``Operations/GetMyPlexAccountResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getMyPlexAccount() async throws -> Response<Operations.GetMyPlexAccountResponse>
|
|
|
|
/// Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetResizedPhotoRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetResizedPhotoResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getResizedPhoto(request: Operations.GetResizedPhotoRequest) async throws -> Response<Operations.GetResizedPhotoResponse>
|
|
|
|
/// Get Server List
|
|
///
|
|
/// - Returns: A ``Operations/GetServerListResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getServerList() async throws -> Response<Operations.GetServerListResponse>
|
|
}
|
|
|
|
// MARK: - MediaAPI
|
|
|
|
/// API Calls interacting with Plex Media Server Media
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``markPlayed(request:)``
|
|
/// - ``markUnplayed(request:)``
|
|
/// - ``updatePlayProgress(request:)``
|
|
///
|
|
public protocol MediaAPI {
|
|
/// This will mark the provided media key as Played.
|
|
///
|
|
/// - Parameter request: A ``Operations/MarkPlayedRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/MarkPlayedResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func markPlayed(request: Operations.MarkPlayedRequest) async throws -> Response<Operations.MarkPlayedResponse>
|
|
|
|
/// This will mark the provided media key as Unplayed.
|
|
///
|
|
/// - Parameter request: A ``Operations/MarkUnplayedRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/MarkUnplayedResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func markUnplayed(request: Operations.MarkUnplayedRequest) async throws -> Response<Operations.MarkUnplayedResponse>
|
|
|
|
/// This API command can be used to update the play progress of a media item.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/UpdatePlayProgressRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/UpdatePlayProgressResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func updatePlayProgress(request: Operations.UpdatePlayProgressRequest) async throws -> Response<Operations.UpdatePlayProgressResponse>
|
|
}
|
|
|
|
// MARK: - VideoAPI
|
|
|
|
/// API Calls that perform operations with Plex Media Server Videos
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getTimeline(request:)``
|
|
/// - ``startUniversalTranscode(request:)``
|
|
///
|
|
public protocol VideoAPI {
|
|
/// Get the timeline for a media item
|
|
///
|
|
/// - Parameter request: A ``Operations/GetTimelineRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetTimelineResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getTimeline(request: Operations.GetTimelineRequest) async throws -> Response<Operations.GetTimelineResponse>
|
|
|
|
/// Begin a Universal Transcode Session
|
|
///
|
|
/// - Parameter request: A ``Operations/StartUniversalTranscodeRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/StartUniversalTranscodeResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func startUniversalTranscode(request: Operations.StartUniversalTranscodeRequest) async throws -> Response<Operations.StartUniversalTranscodeResponse>
|
|
}
|
|
|
|
// MARK: - ActivitiesAPI
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getServerActivities()``
|
|
/// - ``cancelServerActivities(request:)``
|
|
///
|
|
public protocol ActivitiesAPI {
|
|
/// Get Server Activities
|
|
///
|
|
/// - Returns: A ``Operations/GetServerActivitiesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getServerActivities() async throws -> Response<Operations.GetServerActivitiesResponse>
|
|
|
|
/// Cancel Server Activities
|
|
///
|
|
/// - Parameter request: A ``Operations/CancelServerActivitiesRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/CancelServerActivitiesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func cancelServerActivities(request: Operations.CancelServerActivitiesRequest) async throws -> Response<Operations.CancelServerActivitiesResponse>
|
|
}
|
|
|
|
// MARK: - ButlerAPI
|
|
|
|
/// Butler is the task manager of the Plex Media Server Ecosystem.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getButlerTasks()``
|
|
/// - ``startAllTasks()``
|
|
/// - ``stopAllTasks()``
|
|
/// - ``startTask(request:)``
|
|
/// - ``stopTask(request:)``
|
|
///
|
|
public protocol ButlerAPI {
|
|
/// Returns a list of butler tasks
|
|
///
|
|
/// - Returns: A ``Operations/GetButlerTasksResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getButlerTasks() async throws -> Response<Operations.GetButlerTasksResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/StartAllTasksResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func startAllTasks() async throws -> Response<Operations.StartAllTasksResponse>
|
|
|
|
/// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/StopAllTasksResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func stopAllTasks() async throws -> Response<Operations.StopAllTasksResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/StartTaskRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/StartTaskResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func startTask(request: Operations.StartTaskRequest) async throws -> Response<Operations.StartTaskResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/StopTaskRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/StopTaskResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func stopTask(request: Operations.StopTaskRequest) async throws -> Response<Operations.StopTaskResponse>
|
|
}
|
|
|
|
// MARK: - HubsAPI
|
|
|
|
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getGlobalHubs(request:)``
|
|
/// - ``getLibraryHubs(request:)``
|
|
///
|
|
public protocol HubsAPI {
|
|
/// Get Global Hubs filtered by the parameters provided.
|
|
///
|
|
/// - Parameter request: A ``Operations/GetGlobalHubsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetGlobalHubsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getGlobalHubs(request: Operations.GetGlobalHubsRequest) async throws -> Response<Operations.GetGlobalHubsResponse>
|
|
|
|
/// This endpoint will return a list of library specific hubs
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetLibraryHubsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetLibraryHubsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getLibraryHubs(request: Operations.GetLibraryHubsRequest) async throws -> Response<Operations.GetLibraryHubsResponse>
|
|
}
|
|
|
|
// MARK: - SearchAPI
|
|
|
|
/// API Calls that perform search operations with Plex Media Server
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``performSearch(request:)``
|
|
/// - ``performVoiceSearch(request:)``
|
|
/// - ``getSearchResults(request:)``
|
|
///
|
|
public protocol SearchAPI {
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/PerformSearchRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/PerformSearchResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func performSearch(request: Operations.PerformSearchRequest) async throws -> Response<Operations.PerformSearchResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/PerformVoiceSearchRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/PerformVoiceSearchResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func performVoiceSearch(request: Operations.PerformVoiceSearchRequest) async throws -> Response<Operations.PerformVoiceSearchResponse>
|
|
|
|
/// This will search the database for the string provided.
|
|
///
|
|
/// - Parameter request: A ``Operations/GetSearchResultsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetSearchResultsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getSearchResults(request: Operations.GetSearchResultsRequest) async throws -> Response<Operations.GetSearchResultsResponse>
|
|
}
|
|
|
|
// MARK: - LibraryAPI
|
|
|
|
/// API Calls interacting with Plex Media Server Libraries
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getFileHash(request:)``
|
|
/// - ``getRecentlyAdded()``
|
|
/// - ``getLibraries()``
|
|
/// - ``getLibrary(request:)``
|
|
/// - ``deleteLibrary(request:)``
|
|
/// - ``getLibraryItems(request:)``
|
|
/// - ``refreshLibrary(request:)``
|
|
/// - ``searchLibrary(request:)``
|
|
/// - ``getMetadata(request:)``
|
|
/// - ``getMetadataChildren(request:)``
|
|
/// - ``getOnDeck()``
|
|
///
|
|
public protocol LibraryAPI {
|
|
/// This resource returns hash values for local files
|
|
///
|
|
/// - Parameter request: A ``Operations/GetFileHashRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetFileHashResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getFileHash(request: Operations.GetFileHashRequest) async throws -> Response<Operations.GetFileHashResponse>
|
|
|
|
/// This endpoint will return the recently added content.
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/GetRecentlyAddedResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getRecentlyAdded() async throws -> Response<Operations.GetRecentlyAddedResponse>
|
|
|
|
/// 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).
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/GetLibrariesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getLibraries() async throws -> Response<Operations.GetLibrariesResponse>
|
|
|
|
/// ## 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetLibraryRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetLibraryResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getLibrary(request: Operations.GetLibraryRequest) async throws -> Response<Operations.GetLibraryResponse>
|
|
|
|
/// Delate a library using a specific section
|
|
///
|
|
/// - Parameter request: A ``Operations/DeleteLibraryRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/DeleteLibraryResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func deleteLibrary(request: Operations.DeleteLibraryRequest) async throws -> Response<Operations.DeleteLibraryResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetLibraryItemsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetLibraryItemsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getLibraryItems(request: Operations.GetLibraryItemsRequest) async throws -> Response<Operations.GetLibraryItemsResponse>
|
|
|
|
/// This endpoint Refreshes the library.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/RefreshLibraryRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/RefreshLibraryResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func refreshLibrary(request: Operations.RefreshLibraryRequest) async throws -> Response<Operations.RefreshLibraryResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/SearchLibraryRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/SearchLibraryResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func searchLibrary(request: Operations.SearchLibraryRequest) async throws -> Response<Operations.SearchLibraryResponse>
|
|
|
|
/// This endpoint will return the metadata of a library item specified with the ratingKey.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetMetadataRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetMetadataResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getMetadata(request: Operations.GetMetadataRequest) async throws -> Response<Operations.GetMetadataResponse>
|
|
|
|
/// This endpoint will return the children of of a library item specified with the ratingKey.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetMetadataChildrenRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetMetadataChildrenResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getMetadataChildren(request: Operations.GetMetadataChildrenRequest) async throws -> Response<Operations.GetMetadataChildrenResponse>
|
|
|
|
/// This endpoint will return the on deck content.
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/GetOnDeckResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getOnDeck() async throws -> Response<Operations.GetOnDeckResponse>
|
|
}
|
|
|
|
// MARK: - LogAPI
|
|
|
|
/// Submit logs to the Log Handler for Plex Media Server
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``logLine(request:)``
|
|
/// - ``logMultiLine(request:)``
|
|
/// - ``enablePaperTrail()``
|
|
///
|
|
public protocol LogAPI {
|
|
/// This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/LogLineRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/LogLineResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func logLine(request: Operations.LogLineRequest) async throws -> Response<Operations.LogLineResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A string input to the API operation
|
|
/// - Returns: A ``Operations/LogMultiLineResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func logMultiLine(request: String) async throws -> Response<Operations.LogMultiLineResponse>
|
|
|
|
/// This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
|
|
///
|
|
///
|
|
/// - Returns: A ``Operations/EnablePaperTrailResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func enablePaperTrail() async throws -> Response<Operations.EnablePaperTrailResponse>
|
|
}
|
|
|
|
// MARK: - PlexAPI
|
|
public enum PlexServers {
|
|
|
|
/// Describes the available servers that can be used when making 'getPin' requests.
|
|
///
|
|
/// Use this type when making calls to ``PlexAPI/getPin(request:server:)`` to customize the server which is used.
|
|
public enum GetPin: Servers, ServerConvertible {
|
|
/// Supported server value.
|
|
///
|
|
/// Corresponds to `https://plex.tv/api/v2`
|
|
case server1
|
|
|
|
/// Defines the raw URL strings for each server option.
|
|
///
|
|
/// > Note: You do not need to use these values directly.
|
|
///
|
|
/// The available URL strings are defined as:
|
|
/// ```swift
|
|
/// public static let urlStrings = [
|
|
/// "https://plex.tv/api/v2"
|
|
/// ]
|
|
/// ```
|
|
public static let urlStrings = [
|
|
"https://plex.tv/api/v2"
|
|
]
|
|
|
|
static func `default`() throws -> Server {
|
|
return try PlexServers.GetPin.server1.server()
|
|
}
|
|
|
|
func server() throws -> Server {
|
|
switch self {
|
|
case .server1:
|
|
return try type(of: self).server(at: 0, substituting: nil)
|
|
}
|
|
}
|
|
}
|
|
|
|
/// Describes the available servers that can be used when making 'getToken' requests.
|
|
///
|
|
/// Use this type when making calls to ``PlexAPI/getToken(request:server:)`` to customize the server which is used.
|
|
public enum GetToken: Servers, ServerConvertible {
|
|
/// Supported server value.
|
|
///
|
|
/// Corresponds to `https://plex.tv/api/v2`
|
|
case server1
|
|
|
|
/// Defines the raw URL strings for each server option.
|
|
///
|
|
/// > Note: You do not need to use these values directly.
|
|
///
|
|
/// The available URL strings are defined as:
|
|
/// ```swift
|
|
/// public static let urlStrings = [
|
|
/// "https://plex.tv/api/v2"
|
|
/// ]
|
|
/// ```
|
|
public static let urlStrings = [
|
|
"https://plex.tv/api/v2"
|
|
]
|
|
|
|
static func `default`() throws -> Server {
|
|
return try PlexServers.GetToken.server1.server()
|
|
}
|
|
|
|
func server() throws -> Server {
|
|
switch self {
|
|
case .server1:
|
|
return try type(of: self).server(at: 0, substituting: nil)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// API Calls that perform operations directly against https://Plex.tv
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getPin(request:server:)``
|
|
/// - ``getToken(request:server:)``
|
|
///
|
|
public protocol PlexAPI {
|
|
/// Retrieve a Pin from Plex.tv for authentication flows
|
|
///
|
|
/// - Parameter request: A ``Operations/GetPinRequest`` object describing the input to the API operation
|
|
/// - Parameter server: An optional server override to use for this operation
|
|
/// - Returns: A ``Operations/GetPinResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getPin(request: Operations.GetPinRequest, server: PlexServers.GetPin?) async throws -> Response<Operations.GetPinResponse>
|
|
|
|
/// Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
|
///
|
|
/// - Parameter request: A ``Operations/GetTokenRequest`` object describing the input to the API operation
|
|
/// - Parameter server: An optional server override to use for this operation
|
|
/// - Returns: A ``Operations/GetTokenResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getToken(request: Operations.GetTokenRequest, server: PlexServers.GetToken?) async throws -> Response<Operations.GetTokenResponse>
|
|
}
|
|
|
|
// MARK: - PlaylistsAPI
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``createPlaylist(request:)``
|
|
/// - ``getPlaylists(request:)``
|
|
/// - ``getPlaylist(request:)``
|
|
/// - ``deletePlaylist(request:)``
|
|
/// - ``updatePlaylist(request:)``
|
|
/// - ``getPlaylistContents(request:)``
|
|
/// - ``clearPlaylistContents(request:)``
|
|
/// - ``addPlaylistContents(request:)``
|
|
/// - ``uploadPlaylist(request:)``
|
|
///
|
|
public protocol PlaylistsAPI {
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/CreatePlaylistRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/CreatePlaylistResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func createPlaylist(request: Operations.CreatePlaylistRequest) async throws -> Response<Operations.CreatePlaylistResponse>
|
|
|
|
/// Get All Playlists given the specified filters.
|
|
///
|
|
/// - Parameter request: A ``Operations/GetPlaylistsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetPlaylistsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getPlaylists(request: Operations.GetPlaylistsRequest) async throws -> Response<Operations.GetPlaylistsResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetPlaylistRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetPlaylistResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getPlaylist(request: Operations.GetPlaylistRequest) async throws -> Response<Operations.GetPlaylistResponse>
|
|
|
|
/// This endpoint will delete a playlist
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/DeletePlaylistRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/DeletePlaylistResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func deletePlaylist(request: Operations.DeletePlaylistRequest) async throws -> Response<Operations.DeletePlaylistResponse>
|
|
|
|
/// From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/UpdatePlaylistRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/UpdatePlaylistResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func updatePlaylist(request: Operations.UpdatePlaylistRequest) async throws -> Response<Operations.UpdatePlaylistResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetPlaylistContentsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetPlaylistContentsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getPlaylistContents(request: Operations.GetPlaylistContentsRequest) async throws -> Response<Operations.GetPlaylistContentsResponse>
|
|
|
|
/// Clears a playlist, only works with dumb playlists. Returns the playlist.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/ClearPlaylistContentsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/ClearPlaylistContentsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func clearPlaylistContents(request: Operations.ClearPlaylistContentsRequest) async throws -> Response<Operations.ClearPlaylistContentsResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/AddPlaylistContentsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/AddPlaylistContentsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func addPlaylistContents(request: Operations.AddPlaylistContentsRequest) async throws -> Response<Operations.AddPlaylistContentsResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/UploadPlaylistRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/UploadPlaylistResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func uploadPlaylist(request: Operations.UploadPlaylistRequest) async throws -> Response<Operations.UploadPlaylistResponse>
|
|
}
|
|
|
|
// MARK: - AuthenticationAPI
|
|
|
|
/// API Calls regarding authentication for Plex Media Server
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getTransientToken(request:)``
|
|
/// - ``getSourceConnectionInformation(request:)``
|
|
///
|
|
public protocol AuthenticationAPI {
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetTransientTokenRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetTransientTokenResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getTransientToken(request: Operations.GetTransientTokenRequest) async throws -> Response<Operations.GetTransientTokenResponse>
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/GetSourceConnectionInformationRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetSourceConnectionInformationResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getSourceConnectionInformation(request: Operations.GetSourceConnectionInformationRequest) async throws -> Response<Operations.GetSourceConnectionInformationResponse>
|
|
}
|
|
|
|
// MARK: - StatisticsAPI
|
|
|
|
/// API Calls that perform operations with Plex Media Server Statistics
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getStatistics(request:)``
|
|
///
|
|
public protocol StatisticsAPI {
|
|
/// This will return the media statistics for the server
|
|
///
|
|
/// - Parameter request: A ``Operations/GetStatisticsRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/GetStatisticsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getStatistics(request: Operations.GetStatisticsRequest) async throws -> Response<Operations.GetStatisticsResponse>
|
|
}
|
|
|
|
// MARK: - SessionsAPI
|
|
|
|
/// API Calls that perform search operations with Plex Media Server Sessions
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getSessions()``
|
|
/// - ``getSessionHistory()``
|
|
/// - ``getTranscodeSessions()``
|
|
/// - ``stopTranscodeSession(request:)``
|
|
///
|
|
public protocol SessionsAPI {
|
|
/// This will retrieve the "Now Playing" Information of the PMS.
|
|
///
|
|
/// - Returns: A ``Operations/GetSessionsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getSessions() async throws -> Response<Operations.GetSessionsResponse>
|
|
|
|
/// This will Retrieve a listing of all history views.
|
|
///
|
|
/// - Returns: A ``Operations/GetSessionHistoryResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getSessionHistory() async throws -> Response<Operations.GetSessionHistoryResponse>
|
|
|
|
/// Get Transcode Sessions
|
|
///
|
|
/// - Returns: A ``Operations/GetTranscodeSessionsResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getTranscodeSessions() async throws -> Response<Operations.GetTranscodeSessionsResponse>
|
|
|
|
/// Stop a Transcode Session
|
|
///
|
|
/// - Parameter request: A ``Operations/StopTranscodeSessionRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/StopTranscodeSessionResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func stopTranscodeSession(request: Operations.StopTranscodeSessionRequest) async throws -> Response<Operations.StopTranscodeSessionResponse>
|
|
}
|
|
|
|
// MARK: - UpdaterAPI
|
|
|
|
/// 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.
|
|
///
|
|
///
|
|
/// ## Topics
|
|
///
|
|
/// ### API calls
|
|
///
|
|
/// - ``getUpdateStatus()``
|
|
/// - ``checkForUpdates(request:)``
|
|
/// - ``applyUpdates(request:)``
|
|
///
|
|
public protocol UpdaterAPI {
|
|
/// Querying status of updates
|
|
///
|
|
/// - Returns: A ``Operations/GetUpdateStatusResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func getUpdateStatus() async throws -> Response<Operations.GetUpdateStatusResponse>
|
|
|
|
/// Checking for updates
|
|
///
|
|
/// - Parameter request: A ``Operations/CheckForUpdatesRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/CheckForUpdatesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func checkForUpdates(request: Operations.CheckForUpdatesRequest) async throws -> Response<Operations.CheckForUpdatesResponse>
|
|
|
|
/// Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
|
|
///
|
|
///
|
|
/// - Parameter request: A ``Operations/ApplyUpdatesRequest`` object describing the input to the API operation
|
|
/// - Returns: A ``Operations/ApplyUpdatesResponse`` object describing the result of the API operation
|
|
/// - Throws: An error of type ``PlexswiftError``
|
|
func applyUpdates(request: Operations.ApplyUpdatesRequest) async throws -> Response<Operations.ApplyUpdatesResponse>
|
|
}
|