@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
67 lines (66 loc) • 2.67 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.
*/
import { instanceOfContentBlockDeltaEvent, ContentBlockDeltaEventFromJSONTyped, ContentBlockDeltaEventToJSON, } from './ContentBlockDeltaEvent';
import { instanceOfContentBlockStartEvent, ContentBlockStartEventFromJSONTyped, ContentBlockStartEventToJSON, } from './ContentBlockStartEvent';
import { instanceOfContentBlockStopEvent, ContentBlockStopEventFromJSONTyped, ContentBlockStopEventToJSON, } from './ContentBlockStopEvent';
import { instanceOfMessageStartEvent, MessageStartEventFromJSONTyped, MessageStartEventToJSON, } from './MessageStartEvent';
import { instanceOfMessageStopEvent, MessageStopEventFromJSONTyped, MessageStopEventToJSON, } from './MessageStopEvent';
export function Delta2FromJSON(json) {
return Delta2FromJSONTyped(json, false);
}
export function Delta2FromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
if (instanceOfContentBlockDeltaEvent(json)) {
return ContentBlockDeltaEventFromJSONTyped(json, true);
}
if (instanceOfContentBlockStartEvent(json)) {
return ContentBlockStartEventFromJSONTyped(json, true);
}
if (instanceOfContentBlockStopEvent(json)) {
return ContentBlockStopEventFromJSONTyped(json, true);
}
if (instanceOfMessageStartEvent(json)) {
return MessageStartEventFromJSONTyped(json, true);
}
if (instanceOfMessageStopEvent(json)) {
return MessageStopEventFromJSONTyped(json, true);
}
return {};
}
export function Delta2ToJSON(json) {
return Delta2ToJSONTyped(json, false);
}
export function Delta2ToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
if (instanceOfContentBlockDeltaEvent(value)) {
return ContentBlockDeltaEventToJSON(value);
}
if (instanceOfContentBlockStartEvent(value)) {
return ContentBlockStartEventToJSON(value);
}
if (instanceOfContentBlockStopEvent(value)) {
return ContentBlockStopEventToJSON(value);
}
if (instanceOfMessageStartEvent(value)) {
return MessageStartEventToJSON(value);
}
if (instanceOfMessageStopEvent(value)) {
return MessageStopEventToJSON(value);
}
return {};
}