3433 lines
158 KiB
TypeScript
3433 lines
158 KiB
TypeScript
/**
|
|
* Jellyfin API
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
*
|
|
* The version of the OpenAPI document: 10.8.9
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import localVarRequest from 'request';
|
|
import http from 'http';
|
|
|
|
/* tslint:disable:no-unused-locals */
|
|
import { AddListingProviderRequest } from '../model/addListingProviderRequest';
|
|
import { AddTunerHostRequest } from '../model/addTunerHostRequest';
|
|
import { BaseItemDto } from '../model/baseItemDto';
|
|
import { BaseItemDtoQueryResult } from '../model/baseItemDtoQueryResult';
|
|
import { ChannelMappingOptionsDto } from '../model/channelMappingOptionsDto';
|
|
import { ChannelType } from '../model/channelType';
|
|
import { CreateSeriesTimerRequest } from '../model/createSeriesTimerRequest';
|
|
import { CreateTimerRequest } from '../model/createTimerRequest';
|
|
import { GetProgramsRequest } from '../model/getProgramsRequest';
|
|
import { GuideInfo } from '../model/guideInfo';
|
|
import { ImageType } from '../model/imageType';
|
|
import { ItemFields } from '../model/itemFields';
|
|
import { ListingsProviderInfo } from '../model/listingsProviderInfo';
|
|
import { LiveTvInfo } from '../model/liveTvInfo';
|
|
import { NameIdPair } from '../model/nameIdPair';
|
|
import { ProblemDetails } from '../model/problemDetails';
|
|
import { RecordingStatus } from '../model/recordingStatus';
|
|
import { SeriesTimerInfoDto } from '../model/seriesTimerInfoDto';
|
|
import { SeriesTimerInfoDtoQueryResult } from '../model/seriesTimerInfoDtoQueryResult';
|
|
import { SetChannelMappingRequest } from '../model/setChannelMappingRequest';
|
|
import { SortOrder } from '../model/sortOrder';
|
|
import { TimerInfoDto } from '../model/timerInfoDto';
|
|
import { TimerInfoDtoQueryResult } from '../model/timerInfoDtoQueryResult';
|
|
import { TunerChannelMapping } from '../model/tunerChannelMapping';
|
|
import { TunerHostInfo } from '../model/tunerHostInfo';
|
|
|
|
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 LiveTvApiApiKeys {
|
|
CustomAuthentication,
|
|
}
|
|
|
|
export class LiveTvApi {
|
|
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: LiveTvApiApiKeys, value: string) {
|
|
(this.authentications as any)[LiveTvApiApiKeys[key]].apiKey = value;
|
|
}
|
|
|
|
public addInterceptor(interceptor: Interceptor) {
|
|
this.interceptors.push(interceptor);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @summary Adds a listings provider.
|
|
* @param pw Password.
|
|
* @param validateListings Validate listings.
|
|
* @param validateLogin Validate login.
|
|
* @param addListingProviderRequest New listings info.
|
|
*/
|
|
public async addListingProvider (pw?: string, validateListings?: boolean, validateLogin?: boolean, addListingProviderRequest?: AddListingProviderRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListingsProviderInfo; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ListingProviders';
|
|
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 (pw !== undefined) {
|
|
localVarQueryParameters['pw'] = ObjectSerializer.serialize(pw, "string");
|
|
}
|
|
|
|
if (validateListings !== undefined) {
|
|
localVarQueryParameters['validateListings'] = ObjectSerializer.serialize(validateListings, "boolean");
|
|
}
|
|
|
|
if (validateLogin !== undefined) {
|
|
localVarQueryParameters['validateLogin'] = ObjectSerializer.serialize(validateLogin, "boolean");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(addListingProviderRequest, "AddListingProviderRequest")
|
|
};
|
|
|
|
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: ListingsProviderInfo; }>((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, "ListingsProviderInfo");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Adds a tuner host.
|
|
* @param addTunerHostRequest New tuner host.
|
|
*/
|
|
public async addTunerHost (addTunerHostRequest?: AddTunerHostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TunerHostInfo; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/TunerHosts';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(addTunerHostRequest, "AddTunerHostRequest")
|
|
};
|
|
|
|
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: TunerHostInfo; }>((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, "TunerHostInfo");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Cancels a live tv series timer.
|
|
* @param timerId Timer id.
|
|
*/
|
|
public async cancelSeriesTimer (timerId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/SeriesTimers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
// verify required parameter 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling cancelSeriesTimer.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'DELETE',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Cancels a live tv timer.
|
|
* @param timerId Timer id.
|
|
*/
|
|
public async cancelTimer (timerId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
// verify required parameter 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling cancelTimer.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'DELETE',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Creates a live tv series timer.
|
|
* @param createSeriesTimerRequest New series timer info.
|
|
*/
|
|
public async createSeriesTimer (createSeriesTimerRequest?: CreateSeriesTimerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/SeriesTimers';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(createSeriesTimerRequest, "CreateSeriesTimerRequest")
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Creates a live tv timer.
|
|
* @param createTimerRequest New timer info.
|
|
*/
|
|
public async createTimer (createTimerRequest?: CreateTimerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(createTimerRequest, "CreateTimerRequest")
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Delete listing provider.
|
|
* @param id Listing provider id.
|
|
*/
|
|
public async deleteListingProvider (id?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ListingProviders';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
if (id !== undefined) {
|
|
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'DELETE',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Deletes a live tv recording.
|
|
* @param recordingId Recording id.
|
|
*/
|
|
public async deleteRecording (recordingId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/{recordingId}'
|
|
.replace('{' + 'recordingId' + '}', encodeURIComponent(String(recordingId)));
|
|
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 'recordingId' is not null or undefined
|
|
if (recordingId === null || recordingId === undefined) {
|
|
throw new Error('Required parameter recordingId was null or undefined when calling deleteRecording.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'DELETE',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Deletes a tuner host.
|
|
* @param id Tuner host id.
|
|
*/
|
|
public async deleteTunerHost (id?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/TunerHosts';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
if (id !== undefined) {
|
|
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'DELETE',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Discover tuners.
|
|
* @param newDevicesOnly Only discover new tuners.
|
|
*/
|
|
public async discoverTuners (newDevicesOnly?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<TunerHostInfo>; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Tuners/Discover';
|
|
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 (newDevicesOnly !== undefined) {
|
|
localVarQueryParameters['newDevicesOnly'] = ObjectSerializer.serialize(newDevicesOnly, "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: Array<TunerHostInfo>; }>((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<TunerHostInfo>");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Discover tuners.
|
|
* @param newDevicesOnly Only discover new tuners.
|
|
*/
|
|
public async discvoverTuners (newDevicesOnly?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<TunerHostInfo>; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Tuners/Discvover';
|
|
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 (newDevicesOnly !== undefined) {
|
|
localVarQueryParameters['newDevicesOnly'] = ObjectSerializer.serialize(newDevicesOnly, "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: Array<TunerHostInfo>; }>((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<TunerHostInfo>");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv channel.
|
|
* @param channelId Channel id.
|
|
* @param userId Optional. Attach user data.
|
|
*/
|
|
public async getChannel (channelId: string, userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Channels/{channelId}'
|
|
.replace('{' + 'channelId' + '}', encodeURIComponent(String(channelId)));
|
|
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 'channelId' is not null or undefined
|
|
if (channelId === null || channelId === undefined) {
|
|
throw new Error('Required parameter channelId was null or undefined when calling getChannel.');
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDto; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Get channel mapping options.
|
|
* @param providerId Provider id.
|
|
*/
|
|
public async getChannelMappingOptions (providerId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ChannelMappingOptionsDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ChannelMappingOptions';
|
|
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 (providerId !== undefined) {
|
|
localVarQueryParameters['providerId'] = ObjectSerializer.serialize(providerId, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: ChannelMappingOptionsDto; }>((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, "ChannelMappingOptionsDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets default listings provider info.
|
|
*/
|
|
public async getDefaultListingProvider (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListingsProviderInfo; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ListingProviders/Default';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: '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: ListingsProviderInfo; }>((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, "ListingsProviderInfo");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets the default values for a new timer.
|
|
* @param programId Optional. To attach default values based on a program.
|
|
*/
|
|
public async getDefaultTimer (programId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SeriesTimerInfoDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers/Defaults';
|
|
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 (programId !== undefined) {
|
|
localVarQueryParameters['programId'] = ObjectSerializer.serialize(programId, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: SeriesTimerInfoDto; }>((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, "SeriesTimerInfoDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Get guid info.
|
|
*/
|
|
public async getGuideInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GuideInfo; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/GuideInfo';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: '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: GuideInfo; }>((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, "GuideInfo");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets available lineups.
|
|
* @param id Provider id.
|
|
* @param type Provider type.
|
|
* @param location Location.
|
|
* @param country Country.
|
|
*/
|
|
public async getLineups (id?: string, type?: string, location?: string, country?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<NameIdPair>; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ListingProviders/Lineups';
|
|
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 (id !== undefined) {
|
|
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
}
|
|
|
|
if (type !== undefined) {
|
|
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
|
|
}
|
|
|
|
if (location !== undefined) {
|
|
localVarQueryParameters['location'] = ObjectSerializer.serialize(location, "string");
|
|
}
|
|
|
|
if (country !== undefined) {
|
|
localVarQueryParameters['country'] = ObjectSerializer.serialize(country, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: Array<NameIdPair>; }>((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<NameIdPair>");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv recording stream.
|
|
* @param recordingId Recording id.
|
|
*/
|
|
public async getLiveRecordingFile (recordingId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/LiveRecordings/{recordingId}/stream'
|
|
.replace('{' + 'recordingId' + '}', encodeURIComponent(String(recordingId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['video/*', '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 'recordingId' is not null or undefined
|
|
if (recordingId === null || recordingId === undefined) {
|
|
throw new Error('Required parameter recordingId was null or undefined when calling getLiveRecordingFile.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
encoding: null,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv channel stream.
|
|
* @param streamId Stream id.
|
|
* @param container Container type.
|
|
*/
|
|
public async getLiveStreamFile (streamId: string, container: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/LiveStreamFiles/{streamId}/stream.{container}'
|
|
.replace('{' + 'streamId' + '}', encodeURIComponent(String(streamId)))
|
|
.replace('{' + 'container' + '}', encodeURIComponent(String(container)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['video/*', '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 'streamId' is not null or undefined
|
|
if (streamId === null || streamId === undefined) {
|
|
throw new Error('Required parameter streamId was null or undefined when calling getLiveStreamFile.');
|
|
}
|
|
|
|
// verify required parameter 'container' is not null or undefined
|
|
if (container === null || container === undefined) {
|
|
throw new Error('Required parameter container was null or undefined when calling getLiveStreamFile.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
encoding: null,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets available live tv channels.
|
|
* @param type Optional. Filter by channel type.
|
|
* @param userId Optional. Filter by user and attach user data.
|
|
* @param startIndex Optional. The record index to start at. All items with a lower index will be dropped from the results.
|
|
* @param isMovie Optional. Filter for movies.
|
|
* @param isSeries Optional. Filter for series.
|
|
* @param isNews Optional. Filter for news.
|
|
* @param isKids Optional. Filter for kids.
|
|
* @param isSports Optional. Filter for sports.
|
|
* @param limit Optional. The maximum number of records to return.
|
|
* @param isFavorite Optional. Filter by channels that are favorites, or not.
|
|
* @param isLiked Optional. Filter by channels that are liked, or not.
|
|
* @param isDisliked Optional. Filter by channels that are disliked, or not.
|
|
* @param enableImages Optional. Include image information in output.
|
|
* @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 fields Optional. Specify additional fields of information to return in the output.
|
|
* @param enableUserData Optional. Include user data.
|
|
* @param sortBy Optional. Key to sort by.
|
|
* @param sortOrder Optional. Sort order.
|
|
* @param enableFavoriteSorting Optional. Incorporate favorite and like status into channel sorting.
|
|
* @param addCurrentProgram Optional. Adds current program info to each channel.
|
|
*/
|
|
public async getLiveTvChannels (type?: ChannelType, userId?: string, startIndex?: number, isMovie?: boolean, isSeries?: boolean, isNews?: boolean, isKids?: boolean, isSports?: boolean, limit?: number, isFavorite?: boolean, isLiked?: boolean, isDisliked?: boolean, enableImages?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, fields?: Array<ItemFields>, enableUserData?: boolean, sortBy?: Array<string>, sortOrder?: SortOrder, enableFavoriteSorting?: boolean, addCurrentProgram?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Channels';
|
|
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 (type !== undefined) {
|
|
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "ChannelType");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
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 (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (isFavorite !== undefined) {
|
|
localVarQueryParameters['isFavorite'] = ObjectSerializer.serialize(isFavorite, "boolean");
|
|
}
|
|
|
|
if (isLiked !== undefined) {
|
|
localVarQueryParameters['isLiked'] = ObjectSerializer.serialize(isLiked, "boolean");
|
|
}
|
|
|
|
if (isDisliked !== undefined) {
|
|
localVarQueryParameters['isDisliked'] = ObjectSerializer.serialize(isDisliked, "boolean");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (sortBy !== undefined) {
|
|
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
|
|
}
|
|
|
|
if (sortOrder !== undefined) {
|
|
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "SortOrder");
|
|
}
|
|
|
|
if (enableFavoriteSorting !== undefined) {
|
|
localVarQueryParameters['enableFavoriteSorting'] = ObjectSerializer.serialize(enableFavoriteSorting, "boolean");
|
|
}
|
|
|
|
if (addCurrentProgram !== undefined) {
|
|
localVarQueryParameters['addCurrentProgram'] = ObjectSerializer.serialize(addCurrentProgram, "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 available live tv services.
|
|
*/
|
|
public async getLiveTvInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LiveTvInfo; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Info';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: '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: LiveTvInfo; }>((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, "LiveTvInfo");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets available live tv epgs.
|
|
* @param channelIds The channels to return guide information for.
|
|
* @param userId Optional. Filter by user id.
|
|
* @param minStartDate Optional. The minimum premiere start date.
|
|
* @param hasAired Optional. Filter by programs that have completed airing, or not.
|
|
* @param isAiring Optional. Filter by programs that are currently airing, or not.
|
|
* @param maxStartDate Optional. The maximum premiere start date.
|
|
* @param minEndDate Optional. The minimum premiere end date.
|
|
* @param maxEndDate Optional. The maximum premiere end date.
|
|
* @param isMovie Optional. Filter for movies.
|
|
* @param isSeries Optional. Filter for series.
|
|
* @param isNews Optional. Filter for news.
|
|
* @param isKids Optional. Filter for kids.
|
|
* @param isSports Optional. Filter for sports.
|
|
* @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 sortBy Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate.
|
|
* @param sortOrder Sort Order - Ascending,Descending.
|
|
* @param genres The genres to return guide information for.
|
|
* @param genreIds The genre ids to return guide information for.
|
|
* @param enableImages Optional. Include image information in output.
|
|
* @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 enableUserData Optional. Include user data.
|
|
* @param seriesTimerId Optional. Filter by series timer id.
|
|
* @param librarySeriesId Optional. Filter by library series id.
|
|
* @param fields Optional. Specify additional fields of information to return in the output.
|
|
* @param enableTotalRecordCount Retrieve total record count.
|
|
*/
|
|
public async getLiveTvPrograms (channelIds?: Array<string>, userId?: string, minStartDate?: Date, hasAired?: boolean, isAiring?: boolean, maxStartDate?: Date, minEndDate?: Date, maxEndDate?: Date, isMovie?: boolean, isSeries?: boolean, isNews?: boolean, isKids?: boolean, isSports?: boolean, startIndex?: number, limit?: number, sortBy?: Array<string>, sortOrder?: Array<SortOrder>, genres?: Array<string>, genreIds?: Array<string>, enableImages?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, enableUserData?: boolean, seriesTimerId?: string, librarySeriesId?: string, fields?: Array<ItemFields>, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Programs';
|
|
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 (channelIds !== undefined) {
|
|
localVarQueryParameters['channelIds'] = ObjectSerializer.serialize(channelIds, "Array<string>");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (minStartDate !== undefined) {
|
|
localVarQueryParameters['minStartDate'] = ObjectSerializer.serialize(minStartDate, "Date");
|
|
}
|
|
|
|
if (hasAired !== undefined) {
|
|
localVarQueryParameters['hasAired'] = ObjectSerializer.serialize(hasAired, "boolean");
|
|
}
|
|
|
|
if (isAiring !== undefined) {
|
|
localVarQueryParameters['isAiring'] = ObjectSerializer.serialize(isAiring, "boolean");
|
|
}
|
|
|
|
if (maxStartDate !== undefined) {
|
|
localVarQueryParameters['maxStartDate'] = ObjectSerializer.serialize(maxStartDate, "Date");
|
|
}
|
|
|
|
if (minEndDate !== undefined) {
|
|
localVarQueryParameters['minEndDate'] = ObjectSerializer.serialize(minEndDate, "Date");
|
|
}
|
|
|
|
if (maxEndDate !== undefined) {
|
|
localVarQueryParameters['maxEndDate'] = ObjectSerializer.serialize(maxEndDate, "Date");
|
|
}
|
|
|
|
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 (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (sortBy !== undefined) {
|
|
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "Array<string>");
|
|
}
|
|
|
|
if (sortOrder !== undefined) {
|
|
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "Array<SortOrder>");
|
|
}
|
|
|
|
if (genres !== undefined) {
|
|
localVarQueryParameters['genres'] = ObjectSerializer.serialize(genres, "Array<string>");
|
|
}
|
|
|
|
if (genreIds !== undefined) {
|
|
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (seriesTimerId !== undefined) {
|
|
localVarQueryParameters['seriesTimerId'] = ObjectSerializer.serialize(seriesTimerId, "string");
|
|
}
|
|
|
|
if (librarySeriesId !== undefined) {
|
|
localVarQueryParameters['librarySeriesId'] = ObjectSerializer.serialize(librarySeriesId, "string");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv program.
|
|
* @param programId Program id.
|
|
* @param userId Optional. Attach user data.
|
|
*/
|
|
public async getProgram (programId: string, userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Programs/{programId}'
|
|
.replace('{' + 'programId' + '}', encodeURIComponent(String(programId)));
|
|
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 'programId' is not null or undefined
|
|
if (programId === null || programId === undefined) {
|
|
throw new Error('Required parameter programId was null or undefined when calling getProgram.');
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDto; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets available live tv epgs.
|
|
* @param getProgramsRequest Request body.
|
|
*/
|
|
public async getPrograms (getProgramsRequest?: GetProgramsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Programs';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(getProgramsRequest, "GetProgramsRequest")
|
|
};
|
|
|
|
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 recommended live tv epgs.
|
|
* @param userId Optional. filter by user id.
|
|
* @param limit Optional. The maximum number of records to return.
|
|
* @param isAiring Optional. Filter by programs that are currently airing, or not.
|
|
* @param hasAired Optional. Filter by programs that have completed airing, or not.
|
|
* @param isSeries Optional. Filter for series.
|
|
* @param isMovie Optional. Filter for movies.
|
|
* @param isNews Optional. Filter for news.
|
|
* @param isKids Optional. Filter for kids.
|
|
* @param isSports Optional. Filter for sports.
|
|
* @param enableImages Optional. Include image information in output.
|
|
* @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 genreIds The genres to return guide information for.
|
|
* @param fields Optional. Specify additional fields of information to return in the output.
|
|
* @param enableUserData Optional. include user data.
|
|
* @param enableTotalRecordCount Retrieve total record count.
|
|
*/
|
|
public async getRecommendedPrograms (userId?: string, limit?: number, isAiring?: boolean, hasAired?: boolean, isSeries?: boolean, isMovie?: boolean, isNews?: boolean, isKids?: boolean, isSports?: boolean, enableImages?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, genreIds?: Array<string>, fields?: Array<ItemFields>, enableUserData?: boolean, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Programs/Recommended';
|
|
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 (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (isAiring !== undefined) {
|
|
localVarQueryParameters['isAiring'] = ObjectSerializer.serialize(isAiring, "boolean");
|
|
}
|
|
|
|
if (hasAired !== undefined) {
|
|
localVarQueryParameters['hasAired'] = ObjectSerializer.serialize(hasAired, "boolean");
|
|
}
|
|
|
|
if (isSeries !== undefined) {
|
|
localVarQueryParameters['isSeries'] = ObjectSerializer.serialize(isSeries, "boolean");
|
|
}
|
|
|
|
if (isMovie !== undefined) {
|
|
localVarQueryParameters['isMovie'] = ObjectSerializer.serialize(isMovie, "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 (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (genreIds !== undefined) {
|
|
localVarQueryParameters['genreIds'] = ObjectSerializer.serialize(genreIds, "Array<string>");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv recording.
|
|
* @param recordingId Recording id.
|
|
* @param userId Optional. Attach user data.
|
|
*/
|
|
public async getRecording (recordingId: string, userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/{recordingId}'
|
|
.replace('{' + 'recordingId' + '}', encodeURIComponent(String(recordingId)));
|
|
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 'recordingId' is not null or undefined
|
|
if (recordingId === null || recordingId === undefined) {
|
|
throw new Error('Required parameter recordingId was null or undefined when calling getRecording.');
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDto; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets recording folders.
|
|
* @param userId Optional. Filter by user and attach user data.
|
|
*/
|
|
public async getRecordingFolders (userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/Folders';
|
|
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");
|
|
}
|
|
|
|
(<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 Get recording group.
|
|
* @param groupId Group id.
|
|
*/
|
|
public async getRecordingGroup (groupId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/Groups/{groupId}'
|
|
.replace('{' + 'groupId' + '}', encodeURIComponent(String(groupId)));
|
|
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 'groupId' is not null or undefined
|
|
if (groupId === null || groupId === undefined) {
|
|
throw new Error('Required parameter groupId was null or undefined when calling getRecordingGroup.');
|
|
}
|
|
|
|
(<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?: 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 Gets live tv recording groups.
|
|
* @param userId Optional. Filter by user and attach user data.
|
|
*/
|
|
public async getRecordingGroups (userId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/Groups';
|
|
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");
|
|
}
|
|
|
|
(<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 live tv recordings.
|
|
* @param channelId Optional. Filter by channel id.
|
|
* @param userId Optional. Filter by user and attach user data.
|
|
* @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 status Optional. Filter by recording status.
|
|
* @param isInProgress Optional. Filter by recordings that are in progress, or not.
|
|
* @param seriesTimerId Optional. Filter by recordings belonging to a series timer.
|
|
* @param enableImages Optional. Include image information in output.
|
|
* @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 fields Optional. Specify additional fields of information to return in the output.
|
|
* @param enableUserData Optional. Include user data.
|
|
* @param isMovie Optional. Filter for movies.
|
|
* @param isSeries Optional. Filter for series.
|
|
* @param isKids Optional. Filter for kids.
|
|
* @param isSports Optional. Filter for sports.
|
|
* @param isNews Optional. Filter for news.
|
|
* @param isLibraryItem Optional. Filter for is library item.
|
|
* @param enableTotalRecordCount Optional. Return total record count.
|
|
*/
|
|
public async getRecordings (channelId?: string, userId?: string, startIndex?: number, limit?: number, status?: RecordingStatus, isInProgress?: boolean, seriesTimerId?: string, enableImages?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, fields?: Array<ItemFields>, enableUserData?: boolean, isMovie?: boolean, isSeries?: boolean, isKids?: boolean, isSports?: boolean, isNews?: boolean, isLibraryItem?: boolean, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings';
|
|
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 (channelId !== undefined) {
|
|
localVarQueryParameters['channelId'] = ObjectSerializer.serialize(channelId, "string");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (status !== undefined) {
|
|
localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "RecordingStatus");
|
|
}
|
|
|
|
if (isInProgress !== undefined) {
|
|
localVarQueryParameters['isInProgress'] = ObjectSerializer.serialize(isInProgress, "boolean");
|
|
}
|
|
|
|
if (seriesTimerId !== undefined) {
|
|
localVarQueryParameters['seriesTimerId'] = ObjectSerializer.serialize(seriesTimerId, "string");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (isMovie !== undefined) {
|
|
localVarQueryParameters['isMovie'] = ObjectSerializer.serialize(isMovie, "boolean");
|
|
}
|
|
|
|
if (isSeries !== undefined) {
|
|
localVarQueryParameters['isSeries'] = ObjectSerializer.serialize(isSeries, "boolean");
|
|
}
|
|
|
|
if (isKids !== undefined) {
|
|
localVarQueryParameters['isKids'] = ObjectSerializer.serialize(isKids, "boolean");
|
|
}
|
|
|
|
if (isSports !== undefined) {
|
|
localVarQueryParameters['isSports'] = ObjectSerializer.serialize(isSports, "boolean");
|
|
}
|
|
|
|
if (isNews !== undefined) {
|
|
localVarQueryParameters['isNews'] = ObjectSerializer.serialize(isNews, "boolean");
|
|
}
|
|
|
|
if (isLibraryItem !== undefined) {
|
|
localVarQueryParameters['isLibraryItem'] = ObjectSerializer.serialize(isLibraryItem, "boolean");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets live tv recording series.
|
|
* @param channelId Optional. Filter by channel id.
|
|
* @param userId Optional. Filter by user and attach user data.
|
|
* @param groupId Optional. Filter by recording group.
|
|
* @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 status Optional. Filter by recording status.
|
|
* @param isInProgress Optional. Filter by recordings that are in progress, or not.
|
|
* @param seriesTimerId Optional. Filter by recordings belonging to a series timer.
|
|
* @param enableImages Optional. Include image information in output.
|
|
* @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 fields Optional. Specify additional fields of information to return in the output.
|
|
* @param enableUserData Optional. Include user data.
|
|
* @param enableTotalRecordCount Optional. Return total record count.
|
|
*/
|
|
public async getRecordingsSeries (channelId?: string, userId?: string, groupId?: string, startIndex?: number, limit?: number, status?: RecordingStatus, isInProgress?: boolean, seriesTimerId?: string, enableImages?: boolean, imageTypeLimit?: number, enableImageTypes?: Array<ImageType>, fields?: Array<ItemFields>, enableUserData?: boolean, enableTotalRecordCount?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Recordings/Series';
|
|
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 (channelId !== undefined) {
|
|
localVarQueryParameters['channelId'] = ObjectSerializer.serialize(channelId, "string");
|
|
}
|
|
|
|
if (userId !== undefined) {
|
|
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
}
|
|
|
|
if (groupId !== undefined) {
|
|
localVarQueryParameters['groupId'] = ObjectSerializer.serialize(groupId, "string");
|
|
}
|
|
|
|
if (startIndex !== undefined) {
|
|
localVarQueryParameters['startIndex'] = ObjectSerializer.serialize(startIndex, "number");
|
|
}
|
|
|
|
if (limit !== undefined) {
|
|
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
}
|
|
|
|
if (status !== undefined) {
|
|
localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "RecordingStatus");
|
|
}
|
|
|
|
if (isInProgress !== undefined) {
|
|
localVarQueryParameters['isInProgress'] = ObjectSerializer.serialize(isInProgress, "boolean");
|
|
}
|
|
|
|
if (seriesTimerId !== undefined) {
|
|
localVarQueryParameters['seriesTimerId'] = ObjectSerializer.serialize(seriesTimerId, "string");
|
|
}
|
|
|
|
if (enableImages !== undefined) {
|
|
localVarQueryParameters['enableImages'] = ObjectSerializer.serialize(enableImages, "boolean");
|
|
}
|
|
|
|
if (imageTypeLimit !== undefined) {
|
|
localVarQueryParameters['imageTypeLimit'] = ObjectSerializer.serialize(imageTypeLimit, "number");
|
|
}
|
|
|
|
if (enableImageTypes !== undefined) {
|
|
localVarQueryParameters['enableImageTypes'] = ObjectSerializer.serialize(enableImageTypes, "Array<ImageType>");
|
|
}
|
|
|
|
if (fields !== undefined) {
|
|
localVarQueryParameters['fields'] = ObjectSerializer.serialize(fields, "Array<ItemFields>");
|
|
}
|
|
|
|
if (enableUserData !== undefined) {
|
|
localVarQueryParameters['enableUserData'] = ObjectSerializer.serialize(enableUserData, "boolean");
|
|
}
|
|
|
|
if (enableTotalRecordCount !== undefined) {
|
|
localVarQueryParameters['enableTotalRecordCount'] = ObjectSerializer.serialize(enableTotalRecordCount, "boolean");
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: BaseItemDtoQueryResult; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "BaseItemDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets available countries.
|
|
*/
|
|
public async getSchedulesDirectCountries (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ListingProviders/SchedulesDirect/Countries';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
encoding: null,
|
|
};
|
|
|
|
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: Buffer; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
body = ObjectSerializer.deserialize(body, "Buffer");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a live tv series timer.
|
|
* @param timerId Timer id.
|
|
*/
|
|
public async getSeriesTimer (timerId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SeriesTimerInfoDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/SeriesTimers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
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 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling getSeriesTimer.');
|
|
}
|
|
|
|
(<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: SeriesTimerInfoDto; }>((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, "SeriesTimerInfoDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets live tv series timers.
|
|
* @param sortBy Optional. Sort by SortName or Priority.
|
|
* @param sortOrder Optional. Sort in Ascending or Descending order.
|
|
*/
|
|
public async getSeriesTimers (sortBy?: string, sortOrder?: SortOrder, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SeriesTimerInfoDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/SeriesTimers';
|
|
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 (sortBy !== undefined) {
|
|
localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string");
|
|
}
|
|
|
|
if (sortOrder !== undefined) {
|
|
localVarQueryParameters['sortOrder'] = ObjectSerializer.serialize(sortOrder, "SortOrder");
|
|
}
|
|
|
|
(<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: SeriesTimerInfoDtoQueryResult; }>((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, "SeriesTimerInfoDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets a timer.
|
|
* @param timerId Timer id.
|
|
*/
|
|
public async getTimer (timerId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TimerInfoDto; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
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 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling getTimer.');
|
|
}
|
|
|
|
(<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: TimerInfoDto; }>((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, "TimerInfoDto");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Gets the live tv timers.
|
|
* @param channelId Optional. Filter by channel id.
|
|
* @param seriesTimerId Optional. Filter by timers belonging to a series timer.
|
|
* @param isActive Optional. Filter by timers that are active.
|
|
* @param isScheduled Optional. Filter by timers that are scheduled.
|
|
*/
|
|
public async getTimers (channelId?: string, seriesTimerId?: string, isActive?: boolean, isScheduled?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TimerInfoDtoQueryResult; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers';
|
|
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 (channelId !== undefined) {
|
|
localVarQueryParameters['channelId'] = ObjectSerializer.serialize(channelId, "string");
|
|
}
|
|
|
|
if (seriesTimerId !== undefined) {
|
|
localVarQueryParameters['seriesTimerId'] = ObjectSerializer.serialize(seriesTimerId, "string");
|
|
}
|
|
|
|
if (isActive !== undefined) {
|
|
localVarQueryParameters['isActive'] = ObjectSerializer.serialize(isActive, "boolean");
|
|
}
|
|
|
|
if (isScheduled !== undefined) {
|
|
localVarQueryParameters['isScheduled'] = ObjectSerializer.serialize(isScheduled, "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: TimerInfoDtoQueryResult; }>((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, "TimerInfoDtoQueryResult");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Get tuner host types.
|
|
*/
|
|
public async getTunerHostTypes (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<NameIdPair>; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/TunerHosts/Types';
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
const produces = ['application/json', 'application/json; profile=CamelCase', 'application/json; profile=PascalCase'];
|
|
// give precedence to 'application/json'
|
|
if (produces.indexOf('application/json') >= 0) {
|
|
localVarHeaderParams.Accept = 'application/json';
|
|
} else {
|
|
localVarHeaderParams.Accept = produces.join(',');
|
|
}
|
|
let localVarFormParams: any = {};
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'GET',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body: Array<NameIdPair>; }>((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<NameIdPair>");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Resets a tv tuner.
|
|
* @param tunerId Tuner id.
|
|
*/
|
|
public async resetTuner (tunerId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Tuners/{tunerId}/Reset'
|
|
.replace('{' + 'tunerId' + '}', encodeURIComponent(String(tunerId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
// verify required parameter 'tunerId' is not null or undefined
|
|
if (tunerId === null || tunerId === undefined) {
|
|
throw new Error('Required parameter tunerId was null or undefined when calling resetTuner.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Set channel mappings.
|
|
* @param setChannelMappingRequest The set channel mapping dto.
|
|
*/
|
|
public async setChannelMapping (setChannelMappingRequest: SetChannelMappingRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TunerChannelMapping; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/ChannelMappings';
|
|
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 'setChannelMappingRequest' is not null or undefined
|
|
if (setChannelMappingRequest === null || setChannelMappingRequest === undefined) {
|
|
throw new Error('Required parameter setChannelMappingRequest was null or undefined when calling setChannelMapping.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(setChannelMappingRequest, "SetChannelMappingRequest")
|
|
};
|
|
|
|
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: TunerChannelMapping; }>((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, "TunerChannelMapping");
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Updates a live tv series timer.
|
|
* @param timerId Timer id.
|
|
* @param createSeriesTimerRequest New series timer info.
|
|
*/
|
|
public async updateSeriesTimer (timerId: string, createSeriesTimerRequest?: CreateSeriesTimerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/SeriesTimers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
// verify required parameter 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling updateSeriesTimer.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(createSeriesTimerRequest, "CreateSeriesTimerRequest")
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @summary Updates a live tv timer.
|
|
* @param timerId Timer id.
|
|
* @param createTimerRequest New timer info.
|
|
*/
|
|
public async updateTimer (timerId: string, createTimerRequest?: CreateTimerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
const localVarPath = this.basePath + '/LiveTv/Timers/{timerId}'
|
|
.replace('{' + 'timerId' + '}', encodeURIComponent(String(timerId)));
|
|
let localVarQueryParameters: any = {};
|
|
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
let localVarFormParams: any = {};
|
|
|
|
// verify required parameter 'timerId' is not null or undefined
|
|
if (timerId === null || timerId === undefined) {
|
|
throw new Error('Required parameter timerId was null or undefined when calling updateTimer.');
|
|
}
|
|
|
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
|
|
let localVarUseFormData = false;
|
|
|
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
method: 'POST',
|
|
qs: localVarQueryParameters,
|
|
headers: localVarHeaderParams,
|
|
uri: localVarPath,
|
|
useQuerystring: this._useQuerystring,
|
|
json: true,
|
|
body: ObjectSerializer.serialize(createTimerRequest, "CreateTimerRequest")
|
|
};
|
|
|
|
let authenticationPromise = Promise.resolve();
|
|
if (this.authentications.CustomAuthentication.apiKey) {
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.CustomAuthentication.applyToRequest(localVarRequestOptions));
|
|
}
|
|
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
|
|
let interceptorPromise = authenticationPromise;
|
|
for (const interceptor of this.interceptors) {
|
|
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
}
|
|
|
|
return interceptorPromise.then(() => {
|
|
if (Object.keys(localVarFormParams).length) {
|
|
if (localVarUseFormData) {
|
|
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
} else {
|
|
localVarRequestOptions.form = localVarFormParams;
|
|
}
|
|
}
|
|
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
if (error) {
|
|
reject(error);
|
|
} else {
|
|
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
resolve({ response: response, body: body });
|
|
} else {
|
|
reject(new HttpError(response, body, response.statusCode));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|