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

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

export type ChatTranscriptionEvent = {
  audioUrl: string;
  model: string;
  responseMessage: { [k: string]: any };
};

/** @internal */
export const ChatTranscriptionEvent$inboundSchema: z.ZodType<
  ChatTranscriptionEvent,
  unknown
> = z.object({
  audio_url: z.string(),
  model: z.string(),
  response_message: z.record(z.string(), z.any()),
}).transform((v) => {
  return remap$(v, {
    "audio_url": "audioUrl",
    "response_message": "responseMessage",
  });
});

export function chatTranscriptionEventFromJSON(
  jsonString: string,
): SafeParseResult<ChatTranscriptionEvent, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ChatTranscriptionEvent$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ChatTranscriptionEvent' from JSON`,
  );
}
