UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
72 lines (71 loc) 2.58 kB
"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.WebSearchResult1ToJSONTyped = exports.WebSearchResult1ToJSON = exports.WebSearchResult1FromJSONTyped = exports.WebSearchResult1FromJSON = exports.instanceOfWebSearchResult1 = void 0; /** * Check if a given object implements the WebSearchResult1 interface. */ function instanceOfWebSearchResult1(value) { if (!('title' in value) || value['title'] === undefined) return false; if (!('url' in value) || value['url'] === undefined) return false; if (!('source' in value) || value['source'] === undefined) return false; if (!('published' in value) || value['published'] === undefined) return false; if (!('keyPoints' in value) || value['keyPoints'] === undefined) return false; return true; } exports.instanceOfWebSearchResult1 = instanceOfWebSearchResult1; function WebSearchResult1FromJSON(json) { return WebSearchResult1FromJSONTyped(json, false); } exports.WebSearchResult1FromJSON = WebSearchResult1FromJSON; function WebSearchResult1FromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'title': json['title'], 'url': json['url'], 'source': json['source'], 'published': json['published'], 'keyPoints': json['key_points'], 'rawText': json['raw_text'] == null ? undefined : json['raw_text'], 'asStringKey': json['as_string_key'] == null ? undefined : json['as_string_key'], }; } exports.WebSearchResult1FromJSONTyped = WebSearchResult1FromJSONTyped; function WebSearchResult1ToJSON(json) { return WebSearchResult1ToJSONTyped(json, false); } exports.WebSearchResult1ToJSON = WebSearchResult1ToJSON; function WebSearchResult1ToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'title': value['title'], 'url': value['url'], 'source': value['source'], 'published': value['published'], 'key_points': value['keyPoints'], 'raw_text': value['rawText'], 'as_string_key': value['asStringKey'], }; } exports.WebSearchResult1ToJSONTyped = WebSearchResult1ToJSONTyped;