UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
57 lines (56 loc) 1.91 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod) * * The version of the OpenAPI document: 0.24.66 * 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 { DomainQueryArticleItemFromJSON, DomainQueryArticleItemToJSON, } from './DomainQueryArticleItem'; /** * Check if a given object implements the DomainQueryItem interface. */ export function instanceOfDomainQueryItem(value) { if (!('query' in value) || value['query'] === undefined) return false; if (!('coords' in value) || value['coords'] === undefined) return false; if (!('nHits' in value) || value['nHits'] === undefined) return false; if (!('articles' in value) || value['articles'] === undefined) return false; return true; } export function DomainQueryItemFromJSON(json) { return DomainQueryItemFromJSONTyped(json, false); } export function DomainQueryItemFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'query': json['query'], 'coords': json['coords'], 'nHits': json['n_hits'], 'articles': (json['articles'].map(DomainQueryArticleItemFromJSON)), }; } export function DomainQueryItemToJSON(json) { return DomainQueryItemToJSONTyped(json, false); } export function DomainQueryItemToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'query': value['query'], 'coords': value['coords'], 'n_hits': value['nHits'], 'articles': (value['articles'].map(DomainQueryArticleItemToJSON)), }; }