UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
124 lines (112 loc) 3.6 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 { SearchResponseDictItem } from './SearchResponseDictItem'; import { SearchResponseDictItemFromJSON, SearchResponseDictItemFromJSONTyped, SearchResponseDictItemToJSON, SearchResponseDictItemToJSONTyped, } from './SearchResponseDictItem'; /** * * @export * @interface GraphResponse */ export interface GraphResponse { /** * * @type {{ [key: string]: any; }} * @memberof GraphResponse */ fullGraph: { [key: string]: any; }; /** * * @type {Array<{ [key: string]: any; } | null>} * @memberof GraphResponse */ disambiguations: Array<{ [key: string]: any; } | null>; /** * * @type {Array<SearchResponseDictItem>} * @memberof GraphResponse */ articles?: Array<SearchResponseDictItem> | null; /** * * @type {string} * @memberof GraphResponse */ query?: string | null; /** * * @type {Array<{ [key: string]: any; }>} * @memberof GraphResponse */ docsEnhanced?: Array<{ [key: string]: any; }> | null; /** * * @type {string} * @memberof GraphResponse */ triplesUrl?: string | null; /** * * @type {string} * @memberof GraphResponse */ visualizeUrl?: string | null; } /** * Check if a given object implements the GraphResponse interface. */ export function instanceOfGraphResponse(value: object): value is GraphResponse { if (!('fullGraph' in value) || value['fullGraph'] === undefined) return false; if (!('disambiguations' in value) || value['disambiguations'] === undefined) return false; return true; } export function GraphResponseFromJSON(json: any): GraphResponse { return GraphResponseFromJSONTyped(json, false); } export function GraphResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GraphResponse { if (json == null) { return json; } return { 'fullGraph': json['full_graph'], 'disambiguations': json['disambiguations'], 'articles': json['articles'] == null ? undefined : ((json['articles'] as Array<any>).map(SearchResponseDictItemFromJSON)), 'query': json['query'] == null ? undefined : json['query'], 'docsEnhanced': json['docs_enhanced'] == null ? undefined : json['docs_enhanced'], 'triplesUrl': json['triples_url'] == null ? undefined : json['triples_url'], 'visualizeUrl': json['visualize_url'] == null ? undefined : json['visualize_url'], }; } export function GraphResponseToJSON(json: any): GraphResponse { return GraphResponseToJSONTyped(json, false); } export function GraphResponseToJSONTyped(value?: GraphResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'full_graph': value['fullGraph'], 'disambiguations': value['disambiguations'], 'articles': value['articles'] == null ? undefined : ((value['articles'] as Array<any>).map(SearchResponseDictItemToJSON)), 'query': value['query'], 'docs_enhanced': value['docsEnhanced'], 'triples_url': value['triplesUrl'], 'visualize_url': value['visualizeUrl'], }; }