@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
84 lines (73 loc) • 2.38 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.22
* 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';
/**
*
* @export
* @interface TopNArticlesTimeseriesItem
*/
export interface TopNArticlesTimeseriesItem {
/**
*
* @type {string}
* @memberof TopNArticlesTimeseriesItem
*/
articleUrl: string;
/**
*
* @type {string}
* @memberof TopNArticlesTimeseriesItem
*/
articleId?: string | null;
/**
*
* @type {number}
* @memberof TopNArticlesTimeseriesItem
*/
hitCount: number;
}
/**
* Check if a given object implements the TopNArticlesTimeseriesItem interface.
*/
export function instanceOfTopNArticlesTimeseriesItem(value: object): value is TopNArticlesTimeseriesItem {
if (!('articleUrl' in value) || value['articleUrl'] === undefined) return false;
if (!('hitCount' in value) || value['hitCount'] === undefined) return false;
return true;
}
export function TopNArticlesTimeseriesItemFromJSON(json: any): TopNArticlesTimeseriesItem {
return TopNArticlesTimeseriesItemFromJSONTyped(json, false);
}
export function TopNArticlesTimeseriesItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): TopNArticlesTimeseriesItem {
if (json == null) {
return json;
}
return {
'articleUrl': json['article_url'],
'articleId': json['article_id'] == null ? undefined : json['article_id'],
'hitCount': json['hit_count'],
};
}
export function TopNArticlesTimeseriesItemToJSON(json: any): TopNArticlesTimeseriesItem {
return TopNArticlesTimeseriesItemToJSONTyped(json, false);
}
export function TopNArticlesTimeseriesItemToJSONTyped(value?: TopNArticlesTimeseriesItem | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'article_url': value['articleUrl'],
'article_id': value['articleId'],
'hit_count': value['hitCount'],
};
}