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

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 RealtimeTranscriptionInputAudioEnd = {
  type?: "input_audio.end" | undefined;
};

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

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

export function realtimeTranscriptionInputAudioEndToJSON(
  realtimeTranscriptionInputAudioEnd: RealtimeTranscriptionInputAudioEnd,
): string {
  return JSON.stringify(
    RealtimeTranscriptionInputAudioEnd$outboundSchema.parse(
      realtimeTranscriptionInputAudioEnd,
    ),
  );
}
export function realtimeTranscriptionInputAudioEndFromJSON(
  jsonString: string,
): SafeParseResult<RealtimeTranscriptionInputAudioEnd, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      RealtimeTranscriptionInputAudioEnd$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'RealtimeTranscriptionInputAudioEnd' from JSON`,
  );
}
