@jellyfin/sdk
Version:
A TypeScript SDK for Jellyfin.
860 lines (859 loc) • 51.5 kB
JavaScript
import globalAxios from 'axios';
import { assertParamExists, DUMMY_BASE_URL, setApiKeyToObject, setSearchParams, toPathString, serializeDataIfNeeded, createRequestFunction } from '../common.js';
import { operationServerMap, BaseAPI, BASE_PATH } from '../base.js';
/* tslint:disable */
/* eslint-disable */
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit the class manually.
*
* Jellyfin API
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* PlaylistsApi - axios parameter creator
* @export
*/
const PlaylistsApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Adds items to a playlist.
* @param {string} playlistId The playlist id.
* @param {Array<string>} [ids] Item id, comma delimited.
* @param {string} [userId] The userId.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addItemToPlaylist: async (playlistId, ids, userId, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('addItemToPlaylist', '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: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (ids) {
localVarQueryParameter['ids'] = ids;
}
if (userId !== undefined) {
localVarQueryParameter['userId'] = userId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query parameters are obsolete.
* @summary Creates a new playlist.
* @param {string} [name] The playlist name.
* @param {Array<string>} [ids] The item ids.
* @param {string} [userId] The user id.
* @param {MediaType} [mediaType] The media type.
* @param {CreatePlaylistDto} [createPlaylistDto] The create playlist payload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPlaylist: async (name, ids, userId, mediaType, createPlaylistDto, options = {}) => {
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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (name !== undefined) {
localVarQueryParameter['name'] = name;
}
if (ids) {
localVarQueryParameter['ids'] = ids;
}
if (userId !== undefined) {
localVarQueryParameter['userId'] = userId;
}
if (mediaType !== undefined) {
localVarQueryParameter['mediaType'] = mediaType;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(createPlaylistDto, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get a playlist.
* @param {string} playlistId The playlist id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylist: async (playlistId, options = {}) => {
// 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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Gets the original items of a playlist.
* @param {string} playlistId The playlist id.
* @param {string} [userId] User id.
* @param {number} [startIndex] Optional. The record index to start at. All items with a lower index will be dropped from the results.
* @param {number} [limit] Optional. The maximum number of records to return.
* @param {Array<ItemFields>} [fields] Optional. Specify additional fields of information to return in the output.
* @param {boolean} [enableImages] Optional. Include image information in output.
* @param {boolean} [enableUserData] Optional. Include user data.
* @param {number} [imageTypeLimit] Optional. The max number of images to return, per image type.
* @param {Array<ImageType>} [enableImageTypes] Optional. The image types to include in the output.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistItems: async (playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('getPlaylistItems', '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: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (userId !== undefined) {
localVarQueryParameter['userId'] = userId;
}
if (startIndex !== undefined) {
localVarQueryParameter['startIndex'] = startIndex;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (fields) {
localVarQueryParameter['fields'] = fields;
}
if (enableImages !== undefined) {
localVarQueryParameter['enableImages'] = enableImages;
}
if (enableUserData !== undefined) {
localVarQueryParameter['enableUserData'] = enableUserData;
}
if (imageTypeLimit !== undefined) {
localVarQueryParameter['imageTypeLimit'] = imageTypeLimit;
}
if (enableImageTypes) {
localVarQueryParameter['enableImageTypes'] = enableImageTypes;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get a playlist user.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistUser: async (playlistId, userId, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('getPlaylistUser', 'playlistId', playlistId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('getPlaylistUser', 'userId', userId);
const localVarPath = `/Playlists/{playlistId}/Users/{userId}`
.replace(`{${"playlistId"}}`, encodeURIComponent(String(playlistId)))
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
// 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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistUsers: async (playlistId, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('getPlaylistUsers', 'playlistId', playlistId);
const localVarPath = `/Playlists/{playlistId}/Users`
.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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Moves a playlist item.
* @param {string} playlistId The playlist id.
* @param {string} itemId The item id.
* @param {number} newIndex The new index.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
moveItem: async (playlistId, itemId, newIndex, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('moveItem', 'playlistId', playlistId);
// verify required parameter 'itemId' is not null or undefined
assertParamExists('moveItem', 'itemId', itemId);
// verify required parameter 'newIndex' is not null or undefined
assertParamExists('moveItem', 'newIndex', newIndex);
const localVarPath = `/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}`
.replace(`{${"playlistId"}}`, encodeURIComponent(String(playlistId)))
.replace(`{${"itemId"}}`, encodeURIComponent(String(itemId)))
.replace(`{${"newIndex"}}`, encodeURIComponent(String(newIndex)));
// 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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Removes items from a playlist.
* @param {string} playlistId The playlist id.
* @param {Array<string>} [entryIds] The item ids, comma delimited.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeItemFromPlaylist: async (playlistId, entryIds, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('removeItemFromPlaylist', '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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
if (entryIds) {
localVarQueryParameter['entryIds'] = entryIds;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Remove a user from a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeUserFromPlaylist: async (playlistId, userId, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('removeUserFromPlaylist', 'playlistId', playlistId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('removeUserFromPlaylist', 'userId', userId);
const localVarPath = `/Playlists/{playlistId}/Users/{userId}`
.replace(`{${"playlistId"}}`, encodeURIComponent(String(playlistId)))
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
// 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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Updates a playlist.
* @param {string} playlistId The playlist id.
* @param {UpdatePlaylistDto} updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updatePlaylist: async (playlistId, updatePlaylistDto, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('updatePlaylist', 'playlistId', playlistId);
// verify required parameter 'updatePlaylistDto' is not null or undefined
assertParamExists('updatePlaylist', 'updatePlaylistDto', updatePlaylistDto);
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: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(updatePlaylistDto, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Modify a user of a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {UpdatePlaylistUserDto} updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updatePlaylistUser: async (playlistId, userId, updatePlaylistUserDto, options = {}) => {
// verify required parameter 'playlistId' is not null or undefined
assertParamExists('updatePlaylistUser', 'playlistId', playlistId);
// verify required parameter 'userId' is not null or undefined
assertParamExists('updatePlaylistUser', 'userId', userId);
// verify required parameter 'updatePlaylistUserDto' is not null or undefined
assertParamExists('updatePlaylistUser', 'updatePlaylistUserDto', updatePlaylistUserDto);
const localVarPath = `/Playlists/{playlistId}/Users/{userId}`
.replace(`{${"playlistId"}}`, encodeURIComponent(String(playlistId)))
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
// 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, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication CustomAuthentication required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = serializeDataIfNeeded(updatePlaylistUserDto, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* PlaylistsApi - functional programming interface
* @export
*/
const PlaylistsApiFp = function (configuration) {
const localVarAxiosParamCreator = PlaylistsApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Adds items to a playlist.
* @param {string} playlistId The playlist id.
* @param {Array<string>} [ids] Item id, comma delimited.
* @param {string} [userId] The userId.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async addItemToPlaylist(playlistId, ids, userId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.addItemToPlaylist(playlistId, ids, userId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.addItemToPlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query parameters are obsolete.
* @summary Creates a new playlist.
* @param {string} [name] The playlist name.
* @param {Array<string>} [ids] The item ids.
* @param {string} [userId] The user id.
* @param {MediaType} [mediaType] The media type.
* @param {CreatePlaylistDto} [createPlaylistDto] The create playlist payload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createPlaylist(name, ids, userId, mediaType, createPlaylistDto, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.createPlaylist(name, ids, userId, mediaType, createPlaylistDto, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.createPlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Get a playlist.
* @param {string} playlistId The playlist id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPlaylist(playlistId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylist(playlistId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.getPlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Gets the original items of a playlist.
* @param {string} playlistId The playlist id.
* @param {string} [userId] User id.
* @param {number} [startIndex] Optional. The record index to start at. All items with a lower index will be dropped from the results.
* @param {number} [limit] Optional. The maximum number of records to return.
* @param {Array<ItemFields>} [fields] Optional. Specify additional fields of information to return in the output.
* @param {boolean} [enableImages] Optional. Include image information in output.
* @param {boolean} [enableUserData] Optional. Include user data.
* @param {number} [imageTypeLimit] Optional. The max number of images to return, per image type.
* @param {Array<ImageType>} [enableImageTypes] Optional. The image types to include in the output.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPlaylistItems(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylistItems(playlistId, userId, startIndex, limit, fields, enableImages, enableUserData, imageTypeLimit, enableImageTypes, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.getPlaylistItems']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Get a playlist user.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPlaylistUser(playlistId, userId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylistUser(playlistId, userId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.getPlaylistUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Get a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPlaylistUsers(playlistId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaylistUsers(playlistId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.getPlaylistUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Moves a playlist item.
* @param {string} playlistId The playlist id.
* @param {string} itemId The item id.
* @param {number} newIndex The new index.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async moveItem(playlistId, itemId, newIndex, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.moveItem(playlistId, itemId, newIndex, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.moveItem']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Removes items from a playlist.
* @param {string} playlistId The playlist id.
* @param {Array<string>} [entryIds] The item ids, comma delimited.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeItemFromPlaylist(playlistId, entryIds, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.removeItemFromPlaylist(playlistId, entryIds, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.removeItemFromPlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Remove a user from a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeUserFromPlaylist(playlistId, userId, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.removeUserFromPlaylist(playlistId, userId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.removeUserFromPlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Updates a playlist.
* @param {string} playlistId The playlist id.
* @param {UpdatePlaylistDto} updatePlaylistDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistDto id.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updatePlaylist(playlistId, updatePlaylistDto, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.updatePlaylist(playlistId, updatePlaylistDto, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.updatePlaylist']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Modify a user of a playlist\'s users.
* @param {string} playlistId The playlist id.
* @param {string} userId The user id.
* @param {UpdatePlaylistUserDto} updatePlaylistUserDto The Jellyfin.Api.Models.PlaylistDtos.UpdatePlaylistUserDto.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updatePlaylistUser(playlistId, userId, updatePlaylistUserDto, options) {
var _a, _b, _c;
const localVarAxiosArgs = await localVarAxiosParamCreator.updatePlaylistUser(playlistId, userId, updatePlaylistUserDto, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PlaylistsApi.updatePlaylistUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* PlaylistsApi - factory interface
* @export
*/
const PlaylistsApiFactory = function (configuration, basePath, axios) {
const localVarFp = PlaylistsApiFp(configuration);
return {
/**
*
* @summary Adds items to a playlist.
* @param {PlaylistsApiAddItemToPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addItemToPlaylist(requestParameters, options) {
return localVarFp.addItemToPlaylist(requestParameters.playlistId, requestParameters.ids, requestParameters.userId, options).then((request) => request(axios, basePath));
},
/**
* For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query parameters are obsolete.
* @summary Creates a new playlist.
* @param {PlaylistsApiCreatePlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createPlaylist(requestParameters = {}, options) {
return localVarFp.createPlaylist(requestParameters.name, requestParameters.ids, requestParameters.userId, requestParameters.mediaType, requestParameters.createPlaylistDto, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get a playlist.
* @param {PlaylistsApiGetPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylist(requestParameters, options) {
return localVarFp.getPlaylist(requestParameters.playlistId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Gets the original items of a playlist.
* @param {PlaylistsApiGetPlaylistItemsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistItems(requestParameters, options) {
return localVarFp.getPlaylistItems(requestParameters.playlistId, requestParameters.userId, requestParameters.startIndex, requestParameters.limit, requestParameters.fields, requestParameters.enableImages, requestParameters.enableUserData, requestParameters.imageTypeLimit, requestParameters.enableImageTypes, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get a playlist user.
* @param {PlaylistsApiGetPlaylistUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistUser(requestParameters, options) {
return localVarFp.getPlaylistUser(requestParameters.playlistId, requestParameters.userId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get a playlist\'s users.
* @param {PlaylistsApiGetPlaylistUsersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPlaylistUsers(requestParameters, options) {
return localVarFp.getPlaylistUsers(requestParameters.playlistId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Moves a playlist item.
* @param {PlaylistsApiMoveItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
moveItem(requestParameters, options) {
return localVarFp.moveItem(requestParameters.playlistId, requestParameters.itemId, requestParameters.newIndex, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Removes items from a playlist.
* @param {PlaylistsApiRemoveItemFromPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeItemFromPlaylist(requestParameters, options) {
return localVarFp.removeItemFromPlaylist(requestParameters.playlistId, requestParameters.entryIds, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Remove a user from a playlist\'s users.
* @param {PlaylistsApiRemoveUserFromPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeUserFromPlaylist(requestParameters, options) {
return localVarFp.removeUserFromPlaylist(requestParameters.playlistId, requestParameters.userId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Updates a playlist.
* @param {PlaylistsApiUpdatePlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updatePlaylist(requestParameters, options) {
return localVarFp.updatePlaylist(requestParameters.playlistId, requestParameters.updatePlaylistDto, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Modify a user of a playlist\'s users.
* @param {PlaylistsApiUpdatePlaylistUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updatePlaylistUser(requestParameters, options) {
return localVarFp.updatePlaylistUser(requestParameters.playlistId, requestParameters.userId, requestParameters.updatePlaylistUserDto, options).then((request) => request(axios, basePath));
},
};
};
/**
* PlaylistsApi - object-oriented interface
* @export
* @class PlaylistsApi
* @extends {BaseAPI}
*/
class PlaylistsApi extends BaseAPI {
/**
*
* @summary Adds items to a playlist.
* @param {PlaylistsApiAddItemToPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
addItemToPlaylist(requestParameters, options) {
return PlaylistsApiFp(this.configuration).addItemToPlaylist(requestParameters.playlistId, requestParameters.ids, requestParameters.userId, options).then((request) => request(this.axios, this.basePath));
}
/**
* For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. Query parameters are obsolete.
* @summary Creates a new playlist.
* @param {PlaylistsApiCreatePlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
createPlaylist(requestParameters = {}, options) {
return PlaylistsApiFp(this.configuration).createPlaylist(requestParameters.name, requestParameters.ids, requestParameters.userId, requestParameters.mediaType, requestParameters.createPlaylistDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a playlist.
* @param {PlaylistsApiGetPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylist(requestParameters, options) {
return PlaylistsApiFp(this.configuration).getPlaylist(requestParameters.playlistId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Gets the original items of a playlist.
* @param {PlaylistsApiGetPlaylistItemsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylistItems(requestParameters, options) {
return PlaylistsApiFp(this.configuration).getPlaylistItems(requestParameters.playlistId, requestParameters.userId, requestParameters.startIndex, requestParameters.limit, requestParameters.fields, requestParameters.enableImages, requestParameters.enableUserData, requestParameters.imageTypeLimit, requestParameters.enableImageTypes, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a playlist user.
* @param {PlaylistsApiGetPlaylistUserRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylistUser(requestParameters, options) {
return PlaylistsApiFp(this.configuration).getPlaylistUser(requestParameters.playlistId, requestParameters.userId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a playlist\'s users.
* @param {PlaylistsApiGetPlaylistUsersRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
getPlaylistUsers(requestParameters, options) {
return PlaylistsApiFp(this.configuration).getPlaylistUsers(requestParameters.playlistId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Moves a playlist item.
* @param {PlaylistsApiMoveItemRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
moveItem(requestParameters, options) {
return PlaylistsApiFp(this.configuration).moveItem(requestParameters.playlistId, requestParameters.itemId, requestParameters.newIndex, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Removes items from a playlist.
* @param {PlaylistsApiRemoveItemFromPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PlaylistsApi
*/
removeItemFromPlaylist(requestParameters, options) {
return PlaylistsApiFp(this.configuration).removeItemFromPlaylist(requestParameters.playlistId, requestParameters.entryIds, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Remove a user from a playlist\'s users.
* @param {PlaylistsApiRemoveUserFromPlaylistRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @mem