@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
212 lines (211 loc) • 10 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.StoryUpdateToJSONTyped = exports.StoryUpdateToJSON = exports.StoryUpdateFromJSONTyped = exports.StoryUpdateFromJSON = exports.instanceOfStoryUpdate = exports.StoryUpdateProvocativeEnum = void 0;
const IntraClusterStatistics_1 = require("./IntraClusterStatistics");
const Article_1 = require("./Article");
const RedditPerspective_1 = require("./RedditPerspective");
const StoryUpdateDisplayImageUrlsInner_1 = require("./StoryUpdateDisplayImageUrlsInner");
const AsknewsApiSchemaV1StoriesGraphRelationships_1 = require("./AsknewsApiSchemaV1StoriesGraphRelationships");
const RedditThread_1 = require("./RedditThread");
const Entities_1 = require("./Entities");
/**
* @export
*/
exports.StoryUpdateProvocativeEnum = {
Unknown: 'unknown',
Low: 'low',
Medium: 'medium',
High: 'high'
};
/**
* Check if a given object implements the StoryUpdate interface.
*/
function instanceOfStoryUpdate(value) {
if (!('uuid' in value) || value['uuid'] === undefined)
return false;
if (!('clusterArticles' in value) || value['clusterArticles'] === undefined)
return false;
if (!('promptArticles' in value) || value['promptArticles'] === undefined)
return false;
if (!('nArticles' in value) || value['nArticles'] === undefined)
return false;
if (!('entities' in value) || value['entities'] === undefined)
return false;
if (!('headline' in value) || value['headline'] === undefined)
return false;
if (!('story' in value) || value['story'] === undefined)
return false;
if (!('storyUpdateTs' in value) || value['storyUpdateTs'] === undefined)
return false;
if (!('sourcesUrls' in value) || value['sourcesUrls'] === undefined)
return false;
if (!('languagesPct' in value) || value['languagesPct'] === undefined)
return false;
if (!('countriesPct' in value) || value['countriesPct'] === undefined)
return false;
if (!('keyTakeaways' in value) || value['keyTakeaways'] === undefined)
return false;
if (!('contradictions' in value) || value['contradictions'] === undefined)
return false;
if (!('continent' in value) || value['continent'] === undefined)
return false;
if (!('people' in value) || value['people'] === undefined)
return false;
if (!('locations' in value) || value['locations'] === undefined)
return false;
if (!('newInformation' in value) || value['newInformation'] === undefined)
return false;
if (!('imageUrl' in value) || value['imageUrl'] === undefined)
return false;
if (!('urlSafeTitle' in value) || value['urlSafeTitle'] === undefined)
return false;
if (!('storyUuid' in value) || value['storyUuid'] === undefined)
return false;
if (!('categories' in value) || value['categories'] === undefined)
return false;
if (!('imagePrompt' in value) || value['imagePrompt'] === undefined)
return false;
if (!('redditPerspective' in value) || value['redditPerspective'] === undefined)
return false;
if (!('redditThreads' in value) || value['redditThreads'] === undefined)
return false;
if (!('languages' in value) || value['languages'] === undefined)
return false;
if (!('keywords' in value) || value['keywords'] === undefined)
return false;
if (!('intraClusterStatistics' in value) || value['intraClusterStatistics'] === undefined)
return false;
if (!('silhouetteScore' in value) || value['silhouetteScore'] === undefined)
return false;
if (!('articleIds' in value) || value['articleIds'] === undefined)
return false;
if (!('countries' in value) || value['countries'] === undefined)
return false;
if (!('markdownCitations' in value) || value['markdownCitations'] === undefined)
return false;
if (!('relationships' in value) || value['relationships'] === undefined)
return false;
if (!('mermaid' in value) || value['mermaid'] === undefined)
return false;
if (!('ccImageUrl' in value) || value['ccImageUrl'] === undefined)
return false;
if (!('displayImageUrls' in value) || value['displayImageUrls'] === undefined)
return false;
return true;
}
exports.instanceOfStoryUpdate = instanceOfStoryUpdate;
function StoryUpdateFromJSON(json) {
return StoryUpdateFromJSONTyped(json, false);
}
exports.StoryUpdateFromJSON = StoryUpdateFromJSON;
function StoryUpdateFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'uuid': json['uuid'],
'clusterArticles': (json['cluster_articles'].map(Article_1.ArticleFromJSON)),
'promptArticles': (json['prompt_articles'].map(Article_1.ArticleFromJSON)),
'nArticles': json['n_articles'],
'entities': (0, Entities_1.EntitiesFromJSON)(json['entities']),
'headline': json['headline'],
'story': json['story'],
'storyUpdateTs': json['story_update_ts'],
'sourcesUrls': json['sources_urls'],
'languagesPct': json['languages_pct'],
'countriesPct': json['countries_pct'],
'keyTakeaways': json['key_takeaways'],
'contradictions': json['contradictions'],
'continent': json['continent'],
'people': json['people'],
'locations': json['locations'],
'newInformation': json['new_information'],
'imageUrl': json['image_url'],
'urlSafeTitle': json['url_safe_title'],
'storyUuid': json['story_uuid'],
'categories': json['categories'],
'imagePrompt': json['image_prompt'],
'redditPerspective': (0, RedditPerspective_1.RedditPerspectiveFromJSON)(json['reddit_perspective']),
'redditThreads': (json['reddit_threads'].map(RedditThread_1.RedditThreadFromJSON)),
'languages': json['languages'],
'keywords': json['keywords'],
'intraClusterStatistics': (0, IntraClusterStatistics_1.IntraClusterStatisticsFromJSON)(json['intra_cluster_statistics']),
'silhouetteScore': json['silhouette_score'],
'articleIds': json['article_ids'],
'countries': json['countries'],
'markdownCitations': json['markdown_citations'],
'confidence': json['confidence'] == null ? undefined : json['confidence'],
'provocative': json['provocative'] == null ? undefined : json['provocative'],
'reportingVoice': json['reporting_voice'] == null ? undefined : json['reporting_voice'],
'relationships': (0, AsknewsApiSchemaV1StoriesGraphRelationships_1.AsknewsApiSchemaV1StoriesGraphRelationshipsFromJSON)(json['relationships']),
'mermaid': json['mermaid'],
'ccImageUrl': json['cc_image_url'],
'displayImageUrls': (json['display_image_urls'].map(StoryUpdateDisplayImageUrlsInner_1.StoryUpdateDisplayImageUrlsInnerFromJSON)),
'alignment': json['alignment'] == null ? undefined : json['alignment'],
};
}
exports.StoryUpdateFromJSONTyped = StoryUpdateFromJSONTyped;
function StoryUpdateToJSON(json) {
return StoryUpdateToJSONTyped(json, false);
}
exports.StoryUpdateToJSON = StoryUpdateToJSON;
function StoryUpdateToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'uuid': value['uuid'],
'cluster_articles': (value['clusterArticles'].map(Article_1.ArticleToJSON)),
'prompt_articles': (value['promptArticles'].map(Article_1.ArticleToJSON)),
'n_articles': value['nArticles'],
'entities': (0, Entities_1.EntitiesToJSON)(value['entities']),
'headline': value['headline'],
'story': value['story'],
'story_update_ts': value['storyUpdateTs'],
'sources_urls': value['sourcesUrls'],
'languages_pct': value['languagesPct'],
'countries_pct': value['countriesPct'],
'key_takeaways': value['keyTakeaways'],
'contradictions': value['contradictions'],
'continent': value['continent'],
'people': value['people'],
'locations': value['locations'],
'new_information': value['newInformation'],
'image_url': value['imageUrl'],
'url_safe_title': value['urlSafeTitle'],
'story_uuid': value['storyUuid'],
'categories': value['categories'],
'image_prompt': value['imagePrompt'],
'reddit_perspective': (0, RedditPerspective_1.RedditPerspectiveToJSON)(value['redditPerspective']),
'reddit_threads': (value['redditThreads'].map(RedditThread_1.RedditThreadToJSON)),
'languages': value['languages'],
'keywords': value['keywords'],
'intra_cluster_statistics': (0, IntraClusterStatistics_1.IntraClusterStatisticsToJSON)(value['intraClusterStatistics']),
'silhouette_score': value['silhouetteScore'],
'article_ids': value['articleIds'],
'countries': value['countries'],
'markdown_citations': value['markdownCitations'],
'confidence': value['confidence'],
'provocative': value['provocative'],
'reporting_voice': value['reportingVoice'],
'relationships': (0, AsknewsApiSchemaV1StoriesGraphRelationships_1.AsknewsApiSchemaV1StoriesGraphRelationshipsToJSON)(value['relationships']),
'mermaid': value['mermaid'],
'cc_image_url': value['ccImageUrl'],
'display_image_urls': (value['displayImageUrls'].map(StoryUpdateDisplayImageUrlsInner_1.StoryUpdateDisplayImageUrlsInnerToJSON)),
'alignment': value['alignment'],
};
}
exports.StoryUpdateToJSONTyped = StoryUpdateToJSONTyped;