streaming-availability
Version:
Streaming Availability API allows getting streaming availability information of movies and series; and querying the list of available shows on streaming services such as Netflix, Disney+, Apple TV, Max and Hulu across 59 countries!
190 lines (176 loc) • 5.87 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Streaming Availability API
* Streaming Availability API allows getting streaming availability information of movies and series; and querying the list of available shows on streaming services such as Netflix, Disney+, Apple TV, Max and Hulu across 59 countries!
*
* The version of the OpenAPI document: 3.3.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Locale } from './Locale';
import {
LocaleFromJSON,
LocaleFromJSONTyped,
LocaleToJSON,
} from './Locale';
import type { Price } from './Price';
import {
PriceFromJSON,
PriceFromJSONTyped,
PriceToJSON,
} from './Price';
import type { StreamingType } from './StreamingType';
import {
StreamingTypeFromJSON,
StreamingTypeFromJSONTyped,
StreamingTypeToJSON,
} from './StreamingType';
import type { Subtitle } from './Subtitle';
import {
SubtitleFromJSON,
SubtitleFromJSONTyped,
SubtitleToJSON,
} from './Subtitle';
/**
* A streaming option.
* @export
* @interface StreamingOption
*/
export interface StreamingOption {
/**
* Id of the streaming service.
* @type {string}
* @memberof StreamingOption
*/
service: string;
/**
*
* @type {StreamingType}
* @memberof StreamingOption
*/
streamingType: StreamingType;
/**
* Addon id, if the "streamingType" is "addon". Otherwise omitted.
* @type {string}
* @memberof StreamingOption
*/
addon?: string;
/**
* Deep link to the streaming option's page in the streaming service. Guaranteed to be populated.
* @type {string}
* @memberof StreamingOption
*/
link: string;
/**
* Deep link to the video associated with the streaming option. Omitted if there's no direct link to the video. Might have the same value as "link".
* @type {string}
* @memberof StreamingOption
*/
videoLink?: string;
/**
* Maximum video quality of the streaming option. Omitted if the quality is unknown.
* @type {string}
* @memberof StreamingOption
*/
quality?: StreamingOptionQualityEnum;
/**
* Array of the available audios.
* @type {Array<Locale>}
* @memberof StreamingOption
*/
audios: Array<Locale>;
/**
* Array of the available subtitles.
* @type {Array<Subtitle>}
* @memberof StreamingOption
*/
subtitles: Array<Subtitle>;
/**
*
* @type {Price}
* @memberof StreamingOption
*/
price?: Price;
/**
* [Unix Time Stamp](https://www.unixtimestamp.com/) of the date that this streaming option is expiring. In other words, last day to watch. A value of 1 means the streaming option is expiring soon, but there's no specific date info is found. Omitted if there's no known expiry date.
* @type {number}
* @memberof StreamingOption
*/
leaving?: number;
/**
* [Unix Time Stamp](https://www.unixtimestamp.com/) of the date that this streaming option was found on the service.
* @type {number}
* @memberof StreamingOption
*/
availableSince: number;
}
/**
* @export
*/
export const StreamingOptionQualityEnum = {
Sd: 'sd',
Hd: 'hd',
Qhd: 'qhd',
Uhd: 'uhd'
} as const;
export type StreamingOptionQualityEnum = typeof StreamingOptionQualityEnum[keyof typeof StreamingOptionQualityEnum];
/**
* Check if a given object implements the StreamingOption interface.
*/
export function instanceOfStreamingOption(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "service" in value;
isInstance = isInstance && "streamingType" in value;
isInstance = isInstance && "link" in value;
isInstance = isInstance && "audios" in value;
isInstance = isInstance && "subtitles" in value;
isInstance = isInstance && "availableSince" in value;
return isInstance;
}
export function StreamingOptionFromJSON(json: any): StreamingOption {
return StreamingOptionFromJSONTyped(json, false);
}
export function StreamingOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): StreamingOption {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'service': json['service'],
'streamingType': StreamingTypeFromJSON(json['streamingType']),
'addon': !exists(json, 'addon') ? undefined : json['addon'],
'link': json['link'],
'videoLink': !exists(json, 'videoLink') ? undefined : json['videoLink'],
'quality': !exists(json, 'quality') ? undefined : json['quality'],
'audios': ((json['audios'] as Array<any>).map(LocaleFromJSON)),
'subtitles': ((json['subtitles'] as Array<any>).map(SubtitleFromJSON)),
'price': !exists(json, 'price') ? undefined : PriceFromJSON(json['price']),
'leaving': !exists(json, 'leaving') ? undefined : json['leaving'],
'availableSince': json['availableSince'],
};
}
export function StreamingOptionToJSON(value?: StreamingOption | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'service': value.service,
'streamingType': StreamingTypeToJSON(value.streamingType),
'addon': value.addon,
'link': value.link,
'videoLink': value.videoLink,
'quality': value.quality,
'audios': ((value.audios as Array<any>).map(LocaleToJSON)),
'subtitles': ((value.subtitles as Array<any>).map(SubtitleToJSON)),
'price': PriceToJSON(value.price),
'leaving': value.leaving,
'availableSince': value.availableSince,
};
}