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 60 countries!
118 lines (117 loc) • 4.55 kB
JavaScript
;
/* 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 60 countries!
*
* The version of the OpenAPI document: 4.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShowToJSON = exports.ShowFromJSONTyped = exports.ShowFromJSON = exports.instanceOfShow = void 0;
var Genre_1 = require("./Genre");
var Season_1 = require("./Season");
var ShowImageSet_1 = require("./ShowImageSet");
var ShowType_1 = require("./ShowType");
/**
* Check if a given object implements the Show interface.
*/
function instanceOfShow(value) {
if (!('itemType' in value))
return false;
if (!('showType' in value))
return false;
if (!('id' in value))
return false;
if (!('imdbId' in value))
return false;
if (!('tmdbId' in value))
return false;
if (!('title' in value))
return false;
if (!('overview' in value))
return false;
if (!('originalTitle' in value))
return false;
if (!('genres' in value))
return false;
if (!('cast' in value))
return false;
if (!('rating' in value))
return false;
if (!('imageSet' in value))
return false;
if (!('streamingOptions' in value))
return false;
return true;
}
exports.instanceOfShow = instanceOfShow;
function ShowFromJSON(json) {
return ShowFromJSONTyped(json, false);
}
exports.ShowFromJSON = ShowFromJSON;
function ShowFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'itemType': json['itemType'],
'showType': (0, ShowType_1.ShowTypeFromJSON)(json['showType']),
'id': json['id'],
'imdbId': json['imdbId'],
'tmdbId': json['tmdbId'],
'title': json['title'],
'overview': json['overview'],
'releaseYear': json['releaseYear'] == null ? undefined : json['releaseYear'],
'firstAirYear': json['firstAirYear'] == null ? undefined : json['firstAirYear'],
'lastAirYear': json['lastAirYear'] == null ? undefined : json['lastAirYear'],
'originalTitle': json['originalTitle'],
'genres': (json['genres'].map(Genre_1.GenreFromJSON)),
'directors': json['directors'] == null ? undefined : json['directors'],
'creators': json['creators'] == null ? undefined : json['creators'],
'cast': json['cast'],
'rating': json['rating'],
'seasonCount': json['seasonCount'] == null ? undefined : json['seasonCount'],
'episodeCount': json['episodeCount'] == null ? undefined : json['episodeCount'],
'runtime': json['runtime'] == null ? undefined : json['runtime'],
'imageSet': (0, ShowImageSet_1.ShowImageSetFromJSON)(json['imageSet']),
'streamingOptions': json['streamingOptions'],
'seasons': json['seasons'] == null ? undefined : (json['seasons'].map(Season_1.SeasonFromJSON)),
};
}
exports.ShowFromJSONTyped = ShowFromJSONTyped;
function ShowToJSON(value) {
if (value == null) {
return value;
}
return {
'itemType': value['itemType'],
'showType': (0, ShowType_1.ShowTypeToJSON)(value['showType']),
'id': value['id'],
'imdbId': value['imdbId'],
'tmdbId': value['tmdbId'],
'title': value['title'],
'overview': value['overview'],
'releaseYear': value['releaseYear'],
'firstAirYear': value['firstAirYear'],
'lastAirYear': value['lastAirYear'],
'originalTitle': value['originalTitle'],
'genres': (value['genres'].map(Genre_1.GenreToJSON)),
'directors': value['directors'],
'creators': value['creators'],
'cast': value['cast'],
'rating': value['rating'],
'seasonCount': value['seasonCount'],
'episodeCount': value['episodeCount'],
'runtime': value['runtime'],
'imageSet': (0, ShowImageSet_1.ShowImageSetToJSON)(value['imageSet']),
'streamingOptions': value['streamingOptions'],
'seasons': value['seasons'] == null ? undefined : (value['seasons'].map(Season_1.SeasonToJSON)),
};
}
exports.ShowToJSON = ShowToJSON;