/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; import { TranscriptionResponse, TranscriptionResponse$inboundSchema, TranscriptionResponse$Outbound, TranscriptionResponse$outboundSchema, } from "./transcriptionresponse.js"; import { TranscriptionVerboseResponse, TranscriptionVerboseResponse$inboundSchema, TranscriptionVerboseResponse$Outbound, TranscriptionVerboseResponse$outboundSchema, } from "./transcriptionverboseresponse.js"; /** * Successful Response */ export type TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost = | TranscriptionResponse | TranscriptionVerboseResponse; /** @internal */ export const TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$inboundSchema: z.ZodType< TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost, z.ZodTypeDef, unknown > = z.union([ TranscriptionResponse$inboundSchema, TranscriptionVerboseResponse$inboundSchema, ]); /** @internal */ export type TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$Outbound = | TranscriptionResponse$Outbound | TranscriptionVerboseResponse$Outbound; /** @internal */ export const TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$outboundSchema: z.ZodType< TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$Outbound, z.ZodTypeDef, TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost > = z.union([ TranscriptionResponse$outboundSchema, TranscriptionVerboseResponse$outboundSchema, ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$ { /** @deprecated use `TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$inboundSchema` instead. */ export const inboundSchema = TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$inboundSchema; /** @deprecated use `TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$outboundSchema` instead. */ export const outboundSchema = TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$outboundSchema; /** @deprecated use `TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$Outbound` instead. */ export type Outbound = TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$Outbound; } export function translationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPostToJSON( translationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost: TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost, ): string { return JSON.stringify( TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$outboundSchema .parse( translationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost, ), ); } export function translationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPostFromJSON( jsonString: string, ): SafeParseResult< TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost, SDKValidationError > { return safeParse( jsonString, (x) => TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'TranslationsV1AudioTranslationsPostResponseTranslationsV1AudioTranslationsPost' from JSON`, ); }