/* 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 { Service } from './Service';
import {
    ServiceFromJSON,
    ServiceFromJSONTyped,
    ServiceToJSON,
} from './Service';

/**
 * Details of a country.
 * @export
 * @interface Country
 */
export interface Country {
    /**
     * 2-letter ISO code of the country.
     * @type {string}
     * @memberof Country
     */
    countryCode: string;
    /**
     * Name of the country.
     * @type {string}
     * @memberof Country
     */
    name: string;
    /**
     * Map of service id to details of the service in this country.
     * @type {{ [key: string]: Service; }}
     * @memberof Country
     */
    services: { [key: string]: Service; };
}

/**
 * Check if a given object implements the Country interface.
 */
export function instanceOfCountry(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "countryCode" in value;
    isInstance = isInstance && "name" in value;
    isInstance = isInstance && "services" in value;

    return isInstance;
}

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

export function CountryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Country {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'countryCode': json['countryCode'],
        'name': json['name'],
        'services': (mapValues(json['services'], ServiceFromJSON)),
    };
}

export function CountryToJSON(value?: Country | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'countryCode': value.countryCode,
        'name': value.name,
        'services': (mapValues(value.services, ServiceToJSON)),
    };
}

