@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
113 lines (102 loc) • 3.67 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 { ContentBlockDeltaEvent1 } from './ContentBlockDeltaEvent1';
import {
instanceOfContentBlockDeltaEvent1,
ContentBlockDeltaEvent1FromJSON,
ContentBlockDeltaEvent1FromJSONTyped,
ContentBlockDeltaEvent1ToJSON,
} from './ContentBlockDeltaEvent1';
import type { ContentBlockStartEvent1 } from './ContentBlockStartEvent1';
import {
instanceOfContentBlockStartEvent1,
ContentBlockStartEvent1FromJSON,
ContentBlockStartEvent1FromJSONTyped,
ContentBlockStartEvent1ToJSON,
} from './ContentBlockStartEvent1';
import type { ContentBlockStopEvent1 } from './ContentBlockStopEvent1';
import {
instanceOfContentBlockStopEvent1,
ContentBlockStopEvent1FromJSON,
ContentBlockStopEvent1FromJSONTyped,
ContentBlockStopEvent1ToJSON,
} from './ContentBlockStopEvent1';
import type { MessageStartEvent1 } from './MessageStartEvent1';
import {
instanceOfMessageStartEvent1,
MessageStartEvent1FromJSON,
MessageStartEvent1FromJSONTyped,
MessageStartEvent1ToJSON,
} from './MessageStartEvent1';
import type { MessageStopEvent1 } from './MessageStopEvent1';
import {
instanceOfMessageStopEvent1,
MessageStopEvent1FromJSON,
MessageStopEvent1FromJSONTyped,
MessageStopEvent1ToJSON,
} from './MessageStopEvent1';
/**
* @type Delta
*
* @export
*/
export type Delta = ContentBlockDeltaEvent1 | ContentBlockStartEvent1 | ContentBlockStopEvent1 | MessageStartEvent1 | MessageStopEvent1;
export function DeltaFromJSON(json: any): Delta {
return DeltaFromJSONTyped(json, false);
}
export function DeltaFromJSONTyped(json: any, ignoreDiscriminator: boolean): Delta {
if (json == null) {
return json;
}
if (instanceOfContentBlockDeltaEvent1(json)) {
return ContentBlockDeltaEvent1FromJSONTyped(json, true);
}
if (instanceOfContentBlockStartEvent1(json)) {
return ContentBlockStartEvent1FromJSONTyped(json, true);
}
if (instanceOfContentBlockStopEvent1(json)) {
return ContentBlockStopEvent1FromJSONTyped(json, true);
}
if (instanceOfMessageStartEvent1(json)) {
return MessageStartEvent1FromJSONTyped(json, true);
}
if (instanceOfMessageStopEvent1(json)) {
return MessageStopEvent1FromJSONTyped(json, true);
}
return {} as any;
}
export function DeltaToJSON(json: any): any {
return DeltaToJSONTyped(json, false);
}
export function DeltaToJSONTyped(value?: Delta | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
if (instanceOfContentBlockDeltaEvent1(value)) {
return ContentBlockDeltaEvent1ToJSON(value as ContentBlockDeltaEvent1);
}
if (instanceOfContentBlockStartEvent1(value)) {
return ContentBlockStartEvent1ToJSON(value as ContentBlockStartEvent1);
}
if (instanceOfContentBlockStopEvent1(value)) {
return ContentBlockStopEvent1ToJSON(value as ContentBlockStopEvent1);
}
if (instanceOfMessageStartEvent1(value)) {
return MessageStartEvent1ToJSON(value as MessageStartEvent1);
}
if (instanceOfMessageStopEvent1(value)) {
return MessageStopEvent1ToJSON(value as MessageStopEvent1);
}
return {};
}