@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
65 lines (64 loc) • 2.46 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomainQueryItemToJSONTyped = exports.DomainQueryItemToJSON = exports.DomainQueryItemFromJSONTyped = exports.DomainQueryItemFromJSON = exports.instanceOfDomainQueryItem = void 0;
const DomainQueryArticleItem_1 = require("./DomainQueryArticleItem");
/**
* Check if a given object implements the DomainQueryItem interface.
*/
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;
}
exports.instanceOfDomainQueryItem = instanceOfDomainQueryItem;
function DomainQueryItemFromJSON(json) {
return DomainQueryItemFromJSONTyped(json, false);
}
exports.DomainQueryItemFromJSON = DomainQueryItemFromJSON;
function DomainQueryItemFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'query': json['query'],
'coords': json['coords'],
'nHits': json['n_hits'],
'articles': (json['articles'].map(DomainQueryArticleItem_1.DomainQueryArticleItemFromJSON)),
};
}
exports.DomainQueryItemFromJSONTyped = DomainQueryItemFromJSONTyped;
function DomainQueryItemToJSON(json) {
return DomainQueryItemToJSONTyped(json, false);
}
exports.DomainQueryItemToJSON = DomainQueryItemToJSON;
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(DomainQueryArticleItem_1.DomainQueryArticleItemToJSON)),
};
}
exports.DomainQueryItemToJSONTyped = DomainQueryItemToJSONTyped;