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

import * as z from "zod/v4";
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,
  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,
  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`,
  );
}
