@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
52 lines (51 loc) • 1.8 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.22
* 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 { WebSearchResultFromJSON, WebSearchResultToJSON, } from './WebSearchResult';
import { Offset3FromJSON, Offset3ToJSON, } from './Offset3';
/**
* Check if a given object implements the WebSearchResponse interface.
*/
export function instanceOfWebSearchResponse(value) {
if (!('asString' in value) || value['asString'] === undefined)
return false;
if (!('asDicts' in value) || value['asDicts'] === undefined)
return false;
return true;
}
export function WebSearchResponseFromJSON(json) {
return WebSearchResponseFromJSONTyped(json, false);
}
export function WebSearchResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'asString': json['as_string'],
'asDicts': (json['as_dicts'].map(WebSearchResultFromJSON)),
'offset': json['offset'] == null ? undefined : Offset3FromJSON(json['offset']),
};
}
export function WebSearchResponseToJSON(json) {
return WebSearchResponseToJSONTyped(json, false);
}
export function WebSearchResponseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'as_string': value['asString'],
'as_dicts': (value['asDicts'].map(WebSearchResultToJSON)),
'offset': Offset3ToJSON(value['offset']),
};
}