/* tslint:disable */
/* eslint-disable */
/**
 * AskNews API
 * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod)
 *
 * The version of the OpenAPI document: 0.24.66
 * Contact: contact@emergentmethods.ai
 *
 * 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 { TopNArticlesTimeseriesDayItem } from './TopNArticlesTimeseriesDayItem';
import {
    TopNArticlesTimeseriesDayItemFromJSON,
    TopNArticlesTimeseriesDayItemFromJSONTyped,
    TopNArticlesTimeseriesDayItemToJSON,
    TopNArticlesTimeseriesDayItemToJSONTyped,
} from './TopNArticlesTimeseriesDayItem';

/**
 * 
 * @export
 * @interface TopNArticlesTimeseriesResponse
 */
export interface TopNArticlesTimeseriesResponse {
    /**
     * 
     * @type {Array<TopNArticlesTimeseriesDayItem>}
     * @memberof TopNArticlesTimeseriesResponse
     */
    data: Array<TopNArticlesTimeseriesDayItem>;
    /**
     * 
     * @type {number}
     * @memberof TopNArticlesTimeseriesResponse
     */
    totalCount: number;
}

/**
 * Check if a given object implements the TopNArticlesTimeseriesResponse interface.
 */
export function instanceOfTopNArticlesTimeseriesResponse(value: object): value is TopNArticlesTimeseriesResponse {
    if (!('data' in value) || value['data'] === undefined) return false;
    if (!('totalCount' in value) || value['totalCount'] === undefined) return false;
    return true;
}

export function TopNArticlesTimeseriesResponseFromJSON(json: any): TopNArticlesTimeseriesResponse {
    return TopNArticlesTimeseriesResponseFromJSONTyped(json, false);
}

export function TopNArticlesTimeseriesResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TopNArticlesTimeseriesResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'data': ((json['data'] as Array<any>).map(TopNArticlesTimeseriesDayItemFromJSON)),
        'totalCount': json['total_count'],
    };
}

export function TopNArticlesTimeseriesResponseToJSON(json: any): TopNArticlesTimeseriesResponse {
    return TopNArticlesTimeseriesResponseToJSONTyped(json, false);
}

export function TopNArticlesTimeseriesResponseToJSONTyped(value?: TopNArticlesTimeseriesResponse | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'data': ((value['data'] as Array<any>).map(TopNArticlesTimeseriesDayItemToJSON)),
        'total_count': value['totalCount'],
    };
}

