UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
50 lines (49 loc) 1.84 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.18.6 * 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 { AskNewsSourceFromJSONTyped, AskNewsSourceToJSON, } from './AskNewsSource'; import { BlueskySourceFromJSONTyped, BlueskySourceToJSON, } from './BlueskySource'; import { TelegramSourceFromJSONTyped, TelegramSourceToJSON, } from './TelegramSource'; export function SourcesInnerFromJSON(json) { return SourcesInnerFromJSONTyped(json, false); } export function SourcesInnerFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } switch (json['identifier']) { case 'asknews': return Object.assign({}, AskNewsSourceFromJSONTyped(json, true), { identifier: 'asknews' }); case 'bluesky': return Object.assign({}, BlueskySourceFromJSONTyped(json, true), { identifier: 'bluesky' }); case 'telegram': return Object.assign({}, TelegramSourceFromJSONTyped(json, true), { identifier: 'telegram' }); default: throw new Error(`No variant of SourcesInner exists with 'identifier=${json['identifier']}'`); } } export function SourcesInnerToJSON(value) { if (value == null) { return value; } switch (value['identifier']) { case 'asknews': return AskNewsSourceToJSON(value); case 'bluesky': return BlueskySourceToJSON(value); case 'telegram': return TelegramSourceToJSON(value); default: throw new Error(`No variant of SourcesInner exists with 'identifier=${value['identifier']}'`); } }