/* tslint:disable */
/* eslint-disable */
/**
 * AskNews API
 * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](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 { AnthropicInputJsonDelta } from './AnthropicInputJsonDelta';
import {
    instanceOfAnthropicInputJsonDelta,
    AnthropicInputJsonDeltaFromJSON,
    AnthropicInputJsonDeltaFromJSONTyped,
    AnthropicInputJsonDeltaToJSON,
} from './AnthropicInputJsonDelta';
import type { AnthropicTextDelta } from './AnthropicTextDelta';
import {
    instanceOfAnthropicTextDelta,
    AnthropicTextDeltaFromJSON,
    AnthropicTextDeltaFromJSONTyped,
    AnthropicTextDeltaToJSON,
} from './AnthropicTextDelta';
import type { AnthropicThinkingDelta } from './AnthropicThinkingDelta';
import {
    instanceOfAnthropicThinkingDelta,
    AnthropicThinkingDeltaFromJSON,
    AnthropicThinkingDeltaFromJSONTyped,
    AnthropicThinkingDeltaToJSON,
} from './AnthropicThinkingDelta';

/**
 * @type Delta1
 * 
 * @export
 */
export type Delta1 = AnthropicInputJsonDelta | AnthropicTextDelta | AnthropicThinkingDelta;

export function Delta1FromJSON(json: any): Delta1 {
    return Delta1FromJSONTyped(json, false);
}

export function Delta1FromJSONTyped(json: any, ignoreDiscriminator: boolean): Delta1 {
    if (json == null) {
        return json;
    }
    if (instanceOfAnthropicInputJsonDelta(json)) {
        return AnthropicInputJsonDeltaFromJSONTyped(json, true);
    }
    if (instanceOfAnthropicTextDelta(json)) {
        return AnthropicTextDeltaFromJSONTyped(json, true);
    }
    if (instanceOfAnthropicThinkingDelta(json)) {
        return AnthropicThinkingDeltaFromJSONTyped(json, true);
    }

    return {} as any;
}

export function Delta1ToJSON(json: any): any {
    return Delta1ToJSONTyped(json, false);
}

export function Delta1ToJSONTyped(value?: Delta1 | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    if (instanceOfAnthropicInputJsonDelta(value)) {
        return AnthropicInputJsonDeltaToJSON(value as AnthropicInputJsonDelta);
    }
    if (instanceOfAnthropicTextDelta(value)) {
        return AnthropicTextDeltaToJSON(value as AnthropicTextDelta);
    }
    if (instanceOfAnthropicThinkingDelta(value)) {
        return AnthropicThinkingDeltaToJSON(value as AnthropicThinkingDelta);
    }

    return {};
}

