/* 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 { StreamingOption } from './StreamingOption';
import {
    StreamingOptionFromJSON,
    StreamingOptionFromJSONTyped,
    StreamingOptionToJSON,
} from './StreamingOption';

/**
 * Details of an episode.
 * @export
 * @interface Episode
 */
export interface Episode {
    /**
     * Type of the item. Always "episode".
     * @type {string}
     * @memberof Episode
     */
    type: EpisodeTypeEnum;
    /**
     * Title of the episode.
     * @type {string}
     * @memberof Episode
     */
    title: string;
    /**
     * The year that the movie was released.
     * @type {number}
     * @memberof Episode
     */
    year: number;
    /**
     * Country to streaming availability info mapping of a show.
     * @type {{ [key: string]: Array<StreamingOption>; }}
     * @memberof Episode
     */
    streamingInfo: { [key: string]: Array<StreamingOption>; };
}


/**
 * @export
 */
export const EpisodeTypeEnum = {
    Episode: 'episode'
} as const;
export type EpisodeTypeEnum = typeof EpisodeTypeEnum[keyof typeof EpisodeTypeEnum];


/**
 * Check if a given object implements the Episode interface.
 */
export function instanceOfEpisode(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "type" in value;
    isInstance = isInstance && "title" in value;
    isInstance = isInstance && "year" in value;
    isInstance = isInstance && "streamingInfo" in value;

    return isInstance;
}

export function EpisodeFromJSON(json: any): Episode {
    return EpisodeFromJSONTyped(json, false);
}

export function EpisodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Episode {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'type': json['type'],
        'title': json['title'],
        'year': json['year'],
        'streamingInfo': json['streamingInfo'],
    };
}

export function EpisodeToJSON(value?: Episode | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'type': value.type,
        'title': value.title,
        'year': value.year,
        'streamingInfo': value.streamingInfo,
    };
}

