/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 GetEvalSampleAudioRequest = { runId: string; sampleIndex: number; model?: string | undefined; taskId?: string | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const GetEvalSampleAudioRequest$inboundSchema: z.ZodType< GetEvalSampleAudioRequest, z.ZodTypeDef, unknown > = z.object({ run_id: z.string(), sample_index: z.number().int(), model: z.string().optional(), task_id: z.string().optional(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "run_id": "runId", "sample_index": "sampleIndex", "task_id": "taskId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetEvalSampleAudioRequest$Outbound = { run_id: string; sample_index: number; model?: string | undefined; task_id?: string | undefined; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetEvalSampleAudioRequest$outboundSchema: z.ZodType< GetEvalSampleAudioRequest$Outbound, z.ZodTypeDef, GetEvalSampleAudioRequest > = z.object({ runId: z.string(), sampleIndex: z.number().int(), model: z.string().optional(), taskId: z.string().optional(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { runId: "run_id", sampleIndex: "sample_index", taskId: "task_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getEvalSampleAudioRequestToJSON( getEvalSampleAudioRequest: GetEvalSampleAudioRequest, ): string { return JSON.stringify( GetEvalSampleAudioRequest$outboundSchema.parse(getEvalSampleAudioRequest), ); } export function getEvalSampleAudioRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetEvalSampleAudioRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEvalSampleAudioRequest' from JSON`, ); }