/* 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 { Change } from './Change';
import {
    ChangeFromJSON,
    ChangeFromJSONTyped,
    ChangeToJSON,
} from './Change';
import type { Show } from './Show';
import {
    ShowFromJSON,
    ShowFromJSONTyped,
    ShowToJSON,
} from './Show';

/**
 * 
 * @export
 * @interface ChangesResult
 */
export interface ChangesResult {
    /**
     * Array of the changes.
     * @type {Array<Change>}
     * @memberof ChangesResult
     */
    changes: Array<Change>;
    /**
     * Map of the shows by their ids.
     * @type {{ [key: string]: Show; }}
     * @memberof ChangesResult
     */
    shows: { [key: string]: Show; };
    /**
     * Whether there are more changes available.
     * @type {boolean}
     * @memberof ChangesResult
     */
    hasMore: boolean;
    /**
     * Cursor value to pass to get the next set of changes.
     * @type {string}
     * @memberof ChangesResult
     */
    nextCursor?: string;
}

/**
 * Check if a given object implements the ChangesResult interface.
 */
export function instanceOfChangesResult(value: object): boolean {
    if (!('changes' in value)) return false;
    if (!('shows' in value)) return false;
    if (!('hasMore' in value)) return false;
    return true;
}

export function ChangesResultFromJSON(json: any): ChangesResult {
    return ChangesResultFromJSONTyped(json, false);
}

export function ChangesResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangesResult {
    if (json == null) {
        return json;
    }
    return {
        
        'changes': ((json['changes'] as Array<any>).map(ChangeFromJSON)),
        'shows': json['shows'],
        'hasMore': json['hasMore'],
        'nextCursor': json['nextCursor'] == null ? undefined : json['nextCursor'],
    };
}

export function ChangesResultToJSON(value?: ChangesResult | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'changes': ((value['changes'] as Array<any>).map(ChangeToJSON)),
        'shows': value['shows'],
        'hasMore': value['hasMore'],
        'nextCursor': value['nextCursor'],
    };
}

