UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
154 lines (153 loc) 5.53 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.18.6 * 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.StoryResponseToJSON = exports.StoryResponseFromJSONTyped = exports.StoryResponseFromJSON = exports.instanceOfStoryResponse = void 0; const ClusterProbabilities_1 = require("./ClusterProbabilities"); const StoryUpdate_1 = require("./StoryUpdate"); /** * Check if a given object implements the StoryResponse interface. */ function instanceOfStoryResponse(value) { if (!('uuid' in value)) return false; if (!('categories' in value)) return false; if (!('countries' in value)) return false; if (!('countriesPct' in value)) return false; if (!('currentUpdateUuid' in value)) return false; if (!('requestedUpdateUuid' in value)) return false; if (!('generateImage' in value)) return false; if (!('keywords' in value)) return false; if (!('languages' in value)) return false; if (!('languagesPct' in value)) return false; if (!('locations' in value)) return false; if (!('metaType' in value)) return false; if (!('nArticles' in value)) return false; if (!('nUpdates' in value)) return false; if (!('people' in value)) return false; if (!('redditSentiment' in value)) return false; if (!('redditSentimentTimestamps' in value)) return false; if (!('rollingSentiment' in value)) return false; if (!('sentiment' in value)) return false; if (!('sentimentTimestamps' in value)) return false; if (!('sources' in value)) return false; if (!('sourcesUrls' in value)) return false; if (!('topic' in value)) return false; if (!('topics' in value)) return false; if (!('updates' in value)) return false; if (!('updatedTs' in value)) return false; if (!('updateUuids' in value)) 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(ClusterProbabilities_1.ClusterProbabilitiesFromJSON)), '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(value) { 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(ClusterProbabilities_1.ClusterProbabilitiesToJSON)), '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.StoryResponseToJSON = StoryResponseToJSON;