/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type RealtimeTranscriptionInputAudioFlush = {
  type?: "input_audio.flush" | undefined;
};

/** @internal */
export const RealtimeTranscriptionInputAudioFlush$inboundSchema: z.ZodType<
  RealtimeTranscriptionInputAudioFlush,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: z.literal("input_audio.flush").default("input_audio.flush"),
});
/** @internal */
export type RealtimeTranscriptionInputAudioFlush$Outbound = {
  type: "input_audio.flush";
};

/** @internal */
export const RealtimeTranscriptionInputAudioFlush$outboundSchema: z.ZodType<
  RealtimeTranscriptionInputAudioFlush$Outbound,
  z.ZodTypeDef,
  RealtimeTranscriptionInputAudioFlush
> = z.object({
  type: z.literal("input_audio.flush").default("input_audio.flush" as const),
});

export function realtimeTranscriptionInputAudioFlushToJSON(
  realtimeTranscriptionInputAudioFlush: RealtimeTranscriptionInputAudioFlush,
): string {
  return JSON.stringify(
    RealtimeTranscriptionInputAudioFlush$outboundSchema.parse(
      realtimeTranscriptionInputAudioFlush,
    ),
  );
}
export function realtimeTranscriptionInputAudioFlushFromJSON(
  jsonString: string,
): SafeParseResult<RealtimeTranscriptionInputAudioFlush, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      RealtimeTranscriptionInputAudioFlush$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'RealtimeTranscriptionInputAudioFlush' from JSON`,
  );
}
