@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
55 lines (54 loc) • 2.41 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Report1AnyOfToJSONTyped = exports.Report1AnyOfToJSON = exports.Report1AnyOfFromJSONTyped = exports.Report1AnyOfFromJSON = void 0;
const DeepNewsReportRequest_1 = require("./DeepNewsReportRequest");
const LegacyReportRequest_1 = require("./LegacyReportRequest");
function Report1AnyOfFromJSON(json) {
return Report1AnyOfFromJSONTyped(json, false);
}
exports.Report1AnyOfFromJSON = Report1AnyOfFromJSON;
function Report1AnyOfFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
switch (json['identifier']) {
case 'deepnews':
return Object.assign({}, (0, DeepNewsReportRequest_1.DeepNewsReportRequestFromJSONTyped)(json, true), { identifier: 'deepnews' });
case 'legacy':
return Object.assign({}, (0, LegacyReportRequest_1.LegacyReportRequestFromJSONTyped)(json, true), { identifier: 'legacy' });
default:
throw new Error(`No variant of Report1AnyOf exists with 'identifier=${json['identifier']}'`);
}
}
exports.Report1AnyOfFromJSONTyped = Report1AnyOfFromJSONTyped;
function Report1AnyOfToJSON(json) {
return Report1AnyOfToJSONTyped(json, false);
}
exports.Report1AnyOfToJSON = Report1AnyOfToJSON;
function Report1AnyOfToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
switch (value['identifier']) {
case 'deepnews':
return Object.assign({}, (0, DeepNewsReportRequest_1.DeepNewsReportRequestToJSON)(value), { identifier: 'deepnews' });
case 'legacy':
return Object.assign({}, (0, LegacyReportRequest_1.LegacyReportRequestToJSON)(value), { identifier: 'legacy' });
default:
throw new Error(`No variant of Report1AnyOf exists with 'identifier=${value['identifier']}'`);
}
}
exports.Report1AnyOfToJSONTyped = Report1AnyOfToJSONTyped;