UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
58 lines (57 loc) 2.47 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.19.10 * 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 { EmailActionFromJSONTyped, EmailActionToJSON, } from './EmailAction'; import { GoogleDocsActionFromJSONTyped, GoogleDocsActionToJSON, } from './GoogleDocsAction'; import { ResendBroadcastActionFromJSONTyped, ResendBroadcastActionToJSON, } from './ResendBroadcastAction'; import { WebhookActionFromJSONTyped, WebhookActionToJSON, } from './WebhookAction'; export function TriggersInnerFromJSON(json) { return TriggersInnerFromJSONTyped(json, false); } export function TriggersInnerFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } switch (json['action']) { case 'email': return Object.assign({}, EmailActionFromJSONTyped(json, true), { action: 'email' }); case 'google_docs': return Object.assign({}, GoogleDocsActionFromJSONTyped(json, true), { action: 'google_docs' }); case 'resend_broadcast': return Object.assign({}, ResendBroadcastActionFromJSONTyped(json, true), { action: 'resend_broadcast' }); case 'webhook': return Object.assign({}, WebhookActionFromJSONTyped(json, true), { action: 'webhook' }); default: throw new Error(`No variant of TriggersInner exists with 'action=${json['action']}'`); } } export function TriggersInnerToJSON(json) { return TriggersInnerToJSONTyped(json, false); } export function TriggersInnerToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } switch (value['action']) { case 'email': return Object.assign({}, EmailActionToJSON(value), { action: 'email' }); case 'google_docs': return Object.assign({}, GoogleDocsActionToJSON(value), { action: 'google_docs' }); case 'resend_broadcast': return Object.assign({}, ResendBroadcastActionToJSON(value), { action: 'resend_broadcast' }); case 'webhook': return Object.assign({}, WebhookActionToJSON(value), { action: 'webhook' }); default: throw new Error(`No variant of TriggersInner exists with 'action=${value['action']}'`); } }