jellyfin-discord-bot/jellyfin/api/itemsApi.ts

1225 lines
64 KiB
TypeScript
Raw Normal View History

2023-04-15 22:02:40 +02:00
/**
* 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 { 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 { LocationType } from '../model/locationType';
import { SeriesStatus } from '../model/seriesStatus';
import { SortOrder } from '../model/sortOrder';
import { VideoType } from '../model/videoType';
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 ItemsApiApiKeys {
CustomAuthentication,
}
export class ItemsApi {
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: ItemsApiApiKeys, value: string) {
(this.authentications as any)[ItemsApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @summary Gets items based on a query.
* @param userId The user id supplied as query parameter.
* @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).
* @param hasThemeSong Optional filter by items with theme songs.
* @param hasThemeVideo Optional filter by items with theme videos.
* @param hasSubtitles Optional filter by items with subtitles.
* @param hasSpecialFeature Optional filter by items with special features.
* @param hasTrailer Optional filter by items with trailers.
* @param adjacentTo Optional. Return items that are siblings of a supplied item.
* @param parentIndexNumber Optional filter by parent index number.
* @param hasParentalRating Optional filter by items that have or do not have a parental rating.
* @param isHd Optional filter by items that are HD or not.
* @param is4K Optional filter by items that are 4K or not.
* @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.
* @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.
* @param isMissing Optional filter by items that are missing episodes or not.
* @param isUnaired Optional filter by items that are unaired episodes or not.
* @param minCommunityRating Optional filter by minimum community rating.
* @param minCriticRating Optional filter by minimum critic rating.
* @param minPremiereDate Optional. The minimum premiere date. Format &#x3D; ISO.
* @param minDateLastSaved Optional. The minimum last saved date. Format &#x3D; ISO.
* @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format &#x3D; ISO.
* @param maxPremiereDate Optional. The maximum premiere date. Format &#x3D; ISO.
* @param hasOverview Optional filter by items that have an overview or not.
* @param hasImdbId Optional filter by items that have an imdb id or not.
* @param hasTmdbId Optional filter by items that have a tmdb id or not.
* @param hasTvdbId Optional filter by items that have a tvdb id or not.
* @param isMovie Optional filter for live tv movies.
* @param isSeries Optional filter for live tv series.
* @param isNews Optional filter for live tv news.
* @param isKids Optional filter for live tv kids.
* @param isSports Optional filter for live tv sports.
* @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.
* @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 recursive When searching within folders, this determines whether or not the search will be recursive. true/false.
* @param searchTerm Optional. Filter based on a search term.
* @param sortOrder Sort Order - Ascending,Descending.
* @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. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
* @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
* @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.
* @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.
* @param isFavorite Optional filter by items that are marked as favorite, or not.
* @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited.
* @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.
* @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
* @param isPlayed Optional filter by items that are played, or not.
* @param genres Optional. If specified, results will be filtered based on genre. 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 id.
* @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 artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.
* @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.
* @param artistIds Optional. If specified, results will be filtered to include only those containing the specified artist id.
* @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the specified album artist id.
* @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.
* @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.
* @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.
* @param ids Optional. If specific items are needed, specify a list of item id\&#39;s to retrieve. This allows multiple, comma delimited.
* @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.
* @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).
* @param isLocked Optional filter by items that are locked.
* @param isPlaceHolder Optional filter by items that are placeholders.
* @param hasOfficialRating Optional filter by items that have official ratings.
* @param collapseBoxSetItems Whether or not to hide items behind their boxsets.
* @param minWidth Optional. Filter by the minimum width of the item.
* @param minHeight Optional. Filter by the minimum height of the item.
* @param maxWidth Optional. Filter by the maximum width of the item.
* @param maxHeight Optional. Filter by the maximum height of the item.
* @param is3D Optional filter by items that are 3D, or not.
* @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited.
* @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 studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.
* @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.
* @param enableTotalRecordCount Optional. Enable the total record count.
* @param enableImages Optional, include image information in output.
*/
public async getItems (userId?: string, maxOfficialRating?: string, hasThemeSong?: boolean, hasThemeVideo?: boolean, hasSubtitles?: boolean, hasSpecialFeature?: boolean, hasTrailer?: boolean, adjacentTo?: string, parentIndexNumber?: number, hasParentalRating?: boolean, isHd?: boolean, is4K?: boolean, locationTypes?: Array<LocationType>, excludeLocationTypes?: Array<LocationType>, isMissing?: boolean, isUnaired?: boolean, minCommunityRating?: number, minCriticRating?: number, minPremiereDate?: Date, minDateLastSaved?: Date, minDateLastSavedForUser?: Date, maxPremiereDate?: Date, hasOverview?: boolean, hasImdbId?: boolean, hasTmdbId?: boolean, hasTvdbId?: boolean, isMovie?: boolean, isSeries?: boolean, isNews?: boolean, isKids?: boolean, isSports?: boolean, excludeItemIds?: Array<string>, startIndex?: number, limit?: number, recursive?: boolean, searchTerm?: string, sortOrder?: Array<SortOrder>, parentId?: string, fields?: Array<ItemFields>, excludeItemTypes?: Array<BaseItemKind>, includeItemTypes?: Array<BaseItemKind>, filters?: Array<ItemFilter>, isFavorite?: boolean, mediaTypes?: Array<string>, imageTypes?: Array<ImageType>, sortBy?: Array<string>, isPlayed?: boolean, genres?: 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>, artists?: Array<string>, excludeArtistIds?: Array<string>, artistIds?: Array<string>, albumArtistIds?: Array<string>, contributingArtistIds?: Array<string>, albums?: Array<string>, albumIds?: Array<string>, ids?: Array<string>, videoTypes?: Array<VideoType>, minOfficialRating?: string, isLocked?: boolean, isPlaceHolder?: boolean, hasOfficialRating?: boolean, collapseBoxSetItems?: boolean, minWidth?: number, minHeight?: number, maxWidth?: number, maxHeight?: number, is3D?: boolean, seriesStatus?: Array<SeriesStatus>, nameStartsWithOrGreater?: string, nameStartsWith?: string, nameLessThan?: string, studioIds?: Array<string>, genreIds?: Array<string>, enableTotalRecordCount?: boolean, enableImages?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
const localVarPath = this.basePath + '/Items';
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 (userId !== undefined) {
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
}
if (maxOfficialRating !== undefined) {
localVarQueryParameters['maxOfficialRating'] = ObjectSerializer.serialize(maxOfficialRating, "string");
}
if (hasThemeSong !== undefined) {
localVarQueryParameters['hasThemeSong'] = ObjectSerializer.serialize(hasThemeSong, "boolean");
}
if (hasThemeVideo !== undefined) {
localVarQueryParameters['hasThemeVideo'] = ObjectSerializer.serialize(hasThemeVideo, "boolean");
}
if (hasSubtitles !== undefined) {
localVarQueryParameters['hasSubtitles'] = ObjectSerializer.serialize(hasSubtitles, "boolean");
}
if (hasSpecialFeature !== undefined) {
localVarQueryParameters['hasSpecialFeature'] = ObjectSerializer.serialize(hasSpecialFeature, "boolean");
}
if (hasTrailer !== undefined) {
localVarQueryParameters['hasTrailer'] = ObjectSerializer.serialize(hasTrailer, "boolean");
}
if (adjacentTo !== undefined) {
localVarQueryParameters['adjacentTo'] = ObjectSerializer.serialize(adjacentTo, "string");
}
if (parentIndexNumber !== undefined) {
localVarQueryParameters['parentIndexNumber'] = ObjectSerializer.serialize(parentIndexNumber, "number");
}
if (hasParentalRating !== undefined) {
localVarQueryParameters['hasParentalRating'] = ObjectSerializer.serialize(hasParentalRating, "boolean");
}
if (isHd !== undefined) {
localVarQueryParameters['isHd'] = ObjectSerializer.serialize(isHd, "boolean");
}
if (is4K !== undefined) {
localVarQueryParameters['is4K'] = ObjectSerializer.serialize(is4K, "boolean");
}
if (locationTypes !== undefined) {
localVarQueryParameters['locationTypes'] = ObjectSerializer.serialize(locationTypes, "Array<LocationType>");
}
if (excludeLocationTypes !== undefined) {
localVarQueryParameters['excludeLocationTypes'] = ObjectSerializer.serialize(excludeLocationTypes, "Array<LocationType>");
}
if (isMissing !== undefined) {
localVarQueryParameters['isMissing'] = ObjectSerializer.serialize(isMissing, "boolean");
}
if (isUnaired !== undefined) {
localVarQueryParameters['isUnaired'] = ObjectSerializer.serialize(isUnaired, "boolean");
}
if (minCommunityRating !== undefined) {
localVarQueryParameters['minCommunityRating'] = ObjectSerializer.serialize(minCommunityRating, "number");
}
if (minCriticRating !== undefined) {
localVarQueryParameters['minCriticRating'] = ObjectSerializer.serialize(minCriticRating, "number");
}
if (minPremiereDate !== undefined) {
localVarQueryParameters['minPremiereDate'] = ObjectSerializer.serialize(minPremiereDate, "Date");
}
if (minDateLastSaved !== undefined) {
localVarQueryParameters['minDateLastSaved'] = ObjectSerializer.serialize(minDateLastSaved, "Date");
}
if (minDateLastSavedForUser !== undefined) {
localVarQueryParameters['minDateLastSavedForUser'] = ObjectSerializer.serialize(minDateLastSavedForUser, "Date");
}
if (maxPremiereDate !== undefined) {
localVarQueryParameters['maxPremiereDate'] = ObjectSerializer.serialize(maxPremiereDate, "Date");
}
if (hasOverview !== undefined) {
localVarQueryParameters['hasOverview'] = ObjectSerializer.serialize(hasOverview, "boolean");
}
if (hasImdbId !== undefined) {
localVarQueryParameters['hasImdbId'] = ObjectSerializer.serialize(hasImdbId, "boolean");
}
if (hasTmdbId !== undefined) {
localVarQueryParameters['hasTmdbId'] = ObjectSerializer.serialize(hasTmdbId, "boolean");
}
if (hasTvdbId !== undefined) {
localVarQueryParameters['hasTvdbId'] = ObjectSerializer.serialize(hasTvdbId, "boolean");
}
if (isMovie !== undefined) {
localVarQueryParameters['isMovie'] = ObjectSerializer.serialize(isMovie, "boolean");
}
if (isSeries !== undefined) {
localVarQueryParameters['isSeries'] = ObjectSerializer.serialize(isSeries, "boolean");
}
if (isNews !== undefined) {
localVarQueryParameters['isNews'] = ObjectSerializer.serialize(isNews, "boolean");
}
if (isKids !== undefined) {
localVarQueryParameters['isKids'] = ObjectSerializer.serialize(isKids, "boolean");
}
if (isSports !== undefined) {
localVarQueryParameters['isSports'] = ObjectSerializer.serialize(isSports, "boolean");
}
if (excludeItemIds !== undefined) {
localVarQueryParameters['excludeItemIds'] = ObjectSerializer.serialize(excludeItemIds, "Array<string>");
}
if (startIndex !== undefined) {
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
}
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
if (recursive !== undefined) {
localVarQueryParameters['recursive'] = ObjectSerializer.serialize(recursive, "boolean");
}
if (searchTerm !== undefined) {
localVarQueryParameters['searchTerm'] = ObjectSerializer.serialize(searchTerm, "string");
}
if (sortOrder !== undefined) {
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "Array<SortOrder>");
}
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 (imageTypes !== undefined) {
localVarQueryParameters['imageTypes'] = ObjectSerializer.serialize(imageTypes, "Array<ImageType>");
}
if (sortBy !== undefined) {
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
}
if (isPlayed !== undefined) {
localVarQueryParameters['isPlayed'] = ObjectSerializer.serialize(isPlayed, "boolean");
}
if (genres !== undefined) {
localVarQueryParameters['genres'] = ObjectSerializer.serialize(genres, "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 (artists !== undefined) {
localVarQueryParameters['artists'] = ObjectSerializer.serialize(artists, "Array<string>");
}
if (excludeArtistIds !== undefined) {
localVarQueryParameters['excludeArtistIds'] = ObjectSerializer.serialize(excludeArtistIds, "Array<string>");
}
if (artistIds !== undefined) {
localVarQueryParameters['artistIds'] = ObjectSerializer.serialize(artistIds, "Array<string>");
}
if (albumArtistIds !== undefined) {
localVarQueryParameters['albumArtistIds'] = ObjectSerializer.serialize(albumArtistIds, "Array<string>");
}
if (contributingArtistIds !== undefined) {
localVarQueryParameters['contributingArtistIds'] = ObjectSerializer.serialize(contributingArtistIds, "Array<string>");
}
if (albums !== undefined) {
localVarQueryParameters['albums'] = ObjectSerializer.serialize(albums, "Array<string>");
}
if (albumIds !== undefined) {
localVarQueryParameters['albumIds'] = ObjectSerializer.serialize(albumIds, "Array<string>");
}
if (ids !== undefined) {
localVarQueryParameters['ids'] = ObjectSerializer.serialize(ids, "Array<string>");
}
if (videoTypes !== undefined) {
localVarQueryParameters['videoTypes'] = ObjectSerializer.serialize(videoTypes, "Array<VideoType>");
}
if (minOfficialRating !== undefined) {
localVarQueryParameters['minOfficialRating'] = ObjectSerializer.serialize(minOfficialRating, "string");
}
if (isLocked !== undefined) {
localVarQueryParameters['isLocked'] = ObjectSerializer.serialize(isLocked, "boolean");
}
if (isPlaceHolder !== undefined) {
localVarQueryParameters['isPlaceHolder'] = ObjectSerializer.serialize(isPlaceHolder, "boolean");
}
if (hasOfficialRating !== undefined) {
localVarQueryParameters['hasOfficialRating'] = ObjectSerializer.serialize(hasOfficialRating, "boolean");
}
if (collapseBoxSetItems !== undefined) {
localVarQueryParameters['collapseBoxSetItems'] = ObjectSerializer.serialize(collapseBoxSetItems, "boolean");
}
if (minWidth !== undefined) {
localVarQueryParameters['minWidth'] = ObjectSerializer.serialize(minWidth, "number");
}
if (minHeight !== undefined) {
localVarQueryParameters['minHeight'] = ObjectSerializer.serialize(minHeight, "number");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (is3D !== undefined) {
localVarQueryParameters['is3D'] = ObjectSerializer.serialize(is3D, "boolean");
}
if (seriesStatus !== undefined) {
localVarQueryParameters['seriesStatus'] = ObjectSerializer.serialize(seriesStatus, "Array<SeriesStatus>");
}
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 (studioIds !== undefined) {
localVarQueryParameters['studioIds'] = ObjectSerializer.serialize(studioIds, "Array<string>");
}
if (genreIds !== undefined) {
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
}
if (enableTotalRecordCount !== undefined) {
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
}
if (enableImages !== undefined) {
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "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 items based on a query.
* @param userId The user id supplied as query parameter.
* @param maxOfficialRating Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).
* @param hasThemeSong Optional filter by items with theme songs.
* @param hasThemeVideo Optional filter by items with theme videos.
* @param hasSubtitles Optional filter by items with subtitles.
* @param hasSpecialFeature Optional filter by items with special features.
* @param hasTrailer Optional filter by items with trailers.
* @param adjacentTo Optional. Return items that are siblings of a supplied item.
* @param parentIndexNumber Optional filter by parent index number.
* @param hasParentalRating Optional filter by items that have or do not have a parental rating.
* @param isHd Optional filter by items that are HD or not.
* @param is4K Optional filter by items that are 4K or not.
* @param locationTypes Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.
* @param excludeLocationTypes Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.
* @param isMissing Optional filter by items that are missing episodes or not.
* @param isUnaired Optional filter by items that are unaired episodes or not.
* @param minCommunityRating Optional filter by minimum community rating.
* @param minCriticRating Optional filter by minimum critic rating.
* @param minPremiereDate Optional. The minimum premiere date. Format &#x3D; ISO.
* @param minDateLastSaved Optional. The minimum last saved date. Format &#x3D; ISO.
* @param minDateLastSavedForUser Optional. The minimum last saved date for the current user. Format &#x3D; ISO.
* @param maxPremiereDate Optional. The maximum premiere date. Format &#x3D; ISO.
* @param hasOverview Optional filter by items that have an overview or not.
* @param hasImdbId Optional filter by items that have an imdb id or not.
* @param hasTmdbId Optional filter by items that have a tmdb id or not.
* @param hasTvdbId Optional filter by items that have a tvdb id or not.
* @param isMovie Optional filter for live tv movies.
* @param isSeries Optional filter for live tv series.
* @param isNews Optional filter for live tv news.
* @param isKids Optional filter for live tv kids.
* @param isSports Optional filter for live tv sports.
* @param excludeItemIds Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.
* @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 recursive When searching within folders, this determines whether or not the search will be recursive. true/false.
* @param searchTerm Optional. Filter based on a search term.
* @param sortOrder Sort Order - Ascending,Descending.
* @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. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
* @param excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
* @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.
* @param filters Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.
* @param isFavorite Optional filter by items that are marked as favorite, or not.
* @param mediaTypes Optional filter by MediaType. Allows multiple, comma delimited.
* @param imageTypes Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.
* @param sortBy Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
* @param isPlayed Optional filter by items that are played, or not.
* @param genres Optional. If specified, results will be filtered based on genre. 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 id.
* @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 artists Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.
* @param excludeArtistIds Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.
* @param artistIds Optional. If specified, results will be filtered to include only those containing the specified artist id.
* @param albumArtistIds Optional. If specified, results will be filtered to include only those containing the specified album artist id.
* @param contributingArtistIds Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.
* @param albums Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.
* @param albumIds Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.
* @param ids Optional. If specific items are needed, specify a list of item id\&#39;s to retrieve. This allows multiple, comma delimited.
* @param videoTypes Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.
* @param minOfficialRating Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).
* @param isLocked Optional filter by items that are locked.
* @param isPlaceHolder Optional filter by items that are placeholders.
* @param hasOfficialRating Optional filter by items that have official ratings.
* @param collapseBoxSetItems Whether or not to hide items behind their boxsets.
* @param minWidth Optional. Filter by the minimum width of the item.
* @param minHeight Optional. Filter by the minimum height of the item.
* @param maxWidth Optional. Filter by the maximum width of the item.
* @param maxHeight Optional. Filter by the maximum height of the item.
* @param is3D Optional filter by items that are 3D, or not.
* @param seriesStatus Optional filter by Series Status. Allows multiple, comma delimited.
* @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 studioIds Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.
* @param genreIds Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.
* @param enableTotalRecordCount Optional. Enable the total record count.
* @param enableImages Optional, include image information in output.
*/
public async getItemsByUserId (userId: string, maxOfficialRating?: string, hasThemeSong?: boolean, hasThemeVideo?: boolean, hasSubtitles?: boolean, hasSpecialFeature?: boolean, hasTrailer?: boolean, adjacentTo?: string, parentIndexNumber?: number, hasParentalRating?: boolean, isHd?: boolean, is4K?: boolean, locationTypes?: Array<LocationType>, excludeLocationTypes?: Array<LocationType>, isMissing?: boolean, isUnaired?: boolean, minCommunityRating?: number, minCriticRating?: number, minPremiereDate?: Date, minDateLastSaved?: Date, minDateLastSavedForUser?: Date, maxPremiereDate?: Date, hasOverview?: boolean, hasImdbId?: boolean, hasTmdbId?: boolean, hasTvdbId?: boolean, isMovie?: boolean, isSeries?: boolean, isNews?: boolean, isKids?: boolean, isSports?: boolean, excludeItemIds?: Array<string>, startIndex?: number, limit?: number, recursive?: boolean, searchTerm?: string, sortOrder?: Array<SortOrder>, parentId?: string, fields?: Array<ItemFields>, excludeItemTypes?: Array<BaseItemKind>, includeItemTypes?: Array<BaseItemKind>, filters?: Array<ItemFilter>, isFavorite?: boolean, mediaTypes?: Array<string>, imageTypes?: Array<ImageType>, sortBy?: Array<string>, isPlayed?: boolean, genres?: 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>, artists?: Array<string>, excludeArtistIds?: Array<string>, artistIds?: Array<string>, albumArtistIds?: Array<string>, contributingArtistIds?: Array<string>, albums?: Array<string>, albumIds?: Array<string>, ids?: Array<string>, videoTypes?: Array<VideoType>, minOfficialRating?: string, isLocked?: boolean, isPlaceHolder?: boolean, hasOfficialRating?: boolean, collapseBoxSetItems?: boolean, minWidth?: number, minHeight?: number, maxWidth?: number, maxHeight?: number, is3D?: boolean, seriesStatus?: Array<SeriesStatus>, nameStartsWithOrGreater?: string, nameStartsWith?: string, nameLessThan?: string, studioIds?: Array<string>, genreIds?: Array<string>, enableTotalRecordCount?: boolean, enableImages?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
const localVarPath = this.basePath + '/Users/{userId}/Items'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
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 getItemsByUserId.');
}
if (maxOfficialRating !== undefined) {
localVarQueryParameters['maxOfficialRating'] = ObjectSerializer.serialize(maxOfficialRating, "string");
}
if (hasThemeSong !== undefined) {
localVarQueryParameters['hasThemeSong'] = ObjectSerializer.serialize(hasThemeSong, "boolean");
}
if (hasThemeVideo !== undefined) {
localVarQueryParameters['hasThemeVideo'] = ObjectSerializer.serialize(hasThemeVideo, "boolean");
}
if (hasSubtitles !== undefined) {
localVarQueryParameters['hasSubtitles'] = ObjectSerializer.serialize(hasSubtitles, "boolean");
}
if (hasSpecialFeature !== undefined) {
localVarQueryParameters['hasSpecialFeature'] = ObjectSerializer.serialize(hasSpecialFeature, "boolean");
}
if (hasTrailer !== undefined) {
localVarQueryParameters['hasTrailer'] = ObjectSerializer.serialize(hasTrailer, "boolean");
}
if (adjacentTo !== undefined) {
localVarQueryParameters['adjacentTo'] = ObjectSerializer.serialize(adjacentTo, "string");
}
if (parentIndexNumber !== undefined) {
localVarQueryParameters['parentIndexNumber'] = ObjectSerializer.serialize(parentIndexNumber, "number");
}
if (hasParentalRating !== undefined) {
localVarQueryParameters['hasParentalRating'] = ObjectSerializer.serialize(hasParentalRating, "boolean");
}
if (isHd !== undefined) {
localVarQueryParameters['isHd'] = ObjectSerializer.serialize(isHd, "boolean");
}
if (is4K !== undefined) {
localVarQueryParameters['is4K'] = ObjectSerializer.serialize(is4K, "boolean");
}
if (locationTypes !== undefined) {
localVarQueryParameters['locationTypes'] = ObjectSerializer.serialize(locationTypes, "Array<LocationType>");
}
if (excludeLocationTypes !== undefined) {
localVarQueryParameters['excludeLocationTypes'] = ObjectSerializer.serialize(excludeLocationTypes, "Array<LocationType>");
}
if (isMissing !== undefined) {
localVarQueryParameters['isMissing'] = ObjectSerializer.serialize(isMissing, "boolean");
}
if (isUnaired !== undefined) {
localVarQueryParameters['isUnaired'] = ObjectSerializer.serialize(isUnaired, "boolean");
}
if (minCommunityRating !== undefined) {
localVarQueryParameters['minCommunityRating'] = ObjectSerializer.serialize(minCommunityRating, "number");
}
if (minCriticRating !== undefined) {
localVarQueryParameters['minCriticRating'] = ObjectSerializer.serialize(minCriticRating, "number");
}
if (minPremiereDate !== undefined) {
localVarQueryParameters['minPremiereDate'] = ObjectSerializer.serialize(minPremiereDate, "Date");
}
if (minDateLastSaved !== undefined) {
localVarQueryParameters['minDateLastSaved'] = ObjectSerializer.serialize(minDateLastSaved, "Date");
}
if (minDateLastSavedForUser !== undefined) {
localVarQueryParameters['minDateLastSavedForUser'] = ObjectSerializer.serialize(minDateLastSavedForUser, "Date");
}
if (maxPremiereDate !== undefined) {
localVarQueryParameters['maxPremiereDate'] = ObjectSerializer.serialize(maxPremiereDate, "Date");
}
if (hasOverview !== undefined) {
localVarQueryParameters['hasOverview'] = ObjectSerializer.serialize(hasOverview, "boolean");
}
if (hasImdbId !== undefined) {
localVarQueryParameters['hasImdbId'] = ObjectSerializer.serialize(hasImdbId, "boolean");
}
if (hasTmdbId !== undefined) {
localVarQueryParameters['hasTmdbId'] = ObjectSerializer.serialize(hasTmdbId, "boolean");
}
if (hasTvdbId !== undefined) {
localVarQueryParameters['hasTvdbId'] = ObjectSerializer.serialize(hasTvdbId, "boolean");
}
if (isMovie !== undefined) {
localVarQueryParameters['isMovie'] = ObjectSerializer.serialize(isMovie, "boolean");
}
if (isSeries !== undefined) {
localVarQueryParameters['isSeries'] = ObjectSerializer.serialize(isSeries, "boolean");
}
if (isNews !== undefined) {
localVarQueryParameters['isNews'] = ObjectSerializer.serialize(isNews, "boolean");
}
if (isKids !== undefined) {
localVarQueryParameters['isKids'] = ObjectSerializer.serialize(isKids, "boolean");
}
if (isSports !== undefined) {
localVarQueryParameters['isSports'] = ObjectSerializer.serialize(isSports, "boolean");
}
if (excludeItemIds !== undefined) {
localVarQueryParameters['excludeItemIds'] = ObjectSerializer.serialize(excludeItemIds, "Array<string>");
}
if (startIndex !== undefined) {
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
}
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
if (recursive !== undefined) {
localVarQueryParameters['recursive'] = ObjectSerializer.serialize(recursive, "boolean");
}
if (searchTerm !== undefined) {
localVarQueryParameters['searchTerm'] = ObjectSerializer.serialize(searchTerm, "string");
}
if (sortOrder !== undefined) {
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "Array<SortOrder>");
}
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 (imageTypes !== undefined) {
localVarQueryParameters['imageTypes'] = ObjectSerializer.serialize(imageTypes, "Array<ImageType>");
}
if (sortBy !== undefined) {
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
}
if (isPlayed !== undefined) {
localVarQueryParameters['isPlayed'] = ObjectSerializer.serialize(isPlayed, "boolean");
}
if (genres !== undefined) {
localVarQueryParameters['genres'] = ObjectSerializer.serialize(genres, "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 (artists !== undefined) {
localVarQueryParameters['artists'] = ObjectSerializer.serialize(artists, "Array<string>");
}
if (excludeArtistIds !== undefined) {
localVarQueryParameters['excludeArtistIds'] = ObjectSerializer.serialize(excludeArtistIds, "Array<string>");
}
if (artistIds !== undefined) {
localVarQueryParameters['artistIds'] = ObjectSerializer.serialize(artistIds, "Array<string>");
}
if (albumArtistIds !== undefined) {
localVarQueryParameters['albumArtistIds'] = ObjectSerializer.serialize(albumArtistIds, "Array<string>");
}
if (contributingArtistIds !== undefined) {
localVarQueryParameters['contributingArtistIds'] = ObjectSerializer.serialize(contributingArtistIds, "Array<string>");
}
if (albums !== undefined) {
localVarQueryParameters['albums'] = ObjectSerializer.serialize(albums, "Array<string>");
}
if (albumIds !== undefined) {
localVarQueryParameters['albumIds'] = ObjectSerializer.serialize(albumIds, "Array<string>");
}
if (ids !== undefined) {
localVarQueryParameters['ids'] = ObjectSerializer.serialize(ids, "Array<string>");
}
if (videoTypes !== undefined) {
localVarQueryParameters['videoTypes'] = ObjectSerializer.serialize(videoTypes, "Array<VideoType>");
}
if (minOfficialRating !== undefined) {
localVarQueryParameters['minOfficialRating'] = ObjectSerializer.serialize(minOfficialRating, "string");
}
if (isLocked !== undefined) {
localVarQueryParameters['isLocked'] = ObjectSerializer.serialize(isLocked, "boolean");
}
if (isPlaceHolder !== undefined) {
localVarQueryParameters['isPlaceHolder'] = ObjectSerializer.serialize(isPlaceHolder, "boolean");
}
if (hasOfficialRating !== undefined) {
localVarQueryParameters['hasOfficialRating'] = ObjectSerializer.serialize(hasOfficialRating, "boolean");
}
if (collapseBoxSetItems !== undefined) {
localVarQueryParameters['collapseBoxSetItems'] = ObjectSerializer.serialize(collapseBoxSetItems, "boolean");
}
if (minWidth !== undefined) {
localVarQueryParameters['minWidth'] = ObjectSerializer.serialize(minWidth, "number");
}
if (minHeight !== undefined) {
localVarQueryParameters['minHeight'] = ObjectSerializer.serialize(minHeight, "number");
}
if (maxWidth !== undefined) {
localVarQueryParameters['maxWidth'] = ObjectSerializer.serialize(maxWidth, "number");
}
if (maxHeight !== undefined) {
localVarQueryParameters['maxHeight'] = ObjectSerializer.serialize(maxHeight, "number");
}
if (is3D !== undefined) {
localVarQueryParameters['is3D'] = ObjectSerializer.serialize(is3D, "boolean");
}
if (seriesStatus !== undefined) {
localVarQueryParameters['seriesStatus'] = ObjectSerializer.serialize(seriesStatus, "Array<SeriesStatus>");
}
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 (studioIds !== undefined) {
localVarQueryParameters['studioIds'] = ObjectSerializer.serialize(studioIds, "Array<string>");
}
if (genreIds !== undefined) {
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
}
if (enableTotalRecordCount !== undefined) {
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
}
if (enableImages !== undefined) {
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "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 items based on a query.
* @param userId The user id.
* @param startIndex The start index.
* @param limit The item limit.
* @param searchTerm The 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. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
* @param mediaTypes Optional. Filter by MediaType. 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 excludeItemTypes Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
* @param includeItemTypes Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.
* @param enableTotalRecordCount Optional. Enable the total record count.
* @param enableImages Optional. Include image information in output.
* @param excludeActiveSessions Optional. Whether to exclude the currently active sessions.
*/
public async getResumeItems (userId: string, startIndex?: number, limit?: number, searchTerm?: string, parentId?: string, fields?: Array<ItemFields>, mediaTypes?: Array<string>, enableUserData?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, excludeItemTypes?: Array<BaseItemKind>, includeItemTypes?: Array<BaseItemKind>, enableTotalRecordCount?: boolean, enableImages?: boolean, excludeActiveSessions?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
const localVarPath = this.basePath + '/Users/{userId}/Items/Resume'
.replace('{' + 'userId' + '}', encodeURIComponent(String(userId)));
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 getResumeItems.');
}
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 (mediaTypes !== undefined) {
localVarQueryParameters['mediaTypes'] = ObjectSerializer.serialize(mediaTypes, "Array<string>");
}
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 (excludeItemTypes !== undefined) {
localVarQueryParameters['excludeItemTypes'] = ObjectSerializer.serialize(excludeItemTypes, "Array<BaseItemKind>");
}
if (includeItemTypes !== undefined) {
localVarQueryParameters['includeItemTypes'] = ObjectSerializer.serialize(includeItemTypes, "Array<BaseItemKind>");
}
if (enableTotalRecordCount !== undefined) {
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
}
if (enableImages !== undefined) {
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
}
if (excludeActiveSessions !== undefined) {
localVarQueryParameters['excludeActiveSessions'] = ObjectSerializer.serialize(excludeActiveSessions, "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));
}
}
});
});
});
}
}