jellyfin-discord-bot/jellyfin/api/imageApi.ts
2023-04-15 22:02:40 +02:00

5747 lines
274 KiB
TypeScript

/**
* Jellyfin API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 10.8.9
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { ImageFormat } from '../model/imageFormat';
import { ImageInfo } from '../model/imageInfo';
import { ImageType } from '../model/imageType';
import { ProblemDetails } from '../model/problemDetails';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = 'http://localhost';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum ImageApiApiKeys {
CustomAuthentication,
}
export class ImageApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'CustomAuthentication': new ApiKeyAuth('header', 'Authorization'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: ImageApiApiKeys, value: string) {
(this.authentications as any)[ImageApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @summary Delete a custom splashscreen.
*/
public async deleteCustomSplashscreen (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Branding/Splashscreen';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Delete an item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex The image index.
*/
public async deleteItemImage (itemId: string, imageType: ImageType, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling deleteItemImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling deleteItemImage.');
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Delete an item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex The image index.
*/
public async deleteItemImageByIndex (itemId: string, imageType: ImageType, imageIndex: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling deleteItemImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling deleteItemImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling deleteItemImageByIndex.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Delete the user\'s image.
* @param userId User Id.
* @param imageType (Unused) Image type.
* @param index (Unused) Image index.
*/
public async deleteUserImage (userId: string, imageType: ImageType, index?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling deleteUserImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling deleteUserImage.');
}
if (index !== undefined) {
localVarQueryParameters['index'] = ObjectSerializer.serialize(index, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Delete the user\'s image.
* @param userId User Id.
* @param imageType (Unused) Image type.
* @param index (Unused) Image index.
*/
public async deleteUserImageByIndex (userId: string, imageType: ImageType, index: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}/{index}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'index' + '}', encodeURIComponent(String(index)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling deleteUserImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling deleteUserImageByIndex.');
}
// verify required parameter 'index' is not null or undefined
if (index === null || index === undefined) {
throw new Error('Required parameter index was null or undefined when calling deleteUserImageByIndex.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get artist image by name.
* @param name Artist name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getArtistImage (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Artists/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getArtistImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getArtistImage.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getArtistImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get genre image by name.
* @param name Genre name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getGenreImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Genres/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getGenreImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getGenreImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get genre image by name.
* @param name Genre name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getGenreImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Genres/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getGenreImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getGenreImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getGenreImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getItemImage (itemId: string, imageType: ImageType, maxWidth?: number, maxHeight?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, tag?: string, cropWhitespace?: boolean, format?: ImageFormat, addPlayedIndicator?: boolean, percentPlayed?: number, unplayedCount?: number, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling getItemImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getItemImage.');
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param imageIndex Image index.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getItemImage2 (itemId: string, imageType: ImageType, maxWidth: number, maxHeight: number, tag: string, format: ImageFormat, percentPlayed: number, unplayedCount: number, imageIndex: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/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)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling getItemImage2.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getItemImage2.');
}
// verify required parameter 'maxWidth' is not null or undefined
if (maxWidth === null || maxWidth === undefined) {
throw new Error('Required parameter maxWidth was null or undefined when calling getItemImage2.');
}
// verify required parameter 'maxHeight' is not null or undefined
if (maxHeight === null || maxHeight === undefined) {
throw new Error('Required parameter maxHeight was null or undefined when calling getItemImage2.');
}
// verify required parameter 'tag' is not null or undefined
if (tag === null || tag === undefined) {
throw new Error('Required parameter tag was null or undefined when calling getItemImage2.');
}
// verify required parameter 'format' is not null or undefined
if (format === null || format === undefined) {
throw new Error('Required parameter format was null or undefined when calling getItemImage2.');
}
// verify required parameter 'percentPlayed' is not null or undefined
if (percentPlayed === null || percentPlayed === undefined) {
throw new Error('Required parameter percentPlayed was null or undefined when calling getItemImage2.');
}
// verify required parameter 'unplayedCount' is not null or undefined
if (unplayedCount === null || unplayedCount === undefined) {
throw new Error('Required parameter unplayedCount was null or undefined when calling getItemImage2.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getItemImage2.');
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex Image index.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getItemImageByIndex (itemId: string, imageType: ImageType, imageIndex: number, maxWidth?: number, maxHeight?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, tag?: string, cropWhitespace?: boolean, format?: ImageFormat, addPlayedIndicator?: boolean, percentPlayed?: number, unplayedCount?: number, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling getItemImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getItemImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getItemImageByIndex.');
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get item image infos.
* @param itemId Item id.
*/
public async getItemImageInfos (itemId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ImageInfo>; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling getItemImageInfos.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Array<ImageInfo>; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Array<ImageInfo>");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get music genre image by name.
* @param name Music genre name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getMusicGenreImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/MusicGenres/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getMusicGenreImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getMusicGenreImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get music genre image by name.
* @param name Music genre name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getMusicGenreImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/MusicGenres/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getMusicGenreImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getMusicGenreImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getMusicGenreImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get person image by name.
* @param name Person name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getPersonImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Persons/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getPersonImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getPersonImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get person image by name.
* @param name Person name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getPersonImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Persons/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getPersonImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getPersonImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getPersonImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Generates or gets the splashscreen.
* @param tag Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param blur Blur image.
* @param backgroundColor Apply a background color for transparent images.
* @param foregroundLayer Apply a foreground layer on top of the image.
* @param quality Quality setting, from 0-100.
*/
public async getSplashscreen (tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, width?: number, height?: number, fillWidth?: number, fillHeight?: number, blur?: number, backgroundColor?: string, foregroundLayer?: string, quality?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Branding/Splashscreen';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get studio image by name.
* @param name Studio name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getStudioImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Studios/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getStudioImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getStudioImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get studio image by name.
* @param name Studio name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getStudioImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Studios/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getStudioImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getStudioImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getStudioImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get user profile image.
* @param userId User id.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async getUserImage (userId: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling getUserImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getUserImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get user profile image.
* @param userId User id.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async getUserImageByIndex (userId: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling getUserImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling getUserImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling getUserImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get artist image by name.
* @param name Artist name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headArtistImage (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Artists/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headArtistImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headArtistImage.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headArtistImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get genre image by name.
* @param name Genre name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headGenreImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Genres/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headGenreImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headGenreImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get genre image by name.
* @param name Genre name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headGenreImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Genres/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headGenreImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headGenreImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headGenreImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headItemImage (itemId: string, imageType: ImageType, maxWidth?: number, maxHeight?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, tag?: string, cropWhitespace?: boolean, format?: ImageFormat, addPlayedIndicator?: boolean, percentPlayed?: number, unplayedCount?: number, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling headItemImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headItemImage.');
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param imageIndex Image index.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headItemImage2 (itemId: string, imageType: ImageType, maxWidth: number, maxHeight: number, tag: string, format: ImageFormat, percentPlayed: number, unplayedCount: number, imageIndex: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/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)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling headItemImage2.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headItemImage2.');
}
// verify required parameter 'maxWidth' is not null or undefined
if (maxWidth === null || maxWidth === undefined) {
throw new Error('Required parameter maxWidth was null or undefined when calling headItemImage2.');
}
// verify required parameter 'maxHeight' is not null or undefined
if (maxHeight === null || maxHeight === undefined) {
throw new Error('Required parameter maxHeight was null or undefined when calling headItemImage2.');
}
// verify required parameter 'tag' is not null or undefined
if (tag === null || tag === undefined) {
throw new Error('Required parameter tag was null or undefined when calling headItemImage2.');
}
// verify required parameter 'format' is not null or undefined
if (format === null || format === undefined) {
throw new Error('Required parameter format was null or undefined when calling headItemImage2.');
}
// verify required parameter 'percentPlayed' is not null or undefined
if (percentPlayed === null || percentPlayed === undefined) {
throw new Error('Required parameter percentPlayed was null or undefined when calling headItemImage2.');
}
// verify required parameter 'unplayedCount' is not null or undefined
if (unplayedCount === null || unplayedCount === undefined) {
throw new Error('Required parameter unplayedCount was null or undefined when calling headItemImage2.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headItemImage2.');
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Gets the item\'s image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex Image index.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param format Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headItemImageByIndex (itemId: string, imageType: ImageType, imageIndex: number, maxWidth?: number, maxHeight?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, tag?: string, cropWhitespace?: boolean, format?: ImageFormat, addPlayedIndicator?: boolean, percentPlayed?: number, unplayedCount?: number, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling headItemImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headItemImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headItemImageByIndex.');
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get music genre image by name.
* @param name Music genre name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headMusicGenreImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/MusicGenres/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headMusicGenreImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headMusicGenreImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get music genre image by name.
* @param name Music genre name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headMusicGenreImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/MusicGenres/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headMusicGenreImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headMusicGenreImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headMusicGenreImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get person image by name.
* @param name Person name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headPersonImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Persons/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headPersonImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headPersonImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get person image by name.
* @param name Person name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headPersonImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Persons/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headPersonImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headPersonImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headPersonImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get studio image by name.
* @param name Studio name.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headStudioImage (name: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Studios/{name}/Images/{imageType}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headStudioImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headStudioImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get studio image by name.
* @param name Studio name.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headStudioImageByIndex (name: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Studios/{name}/Images/{imageType}/{imageIndex}'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling headStudioImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headStudioImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headStudioImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get user profile image.
* @param userId User id.
* @param imageType Image type.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
* @param imageIndex Image index.
*/
public async headUserImage (userId: string, imageType: ImageType, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, imageIndex?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling headUserImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headUserImage.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
if (imageIndex !== undefined) {
localVarQueryParameters['imageIndex'] = ObjectSerializer.serialize(imageIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Get user profile image.
* @param userId User id.
* @param imageType Image type.
* @param imageIndex Image index.
* @param tag Optional. Supply the cache tag from the item object to receive strong caching headers.
* @param format Determines the output format of the image - original,gif,jpg,png.
* @param maxWidth The maximum image width to return.
* @param maxHeight The maximum image height to return.
* @param percentPlayed Optional. Percent to render for the percent played overlay.
* @param unplayedCount Optional. Unplayed count overlay to render.
* @param width The fixed image width to return.
* @param height The fixed image height to return.
* @param quality Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases.
* @param fillWidth Width of box to fill.
* @param fillHeight Height of box to fill.
* @param cropWhitespace Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art.
* @param addPlayedIndicator Optional. Add a played indicator.
* @param blur Optional. Blur image.
* @param backgroundColor Optional. Apply a background color for transparent images.
* @param foregroundLayer Optional. Apply a foreground layer on top of the image.
*/
public async headUserImageByIndex (userId: string, imageType: ImageType, imageIndex: number, tag?: string, format?: ImageFormat, maxWidth?: number, maxHeight?: number, percentPlayed?: number, unplayedCount?: number, width?: number, height?: number, quality?: number, fillWidth?: number, fillHeight?: number, cropWhitespace?: boolean, addPlayedIndicator?: boolean, blur?: number, backgroundColor?: string, foregroundLayer?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['image/*', 'application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling headUserImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling headUserImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling headUserImageByIndex.');
}
if (tag !== undefined) {
localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "ImageFormat");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (percentPlayed !== undefined) {
localVarQueryParameters['percentPlayed'] = ObjectSerializer.serialize(percentPlayed, "number");
}
if (unplayedCount !== undefined) {
localVarQueryParameters['unplayedCount'] = ObjectSerializer.serialize(unplayedCount, "number");
}
if (width !== undefined) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}
if (height !== undefined) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}
if (quality !== undefined) {
localVarQueryParameters['quality'] = ObjectSerializer.serialize(quality, "number");
}
if (fillWidth !== undefined) {
localVarQueryParameters['fillWidth'] = ObjectSerializer.serialize(fillWidth, "number");
}
if (fillHeight !== undefined) {
localVarQueryParameters['fillHeight'] = ObjectSerializer.serialize(fillHeight, "number");
}
if (cropWhitespace !== undefined) {
localVarQueryParameters['cropWhitespace'] = ObjectSerializer.serialize(cropWhitespace, "boolean");
}
if (addPlayedIndicator !== undefined) {
localVarQueryParameters['addPlayedIndicator'] = ObjectSerializer.serialize(addPlayedIndicator, "boolean");
}
if (blur !== undefined) {
localVarQueryParameters['blur'] = ObjectSerializer.serialize(blur, "number");
}
if (backgroundColor !== undefined) {
localVarQueryParameters['backgroundColor'] = ObjectSerializer.serialize(backgroundColor, "string");
}
if (foregroundLayer !== undefined) {
localVarQueryParameters['foregroundLayer'] = ObjectSerializer.serialize(foregroundLayer, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'HEAD',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Buffer");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Sets the user image.
* @param userId User Id.
* @param imageType (Unused) Image type.
* @param index (Unused) Image index.
* @param body
*/
public async postUserImage (userId: string, imageType: ImageType, index?: number, body?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling postUserImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling postUserImage.');
}
if (index !== undefined) {
localVarQueryParameters['index'] = ObjectSerializer.serialize(index, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RequestFile")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Sets the user image.
* @param userId User Id.
* @param imageType (Unused) Image type.
* @param index (Unused) Image index.
* @param body
*/
public async postUserImageByIndex (userId: string, imageType: ImageType, index: number, body?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Users/{userId}/Images/{imageType}/{index}'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'index' + '}', encodeURIComponent(String(index)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'userId' is not null or undefined
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling postUserImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling postUserImageByIndex.');
}
// verify required parameter 'index' is not null or undefined
if (index === null || index === undefined) {
throw new Error('Required parameter index was null or undefined when calling postUserImageByIndex.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RequestFile")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Set item image.
* @param itemId Item id.
* @param imageType Image type.
* @param body
*/
public async setItemImage (itemId: string, imageType: ImageType, body?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling setItemImage.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling setItemImage.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RequestFile")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Set item image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex (Unused) Image index.
* @param body
*/
public async setItemImageByIndex (itemId: string, imageType: ImageType, imageIndex: number, body?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}/{imageIndex}'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling setItemImageByIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling setItemImageByIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling setItemImageByIndex.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RequestFile")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Updates the index for an item image.
* @param itemId Item id.
* @param imageType Image type.
* @param imageIndex Old image index.
* @param newIndex New image index.
*/
public async updateItemImageIndex (itemId: string, imageType: ImageType, imageIndex: number, newIndex: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Items/{itemId}/Images/{imageType}/{imageIndex}/Index'
.replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId)))
.replace('{' + 'imageType' + '}', encodeURIComponent(String(imageType)))
.replace('{' + 'imageIndex' + '}', encodeURIComponent(String(imageIndex)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'itemId' is not null or undefined
if (itemId === null || itemId === undefined) {
throw new Error('Required parameter itemId was null or undefined when calling updateItemImageIndex.');
}
// verify required parameter 'imageType' is not null or undefined
if (imageType === null || imageType === undefined) {
throw new Error('Required parameter imageType was null or undefined when calling updateItemImageIndex.');
}
// verify required parameter 'imageIndex' is not null or undefined
if (imageIndex === null || imageIndex === undefined) {
throw new Error('Required parameter imageIndex was null or undefined when calling updateItemImageIndex.');
}
// verify required parameter 'newIndex' is not null or undefined
if (newIndex === null || newIndex === undefined) {
throw new Error('Required parameter newIndex was null or undefined when calling updateItemImageIndex.');
}
if (newIndex !== undefined) {
localVarQueryParameters['newIndex'] = ObjectSerializer.serialize(newIndex, "number");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @summary Uploads a custom splashscreen. The body is expected to the image contents base64 encoded.
* @param body
*/
public async uploadCustomSplashscreen (body?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/Branding/Splashscreen';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RequestFile")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.CustomAuthentication.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}