@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
158 lines (157 loc) • 6.8 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.21.1
* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StoryResponseToJSONTyped = exports.StoryResponseToJSON = exports.StoryResponseFromJSONTyped = exports.StoryResponseFromJSON = exports.instanceOfStoryResponse = void 0;
const ClusterProbabilitiesValue_1 = require("./ClusterProbabilitiesValue");
const StoryUpdate_1 = require("./StoryUpdate");
/**
* Check if a given object implements the StoryResponse interface.
*/
function instanceOfStoryResponse(value) {
if (!('uuid' in value) || value['uuid'] === undefined)
return false;
if (!('categories' in value) || value['categories'] === undefined)
return false;
if (!('countries' in value) || value['countries'] === undefined)
return false;
if (!('countriesPct' in value) || value['countriesPct'] === undefined)
return false;
if (!('currentUpdateUuid' in value) || value['currentUpdateUuid'] === undefined)
return false;
if (!('requestedUpdateUuid' in value) || value['requestedUpdateUuid'] === undefined)
return false;
if (!('generateImage' in value) || value['generateImage'] === undefined)
return false;
if (!('keywords' in value) || value['keywords'] === undefined)
return false;
if (!('languages' in value) || value['languages'] === undefined)
return false;
if (!('languagesPct' in value) || value['languagesPct'] === undefined)
return false;
if (!('locations' in value) || value['locations'] === undefined)
return false;
if (!('metaType' in value) || value['metaType'] === undefined)
return false;
if (!('nArticles' in value) || value['nArticles'] === undefined)
return false;
if (!('nUpdates' in value) || value['nUpdates'] === undefined)
return false;
if (!('people' in value) || value['people'] === undefined)
return false;
if (!('redditSentiment' in value) || value['redditSentiment'] === undefined)
return false;
if (!('redditSentimentTimestamps' in value) || value['redditSentimentTimestamps'] === undefined)
return false;
if (!('rollingSentiment' in value) || value['rollingSentiment'] === undefined)
return false;
if (!('sentiment' in value) || value['sentiment'] === undefined)
return false;
if (!('sentimentTimestamps' in value) || value['sentimentTimestamps'] === undefined)
return false;
if (!('sources' in value) || value['sources'] === undefined)
return false;
if (!('sourcesUrls' in value) || value['sourcesUrls'] === undefined)
return false;
if (!('topic' in value) || value['topic'] === undefined)
return false;
if (!('topics' in value) || value['topics'] === undefined)
return false;
if (!('updates' in value) || value['updates'] === undefined)
return false;
if (!('updatedTs' in value) || value['updatedTs'] === undefined)
return false;
if (!('updateUuids' in value) || value['updateUuids'] === undefined)
return false;
return true;
}
exports.instanceOfStoryResponse = instanceOfStoryResponse;
function StoryResponseFromJSON(json) {
return StoryResponseFromJSONTyped(json, false);
}
exports.StoryResponseFromJSON = StoryResponseFromJSON;
function StoryResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'uuid': json['uuid'],
'categories': json['categories'],
'countries': json['countries'],
'countriesPct': json['countries_pct'],
'currentUpdateUuid': json['current_update_uuid'],
'requestedUpdateUuid': json['requested_update_uuid'],
'generateImage': json['generate_image'],
'keywords': json['keywords'],
'languages': json['languages'],
'languagesPct': json['languages_pct'],
'locations': json['locations'],
'metaType': json['meta_type'],
'nArticles': json['n_articles'],
'nUpdates': json['n_updates'],
'people': json['people'],
'redditSentiment': (json['reddit_sentiment'].map(ClusterProbabilitiesValue_1.ClusterProbabilitiesValueFromJSON)),
'redditSentimentTimestamps': json['reddit_sentiment_timestamps'],
'rollingSentiment': json['rolling_sentiment'],
'sentiment': json['sentiment'],
'sentimentTimestamps': json['sentiment_timestamps'],
'sources': json['sources'],
'sourcesUrls': json['sources_urls'],
'topic': json['topic'],
'topics': json['topics'],
'updates': (json['updates'].map(StoryUpdate_1.StoryUpdateFromJSON)),
'updatedTs': json['updated_ts'],
'updateUuids': json['update_uuids'],
};
}
exports.StoryResponseFromJSONTyped = StoryResponseFromJSONTyped;
function StoryResponseToJSON(json) {
return StoryResponseToJSONTyped(json, false);
}
exports.StoryResponseToJSON = StoryResponseToJSON;
function StoryResponseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'uuid': value['uuid'],
'categories': value['categories'],
'countries': value['countries'],
'countries_pct': value['countriesPct'],
'current_update_uuid': value['currentUpdateUuid'],
'requested_update_uuid': value['requestedUpdateUuid'],
'generate_image': value['generateImage'],
'keywords': value['keywords'],
'languages': value['languages'],
'languages_pct': value['languagesPct'],
'locations': value['locations'],
'meta_type': value['metaType'],
'n_articles': value['nArticles'],
'n_updates': value['nUpdates'],
'people': value['people'],
'reddit_sentiment': (value['redditSentiment'].map(ClusterProbabilitiesValue_1.ClusterProbabilitiesValueToJSON)),
'reddit_sentiment_timestamps': value['redditSentimentTimestamps'],
'rolling_sentiment': value['rollingSentiment'],
'sentiment': value['sentiment'],
'sentiment_timestamps': value['sentimentTimestamps'],
'sources': value['sources'],
'sources_urls': value['sourcesUrls'],
'topic': value['topic'],
'topics': value['topics'],
'updates': (value['updates'].map(StoryUpdate_1.StoryUpdateToJSON)),
'updated_ts': value['updatedTs'],
'update_uuids': value['updateUuids'],
};
}
exports.StoryResponseToJSONTyped = StoryResponseToJSONTyped;