Files
plexjs/plexjs/plextv/api.ts
2023-04-20 03:25:13 +00:00

1128 lines
42 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
/**
* Plex-API
* An Open API Spec for interacting with Plex.tv
*
* 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 { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
/**
*
* @export
* @interface GetCompanionsData401Response
*/
export interface GetCompanionsData401Response {
/**
*
* @type {any}
* @memberof GetCompanionsData401Response
*/
'errors'?: any;
}
/**
*
* @export
* @interface GetGeoData200Response
*/
export interface GetGeoData200Response {
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'id'?: any;
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'name'?: any;
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'guestUserID'?: any;
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'guestUserUUID'?: any;
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'guestEnabled'?: any;
/**
*
* @type {any}
* @memberof GetGeoData200Response
*/
'subscription'?: any;
}
/**
*
* @export
* @interface GetPin200Response
*/
export interface GetPin200Response {
/**
* PinID for use with authentication
* @type {any}
* @memberof GetPin200Response
*/
'id'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'code'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'product'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'trusted'?: any;
/**
* a link to a QR code hosted on plex.tv The QR code redirects to the relevant `plex.tv/link` authentication page Which then prompts the user for the 4 Digit Link Pin
* @type {any}
* @memberof GetPin200Response
*/
'qr'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'clientIdentifier'?: any;
/**
*
* @type {GetPin200ResponseLocation}
* @memberof GetPin200Response
*/
'location'?: GetPin200ResponseLocation;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'expiresIn'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'createdAt'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'expiresAt'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'authToken'?: any;
/**
*
* @type {any}
* @memberof GetPin200Response
*/
'newRegistration'?: any;
}
/**
*
* @export
* @interface GetPin200ResponseLocation
*/
export interface GetPin200ResponseLocation {
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'code'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'european_union_member'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'continent_code'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'country'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'city'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'time_zone'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'postal_code'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'in_privacy_restricted_country'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'subdivisions'?: any;
/**
*
* @type {any}
* @memberof GetPin200ResponseLocation
*/
'coordinates'?: any;
}
/**
*
* @export
* @interface GetPin400Response
*/
export interface GetPin400Response {
/**
*
* @type {any}
* @memberof GetPin400Response
*/
'errors'?: any;
}
/**
*
* @export
* @interface GetUserOptOutSettings200Response
*/
export interface GetUserOptOutSettings200Response {
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'tv.plex.provider.podcasts'?: any;
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'tv.plex.provider.news'?: any;
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'tv.plex.provider.webshows'?: any;
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'tv.plex.provider.music'?: any;
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'tv.plex.provider.vod'?: any;
/**
*
* @type {any}
* @memberof GetUserOptOutSettings200Response
*/
'scrobbling'?: any;
}
/**
* PlexTvApi - axios parameter creator
* @export
*/
export const PlexTvApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Get Companions Data
* @summary Get Companions Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getCompanionsData: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/companions`;
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", 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 {any} [includeHttps] Include Https entries in the results
* @param {any} [includeRelay] Include Relay addresses in the results
* @param {any} [includeIPv6] Include IPv6 entries in the results
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getDevices: async (includeHttps?: any, includeRelay?: any, includeIPv6?: any, axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
if (includeHttps !== undefined) {
localVarQueryParameter['includeHttps'] = includeHttps;
}
if (includeRelay !== undefined) {
localVarQueryParameter['includeRelay'] = includeRelay;
}
if (includeIPv6 !== undefined) {
localVarQueryParameter['includeIPv6'] = includeIPv6;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Geo Data
* @summary Get Geo Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getGeoData: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/geoip`;
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Home Data
* @summary Get Home Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getHomeData: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/home`;
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* 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 &#x60;Plex.tv/link&#x60;
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPin: async (strong?: any, axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", 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: any, axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserDetails: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get User Opt Out Settings
* @summary Get User Opt Out Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserOptOutSettings: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/user/settings/opt_outs`;
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
/**
* Get User Settings
* @summary Get User Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserSettings: async (axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/user/settings`;
// 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 = {} as any;
const localVarQueryParameter = {} as any;
// authentication ClientIdentifier required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
// authentication Device required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
// authentication DeviceName required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
// authentication Platform required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
// authentication PlatformVersion required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
// authentication Product required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
// authentication Token required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
// authentication Version required
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
return {
url: toPathString(localVarUrlObj),
axiosOptions: localVarRequestOptions,
};
},
}
};
/**
* PlexTvApi - functional programming interface
* @export
*/
export const PlexTvApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = PlexTvApiAxiosParamCreator(configuration)
return {
/**
* Get Companions Data
* @summary Get Companions Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getCompanionsData(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCompanionsData(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Devices
* @summary Get Devices
* @param {any} [includeHttps] Include Https entries in the results
* @param {any} [includeRelay] Include Relay addresses in the results
* @param {any} [includeIPv6] Include IPv6 entries in the results
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getDevices(includeHttps?: any, includeRelay?: any, includeIPv6?: any, axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDevices(includeHttps, includeRelay, includeIPv6, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Geo Data
* @summary Get Geo Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getGeoData(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetGeoData200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getGeoData(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Home Data
* @summary Get Home Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getHomeData(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetGeoData200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getHomeData(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* 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 &#x60;Plex.tv/link&#x60;
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getPin(strong?: any, axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPin200Response>> {
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: any, axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getToken(pinID, axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getUserDetails(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getUserDetails(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get User Opt Out Settings
* @summary Get User Opt Out Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getUserOptOutSettings(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetUserOptOutSettings200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getUserOptOutSettings(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Get User Settings
* @summary Get User Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
async getUserSettings(axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getUserSettings(axiosOptions);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* PlexTvApi - factory interface
* @export
*/
export const PlexTvApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = PlexTvApiFp(configuration)
return {
/**
* Get Companions Data
* @summary Get Companions Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getCompanionsData(axiosOptions?: any): AxiosPromise<any> {
return localVarFp.getCompanionsData(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Devices
* @summary Get Devices
* @param {any} [includeHttps] Include Https entries in the results
* @param {any} [includeRelay] Include Relay addresses in the results
* @param {any} [includeIPv6] Include IPv6 entries in the results
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getDevices(includeHttps?: any, includeRelay?: any, includeIPv6?: any, axiosOptions?: any): AxiosPromise<any> {
return localVarFp.getDevices(includeHttps, includeRelay, includeIPv6, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Geo Data
* @summary Get Geo Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getGeoData(axiosOptions?: any): AxiosPromise<GetGeoData200Response> {
return localVarFp.getGeoData(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Home Data
* @summary Get Home Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getHomeData(axiosOptions?: any): AxiosPromise<GetGeoData200Response> {
return localVarFp.getHomeData(axiosOptions).then((request) => request(axios, basePath));
},
/**
* 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 &#x60;Plex.tv/link&#x60;
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getPin(strong?: any, axiosOptions?: any): AxiosPromise<GetPin200Response> {
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: any, axiosOptions?: any): AxiosPromise<void> {
return localVarFp.getToken(pinID, axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserDetails(axiosOptions?: any): AxiosPromise<void> {
return localVarFp.getUserDetails(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get User Opt Out Settings
* @summary Get User Opt Out Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserOptOutSettings(axiosOptions?: any): AxiosPromise<GetUserOptOutSettings200Response> {
return localVarFp.getUserOptOutSettings(axiosOptions).then((request) => request(axios, basePath));
},
/**
* Get User Settings
* @summary Get User Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
*/
getUserSettings(axiosOptions?: any): AxiosPromise<any> {
return localVarFp.getUserSettings(axiosOptions).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for getDevices operation in PlexTvApi.
* @export
* @interface PlexTvApiGetDevicesRequest
*/
export interface PlexTvApiGetDevicesRequest {
/**
* Include Https entries in the results
* @type {any}
* @memberof PlexTvApiGetDevices
*/
readonly includeHttps?: any
/**
* Include Relay addresses in the results
* @type {any}
* @memberof PlexTvApiGetDevices
*/
readonly includeRelay?: any
/**
* Include IPv6 entries in the results
* @type {any}
* @memberof PlexTvApiGetDevices
*/
readonly includeIPv6?: any
}
/**
* Request parameters for getPin operation in PlexTvApi.
* @export
* @interface PlexTvApiGetPinRequest
*/
export interface PlexTvApiGetPinRequest {
/**
* Determines the kind of code returned by the API call Strong codes are used for Pin authentication flows Non-Strong codes are used for &#x60;Plex.tv/link&#x60;
* @type {any}
* @memberof PlexTvApiGetPin
*/
readonly strong?: any
}
/**
* Request parameters for getToken operation in PlexTvApi.
* @export
* @interface PlexTvApiGetTokenRequest
*/
export interface PlexTvApiGetTokenRequest {
/**
* The PinID to retrieve an access token for
* @type {any}
* @memberof PlexTvApiGetToken
*/
readonly pinID: any
}
/**
* PlexTvApi - object-oriented interface
* @export
* @class PlexTvApi
* @extends {BaseAPI}
*/
export class PlexTvApi extends BaseAPI {
/**
* Get Companions Data
* @summary Get Companions Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getCompanionsData(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getCompanionsData(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Devices
* @summary Get Devices
* @param {PlexTvApiGetDevicesRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getDevices(requestParameters: PlexTvApiGetDevicesRequest = {}, axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getDevices(requestParameters.includeHttps, requestParameters.includeRelay, requestParameters.includeIPv6, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Geo Data
* @summary Get Geo Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getGeoData(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getGeoData(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Home Data
* @summary Get Home Data
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getHomeData(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getHomeData(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Retrieve a Pin from Plex.tv for authentication flows
* @summary Get a Pin
* @param {PlexTvApiGetPinRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getPin(requestParameters: PlexTvApiGetPinRequest = {}, axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(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 {PlexTvApiGetTokenRequest} requestParameters Request parameters.
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getToken(requestParameters: PlexTvApiGetTokenRequest, axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getToken(requestParameters.pinID, axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get Logged in User
* @summary Get Logged in User
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getUserDetails(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getUserDetails(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get User Opt Out Settings
* @summary Get User Opt Out Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getUserOptOutSettings(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getUserOptOutSettings(axiosOptions).then((request) => request(this.axios, this.basePath));
}
/**
* Get User Settings
* @summary Get User Settings
* @param {*} [axiosOptions] Override http request option.
* @throws {RequiredError}
* @memberof PlexTvApi
*/
public getUserSettings(axiosOptions?: AxiosRequestConfig) {
return PlexTvApiFp(this.configuration).getUserSettings(axiosOptions).then((request) => request(this.axios, this.basePath));
}
}