UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
204 lines (203 loc) 9.35 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.19.10 * 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 { IntraClusterStatisticsFromJSON, IntraClusterStatisticsToJSON, } from './IntraClusterStatistics'; import { ArticleFromJSON, ArticleToJSON, } from './Article'; import { RedditPerspectiveFromJSON, RedditPerspectiveToJSON, } from './RedditPerspective'; import { StoryUpdateDisplayImageUrlsInnerFromJSON, StoryUpdateDisplayImageUrlsInnerToJSON, } from './StoryUpdateDisplayImageUrlsInner'; import { AsknewsApiSchemaV1StoriesGraphRelationshipsFromJSON, AsknewsApiSchemaV1StoriesGraphRelationshipsToJSON, } from './AsknewsApiSchemaV1StoriesGraphRelationships'; import { RedditThreadFromJSON, RedditThreadToJSON, } from './RedditThread'; import { EntitiesFromJSON, EntitiesToJSON, } from './Entities'; /** * @export */ export const StoryUpdateProvocativeEnum = { Unknown: 'unknown', Low: 'low', Medium: 'medium', High: 'high' }; /** * Check if a given object implements the StoryUpdate interface. */ export 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; } export function StoryUpdateFromJSON(json) { return StoryUpdateFromJSONTyped(json, false); } export function StoryUpdateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'uuid': json['uuid'], 'clusterArticles': (json['cluster_articles'].map(ArticleFromJSON)), 'promptArticles': (json['prompt_articles'].map(ArticleFromJSON)), 'nArticles': json['n_articles'], 'entities': 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': RedditPerspectiveFromJSON(json['reddit_perspective']), 'redditThreads': (json['reddit_threads'].map(RedditThreadFromJSON)), 'languages': json['languages'], 'keywords': json['keywords'], 'intraClusterStatistics': 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': AsknewsApiSchemaV1StoriesGraphRelationshipsFromJSON(json['relationships']), 'mermaid': json['mermaid'], 'ccImageUrl': json['cc_image_url'], 'displayImageUrls': (json['display_image_urls'].map(StoryUpdateDisplayImageUrlsInnerFromJSON)), 'alignment': json['alignment'] == null ? undefined : json['alignment'], }; } export function StoryUpdateToJSON(json) { return StoryUpdateToJSONTyped(json, false); } export function StoryUpdateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'uuid': value['uuid'], 'cluster_articles': (value['clusterArticles'].map(ArticleToJSON)), 'prompt_articles': (value['promptArticles'].map(ArticleToJSON)), 'n_articles': value['nArticles'], 'entities': 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': RedditPerspectiveToJSON(value['redditPerspective']), 'reddit_threads': (value['redditThreads'].map(RedditThreadToJSON)), 'languages': value['languages'], 'keywords': value['keywords'], 'intra_cluster_statistics': 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': AsknewsApiSchemaV1StoriesGraphRelationshipsToJSON(value['relationships']), 'mermaid': value['mermaid'], 'cc_image_url': value['ccImageUrl'], 'display_image_urls': (value['displayImageUrls'].map(StoryUpdateDisplayImageUrlsInnerToJSON)), 'alignment': value['alignment'], }; }