UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
370 lines (354 loc) 11.5 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 { mapValues } from '../runtime'; import type { GeoCoordinate1 } from './GeoCoordinate1'; import { GeoCoordinate1FromJSON, GeoCoordinate1FromJSONTyped, GeoCoordinate1ToJSON, GeoCoordinate1ToJSONTyped, } from './GeoCoordinate1'; import type { Entities1 } from './Entities1'; import { Entities1FromJSON, Entities1FromJSONTyped, Entities1ToJSON, Entities1ToJSONTyped, } from './Entities1'; import type { Classification } from './Classification'; import { ClassificationFromJSON, ClassificationFromJSONTyped, ClassificationToJSON, ClassificationToJSONTyped, } from './Classification'; import type { Assets1 } from './Assets1'; import { Assets1FromJSON, Assets1FromJSONTyped, Assets1ToJSON, Assets1ToJSONTyped, } from './Assets1'; import type { GraphRelationships } from './GraphRelationships'; import { GraphRelationshipsFromJSON, GraphRelationshipsFromJSONTyped, GraphRelationshipsToJSON, GraphRelationshipsToJSONTyped, } from './GraphRelationships'; import type { ReportingVoice1 } from './ReportingVoice1'; import { ReportingVoice1FromJSON, ReportingVoice1FromJSONTyped, ReportingVoice1ToJSON, ReportingVoice1ToJSONTyped, } from './ReportingVoice1'; /** * * @export * @interface SearchResponseDictItem1 */ export interface SearchResponseDictItem1 { /** * * @type {string} * @memberof SearchResponseDictItem1 */ articleUrl: string; /** * * @type {string} * @memberof SearchResponseDictItem1 */ articleId: string; /** * * @type {Classification} * @memberof SearchResponseDictItem1 */ classification: Classification; /** * * @type {string} * @memberof SearchResponseDictItem1 */ country: string; /** * * @type {string} * @memberof SearchResponseDictItem1 */ sourceId: string; /** * * @type {number} * @memberof SearchResponseDictItem1 */ pageRank: number; /** * * @type {string} * @memberof SearchResponseDictItem1 */ domainUrl: string; /** * * @type {string} * @memberof SearchResponseDictItem1 */ engTitle: string; /** * * @type {Entities1} * @memberof SearchResponseDictItem1 */ entities: Entities1; /** * * @type {string} * @memberof SearchResponseDictItem1 */ imageUrl?: string | null; /** * * @type {Array<string>} * @memberof SearchResponseDictItem1 */ keywords: Array<string>; /** * * @type {string} * @memberof SearchResponseDictItem1 */ language: string; /** * * @type {Date} * @memberof SearchResponseDictItem1 */ pubDate: Date; /** * * @type {string} * @memberof SearchResponseDictItem1 */ summary: string; /** * * @type {Array<string>} * @memberof SearchResponseDictItem1 */ keyPoints?: Array<string> | null; /** * * @type {string} * @memberof SearchResponseDictItem1 */ title: string; /** * * @type {number} * @memberof SearchResponseDictItem1 */ sentiment: number; /** * * @type {number} * @memberof SearchResponseDictItem1 */ centroidDistance: number; /** * * @type {number} * @memberof SearchResponseDictItem1 */ clusterProbability: number; /** * * @type {string} * @memberof SearchResponseDictItem1 */ markdownCitation?: string; /** * * @type {string} * @memberof SearchResponseDictItem1 */ provocative?: SearchResponseDictItem1ProvocativeEnum; /** * * @type {ReportingVoice1} * @memberof SearchResponseDictItem1 */ reportingVoice?: ReportingVoice1; /** * * @type {GraphRelationships} * @memberof SearchResponseDictItem1 */ entityRelationGraph?: GraphRelationships | null; /** * * @type {{ [key: string]: GeoCoordinate1; }} * @memberof SearchResponseDictItem1 */ geoCoordinates?: { [key: string]: GeoCoordinate1; } | null; /** * * @type {string} * @memberof SearchResponseDictItem1 */ continent?: SearchResponseDictItem1ContinentEnum | null; /** * * @type {Assets1} * @memberof SearchResponseDictItem1 */ assets?: Assets1 | null; /** * * @type {Array<string>} * @memberof SearchResponseDictItem1 */ socialEmbeds?: Array<string> | null; /** * * @type {string} * @memberof SearchResponseDictItem1 */ asStringKey: string; } /** * @export */ export const SearchResponseDictItem1ProvocativeEnum = { Unknown: 'unknown', Low: 'low', Medium: 'medium', High: 'high' } as const; export type SearchResponseDictItem1ProvocativeEnum = typeof SearchResponseDictItem1ProvocativeEnum[keyof typeof SearchResponseDictItem1ProvocativeEnum]; /** * @export */ export const SearchResponseDictItem1ContinentEnum = { Africa: 'Africa', Asia: 'Asia', Europe: 'Europe', MiddleEast: 'Middle East', NorthAmerica: 'North America', SouthAmerica: 'South America', Oceania: 'Oceania' } as const; export type SearchResponseDictItem1ContinentEnum = typeof SearchResponseDictItem1ContinentEnum[keyof typeof SearchResponseDictItem1ContinentEnum]; /** * Check if a given object implements the SearchResponseDictItem1 interface. */ export function instanceOfSearchResponseDictItem1(value: object): value is SearchResponseDictItem1 { if (!('articleUrl' in value) || value['articleUrl'] === undefined) return false; if (!('articleId' in value) || value['articleId'] === undefined) return false; if (!('classification' in value) || value['classification'] === undefined) return false; if (!('country' in value) || value['country'] === undefined) return false; if (!('sourceId' in value) || value['sourceId'] === undefined) return false; if (!('pageRank' in value) || value['pageRank'] === undefined) return false; if (!('domainUrl' in value) || value['domainUrl'] === undefined) return false; if (!('engTitle' in value) || value['engTitle'] === undefined) return false; if (!('entities' in value) || value['entities'] === undefined) return false; if (!('keywords' in value) || value['keywords'] === undefined) return false; if (!('language' in value) || value['language'] === undefined) return false; if (!('pubDate' in value) || value['pubDate'] === undefined) return false; if (!('summary' in value) || value['summary'] === undefined) return false; if (!('title' in value) || value['title'] === undefined) return false; if (!('sentiment' in value) || value['sentiment'] === undefined) return false; if (!('centroidDistance' in value) || value['centroidDistance'] === undefined) return false; if (!('clusterProbability' in value) || value['clusterProbability'] === undefined) return false; if (!('asStringKey' in value) || value['asStringKey'] === undefined) return false; return true; } export function SearchResponseDictItem1FromJSON(json: any): SearchResponseDictItem1 { return SearchResponseDictItem1FromJSONTyped(json, false); } export function SearchResponseDictItem1FromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchResponseDictItem1 { if (json == null) { return json; } return { 'articleUrl': json['article_url'], 'articleId': json['article_id'], 'classification': ClassificationFromJSON(json['classification']), 'country': json['country'], 'sourceId': json['source_id'], 'pageRank': json['page_rank'], 'domainUrl': json['domain_url'], 'engTitle': json['eng_title'], 'entities': Entities1FromJSON(json['entities']), 'imageUrl': json['image_url'] == null ? undefined : json['image_url'], 'keywords': json['keywords'], 'language': json['language'], 'pubDate': (new Date(json['pub_date'])), 'summary': json['summary'], 'keyPoints': json['key_points'] == null ? undefined : json['key_points'], 'title': json['title'], 'sentiment': json['sentiment'], 'centroidDistance': json['centroid_distance'], 'clusterProbability': json['cluster_probability'], 'markdownCitation': json['markdown_citation'] == null ? undefined : json['markdown_citation'], 'provocative': json['provocative'] == null ? undefined : json['provocative'], 'reportingVoice': json['reporting_voice'] == null ? undefined : ReportingVoice1FromJSON(json['reporting_voice']), 'entityRelationGraph': json['entity_relation_graph'] == null ? undefined : GraphRelationshipsFromJSON(json['entity_relation_graph']), 'geoCoordinates': json['geo_coordinates'] == null ? undefined : (mapValues(json['geo_coordinates'], GeoCoordinate1FromJSON)), 'continent': json['continent'] == null ? undefined : json['continent'], 'assets': json['assets'] == null ? undefined : Assets1FromJSON(json['assets']), 'socialEmbeds': json['social_embeds'] == null ? undefined : json['social_embeds'], 'asStringKey': json['as_string_key'], }; } export function SearchResponseDictItem1ToJSON(json: any): SearchResponseDictItem1 { return SearchResponseDictItem1ToJSONTyped(json, false); } export function SearchResponseDictItem1ToJSONTyped(value?: SearchResponseDictItem1 | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'article_url': value['articleUrl'], 'article_id': value['articleId'], 'classification': ClassificationToJSON(value['classification']), 'country': value['country'], 'source_id': value['sourceId'], 'page_rank': value['pageRank'], 'domain_url': value['domainUrl'], 'eng_title': value['engTitle'], 'entities': Entities1ToJSON(value['entities']), 'image_url': value['imageUrl'], 'keywords': value['keywords'], 'language': value['language'], 'pub_date': ((value['pubDate']).toISOString()), 'summary': value['summary'], 'key_points': value['keyPoints'], 'title': value['title'], 'sentiment': value['sentiment'], 'centroid_distance': value['centroidDistance'], 'cluster_probability': value['clusterProbability'], 'markdown_citation': value['markdownCitation'], 'provocative': value['provocative'], 'reporting_voice': ReportingVoice1ToJSON(value['reportingVoice']), 'entity_relation_graph': GraphRelationshipsToJSON(value['entityRelationGraph']), 'geo_coordinates': value['geoCoordinates'] == null ? undefined : (mapValues(value['geoCoordinates'], GeoCoordinate1ToJSON)), 'continent': value['continent'], 'assets': Assets1ToJSON(value['assets']), 'social_embeds': value['socialEmbeds'], 'as_string_key': value['asStringKey'], }; }