UNPKG

@jellyfin/sdk

Version:
895 lines (893 loc) • 301 kB
import globalAxios from 'axios'; import { DUMMY_BASE_URL, setApiKeyToObject, setSearchParams, toPathString, assertParamExists, 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/. */ /** * ImageApi - axios parameter creator * @export */ const ImageApiAxiosParamCreator = function (configuration) { return { /** * * @summary Delete a custom splashscreen. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCustomSplashscreen: async (options = {}) => { const localVarPath = `/Branding/Splashscreen`; // 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 Delete an item\'s image. * @param {string} itemId Item id. * @param {ImageType} imageType Image type. * @param {number} [imageIndex] The image index. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteItemImage: async (itemId, imageType, imageIndex, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('deleteItemImage', 'itemId', itemId); // verify required parameter 'imageType' is not null or undefined assertParamExists('deleteItemImage', 'imageType', imageType); const localVarPath = `/Items/{itemId}/Images/{imageType}` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))); // 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 (imageIndex !== undefined) { localVarQueryParameter['imageIndex'] = imageIndex; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete an item\'s image. * @param {string} itemId Item id. * @param {ImageType} imageType Image type. * @param {number} imageIndex The image index. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteItemImageByIndex: async (itemId, imageType, imageIndex, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('deleteItemImageByIndex', 'itemId', itemId); // verify required parameter 'imageType' is not null or undefined assertParamExists('deleteItemImageByIndex', 'imageType', imageType); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('deleteItemImageByIndex', 'imageIndex', imageIndex); const localVarPath = `/Items/{itemId}/Images/{imageType}/{imageIndex}` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 Delete the user\'s image. * @param {string} [userId] User Id. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteUserImage: async (userId, options = {}) => { const localVarPath = `/UserImage`; // 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 (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, }; }, /** * * @summary Get artist image by name. * @param {string} name Artist name. * @param {ImageType} imageType Image type. * @param {number} imageIndex Image index. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Determines the output format of the image - original,gif,jpg,png. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getArtistImage: async (name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, options = {}) => { // verify required parameter 'name' is not null or undefined assertParamExists('getArtistImage', 'name', name); // verify required parameter 'imageType' is not null or undefined assertParamExists('getArtistImage', 'imageType', imageType); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('getArtistImage', 'imageIndex', imageIndex); const localVarPath = `/Artists/{name}/Images/{imageType}/{imageIndex}` .replace(`{${"name"}}`, encodeURIComponent(String(name))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 = {}; if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get genre image by name. * @param {string} name Genre name. * @param {ImageType} imageType Image type. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Determines the output format of the image - original,gif,jpg,png. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {number} [imageIndex] Image index. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGenreImage: async (name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, options = {}) => { // verify required parameter 'name' is not null or undefined assertParamExists('getGenreImage', 'name', name); // verify required parameter 'imageType' is not null or undefined assertParamExists('getGenreImage', 'imageType', imageType); const localVarPath = `/Genres/{name}/Images/{imageType}` .replace(`{${"name"}}`, encodeURIComponent(String(name))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))); // 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 = {}; if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } if (imageIndex !== undefined) { localVarQueryParameter['imageIndex'] = imageIndex; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get genre image by name. * @param {string} name Genre name. * @param {ImageType} imageType Image type. * @param {number} imageIndex Image index. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Determines the output format of the image - original,gif,jpg,png. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGenreImageByIndex: async (name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, options = {}) => { // verify required parameter 'name' is not null or undefined assertParamExists('getGenreImageByIndex', 'name', name); // verify required parameter 'imageType' is not null or undefined assertParamExists('getGenreImageByIndex', 'imageType', imageType); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('getGenreImageByIndex', 'imageIndex', imageIndex); const localVarPath = `/Genres/{name}/Images/{imageType}/{imageIndex}` .replace(`{${"name"}}`, encodeURIComponent(String(name))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 = {}; if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } 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 item\'s image. * @param {string} itemId Item id. * @param {ImageType} imageType Image type. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {number} [imageIndex] Image index. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemImage: async (itemId, imageType, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, imageIndex, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getItemImage', 'itemId', itemId); // verify required parameter 'imageType' is not null or undefined assertParamExists('getItemImage', 'imageType', imageType); const localVarPath = `/Items/{itemId}/Images/{imageType}` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))); // 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 = {}; if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } if (imageIndex !== undefined) { localVarQueryParameter['imageIndex'] = imageIndex; } 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 item\'s image. * @param {string} itemId Item id. * @param {ImageType} imageType Image type. * @param {number} maxWidth The maximum image width to return. * @param {number} maxHeight The maximum image height to return. * @param {string} tag Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} format Determines the output format of the image - original,gif,jpg,png. * @param {number} percentPlayed Optional. Percent to render for the percent played overlay. * @param {number} unplayedCount Optional. Unplayed count overlay to render. * @param {number} imageIndex Image index. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemImage2: async (itemId, imageType, maxWidth, maxHeight, tag, format, percentPlayed, unplayedCount, imageIndex, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getItemImage2', 'itemId', itemId); // verify required parameter 'imageType' is not null or undefined assertParamExists('getItemImage2', 'imageType', imageType); // verify required parameter 'maxWidth' is not null or undefined assertParamExists('getItemImage2', 'maxWidth', maxWidth); // verify required parameter 'maxHeight' is not null or undefined assertParamExists('getItemImage2', 'maxHeight', maxHeight); // verify required parameter 'tag' is not null or undefined assertParamExists('getItemImage2', 'tag', tag); // verify required parameter 'format' is not null or undefined assertParamExists('getItemImage2', 'format', format); // verify required parameter 'percentPlayed' is not null or undefined assertParamExists('getItemImage2', 'percentPlayed', percentPlayed); // verify required parameter 'unplayedCount' is not null or undefined assertParamExists('getItemImage2', 'unplayedCount', unplayedCount); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('getItemImage2', 'imageIndex', imageIndex); const localVarPath = `/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"maxWidth"}}`, encodeURIComponent(String(maxWidth))) .replace(`{${"maxHeight"}}`, encodeURIComponent(String(maxHeight))) .replace(`{${"tag"}}`, encodeURIComponent(String(tag))) .replace(`{${"format"}}`, encodeURIComponent(String(format))) .replace(`{${"percentPlayed"}}`, encodeURIComponent(String(percentPlayed))) .replace(`{${"unplayedCount"}}`, encodeURIComponent(String(unplayedCount))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 = {}; if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } 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 item\'s image. * @param {string} itemId Item id. * @param {ImageType} imageType Image type. * @param {number} imageIndex Image index. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemImageByIndex: async (itemId, imageType, imageIndex, maxWidth, maxHeight, width, height, quality, fillWidth, fillHeight, tag, format, percentPlayed, unplayedCount, blur, backgroundColor, foregroundLayer, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getItemImageByIndex', 'itemId', itemId); // verify required parameter 'imageType' is not null or undefined assertParamExists('getItemImageByIndex', 'imageType', imageType); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('getItemImageByIndex', 'imageIndex', imageIndex); const localVarPath = `/Items/{itemId}/Images/{imageType}/{imageIndex}` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 = {}; if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get item image infos. * @param {string} itemId Item id. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemImageInfos: async (itemId, options = {}) => { // verify required parameter 'itemId' is not null or undefined assertParamExists('getItemImageInfos', 'itemId', itemId); const localVarPath = `/Items/{itemId}/Images` .replace(`{${"itemId"}}`, encodeURIComponent(String(itemId))); // 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 music genre image by name. * @param {string} name Music genre name. * @param {ImageType} imageType Image type. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Determines the output format of the image - original,gif,jpg,png. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {number} [imageIndex] Image index. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMusicGenreImage: async (name, imageType, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, imageIndex, options = {}) => { // verify required parameter 'name' is not null or undefined assertParamExists('getMusicGenreImage', 'name', name); // verify required parameter 'imageType' is not null or undefined assertParamExists('getMusicGenreImage', 'imageType', imageType); const localVarPath = `/MusicGenres/{name}/Images/{imageType}` .replace(`{${"name"}}`, encodeURIComponent(String(name))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))); // 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 = {}; if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight; } if (percentPlayed !== undefined) { localVarQueryParameter['percentPlayed'] = percentPlayed; } if (unplayedCount !== undefined) { localVarQueryParameter['unplayedCount'] = unplayedCount; } if (width !== undefined) { localVarQueryParameter['width'] = width; } if (height !== undefined) { localVarQueryParameter['height'] = height; } if (quality !== undefined) { localVarQueryParameter['quality'] = quality; } if (fillWidth !== undefined) { localVarQueryParameter['fillWidth'] = fillWidth; } if (fillHeight !== undefined) { localVarQueryParameter['fillHeight'] = fillHeight; } if (blur !== undefined) { localVarQueryParameter['blur'] = blur; } if (backgroundColor !== undefined) { localVarQueryParameter['backgroundColor'] = backgroundColor; } if (foregroundLayer !== undefined) { localVarQueryParameter['foregroundLayer'] = foregroundLayer; } if (imageIndex !== undefined) { localVarQueryParameter['imageIndex'] = imageIndex; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get music genre image by name. * @param {string} name Music genre name. * @param {ImageType} imageType Image type. * @param {number} imageIndex Image index. * @param {string} [tag] Optional. Supply the cache tag from the item object to receive strong caching headers. * @param {ImageFormat} [format] Determines the output format of the image - original,gif,jpg,png. * @param {number} [maxWidth] The maximum image width to return. * @param {number} [maxHeight] The maximum image height to return. * @param {number} [percentPlayed] Optional. Percent to render for the percent played overlay. * @param {number} [unplayedCount] Optional. Unplayed count overlay to render. * @param {number} [width] The fixed image width to return. * @param {number} [height] The fixed image height to return. * @param {number} [quality] Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. * @param {number} [fillWidth] Width of box to fill. * @param {number} [fillHeight] Height of box to fill. * @param {number} [blur] Optional. Blur image. * @param {string} [backgroundColor] Optional. Apply a background color for transparent images. * @param {string} [foregroundLayer] Optional. Apply a foreground layer on top of the image. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMusicGenreImageByIndex: async (name, imageType, imageIndex, tag, format, maxWidth, maxHeight, percentPlayed, unplayedCount, width, height, quality, fillWidth, fillHeight, blur, backgroundColor, foregroundLayer, options = {}) => { // verify required parameter 'name' is not null or undefined assertParamExists('getMusicGenreImageByIndex', 'name', name); // verify required parameter 'imageType' is not null or undefined assertParamExists('getMusicGenreImageByIndex', 'imageType', imageType); // verify required parameter 'imageIndex' is not null or undefined assertParamExists('getMusicGenreImageByIndex', 'imageIndex', imageIndex); const localVarPath = `/MusicGenres/{name}/Images/{imageType}/{imageIndex}` .replace(`{${"name"}}`, encodeURIComponent(String(name))) .replace(`{${"imageType"}}`, encodeURIComponent(String(imageType))) .replace(`{${"imageIndex"}}`, encodeURIComponent(String(imageIndex))); // 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 = {}; if (tag !== undefined) { localVarQueryParameter['tag'] = tag; } if (format !== undefined) { localVarQueryParameter['format'] = format; } if (maxWidth !== undefined) { localVarQueryParameter['maxWidth'] = maxWidth; } if (maxHeight !== undefined) { localVarQueryParameter['maxHeight'] = maxHeight;