/* * 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 "./errors/sdkvalidationerror.js"; export type APISampleData = { /** * Language of the sample */ language: string; /** * Style of the sample */ style: string; /** * Model of the sample */ model: string; /** * URL to the sample audio file */ url: string; }; /** @internal */ export const APISampleData$inboundSchema: z.ZodType< APISampleData, z.ZodTypeDef, unknown > = z.object({ language: z.string(), style: z.string(), model: z.string(), url: z.string(), }); /** @internal */ export type APISampleData$Outbound = { language: string; style: string; model: string; url: string; }; /** @internal */ export const APISampleData$outboundSchema: z.ZodType< APISampleData$Outbound, z.ZodTypeDef, APISampleData > = z.object({ language: z.string(), style: z.string(), model: z.string(), url: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace APISampleData$ { /** @deprecated use `APISampleData$inboundSchema` instead. */ export const inboundSchema = APISampleData$inboundSchema; /** @deprecated use `APISampleData$outboundSchema` instead. */ export const outboundSchema = APISampleData$outboundSchema; /** @deprecated use `APISampleData$Outbound` instead. */ export type Outbound = APISampleData$Outbound; } export function apiSampleDataToJSON(apiSampleData: APISampleData): string { return JSON.stringify(APISampleData$outboundSchema.parse(apiSampleData)); } export function apiSampleDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => APISampleData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'APISampleData' from JSON`, ); }