Files
plexjs/dist/sdk-output/api.js
2023-04-17 15:33:39 +00:00

3659 lines
216 KiB
JavaScript

/* tslint:disable */
/* eslint-disable */
/**
* Plex-API
* An Open API Spec for interacting with Plex.tv and Plex Servers
*
* The version of the OpenAPI document: 0.0.3
* Contact: Lukeslakemail@gmail.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from './common';
// @ts-ignore
import { BASE_PATH, BaseAPI } from './base';
/**
* ActivitiesApi - axios parameter creator
* @export
*/
export const ActivitiesApiAxiosParamCreator = function (configuration) {
return {
/**
* Cancel Server Activities
* @summary Cancel Server Activities
* @param {any} activityUUID The UUID of the activity to cancel.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
cancelServerActivities: async (activityUUID, axiosOptions = {}) => {
// verify required parameter 'activityUUID' is not null or undefined
assertParamExists('cancelServerActivities', 'activityUUID', activityUUID);
const localVarPath = `/activities/{activityUUID}`
.replace(`{${"activityUUID"}}`, encodeURIComponent(String(activityUUID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Server Activities
* @summary Get Server Activities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerActivities: async (axiosOptions = {}) => {
const localVarPath = `/activities`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* ActivitiesApi - functional programming interface
* @export
*/
export const ActivitiesApiFp = function (configuration) {
const localVarAxiosParamCreator = ActivitiesApiAxiosParamCreator(configuration);
return {
/**
* Cancel Server Activities
* @summary Cancel Server Activities
* @param {any} activityUUID The UUID of the activity to cancel.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async cancelServerActivities(activityUUID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.cancelServerActivities(activityUUID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Server Activities
* @summary Get Server Activities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getServerActivities(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getServerActivities(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* ActivitiesApi - factory interface
* @export
*/
export const ActivitiesApiFactory = function (configuration, basePath, axios) {
const localVarFp = ActivitiesApiFp(configuration);
return {
/**
* Cancel Server Activities
* @summary Cancel Server Activities
* @param {any} activityUUID The UUID of the activity to cancel.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
cancelServerActivities(activityUUID, axiosOptions) {
return localVarFp.cancelServerActivities(activityUUID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Server Activities
* @summary Get Server Activities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerActivities(axiosOptions) {
return localVarFp.getServerActivities(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* ActivitiesApi - object-oriented interface
* @export
* @class ActivitiesApi
* @extends {BaseAPI}
*/
export class ActivitiesApi extends BaseAPI {
/**
* Cancel Server Activities
* @summary Cancel Server Activities
* @param {ActivitiesApiCancelServerActivitiesRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ActivitiesApi
*/
cancelServerActivities(requestParameters, axiosOptions) {
return ActivitiesApiFp(this.configuration).cancelServerActivities(requestParameters.activityUUID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Server Activities
* @summary Get Server Activities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ActivitiesApi
*/
getServerActivities(axiosOptions) {
return ActivitiesApiFp(this.configuration).getServerActivities(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* AuthenticationApi - axios parameter creator
* @export
*/
export const AuthenticationApiAxiosParamCreator = function (configuration) {
return {
/**
* Retrieve a Pin from Plex.tv for authentication flows
* @summary Get a Pin
* @param {any} [strong] Determines the kind of code returned by the API call Strong codes are used for Pin authentication flows Non-Strong codes are used for `Plex.tv/link`
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPin: async (strong, axiosOptions = {}) => {
const localVarPath = `/pins`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
if (strong !== undefined) {
localVarQueryParameter['strong'] = strong;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
* @summary Get Access Token
* @param {any} pinID The PinID to retrieve an access token for
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getToken: async (pinID, axiosOptions = {}) => {
// verify required parameter 'pinID' is not null or undefined
assertParamExists('getToken', 'pinID', pinID);
const localVarPath = `/pins/{pinID}`
.replace(`{${"pinID"}}`, encodeURIComponent(String(pinID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* AuthenticationApi - functional programming interface
* @export
*/
export const AuthenticationApiFp = function (configuration) {
const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration);
return {
/**
* Retrieve a Pin from Plex.tv for authentication flows
* @summary Get a Pin
* @param {any} [strong] Determines the kind of code returned by the API call Strong codes are used for Pin authentication flows Non-Strong codes are used for `Plex.tv/link`
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getPin(strong, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPin(strong, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
* @summary Get Access Token
* @param {any} pinID The PinID to retrieve an access token for
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getToken(pinID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getToken(pinID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* AuthenticationApi - factory interface
* @export
*/
export const AuthenticationApiFactory = function (configuration, basePath, axios) {
const localVarFp = AuthenticationApiFp(configuration);
return {
/**
* Retrieve a Pin from Plex.tv for authentication flows
* @summary Get a Pin
* @param {any} [strong] Determines the kind of code returned by the API call Strong codes are used for Pin authentication flows Non-Strong codes are used for `Plex.tv/link`
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPin(strong, axiosOptions) {
return localVarFp.getPin(strong, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
* @summary Get Access Token
* @param {any} pinID The PinID to retrieve an access token for
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getToken(pinID, axiosOptions) {
return localVarFp.getToken(pinID, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* AuthenticationApi - object-oriented interface
* @export
* @class AuthenticationApi
* @extends {BaseAPI}
*/
export class AuthenticationApi extends BaseAPI {
/**
* Retrieve a Pin from Plex.tv for authentication flows
* @summary Get a Pin
* @param {AuthenticationApiGetPinRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof AuthenticationApi
*/
getPin(requestParameters = {}, axiosOptions) {
return AuthenticationApiFp(this.configuration).getPin(requestParameters.strong, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
* @summary Get Access Token
* @param {AuthenticationApiGetTokenRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof AuthenticationApi
*/
getToken(requestParameters, axiosOptions) {
return AuthenticationApiFp(this.configuration).getToken(requestParameters.pinID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* ButlerApi - axios parameter creator
* @export
*/
export const ButlerApiAxiosParamCreator = function (configuration) {
return {
/**
* 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.
* @summary Start all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
startAllTasks: async (axiosOptions = {}) => {
const localVarPath = `/butler`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Start a single Butler task
* @param {any} taskName the name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
startTask: async (taskName, axiosOptions = {}) => {
// verify required parameter 'taskName' is not null or undefined
assertParamExists('startTask', 'taskName', taskName);
const localVarPath = `/butler/{taskName}`
.replace(`{${"taskName"}}`, encodeURIComponent(String(taskName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
* @summary Stop all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
stopAllTasks: async (axiosOptions = {}) => {
const localVarPath = `/butler`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Stop a single Butler task
* @param {any} taskName The name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
stopTask: async (taskName, axiosOptions = {}) => {
// verify required parameter 'taskName' is not null or undefined
assertParamExists('stopTask', 'taskName', taskName);
const localVarPath = `/butler/{taskName}`
.replace(`{${"taskName"}}`, encodeURIComponent(String(taskName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* ButlerApi - functional programming interface
* @export
*/
export const ButlerApiFp = function (configuration) {
const localVarAxiosParamCreator = ButlerApiAxiosParamCreator(configuration);
return {
/**
* 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.
* @summary Start all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async startAllTasks(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.startAllTasks(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Start a single Butler task
* @param {any} taskName the name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async startTask(taskName, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.startTask(taskName, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
* @summary Stop all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async stopAllTasks(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.stopAllTasks(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Stop a single Butler task
* @param {any} taskName The name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async stopTask(taskName, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.stopTask(taskName, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* ButlerApi - factory interface
* @export
*/
export const ButlerApiFactory = function (configuration, basePath, axios) {
const localVarFp = ButlerApiFp(configuration);
return {
/**
* 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.
* @summary Start all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
startAllTasks(axiosOptions) {
return localVarFp.startAllTasks(axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Start a single Butler task
* @param {any} taskName the name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
startTask(taskName, axiosOptions) {
return localVarFp.startTask(taskName, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
* @summary Stop all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
stopAllTasks(axiosOptions) {
return localVarFp.stopAllTasks(axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Stop a single Butler task
* @param {any} taskName The name of the task to be started.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
stopTask(taskName, axiosOptions) {
return localVarFp.stopTask(taskName, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* ButlerApi - object-oriented interface
* @export
* @class ButlerApi
* @extends {BaseAPI}
*/
export class ButlerApi extends BaseAPI {
/**
* 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.
* @summary Start all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ButlerApi
*/
startAllTasks(axiosOptions) {
return ButlerApiFp(this.configuration).startAllTasks(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Start a single Butler task
* @param {ButlerApiStartTaskRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ButlerApi
*/
startTask(requestParameters, axiosOptions) {
return ButlerApiFp(this.configuration).startTask(requestParameters.taskName, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
* @summary Stop all Butler tasks
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ButlerApi
*/
stopAllTasks(axiosOptions) {
return ButlerApiFp(this.configuration).stopAllTasks(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Stop a single Butler task
* @param {ButlerApiStopTaskRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ButlerApi
*/
stopTask(requestParameters, axiosOptions) {
return ButlerApiFp(this.configuration).stopTask(requestParameters.taskName, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* DevicesApi - axios parameter creator
* @export
*/
export const DevicesApiAxiosParamCreator = function (configuration) {
return {
/**
* Get Available Clients
* @summary Get Available Clients
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getAvailableClients: async (axiosOptions = {}) => {
const localVarPath = `/clients`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Devices
* @summary Get Devices
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getDevices: async (axiosOptions = {}) => {
const localVarPath = `/resources`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* DevicesApi - functional programming interface
* @export
*/
export const DevicesApiFp = function (configuration) {
const localVarAxiosParamCreator = DevicesApiAxiosParamCreator(configuration);
return {
/**
* Get Available Clients
* @summary Get Available Clients
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getAvailableClients(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAvailableClients(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Devices
* @summary Get Devices
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getDevices(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDevices(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* DevicesApi - factory interface
* @export
*/
export const DevicesApiFactory = function (configuration, basePath, axios) {
const localVarFp = DevicesApiFp(configuration);
return {
/**
* Get Available Clients
* @summary Get Available Clients
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getAvailableClients(axiosOptions) {
return localVarFp.getAvailableClients(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Devices
* @summary Get Devices
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getDevices(axiosOptions) {
return localVarFp.getDevices(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* DevicesApi - object-oriented interface
* @export
* @class DevicesApi
* @extends {BaseAPI}
*/
export class DevicesApi extends BaseAPI {
/**
* Get Available Clients
* @summary Get Available Clients
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof DevicesApi
*/
getAvailableClients(axiosOptions) {
return DevicesApiFp(this.configuration).getAvailableClients(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Devices
* @summary Get Devices
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof DevicesApi
*/
getDevices(axiosOptions) {
return DevicesApiFp(this.configuration).getDevices(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* HashesApi - axios parameter creator
* @export
*/
export const HashesApiAxiosParamCreator = function (configuration) {
return {
/**
* This resource returns hash values for local files
* @summary Get Hash Value
* @param {any} url This is the path to the local file, must be prefixed by `file://`
* @param {any} [type] Item type
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getFileHash: async (url, type, axiosOptions = {}) => {
// verify required parameter 'url' is not null or undefined
assertParamExists('getFileHash', 'url', url);
const localVarPath = `/library/hashes`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (url !== undefined) {
localVarQueryParameter['url'] = url;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* HashesApi - functional programming interface
* @export
*/
export const HashesApiFp = function (configuration) {
const localVarAxiosParamCreator = HashesApiAxiosParamCreator(configuration);
return {
/**
* This resource returns hash values for local files
* @summary Get Hash Value
* @param {any} url This is the path to the local file, must be prefixed by `file://`
* @param {any} [type] Item type
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getFileHash(url, type, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getFileHash(url, type, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* HashesApi - factory interface
* @export
*/
export const HashesApiFactory = function (configuration, basePath, axios) {
const localVarFp = HashesApiFp(configuration);
return {
/**
* This resource returns hash values for local files
* @summary Get Hash Value
* @param {any} url This is the path to the local file, must be prefixed by `file://`
* @param {any} [type] Item type
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getFileHash(url, type, axiosOptions) {
return localVarFp.getFileHash(url, type, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* HashesApi - object-oriented interface
* @export
* @class HashesApi
* @extends {BaseAPI}
*/
export class HashesApi extends BaseAPI {
/**
* This resource returns hash values for local files
* @summary Get Hash Value
* @param {HashesApiGetFileHashRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof HashesApi
*/
getFileHash(requestParameters, axiosOptions) {
return HashesApiFp(this.configuration).getFileHash(requestParameters.url, requestParameters.type, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* HubsApi - axios parameter creator
* @export
*/
export const HubsApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Get Global Hubs
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getGlobalHubs: async (count, onlyTransient, axiosOptions = {}) => {
const localVarPath = `/hubs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (count !== undefined) {
localVarQueryParameter['count'] = count;
}
if (onlyTransient !== undefined) {
localVarQueryParameter['onlyTransient'] = onlyTransient;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will return a list of library specific hubs
* @summary Get library specific hubs
* @param {any} sectionId the Id of the library to query
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryHubs: async (sectionId, count, onlyTransient, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('getLibraryHubs', 'sectionId', sectionId);
const localVarPath = `/hubs/sections/{sectionId}`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (count !== undefined) {
localVarQueryParameter['count'] = count;
}
if (onlyTransient !== undefined) {
localVarQueryParameter['onlyTransient'] = onlyTransient;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* HubsApi - functional programming interface
* @export
*/
export const HubsApiFp = function (configuration) {
const localVarAxiosParamCreator = HubsApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Get Global Hubs
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getGlobalHubs(count, onlyTransient, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getGlobalHubs(count, onlyTransient, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will return a list of library specific hubs
* @summary Get library specific hubs
* @param {any} sectionId the Id of the library to query
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getLibraryHubs(sectionId, count, onlyTransient, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraryHubs(sectionId, count, onlyTransient, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* HubsApi - factory interface
* @export
*/
export const HubsApiFactory = function (configuration, basePath, axios) {
const localVarFp = HubsApiFp(configuration);
return {
/**
*
* @summary Get Global Hubs
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getGlobalHubs(count, onlyTransient, axiosOptions) {
return localVarFp.getGlobalHubs(count, onlyTransient, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will return a list of library specific hubs
* @summary Get library specific hubs
* @param {any} sectionId the Id of the library to query
* @param {any} [count] The number of items to return with each hub.
* @param {any} [onlyTransient] Only return hubs which are \"transient\", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryHubs(sectionId, count, onlyTransient, axiosOptions) {
return localVarFp.getLibraryHubs(sectionId, count, onlyTransient, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* HubsApi - object-oriented interface
* @export
* @class HubsApi
* @extends {BaseAPI}
*/
export class HubsApi extends BaseAPI {
/**
*
* @summary Get Global Hubs
* @param {HubsApiGetGlobalHubsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof HubsApi
*/
getGlobalHubs(requestParameters = {}, axiosOptions) {
return HubsApiFp(this.configuration).getGlobalHubs(requestParameters.count, requestParameters.onlyTransient, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will return a list of library specific hubs
* @summary Get library specific hubs
* @param {HubsApiGetLibraryHubsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof HubsApi
*/
getLibraryHubs(requestParameters, axiosOptions) {
return HubsApiFp(this.configuration).getLibraryHubs(requestParameters.sectionId, requestParameters.count, requestParameters.onlyTransient, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* LibraryApi - axios parameter creator
* @export
*/
export const LibraryApiAxiosParamCreator = function (configuration) {
return {
/**
* Represents a \"Common\" item. It contains only the common attributes of the items selected by the provided filter
* @summary Get Common Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getCommonLibraryItems: async (sectionId, type, filter, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('getCommonLibraryItems', 'sectionId', sectionId);
// verify required parameter 'type' is not null or undefined
assertParamExists('getCommonLibraryItems', 'type', type);
const localVarPath = `/library/sections/{sectionId}/common`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (filter !== undefined) {
localVarQueryParameter['filter'] = filter;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will return a list of the latest library items filtered by the filter and type provided
* @summary Get Latest Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLatestLibraryItems: async (sectionId, type, filter, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('getLatestLibraryItems', 'sectionId', sectionId);
// verify required parameter 'type' is not null or undefined
assertParamExists('getLatestLibraryItems', 'type', type);
const localVarPath = `/library/sections/{sectionId}/latest`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (filter !== undefined) {
localVarQueryParameter['filter'] = filter;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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).
* @summary Get All Libraries
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraries: async (axiosOptions = {}) => {
const localVarPath = `/library/sections`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Get Library Details
* @param {any} sectionId the Id of the library to query
* @param {any} [includeDetails] Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryDetails: async (sectionId, includeDetails, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('getLibraryDetails', 'sectionId', sectionId);
const localVarPath = `/library/sections/{sectionId}`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (includeDetails !== undefined) {
localVarQueryParameter['includeDetails'] = includeDetails;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will return a list of library items filtered by the filter and type provided
* @summary Get Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} [type] item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryItems: async (sectionId, type, filter, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('getLibraryItems', 'sectionId', sectionId);
const localVarPath = `/library/sections/{sectionId}/all`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (filter !== undefined) {
localVarQueryParameter['filter'] = filter;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will return the on deck content.
* @summary Get On Deck
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getOnDeck: async (axiosOptions = {}) => {
const localVarPath = `/library/onDeck`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint Refreshes the library.
* @summary Refresh Library
* @param {any} sectionId the Id of the library to refresh
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
refreshLibrary: async (sectionId, axiosOptions = {}) => {
// verify required parameter 'sectionId' is not null or undefined
assertParamExists('refreshLibrary', 'sectionId', sectionId);
const localVarPath = `/library/sections/{sectionId}/refresh`
.replace(`{${"sectionId"}}`, encodeURIComponent(String(sectionId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* LibraryApi - functional programming interface
* @export
*/
export const LibraryApiFp = function (configuration) {
const localVarAxiosParamCreator = LibraryApiAxiosParamCreator(configuration);
return {
/**
* Represents a \"Common\" item. It contains only the common attributes of the items selected by the provided filter
* @summary Get Common Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getCommonLibraryItems(sectionId, type, filter, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCommonLibraryItems(sectionId, type, filter, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will return a list of the latest library items filtered by the filter and type provided
* @summary Get Latest Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getLatestLibraryItems(sectionId, type, filter, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLatestLibraryItems(sectionId, type, filter, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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).
* @summary Get All Libraries
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getLibraries(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraries(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Get Library Details
* @param {any} sectionId the Id of the library to query
* @param {any} [includeDetails] Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getLibraryDetails(sectionId, includeDetails, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraryDetails(sectionId, includeDetails, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will return a list of library items filtered by the filter and type provided
* @summary Get Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} [type] item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getLibraryItems(sectionId, type, filter, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraryItems(sectionId, type, filter, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will return the on deck content.
* @summary Get On Deck
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getOnDeck(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getOnDeck(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint Refreshes the library.
* @summary Refresh Library
* @param {any} sectionId the Id of the library to refresh
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async refreshLibrary(sectionId, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshLibrary(sectionId, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* LibraryApi - factory interface
* @export
*/
export const LibraryApiFactory = function (configuration, basePath, axios) {
const localVarFp = LibraryApiFp(configuration);
return {
/**
* Represents a \"Common\" item. It contains only the common attributes of the items selected by the provided filter
* @summary Get Common Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getCommonLibraryItems(sectionId, type, filter, axiosOptions) {
return localVarFp.getCommonLibraryItems(sectionId, type, filter, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will return a list of the latest library items filtered by the filter and type provided
* @summary Get Latest Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} type item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLatestLibraryItems(sectionId, type, filter, axiosOptions) {
return localVarFp.getLatestLibraryItems(sectionId, type, filter, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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).
* @summary Get All Libraries
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraries(axiosOptions) {
return localVarFp.getLibraries(axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Get Library Details
* @param {any} sectionId the Id of the library to query
* @param {any} [includeDetails] Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryDetails(sectionId, includeDetails, axiosOptions) {
return localVarFp.getLibraryDetails(sectionId, includeDetails, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will return a list of library items filtered by the filter and type provided
* @summary Get Library Items
* @param {any} sectionId the Id of the library to query
* @param {any} [type] item type
* @param {any} [filter] the filter parameter
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getLibraryItems(sectionId, type, filter, axiosOptions) {
return localVarFp.getLibraryItems(sectionId, type, filter, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will return the on deck content.
* @summary Get On Deck
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getOnDeck(axiosOptions) {
return localVarFp.getOnDeck(axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint Refreshes the library.
* @summary Refresh Library
* @param {any} sectionId the Id of the library to refresh
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
refreshLibrary(sectionId, axiosOptions) {
return localVarFp.refreshLibrary(sectionId, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* LibraryApi - object-oriented interface
* @export
* @class LibraryApi
* @extends {BaseAPI}
*/
export class LibraryApi extends BaseAPI {
/**
* Represents a \"Common\" item. It contains only the common attributes of the items selected by the provided filter
* @summary Get Common Library Items
* @param {LibraryApiGetCommonLibraryItemsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getCommonLibraryItems(requestParameters, axiosOptions) {
return LibraryApiFp(this.configuration).getCommonLibraryItems(requestParameters.sectionId, requestParameters.type, requestParameters.filter, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will return a list of the latest library items filtered by the filter and type provided
* @summary Get Latest Library Items
* @param {LibraryApiGetLatestLibraryItemsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getLatestLibraryItems(requestParameters, axiosOptions) {
return LibraryApiFp(this.configuration).getLatestLibraryItems(requestParameters.sectionId, requestParameters.type, requestParameters.filter, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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).
* @summary Get All Libraries
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getLibraries(axiosOptions) {
return LibraryApiFp(this.configuration).getLibraries(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Get Library Details
* @param {LibraryApiGetLibraryDetailsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getLibraryDetails(requestParameters, axiosOptions) {
return LibraryApiFp(this.configuration).getLibraryDetails(requestParameters.sectionId, requestParameters.includeDetails, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will return a list of library items filtered by the filter and type provided
* @summary Get Library Items
* @param {LibraryApiGetLibraryItemsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getLibraryItems(requestParameters, axiosOptions) {
return LibraryApiFp(this.configuration).getLibraryItems(requestParameters.sectionId, requestParameters.type, requestParameters.filter, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will return the on deck content.
* @summary Get On Deck
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
getOnDeck(axiosOptions) {
return LibraryApiFp(this.configuration).getOnDeck(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint Refreshes the library.
* @summary Refresh Library
* @param {LibraryApiRefreshLibraryRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LibraryApi
*/
refreshLibrary(requestParameters, axiosOptions) {
return LibraryApiFp(this.configuration).refreshLibrary(requestParameters.sectionId, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* LogApi - axios parameter creator
* @export
*/
export const LogApiAxiosParamCreator = function (configuration) {
return {
/**
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
* @summary Enabling Papertrail
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
enablePaperTrail: async (axiosOptions = {}) => {
const localVarPath = `/log/networked`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
* @summary Logging a single line message.
* @param {any} level An integer log level to write to the PMS log with. 0: Error 1: Warning 2: Info 3: Debug 4: Verbose
* @param {any} message The text of the message to write to the log.
* @param {any} source a string indicating the source of the message.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
logLine: async (level, message, source, axiosOptions = {}) => {
// verify required parameter 'level' is not null or undefined
assertParamExists('logLine', 'level', level);
// verify required parameter 'message' is not null or undefined
assertParamExists('logLine', 'message', message);
// verify required parameter 'source' is not null or undefined
assertParamExists('logLine', 'source', source);
const localVarPath = `/log`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (level !== undefined) {
localVarQueryParameter['level'] = level;
}
if (message !== undefined) {
localVarQueryParameter['message'] = message;
}
if (source !== undefined) {
localVarQueryParameter['source'] = source;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Logging a multi-line message
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
logMultiLine: async (axiosOptions = {}) => {
const localVarPath = `/log`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* LogApi - functional programming interface
* @export
*/
export const LogApiFp = function (configuration) {
const localVarAxiosParamCreator = LogApiAxiosParamCreator(configuration);
return {
/**
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
* @summary Enabling Papertrail
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async enablePaperTrail(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.enablePaperTrail(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
* @summary Logging a single line message.
* @param {any} level An integer log level to write to the PMS log with. 0: Error 1: Warning 2: Info 3: Debug 4: Verbose
* @param {any} message The text of the message to write to the log.
* @param {any} source a string indicating the source of the message.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async logLine(level, message, source, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.logLine(level, message, source, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Logging a multi-line message
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async logMultiLine(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.logMultiLine(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* LogApi - factory interface
* @export
*/
export const LogApiFactory = function (configuration, basePath, axios) {
const localVarFp = LogApiFp(configuration);
return {
/**
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
* @summary Enabling Papertrail
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
enablePaperTrail(axiosOptions) {
return localVarFp.enablePaperTrail(axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
* @summary Logging a single line message.
* @param {any} level An integer log level to write to the PMS log with. 0: Error 1: Warning 2: Info 3: Debug 4: Verbose
* @param {any} message The text of the message to write to the log.
* @param {any} source a string indicating the source of the message.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
logLine(level, message, source, axiosOptions) {
return localVarFp.logLine(level, message, source, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Logging a multi-line message
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
logMultiLine(axiosOptions) {
return localVarFp.logMultiLine(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* LogApi - object-oriented interface
* @export
* @class LogApi
* @extends {BaseAPI}
*/
export class LogApi extends BaseAPI {
/**
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
* @summary Enabling Papertrail
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LogApi
*/
enablePaperTrail(axiosOptions) {
return LogApiFp(this.configuration).enablePaperTrail(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
* @summary Logging a single line message.
* @param {LogApiLogLineRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LogApi
*/
logLine(requestParameters, axiosOptions) {
return LogApiFp(this.configuration).logLine(requestParameters.level, requestParameters.message, requestParameters.source, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Logging a multi-line message
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof LogApi
*/
logMultiLine(axiosOptions) {
return LogApiFp(this.configuration).logMultiLine(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* PlaylistsApi - axios parameter creator
* @export
*/
export const PlaylistsApiAxiosParamCreator = function (configuration) {
return {
/**
* 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.
* @summary Adding to a Playlist
* @param {any} playlistID the ID of the playlist
* @param {any} uri the content URI for the playlist
* @param {any} playQueueID the play queue to add to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
addPlaylistContents: async (playlistID, uri, playQueueID, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('addPlaylistContents', 'playlistID', playlistID);
// verify required parameter 'uri' is not null or undefined
assertParamExists('addPlaylistContents', 'uri', uri);
// verify required parameter 'playQueueID' is not null or undefined
assertParamExists('addPlaylistContents', 'playQueueID', playQueueID);
const localVarPath = `/playlists/{playlistID}/items`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (uri !== undefined) {
localVarQueryParameter['uri'] = uri;
}
if (playQueueID !== undefined) {
localVarQueryParameter['playQueueID'] = playQueueID;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Clears a playlist, only works with dumb playlists. Returns the playlist.
* @summary Delete Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
clearPlaylistContents: async (playlistID, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('clearPlaylistContents', 'playlistID', playlistID);
const localVarPath = `/playlists/{playlistID}/items`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Create a Playlist
* @param {any} title name of the playlist
* @param {any} type type of playlist to create
* @param {any} smart whether the playlist is smart or not
* @param {any} [uri] the content URI for the playlist
* @param {any} [playQueueID] the play queue to copy to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
createPlaylist: async (title, type, smart, uri, playQueueID, axiosOptions = {}) => {
// verify required parameter 'title' is not null or undefined
assertParamExists('createPlaylist', 'title', title);
// verify required parameter 'type' is not null or undefined
assertParamExists('createPlaylist', 'type', type);
// verify required parameter 'smart' is not null or undefined
assertParamExists('createPlaylist', 'smart', smart);
const localVarPath = `/playlists`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (title !== undefined) {
localVarQueryParameter['title'] = title;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (smart !== undefined) {
localVarQueryParameter['smart'] = smart;
}
if (uri !== undefined) {
localVarQueryParameter['uri'] = uri;
}
if (playQueueID !== undefined) {
localVarQueryParameter['playQueueID'] = playQueueID;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This endpoint will delete a playlist
* @summary Deletes a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
deletePlaylist: async (playlistID, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('deletePlaylist', 'playlistID', playlistID);
const localVarPath = `/playlists/{playlistID}`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Retrieve Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylist: async (playlistID, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('getPlaylist', 'playlistID', playlistID);
const localVarPath = `/playlists/{playlistID}`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Retrieve Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {any} type the metadata type of the item to return
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylistContents: async (playlistID, type, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('getPlaylistContents', 'playlistID', playlistID);
// verify required parameter 'type' is not null or undefined
assertParamExists('getPlaylistContents', 'type', type);
const localVarPath = `/playlists/{playlistID}/items`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
*
* @summary Get All Playlists
* @param {any} [playlistType] limit to a type of playlist.
* @param {any} [smart] type of playlists to return (default is all).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylists: async (playlistType, smart, axiosOptions = {}) => {
const localVarPath = `/playlists/all`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (playlistType !== undefined) {
localVarQueryParameter['playlistType'] = playlistType;
}
if (smart !== undefined) {
localVarQueryParameter['smart'] = smart;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
* @summary Update a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
updatePlaylist: async (playlistID, axiosOptions = {}) => {
// verify required parameter 'playlistID' is not null or undefined
assertParamExists('updatePlaylist', 'playlistID', playlistID);
const localVarPath = `/playlists/{playlistID}`
.replace(`{${"playlistID"}}`, encodeURIComponent(String(playlistID)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Upload Playlist
* @param {any} path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. If the `path` argument is a directory, that path will be scanned for playlist files to be processed. Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. The GUID of each playlist is based on the filename. 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. The GUID of each playlist is based on the filename.
* @param {any} force force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. 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.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
uploadPlaylist: async (path, force, axiosOptions = {}) => {
// verify required parameter 'path' is not null or undefined
assertParamExists('uploadPlaylist', 'path', path);
// verify required parameter 'force' is not null or undefined
assertParamExists('uploadPlaylist', 'force', force);
const localVarPath = `/playlists/upload`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (path !== undefined) {
localVarQueryParameter['path'] = path;
}
if (force !== undefined) {
localVarQueryParameter['force'] = force;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* PlaylistsApi - functional programming interface
* @export
*/
export const PlaylistsApiFp = function (configuration) {
const localVarAxiosParamCreator = PlaylistsApiAxiosParamCreator(configuration);
return {
/**
* 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.
* @summary Adding to a Playlist
* @param {any} playlistID the ID of the playlist
* @param {any} uri the content URI for the playlist
* @param {any} playQueueID the play queue to add to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async addPlaylistContents(playlistID, uri, playQueueID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.addPlaylistContents(playlistID, uri, playQueueID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Clears a playlist, only works with dumb playlists. Returns the playlist.
* @summary Delete Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async clearPlaylistContents(playlistID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.clearPlaylistContents(playlistID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Create a Playlist
* @param {any} title name of the playlist
* @param {any} type type of playlist to create
* @param {any} smart whether the playlist is smart or not
* @param {any} [uri] the content URI for the playlist
* @param {any} [playQueueID] the play queue to copy to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async createPlaylist(title, type, smart, uri, playQueueID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createPlaylist(title, type, smart, uri, playQueueID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This endpoint will delete a playlist
* @summary Deletes a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async deletePlaylist(playlistID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.deletePlaylist(playlistID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Retrieve Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getPlaylist(playlistID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylist(playlistID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Retrieve Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {any} type the metadata type of the item to return
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getPlaylistContents(playlistID, type, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylistContents(playlistID, type, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Get All Playlists
* @param {any} [playlistType] limit to a type of playlist.
* @param {any} [smart] type of playlists to return (default is all).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getPlaylists(playlistType, smart, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylists(playlistType, smart, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
* @summary Update a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async updatePlaylist(playlistID, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.updatePlaylist(playlistID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Upload Playlist
* @param {any} path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. If the `path` argument is a directory, that path will be scanned for playlist files to be processed. Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. The GUID of each playlist is based on the filename. 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. The GUID of each playlist is based on the filename.
* @param {any} force force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. 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.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async uploadPlaylist(path, force, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.uploadPlaylist(path, force, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* PlaylistsApi - factory interface
* @export
*/
export const PlaylistsApiFactory = function (configuration, basePath, axios) {
const localVarFp = PlaylistsApiFp(configuration);
return {
/**
* 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.
* @summary Adding to a Playlist
* @param {any} playlistID the ID of the playlist
* @param {any} uri the content URI for the playlist
* @param {any} playQueueID the play queue to add to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
addPlaylistContents(playlistID, uri, playQueueID, axiosOptions) {
return localVarFp.addPlaylistContents(playlistID, uri, playQueueID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Clears a playlist, only works with dumb playlists. Returns the playlist.
* @summary Delete Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
clearPlaylistContents(playlistID, axiosOptions) {
return localVarFp.clearPlaylistContents(playlistID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Create a Playlist
* @param {any} title name of the playlist
* @param {any} type type of playlist to create
* @param {any} smart whether the playlist is smart or not
* @param {any} [uri] the content URI for the playlist
* @param {any} [playQueueID] the play queue to copy to a playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
createPlaylist(title, type, smart, uri, playQueueID, axiosOptions) {
return localVarFp.createPlaylist(title, type, smart, uri, playQueueID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* This endpoint will delete a playlist
* @summary Deletes a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
deletePlaylist(playlistID, axiosOptions) {
return localVarFp.deletePlaylist(playlistID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Retrieve Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylist(playlistID, axiosOptions) {
return localVarFp.getPlaylist(playlistID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Retrieve Playlist Contents
* @param {any} playlistID the ID of the playlist
* @param {any} type the metadata type of the item to return
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylistContents(playlistID, type, axiosOptions) {
return localVarFp.getPlaylistContents(playlistID, type, axiosOptions).then((request) => request(axios, basePath));
},
/**
*
* @summary Get All Playlists
* @param {any} [playlistType] limit to a type of playlist.
* @param {any} [smart] type of playlists to return (default is all).
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPlaylists(playlistType, smart, axiosOptions) {
return localVarFp.getPlaylists(playlistType, smart, axiosOptions).then((request) => request(axios, basePath));
},
/**
* From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
* @summary Update a Playlist
* @param {any} playlistID the ID of the playlist
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
updatePlaylist(playlistID, axiosOptions) {
return localVarFp.updatePlaylist(playlistID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Upload Playlist
* @param {any} path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. If the `path` argument is a directory, that path will be scanned for playlist files to be processed. Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. The GUID of each playlist is based on the filename. 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. The GUID of each playlist is based on the filename.
* @param {any} force force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. 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.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
uploadPlaylist(path, force, axiosOptions) {
return localVarFp.uploadPlaylist(path, force, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* PlaylistsApi - object-oriented interface
* @export
* @class PlaylistsApi
* @extends {BaseAPI}
*/
export class PlaylistsApi extends BaseAPI {
/**
* 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.
* @summary Adding to a Playlist
* @param {PlaylistsApiAddPlaylistContentsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
addPlaylistContents(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).addPlaylistContents(requestParameters.playlistID, requestParameters.uri, requestParameters.playQueueID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Clears a playlist, only works with dumb playlists. Returns the playlist.
* @summary Delete Playlist Contents
* @param {PlaylistsApiClearPlaylistContentsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
clearPlaylistContents(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).clearPlaylistContents(requestParameters.playlistID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Create a Playlist
* @param {PlaylistsApiCreatePlaylistRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
createPlaylist(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).createPlaylist(requestParameters.title, requestParameters.type, requestParameters.smart, requestParameters.uri, requestParameters.playQueueID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This endpoint will delete a playlist
* @summary Deletes a Playlist
* @param {PlaylistsApiDeletePlaylistRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
deletePlaylist(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).deletePlaylist(requestParameters.playlistID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Retrieve Playlist
* @param {PlaylistsApiGetPlaylistRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylist(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).getPlaylist(requestParameters.playlistID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Retrieve Playlist Contents
* @param {PlaylistsApiGetPlaylistContentsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylistContents(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).getPlaylistContents(requestParameters.playlistID, requestParameters.type, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get All Playlists
* @param {PlaylistsApiGetPlaylistsRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylists(requestParameters = {}, axiosOptions) {
return PlaylistsApiFp(this.configuration).getPlaylists(requestParameters.playlistType, requestParameters.smart, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
* @summary Update a Playlist
* @param {PlaylistsApiUpdatePlaylistRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
updatePlaylist(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).updatePlaylist(requestParameters.playlistID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Upload Playlist
* @param {PlaylistsApiUploadPlaylistRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
uploadPlaylist(requestParameters, axiosOptions) {
return PlaylistsApiFp(this.configuration).uploadPlaylist(requestParameters.path, requestParameters.force, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* SearchApi - axios parameter creator
* @export
*/
export const SearchApiAxiosParamCreator = function (configuration) {
return {
/**
* 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.
* @summary Perform a search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
performSearch: async (query, sectionId, limit, axiosOptions = {}) => {
// verify required parameter 'query' is not null or undefined
assertParamExists('performSearch', 'query', query);
const localVarPath = `/hubs/search`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (query !== undefined) {
localVarQueryParameter['query'] = query;
}
if (sectionId !== undefined) {
localVarQueryParameter['sectionId'] = sectionId;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Perform a voice search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
performVoiceSearch: async (query, sectionId, limit, axiosOptions = {}) => {
// verify required parameter 'query' is not null or undefined
assertParamExists('performVoiceSearch', 'query', query);
const localVarPath = `/hubs/search/voice`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (query !== undefined) {
localVarQueryParameter['query'] = query;
}
if (sectionId !== undefined) {
localVarQueryParameter['sectionId'] = sectionId;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* SearchApi - functional programming interface
* @export
*/
export const SearchApiFp = function (configuration) {
const localVarAxiosParamCreator = SearchApiAxiosParamCreator(configuration);
return {
/**
* 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.
* @summary Perform a search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async performSearch(query, sectionId, limit, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.performSearch(query, sectionId, limit, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Perform a voice search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async performVoiceSearch(query, sectionId, limit, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.performVoiceSearch(query, sectionId, limit, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* SearchApi - factory interface
* @export
*/
export const SearchApiFactory = function (configuration, basePath, axios) {
const localVarFp = SearchApiFp(configuration);
return {
/**
* 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.
* @summary Perform a search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
performSearch(query, sectionId, limit, axiosOptions) {
return localVarFp.performSearch(query, sectionId, limit, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Perform a voice search
* @param {any} query The query term
* @param {any} [sectionId] This gives context to the search, and can result in re-ordering of search result hubs
* @param {any} [limit] The number of items to return per hub
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
performVoiceSearch(query, sectionId, limit, axiosOptions) {
return localVarFp.performVoiceSearch(query, sectionId, limit, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* SearchApi - object-oriented interface
* @export
* @class SearchApi
* @extends {BaseAPI}
*/
export class SearchApi extends BaseAPI {
/**
* 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.
* @summary Perform a search
* @param {SearchApiPerformSearchRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SearchApi
*/
performSearch(requestParameters, axiosOptions) {
return SearchApiFp(this.configuration).performSearch(requestParameters.query, requestParameters.sectionId, requestParameters.limit, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Perform a voice search
* @param {SearchApiPerformVoiceSearchRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SearchApi
*/
performVoiceSearch(requestParameters, axiosOptions) {
return SearchApiFp(this.configuration).performVoiceSearch(requestParameters.query, requestParameters.sectionId, requestParameters.limit, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* SecurityApi - axios parameter creator
* @export
*/
export const SecurityApiAxiosParamCreator = function (configuration) {
return {
/**
* 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.
* @summary Get Source Connection Information
* @param {any} source The source identifier with an included prefix.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSourceConnectionInformation: async (source, axiosOptions = {}) => {
// verify required parameter 'source' is not null or undefined
assertParamExists('getSourceConnectionInformation', 'source', source);
const localVarPath = `/security/resources`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (source !== undefined) {
localVarQueryParameter['source'] = source;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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.
* @summary Get a Transient Token.
* @param {any} type &#x60;delegation&#x60; - This is the only supported &#x60;type&#x60; parameter.
* @param {any} scope &#x60;all&#x60; - This is the only supported &#x60;scope&#x60; parameter.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getTransientToken: async (type, scope, axiosOptions = {}) => {
// verify required parameter 'type' is not null or undefined
assertParamExists('getTransientToken', 'type', type);
// verify required parameter 'scope' is not null or undefined
assertParamExists('getTransientToken', 'scope', scope);
const localVarPath = `/security/token`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (scope !== undefined) {
localVarQueryParameter['scope'] = scope;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* SecurityApi - functional programming interface
* @export
*/
export const SecurityApiFp = function (configuration) {
const localVarAxiosParamCreator = SecurityApiAxiosParamCreator(configuration);
return {
/**
* 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.
* @summary Get Source Connection Information
* @param {any} source The source identifier with an included prefix.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getSourceConnectionInformation(source, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getSourceConnectionInformation(source, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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.
* @summary Get a Transient Token.
* @param {any} type &#x60;delegation&#x60; - This is the only supported &#x60;type&#x60; parameter.
* @param {any} scope &#x60;all&#x60; - This is the only supported &#x60;scope&#x60; parameter.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getTransientToken(type, scope, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getTransientToken(type, scope, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* SecurityApi - factory interface
* @export
*/
export const SecurityApiFactory = function (configuration, basePath, axios) {
const localVarFp = SecurityApiFp(configuration);
return {
/**
* 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.
* @summary Get Source Connection Information
* @param {any} source The source identifier with an included prefix.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSourceConnectionInformation(source, axiosOptions) {
return localVarFp.getSourceConnectionInformation(source, axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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.
* @summary Get a Transient Token.
* @param {any} type &#x60;delegation&#x60; - This is the only supported &#x60;type&#x60; parameter.
* @param {any} scope &#x60;all&#x60; - This is the only supported &#x60;scope&#x60; parameter.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getTransientToken(type, scope, axiosOptions) {
return localVarFp.getTransientToken(type, scope, axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* SecurityApi - object-oriented interface
* @export
* @class SecurityApi
* @extends {BaseAPI}
*/
export class SecurityApi extends BaseAPI {
/**
* 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.
* @summary Get Source Connection Information
* @param {SecurityApiGetSourceConnectionInformationRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
getSourceConnectionInformation(requestParameters, axiosOptions) {
return SecurityApiFp(this.configuration).getSourceConnectionInformation(requestParameters.source, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* 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.
* @summary Get a Transient Token.
* @param {SecurityApiGetTransientTokenRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SecurityApi
*/
getTransientToken(requestParameters, axiosOptions) {
return SecurityApiFp(this.configuration).getTransientToken(requestParameters.type, requestParameters.scope, axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* ServerApi - axios parameter creator
* @export
*/
export const ServerApiAxiosParamCreator = function (configuration) {
return {
/**
* Server Capabilities
* @summary Server Capabilities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerCapabilities: async (axiosOptions = {}) => {
const localVarPath = `/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Server Preferences
* @summary Get Server Preferences
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerPreferences: async (axiosOptions = {}) => {
const localVarPath = `/:/prefs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* ServerApi - functional programming interface
* @export
*/
export const ServerApiFp = function (configuration) {
const localVarAxiosParamCreator = ServerApiAxiosParamCreator(configuration);
return {
/**
* Server Capabilities
* @summary Server Capabilities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getServerCapabilities(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getServerCapabilities(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Server Preferences
* @summary Get Server Preferences
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getServerPreferences(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getServerPreferences(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* ServerApi - factory interface
* @export
*/
export const ServerApiFactory = function (configuration, basePath, axios) {
const localVarFp = ServerApiFp(configuration);
return {
/**
* Server Capabilities
* @summary Server Capabilities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerCapabilities(axiosOptions) {
return localVarFp.getServerCapabilities(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Server Preferences
* @summary Get Server Preferences
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getServerPreferences(axiosOptions) {
return localVarFp.getServerPreferences(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* ServerApi - object-oriented interface
* @export
* @class ServerApi
* @extends {BaseAPI}
*/
export class ServerApi extends BaseAPI {
/**
* Server Capabilities
* @summary Server Capabilities
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ServerApi
*/
getServerCapabilities(axiosOptions) {
return ServerApiFp(this.configuration).getServerCapabilities(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Server Preferences
* @summary Get Server Preferences
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof ServerApi
*/
getServerPreferences(axiosOptions) {
return ServerApiFp(this.configuration).getServerPreferences(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* SessionsApi - axios parameter creator
* @export
*/
export const SessionsApiAxiosParamCreator = function (configuration) {
return {
/**
* This will Retrieve a listing of all history views.
* @summary Get Session History
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSessionHistory: async (axiosOptions = {}) => {
const localVarPath = `/status/sessions/history/all`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* This will retrieve the \"Now Playing\" Information of the PMS.
* @summary Get Active Sessions
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSessions: async (axiosOptions = {}) => {
const localVarPath = `/status/sessions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* SessionsApi - functional programming interface
* @export
*/
export const SessionsApiFp = function (configuration) {
const localVarAxiosParamCreator = SessionsApiAxiosParamCreator(configuration);
return {
/**
* This will Retrieve a listing of all history views.
* @summary Get Session History
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getSessionHistory(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getSessionHistory(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This will retrieve the \"Now Playing\" Information of the PMS.
* @summary Get Active Sessions
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getSessions(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getSessions(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* SessionsApi - factory interface
* @export
*/
export const SessionsApiFactory = function (configuration, basePath, axios) {
const localVarFp = SessionsApiFp(configuration);
return {
/**
* This will Retrieve a listing of all history views.
* @summary Get Session History
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSessionHistory(axiosOptions) {
return localVarFp.getSessionHistory(axiosOptions).then((request) => request(axios, basePath));
},
/**
* This will retrieve the \"Now Playing\" Information of the PMS.
* @summary Get Active Sessions
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getSessions(axiosOptions) {
return localVarFp.getSessions(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* SessionsApi - object-oriented interface
* @export
* @class SessionsApi
* @extends {BaseAPI}
*/
export class SessionsApi extends BaseAPI {
/**
* This will Retrieve a listing of all history views.
* @summary Get Session History
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SessionsApi
*/
getSessionHistory(axiosOptions) {
return SessionsApiFp(this.configuration).getSessionHistory(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* This will retrieve the \"Now Playing\" Information of the PMS.
* @summary Get Active Sessions
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof SessionsApi
*/
getSessions(axiosOptions) {
return SessionsApiFp(this.configuration).getSessions(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* UpdaterApi - axios parameter creator
* @export
*/
export const UpdaterApiAxiosParamCreator = function (configuration) {
return {
/**
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
* @summary Apply Updates
* @param {any} [tonight] 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
* @param {any} [skip] Indicate that the latest version should be marked as skipped. The &lt;Release&gt; entry for this version will have the &#x60;state&#x60; set to &#x60;skipped&#x60;.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
applyUpdates: async (tonight, skip, axiosOptions = {}) => {
const localVarPath = `/updater/apply`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (tonight !== undefined) {
localVarQueryParameter['tonight'] = tonight;
}
if (skip !== undefined) {
localVarQueryParameter['skip'] = skip;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Checking for updates
* @summary Checking for updates
* @param {any} [download] Indicate that you want to start download any updates found.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
checkForUpdates: async (download, axiosOptions = {}) => {
const localVarPath = `/updater/check`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
if (download !== undefined) {
localVarQueryParameter['download'] = download;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Querying status of updates
* @summary Querying status of updates
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
queryUpdateStatus: async (axiosOptions = {}) => {
const localVarPath = `/updater/status`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* UpdaterApi - functional programming interface
* @export
*/
export const UpdaterApiFp = function (configuration) {
const localVarAxiosParamCreator = UpdaterApiAxiosParamCreator(configuration);
return {
/**
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
* @summary Apply Updates
* @param {any} [tonight] 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
* @param {any} [skip] Indicate that the latest version should be marked as skipped. The &lt;Release&gt; entry for this version will have the &#x60;state&#x60; set to &#x60;skipped&#x60;.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async applyUpdates(tonight, skip, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.applyUpdates(tonight, skip, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Checking for updates
* @summary Checking for updates
* @param {any} [download] Indicate that you want to start download any updates found.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async checkForUpdates(download, axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.checkForUpdates(download, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Querying status of updates
* @summary Querying status of updates
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async queryUpdateStatus(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.queryUpdateStatus(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* UpdaterApi - factory interface
* @export
*/
export const UpdaterApiFactory = function (configuration, basePath, axios) {
const localVarFp = UpdaterApiFp(configuration);
return {
/**
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
* @summary Apply Updates
* @param {any} [tonight] 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
* @param {any} [skip] Indicate that the latest version should be marked as skipped. The &lt;Release&gt; entry for this version will have the &#x60;state&#x60; set to &#x60;skipped&#x60;.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
applyUpdates(tonight, skip, axiosOptions) {
return localVarFp.applyUpdates(tonight, skip, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Checking for updates
* @summary Checking for updates
* @param {any} [download] Indicate that you want to start download any updates found.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
checkForUpdates(download, axiosOptions) {
return localVarFp.checkForUpdates(download, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Querying status of updates
* @summary Querying status of updates
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
queryUpdateStatus(axiosOptions) {
return localVarFp.queryUpdateStatus(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* UpdaterApi - object-oriented interface
* @export
* @class UpdaterApi
* @extends {BaseAPI}
*/
export class UpdaterApi extends BaseAPI {
/**
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
* @summary Apply Updates
* @param {UpdaterApiApplyUpdatesRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof UpdaterApi
*/
applyUpdates(requestParameters = {}, axiosOptions) {
return UpdaterApiFp(this.configuration).applyUpdates(requestParameters.tonight, requestParameters.skip, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Checking for updates
* @summary Checking for updates
* @param {UpdaterApiCheckForUpdatesRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof UpdaterApi
*/
checkForUpdates(requestParameters = {}, axiosOptions) {
return UpdaterApiFp(this.configuration).checkForUpdates(requestParameters.download, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Querying status of updates
* @summary Querying status of updates
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof UpdaterApi
*/
queryUpdateStatus(axiosOptions) {
return UpdaterApiFp(this.configuration).queryUpdateStatus(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
/**
* UserApi - axios parameter creator
* @export
*/
export const UserApiAxiosParamCreator = function (configuration) {
return {
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserDetails: async (axiosOptions = {}) => {
const localVarPath = `/user`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration);
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration);
// authentication Host required
await setApiKeyToObject(localVarHeaderParameter, "Host", configuration);
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers };
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
};
};
/**
* UserApi - functional programming interface
* @export
*/
export const UserApiFp = function (configuration) {
const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration);
return {
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getUserDetails(axiosOptions) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getUserDetails(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
};
};
/**
* UserApi - factory interface
* @export
*/
export const UserApiFactory = function (configuration, basePath, axios) {
const localVarFp = UserApiFp(configuration);
return {
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserDetails(axiosOptions) {
return localVarFp.getUserDetails(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* UserApi - object-oriented interface
* @export
* @class UserApi
* @extends {BaseAPI}
*/
export class UserApi extends BaseAPI {
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
getUserDetails(axiosOptions) {
return UserApiFp(this.configuration).getUserDetails(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}
//# sourceMappingURL=api.js.map