626 lines
30 KiB
TypeScript
626 lines
30 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 { BaseItemDto } from '../model/baseItemDto';
|
|
import { BaseItemDtoQueryResult } from '../model/baseItemDtoQueryResult';
|
|
import { BaseItemKind } from '../model/baseItemKind';
|
|
import { ImageType } from '../model/imageType';
|
|
import { ItemFields } from '../model/itemFields';
|
|
import { ItemFilter } from '../model/itemFilter';
|
|
import { SortOrder } from '../model/sortOrder';
|
|
|
|
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 ArtistsApiApiKeys {
|
|
CustomAuthentication,
|
|
}
|
|
|
|
export class ArtistsApi {
|
|
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: ArtistsApiApiKeys, value: string) {
|
|
(this.authentications as any)[ArtistsApiApiKeys[key]].apiKey = value;
|
|
}
|
|
|
|
public addInterceptor(interceptor: Interceptor) {
|
|
this.interceptors.push(interceptor);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Gets all album artists from a given item, folder, or the entire library.
|
|
* @param minCommunityRating Optional filter by minimum community rating.
|
|
* @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the results.
|
|
* @param limit Optional. The maximum number of records to return.
|
|
* @param searchTerm Optional. Search term.
|
|
* @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root.
|
|
* @param fields Optional. Specify additional fields of information to return in the output.
|
|
* @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.
|
|
* @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
|
|
* @param filters Optional. Specify additional filters to apply.
|
|
* @param isFavorite Optional filter by items that are marked as favorite, or not.
|
|
* @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited.
|
|
* @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.
|
|
* @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.
|
|
* @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.
|
|
* @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.
|
|
* @param years Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.
|
|
* @param enableUserData Optional, include user data.
|
|
* @param imageTypeLimit Optional, the max number of images to return, per image type.
|
|
* @param enableImageTypes Optional. The image types to include in the output.
|
|
* @param person Optional. If specified, results will be filtered to include only those containing the specified person.
|
|
* @param personIds Optional. If specified, results will be filtered to include only those containing the specified person ids.
|
|
* @param personTypes Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.
|
|
* @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.
|
|
* @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.
|
|
* @param userId User id.
|
|
* @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given input string.
|
|
* @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string.
|
|
* @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string.
|
|
* @param sortBy Optional. Specify one or more sort orders, comma delimited.
|
|
* @param sortOrder Sort Order - Ascending,Descending.
|
|
* @param enableImages Optional, include image information in output.
|
|
* @param enableTotalRecordCount Total record count.
|
|
*/
|
|
public async getAlbumArtists (minCommunityRating?: number, startIndex?: number, limit?: number, searchTerm?: string, parentId?: string, fields?: Array<ItemFields>, excludeItemTypes?: Array<BaseItemKind>, includeItemTypes?: Array<BaseItemKind>, filters?: Array<ItemFilter>, isFavorite?: boolean, mediaTypes?: Array<string>, genres?: Array<string>, genreIds?: Array<string>, officialRatings?: Array<string>, tags?: Array<string>, years?: Array<number>, enableUserData?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, person?: string, personIds?: Array<string>, personTypes?: Array<string>, studios?: Array<string>, studioIds?: Array<string>, userId?: string, nameStartsWithOrGreater?: string, nameStartsWith?: string, nameLessThan?: string, sortBy?: Array<string>, sortOrder?: Array<SortOrder>, enableImages?: boolean, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/Artists/AlbumArtists';
|
|
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 = {};
|
|
|
|
if (minCommunityRating !== undefined) {
|
|
localVarQueryParameters['minCommunityRating'] = ObjectSerializer.serialize(minCommunityRating, "number");
|
|
}
|
|
|
|
if (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (searchTerm !== undefined) {
|
|
localVarQueryParameters['searchTerm'] = ObjectSerializer.serialize(searchTerm, "string");
|
|
}
|
|
|
|
if (parentId !== undefined) {
|
|
localVarQueryParameters['parentId'] = ObjectSerializer.serialize(parentId, "string");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (excludeItemTypes !== undefined) {
|
|
localVarQueryParameters['excludeItemTypes'] = ObjectSerializer.serialize(excludeItemTypes, "Array<BaseItemKind>");
|
|
}
|
|
|
|
if (includeItemTypes !== undefined) {
|
|
localVarQueryParameters['includeItemTypes'] = ObjectSerializer.serialize(includeItemTypes, "Array<BaseItemKind>");
|
|
}
|
|
|
|
if (filters !== undefined) {
|
|
localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "Array<ItemFilter>");
|
|
}
|
|
|
|
if (isFavorite !== undefined) {
|
|
localVarQueryParameters['isFavorite'] = ObjectSerializer.serialize(isFavorite, "boolean");
|
|
}
|
|
|
|
if (mediaTypes !== undefined) {
|
|
localVarQueryParameters['mediaTypes'] = ObjectSerializer.serialize(mediaTypes, "Array<string>");
|
|
}
|
|
|
|
if (genres !== undefined) {
|
|
localVarQueryParameters['genres'] = ObjectSerializer.serialize(genres, "Array<string>");
|
|
}
|
|
|
|
if (genreIds !== undefined) {
|
|
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
|
|
}
|
|
|
|
if (officialRatings !== undefined) {
|
|
localVarQueryParameters['officialRatings'] = ObjectSerializer.serialize(officialRatings, "Array<string>");
|
|
}
|
|
|
|
if (tags !== undefined) {
|
|
localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array<string>");
|
|
}
|
|
|
|
if (years !== undefined) {
|
|
localVarQueryParameters['years'] = ObjectSerializer.serialize(years, "Array<number>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (person !== undefined) {
|
|
localVarQueryParameters['person'] = ObjectSerializer.serialize(person, "string");
|
|
}
|
|
|
|
if (personIds !== undefined) {
|
|
localVarQueryParameters['personIds'] = ObjectSerializer.serialize(personIds, "Array<string>");
|
|
}
|
|
|
|
if (personTypes !== undefined) {
|
|
localVarQueryParameters['personTypes'] = ObjectSerializer.serialize(personTypes, "Array<string>");
|
|
}
|
|
|
|
if (studios !== undefined) {
|
|
localVarQueryParameters['studios'] = ObjectSerializer.serialize(studios, "Array<string>");
|
|
}
|
|
|
|
if (studioIds !== undefined) {
|
|
localVarQueryParameters['studioIds'] = ObjectSerializer.serialize(studioIds, "Array<string>");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (nameStartsWithOrGreater !== undefined) {
|
|
localVarQueryParameters['nameStartsWithOrGreater'] = ObjectSerializer.serialize(nameStartsWithOrGreater, "string");
|
|
}
|
|
|
|
if (nameStartsWith !== undefined) {
|
|
localVarQueryParameters['nameStartsWith'] = ObjectSerializer.serialize(nameStartsWith, "string");
|
|
}
|
|
|
|
if (nameLessThan !== undefined) {
|
|
localVarQueryParameters['nameLessThan'] = ObjectSerializer.serialize(nameLessThan, "string");
|
|
}
|
|
|
|
if (sortBy !== undefined) {
|
|
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
|
|
}
|
|
|
|
if (sortOrder !== undefined) {
|
|
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "Array<SortOrder>");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<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: BaseItemDtoQueryResult; }>((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, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets an artist by name.
|
|
* @param name Studio name.
|
|
* @param userId Optional. Filter by user id, and attach user data.
|
|
*/
|
|
public async getArtistByName (name: string, userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDto; }> {
|
|
const localVarPath = this.basePath + '/Artists/{name}'
|
|
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
|
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 'name' is not null or undefined
|
|
if (name === null || name === undefined) {
|
|
throw new Error('Required parameter name was null or undefined when calling getArtistByName.');
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "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,
|
|
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: BaseItemDto; }>((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, "BaseItemDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets all artists from a given item, folder, or the entire library.
|
|
* @param minCommunityRating Optional filter by minimum community rating.
|
|
* @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the results.
|
|
* @param limit Optional. The maximum number of records to return.
|
|
* @param searchTerm Optional. Search term.
|
|
* @param parentId Specify this to localize the search to a specific item or folder. Omit to use the root.
|
|
* @param fields Optional. Specify additional fields of information to return in the output.
|
|
* @param excludeItemTypes Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited.
|
|
* @param includeItemTypes Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
|
|
* @param filters Optional. Specify additional filters to apply.
|
|
* @param isFavorite Optional filter by items that are marked as favorite, or not.
|
|
* @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited.
|
|
* @param genres Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.
|
|
* @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.
|
|
* @param officialRatings Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.
|
|
* @param tags Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.
|
|
* @param years Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.
|
|
* @param enableUserData Optional, include user data.
|
|
* @param imageTypeLimit Optional, the max number of images to return, per image type.
|
|
* @param enableImageTypes Optional. The image types to include in the output.
|
|
* @param person Optional. If specified, results will be filtered to include only those containing the specified person.
|
|
* @param personIds Optional. If specified, results will be filtered to include only those containing the specified person ids.
|
|
* @param personTypes Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.
|
|
* @param studios Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.
|
|
* @param studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.
|
|
* @param userId User id.
|
|
* @param nameStartsWithOrGreater Optional filter by items whose name is sorted equally or greater than a given input string.
|
|
* @param nameStartsWith Optional filter by items whose name is sorted equally than a given input string.
|
|
* @param nameLessThan Optional filter by items whose name is equally or lesser than a given input string.
|
|
* @param sortBy Optional. Specify one or more sort orders, comma delimited.
|
|
* @param sortOrder Sort Order - Ascending,Descending.
|
|
* @param enableImages Optional, include image information in output.
|
|
* @param enableTotalRecordCount Total record count.
|
|
*/
|
|
public async getArtists (minCommunityRating?: number, startIndex?: number, limit?: number, searchTerm?: string, parentId?: string, fields?: Array<ItemFields>, excludeItemTypes?: Array<BaseItemKind>, includeItemTypes?: Array<BaseItemKind>, filters?: Array<ItemFilter>, isFavorite?: boolean, mediaTypes?: Array<string>, genres?: Array<string>, genreIds?: Array<string>, officialRatings?: Array<string>, tags?: Array<string>, years?: Array<number>, enableUserData?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, person?: string, personIds?: Array<string>, personTypes?: Array<string>, studios?: Array<string>, studioIds?: Array<string>, userId?: string, nameStartsWithOrGreater?: string, nameStartsWith?: string, nameLessThan?: string, sortBy?: Array<string>, sortOrder?: Array<SortOrder>, enableImages?: boolean, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/Artists';
|
|
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 = {};
|
|
|
|
if (minCommunityRating !== undefined) {
|
|
localVarQueryParameters['minCommunityRating'] = ObjectSerializer.serialize(minCommunityRating, "number");
|
|
}
|
|
|
|
if (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (searchTerm !== undefined) {
|
|
localVarQueryParameters['searchTerm'] = ObjectSerializer.serialize(searchTerm, "string");
|
|
}
|
|
|
|
if (parentId !== undefined) {
|
|
localVarQueryParameters['parentId'] = ObjectSerializer.serialize(parentId, "string");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (excludeItemTypes !== undefined) {
|
|
localVarQueryParameters['excludeItemTypes'] = ObjectSerializer.serialize(excludeItemTypes, "Array<BaseItemKind>");
|
|
}
|
|
|
|
if (includeItemTypes !== undefined) {
|
|
localVarQueryParameters['includeItemTypes'] = ObjectSerializer.serialize(includeItemTypes, "Array<BaseItemKind>");
|
|
}
|
|
|
|
if (filters !== undefined) {
|
|
localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "Array<ItemFilter>");
|
|
}
|
|
|
|
if (isFavorite !== undefined) {
|
|
localVarQueryParameters['isFavorite'] = ObjectSerializer.serialize(isFavorite, "boolean");
|
|
}
|
|
|
|
if (mediaTypes !== undefined) {
|
|
localVarQueryParameters['mediaTypes'] = ObjectSerializer.serialize(mediaTypes, "Array<string>");
|
|
}
|
|
|
|
if (genres !== undefined) {
|
|
localVarQueryParameters['genres'] = ObjectSerializer.serialize(genres, "Array<string>");
|
|
}
|
|
|
|
if (genreIds !== undefined) {
|
|
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
|
|
}
|
|
|
|
if (officialRatings !== undefined) {
|
|
localVarQueryParameters['officialRatings'] = ObjectSerializer.serialize(officialRatings, "Array<string>");
|
|
}
|
|
|
|
if (tags !== undefined) {
|
|
localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array<string>");
|
|
}
|
|
|
|
if (years !== undefined) {
|
|
localVarQueryParameters['years'] = ObjectSerializer.serialize(years, "Array<number>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (person !== undefined) {
|
|
localVarQueryParameters['person'] = ObjectSerializer.serialize(person, "string");
|
|
}
|
|
|
|
if (personIds !== undefined) {
|
|
localVarQueryParameters['personIds'] = ObjectSerializer.serialize(personIds, "Array<string>");
|
|
}
|
|
|
|
if (personTypes !== undefined) {
|
|
localVarQueryParameters['personTypes'] = ObjectSerializer.serialize(personTypes, "Array<string>");
|
|
}
|
|
|
|
if (studios !== undefined) {
|
|
localVarQueryParameters['studios'] = ObjectSerializer.serialize(studios, "Array<string>");
|
|
}
|
|
|
|
if (studioIds !== undefined) {
|
|
localVarQueryParameters['studioIds'] = ObjectSerializer.serialize(studioIds, "Array<string>");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (nameStartsWithOrGreater !== undefined) {
|
|
localVarQueryParameters['nameStartsWithOrGreater'] = ObjectSerializer.serialize(nameStartsWithOrGreater, "string");
|
|
}
|
|
|
|
if (nameStartsWith !== undefined) {
|
|
localVarQueryParameters['nameStartsWith'] = ObjectSerializer.serialize(nameStartsWith, "string");
|
|
}
|
|
|
|
if (nameLessThan !== undefined) {
|
|
localVarQueryParameters['nameLessThan'] = ObjectSerializer.serialize(nameLessThan, "string");
|
|
}
|
|
|
|
if (sortBy !== undefined) {
|
|
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
|
|
}
|
|
|
|
if (sortOrder !== undefined) {
|
|
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "Array<SortOrder>");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<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: BaseItemDtoQueryResult; }>((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, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|