@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
119 lines (108 loc) • 3.05 kB
text/typescript
/* 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';
/**
*
* @export
* @interface WebSearchResult1
*/
export interface WebSearchResult1 {
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
title: string;
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
url: string;
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
source: string;
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
published: string;
/**
*
* @type {Array<string | null>}
* @memberof WebSearchResult1
*/
keyPoints: Array<string | null>;
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
rawText?: string;
/**
*
* @type {string}
* @memberof WebSearchResult1
*/
asStringKey?: string | null;
}
/**
* Check if a given object implements the WebSearchResult1 interface.
*/
export function instanceOfWebSearchResult1(value: object): value is WebSearchResult1 {
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;
}
export function WebSearchResult1FromJSON(json: any): WebSearchResult1 {
return WebSearchResult1FromJSONTyped(json, false);
}
export function WebSearchResult1FromJSONTyped(json: any, ignoreDiscriminator: boolean): WebSearchResult1 {
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'],
};
}
export function WebSearchResult1ToJSON(json: any): WebSearchResult1 {
return WebSearchResult1ToJSONTyped(json, false);
}
export function WebSearchResult1ToJSONTyped(value?: WebSearchResult1 | null, ignoreDiscriminator: boolean = false): any {
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'],
};
}