@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
67 lines (66 loc) • 2.72 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.21.1
* 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.GraphResponseToJSONTyped = exports.GraphResponseToJSON = exports.GraphResponseFromJSONTyped = exports.GraphResponseFromJSON = exports.instanceOfGraphResponse = void 0;
const SearchResponseDictItem_1 = require("./SearchResponseDictItem");
/**
* Check if a given object implements the GraphResponse interface.
*/
function instanceOfGraphResponse(value) {
if (!('fullGraph' in value) || value['fullGraph'] === undefined)
return false;
if (!('disambiguations' in value) || value['disambiguations'] === undefined)
return false;
return true;
}
exports.instanceOfGraphResponse = instanceOfGraphResponse;
function GraphResponseFromJSON(json) {
return GraphResponseFromJSONTyped(json, false);
}
exports.GraphResponseFromJSON = GraphResponseFromJSON;
function GraphResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'fullGraph': json['full_graph'],
'disambiguations': json['disambiguations'],
'articles': json['articles'] == null ? undefined : (json['articles'].map(SearchResponseDictItem_1.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'],
};
}
exports.GraphResponseFromJSONTyped = GraphResponseFromJSONTyped;
function GraphResponseToJSON(json) {
return GraphResponseToJSONTyped(json, false);
}
exports.GraphResponseToJSON = GraphResponseToJSON;
function GraphResponseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'full_graph': value['fullGraph'],
'disambiguations': value['disambiguations'],
'articles': value['articles'] == null ? undefined : (value['articles'].map(SearchResponseDictItem_1.SearchResponseDictItemToJSON)),
'query': value['query'],
'docs_enhanced': value['docsEnhanced'],
'triples_url': value['triplesUrl'],
'visualize_url': value['visualizeUrl'],
};
}
exports.GraphResponseToJSONTyped = GraphResponseToJSONTyped;
;