/* 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.
 */

import { mapValues } from '../runtime';
import type { Service } from './Service';
import {
    ServiceFromJSON,
    ServiceFromJSONTyped,
    ServiceToJSON,
} from './Service';

/**
 * Countries are the primary way to get the supported streaming services and addons
 * (such as list of available Apple TV and Prime Video channels) in a region.
 * 
 * Each country object contains the country code, name and the list of supported streaming services.
 * 
 * Details of the streaming services include localized
 * logos, homepages, theme colors, and available streaming options and addons.
 * 
 * @export
 * @interface Country
 */
export interface Country {
    /**
     * [ISO 3166-1 alpha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the country.
     * 
     * @type {string}
     * @memberof Country
     */
    countryCode: string;
    /**
     * Name of the country.
     * @type {string}
     * @memberof Country
     */
    name: string;
    /**
     * Array of the supported services in the country, ordered by popularity.
     * @type {Array<Service>}
     * @memberof Country
     */
    services: Array<Service>;
}

/**
 * Check if a given object implements the Country interface.
 */
export function instanceOfCountry(value: object): boolean {
    if (!('countryCode' in value)) return false;
    if (!('name' in value)) return false;
    if (!('services' in value)) return false;
    return true;
}

export function CountryFromJSON(json: any): Country {
    return CountryFromJSONTyped(json, false);
}

export function CountryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Country {
    if (json == null) {
        return json;
    }
    return {
        
        'countryCode': json['countryCode'],
        'name': json['name'],
        'services': ((json['services'] as Array<any>).map(ServiceFromJSON)),
    };
}

export function CountryToJSON(value?: Country | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'countryCode': value['countryCode'],
        'name': value['name'],
        'services': ((value['services'] as Array<any>).map(ServiceToJSON)),
    };
}

