UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
48 lines (47 loc) 2.06 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.50 * 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 { DeepNewsReportRequestFromJSONTyped, DeepNewsReportRequestToJSON, } from './DeepNewsReportRequest'; import { LegacyReportRequestFromJSONTyped, LegacyReportRequestToJSON, } from './LegacyReportRequest'; export function CreateAlertRequestReportFromJSON(json) { return CreateAlertRequestReportFromJSONTyped(json, false); } export function CreateAlertRequestReportFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } switch (json['identifier']) { case 'deepnews': return Object.assign({}, DeepNewsReportRequestFromJSONTyped(json, true), { identifier: 'deepnews' }); case 'legacy': return Object.assign({}, LegacyReportRequestFromJSONTyped(json, true), { identifier: 'legacy' }); default: throw new Error(`No variant of CreateAlertRequestReport exists with 'identifier=${json['identifier']}'`); } } export function CreateAlertRequestReportToJSON(json) { return CreateAlertRequestReportToJSONTyped(json, false); } export function CreateAlertRequestReportToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } switch (value['identifier']) { case 'deepnews': return Object.assign({}, DeepNewsReportRequestToJSON(value), { identifier: 'deepnews' }); case 'legacy': return Object.assign({}, LegacyReportRequestToJSON(value), { identifier: 'legacy' }); default: throw new Error(`No variant of CreateAlertRequestReport exists with 'identifier=${value['identifier']}'`); } }