/** * 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 { ApplySearchCriteriaRequest } from '../model/applySearchCriteriaRequest'; import { ExternalIdInfo } from '../model/externalIdInfo'; import { GetBookRemoteSearchResultsRequest } from '../model/getBookRemoteSearchResultsRequest'; import { GetBoxSetRemoteSearchResultsRequest } from '../model/getBoxSetRemoteSearchResultsRequest'; import { GetMovieRemoteSearchResultsRequest } from '../model/getMovieRemoteSearchResultsRequest'; import { GetMusicAlbumRemoteSearchResultsRequest } from '../model/getMusicAlbumRemoteSearchResultsRequest'; import { GetMusicArtistRemoteSearchResultsRequest } from '../model/getMusicArtistRemoteSearchResultsRequest'; import { GetMusicVideoRemoteSearchResultsRequest } from '../model/getMusicVideoRemoteSearchResultsRequest'; import { GetPersonRemoteSearchResultsRequest } from '../model/getPersonRemoteSearchResultsRequest'; import { GetSeriesRemoteSearchResultsRequest } from '../model/getSeriesRemoteSearchResultsRequest'; import { GetTrailerRemoteSearchResultsRequest } from '../model/getTrailerRemoteSearchResultsRequest'; import { ProblemDetails } from '../model/problemDetails'; import { RemoteSearchResult } from '../model/remoteSearchResult'; 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 ItemLookupApiApiKeys { CustomAuthentication, } export class ItemLookupApi { protected _basePath = defaultBasePath; protected _defaultHeaders : any = {}; protected _useQuerystring : boolean = false; protected authentications = { 'default': 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: ItemLookupApiApiKeys, value: string) { (this.authentications as any)[ItemLookupApiApiKeys[key]].apiKey = value; } public addInterceptor(interceptor: Interceptor) { this.interceptors.push(interceptor); } /** * * @summary Applies search criteria to an item and refreshes metadata. * @param itemId Item id. * @param applySearchCriteriaRequest The remote search result. * @param replaceAllImages Optional. Whether or not to replace all images. Default: True. */ public async applySearchCriteria (itemId: string, applySearchCriteriaRequest: ApplySearchCriteriaRequest, replaceAllImages?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Apply/{itemId}' .replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); 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 applySearchCriteria.'); } // verify required parameter 'applySearchCriteriaRequest' is not null or undefined if (applySearchCriteriaRequest === null || applySearchCriteriaRequest === undefined) { throw new Error('Required parameter applySearchCriteriaRequest was null or undefined when calling applySearchCriteria.'); } if (replaceAllImages !== undefined) { localVarQueryParameters['replaceAllImages'] = ObjectSerializer.serialize(replaceAllImages, "boolean"); } (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(applySearchCriteriaRequest, "ApplySearchCriteriaRequest") }; 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) { (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 book remote search. * @param getBookRemoteSearchResultsRequest Remote search query. */ public async getBookRemoteSearchResults (getBookRemoteSearchResultsRequest: GetBookRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Book'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getBookRemoteSearchResultsRequest' is not null or undefined if (getBookRemoteSearchResultsRequest === null || getBookRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getBookRemoteSearchResultsRequest was null or undefined when calling getBookRemoteSearchResults.'); } (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(getBookRemoteSearchResultsRequest, "GetBookRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get box set remote search. * @param getBoxSetRemoteSearchResultsRequest Remote search query. */ public async getBoxSetRemoteSearchResults (getBoxSetRemoteSearchResultsRequest: GetBoxSetRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/BoxSet'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getBoxSetRemoteSearchResultsRequest' is not null or undefined if (getBoxSetRemoteSearchResultsRequest === null || getBoxSetRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getBoxSetRemoteSearchResultsRequest was null or undefined when calling getBoxSetRemoteSearchResults.'); } (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(getBoxSetRemoteSearchResultsRequest, "GetBoxSetRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get the item\'s external id info. * @param itemId Item id. */ public async getExternalIdInfos (itemId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/{itemId}/ExternalIdInfos' .replace('{' + 'itemId' + '}', encodeURIComponent(String(itemId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 getExternalIdInfos.'); } (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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get movie remote search. * @param getMovieRemoteSearchResultsRequest Remote search query. */ public async getMovieRemoteSearchResults (getMovieRemoteSearchResultsRequest: GetMovieRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Movie'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getMovieRemoteSearchResultsRequest' is not null or undefined if (getMovieRemoteSearchResultsRequest === null || getMovieRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getMovieRemoteSearchResultsRequest was null or undefined when calling getMovieRemoteSearchResults.'); } (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(getMovieRemoteSearchResultsRequest, "GetMovieRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get music album remote search. * @param getMusicAlbumRemoteSearchResultsRequest Remote search query. */ public async getMusicAlbumRemoteSearchResults (getMusicAlbumRemoteSearchResultsRequest: GetMusicAlbumRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/MusicAlbum'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getMusicAlbumRemoteSearchResultsRequest' is not null or undefined if (getMusicAlbumRemoteSearchResultsRequest === null || getMusicAlbumRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getMusicAlbumRemoteSearchResultsRequest was null or undefined when calling getMusicAlbumRemoteSearchResults.'); } (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(getMusicAlbumRemoteSearchResultsRequest, "GetMusicAlbumRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get music artist remote search. * @param getMusicArtistRemoteSearchResultsRequest Remote search query. */ public async getMusicArtistRemoteSearchResults (getMusicArtistRemoteSearchResultsRequest: GetMusicArtistRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/MusicArtist'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getMusicArtistRemoteSearchResultsRequest' is not null or undefined if (getMusicArtistRemoteSearchResultsRequest === null || getMusicArtistRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getMusicArtistRemoteSearchResultsRequest was null or undefined when calling getMusicArtistRemoteSearchResults.'); } (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(getMusicArtistRemoteSearchResultsRequest, "GetMusicArtistRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get music video remote search. * @param getMusicVideoRemoteSearchResultsRequest Remote search query. */ public async getMusicVideoRemoteSearchResults (getMusicVideoRemoteSearchResultsRequest: GetMusicVideoRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/MusicVideo'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getMusicVideoRemoteSearchResultsRequest' is not null or undefined if (getMusicVideoRemoteSearchResultsRequest === null || getMusicVideoRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getMusicVideoRemoteSearchResultsRequest was null or undefined when calling getMusicVideoRemoteSearchResults.'); } (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(getMusicVideoRemoteSearchResultsRequest, "GetMusicVideoRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get person remote search. * @param getPersonRemoteSearchResultsRequest Remote search query. */ public async getPersonRemoteSearchResults (getPersonRemoteSearchResultsRequest: GetPersonRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Person'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getPersonRemoteSearchResultsRequest' is not null or undefined if (getPersonRemoteSearchResultsRequest === null || getPersonRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getPersonRemoteSearchResultsRequest was null or undefined when calling getPersonRemoteSearchResults.'); } (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(getPersonRemoteSearchResultsRequest, "GetPersonRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get series remote search. * @param getSeriesRemoteSearchResultsRequest Remote search query. */ public async getSeriesRemoteSearchResults (getSeriesRemoteSearchResultsRequest: GetSeriesRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Series'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getSeriesRemoteSearchResultsRequest' is not null or undefined if (getSeriesRemoteSearchResultsRequest === null || getSeriesRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getSeriesRemoteSearchResultsRequest was null or undefined when calling getSeriesRemoteSearchResults.'); } (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(getSeriesRemoteSearchResultsRequest, "GetSeriesRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get trailer remote search. * @param getTrailerRemoteSearchResultsRequest Remote search query. */ public async getTrailerRemoteSearchResults (getTrailerRemoteSearchResultsRequest: GetTrailerRemoteSearchResultsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { const localVarPath = this.basePath + '/Items/RemoteSearch/Trailer'; let localVarQueryParameters: any = {}; let localVarHeaderParams: 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 'getTrailerRemoteSearchResultsRequest' is not null or undefined if (getTrailerRemoteSearchResultsRequest === null || getTrailerRemoteSearchResultsRequest === undefined) { throw new Error('Required parameter getTrailerRemoteSearchResultsRequest was null or undefined when calling getTrailerRemoteSearchResults.'); } (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(getTrailerRemoteSearchResultsRequest, "GetTrailerRemoteSearchResultsRequest") }; 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) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.IncomingMessage; body: Array; }>((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"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } }