@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
113 lines (102 loc) • 3.62 kB
text/typescript
/* 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 type { ContentBlockDeltaEvent } from './ContentBlockDeltaEvent';
import {
instanceOfContentBlockDeltaEvent,
ContentBlockDeltaEventFromJSON,
ContentBlockDeltaEventFromJSONTyped,
ContentBlockDeltaEventToJSON,
} from './ContentBlockDeltaEvent';
import type { ContentBlockStartEvent } from './ContentBlockStartEvent';
import {
instanceOfContentBlockStartEvent,
ContentBlockStartEventFromJSON,
ContentBlockStartEventFromJSONTyped,
ContentBlockStartEventToJSON,
} from './ContentBlockStartEvent';
import type { ContentBlockStopEvent } from './ContentBlockStopEvent';
import {
instanceOfContentBlockStopEvent,
ContentBlockStopEventFromJSON,
ContentBlockStopEventFromJSONTyped,
ContentBlockStopEventToJSON,
} from './ContentBlockStopEvent';
import type { MessageStartEvent } from './MessageStartEvent';
import {
instanceOfMessageStartEvent,
MessageStartEventFromJSON,
MessageStartEventFromJSONTyped,
MessageStartEventToJSON,
} from './MessageStartEvent';
import type { MessageStopEvent } from './MessageStopEvent';
import {
instanceOfMessageStopEvent,
MessageStopEventFromJSON,
MessageStopEventFromJSONTyped,
MessageStopEventToJSON,
} from './MessageStopEvent';
/**
* @type Delta2
*
* @export
*/
export type Delta2 = ContentBlockDeltaEvent | ContentBlockStartEvent | ContentBlockStopEvent | MessageStartEvent | MessageStopEvent;
export function Delta2FromJSON(json: any): Delta2 {
return Delta2FromJSONTyped(json, false);
}
export function Delta2FromJSONTyped(json: any, ignoreDiscriminator: boolean): Delta2 {
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 {} as any;
}
export function Delta2ToJSON(json: any): any {
return Delta2ToJSONTyped(json, false);
}
export function Delta2ToJSONTyped(value?: Delta2 | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
if (instanceOfContentBlockDeltaEvent(value)) {
return ContentBlockDeltaEventToJSON(value as ContentBlockDeltaEvent);
}
if (instanceOfContentBlockStartEvent(value)) {
return ContentBlockStartEventToJSON(value as ContentBlockStartEvent);
}
if (instanceOfContentBlockStopEvent(value)) {
return ContentBlockStopEventToJSON(value as ContentBlockStopEvent);
}
if (instanceOfMessageStartEvent(value)) {
return MessageStartEventToJSON(value as MessageStartEvent);
}
if (instanceOfMessageStopEvent(value)) {
return MessageStopEventToJSON(value as MessageStopEvent);
}
return {};
}