/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type FineTuningError = { code: string; message: string; param?: string | null | undefined; }; /** @internal */ export const FineTuningError$inboundSchema: z.ZodType< FineTuningError, z.ZodTypeDef, unknown > = z.object({ code: z.string(), message: z.string(), param: z.nullable(z.string()).optional(), }); /** @internal */ export type FineTuningError$Outbound = { code: string; message: string; param?: string | null | undefined; }; /** @internal */ export const FineTuningError$outboundSchema: z.ZodType< FineTuningError$Outbound, z.ZodTypeDef, FineTuningError > = z.object({ code: z.string(), message: z.string(), param: z.nullable(z.string()).optional(), }); export function fineTuningErrorToJSON( fineTuningError: FineTuningError, ): string { return JSON.stringify(FineTuningError$outboundSchema.parse(fineTuningError)); } export function fineTuningErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FineTuningError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FineTuningError' from JSON`, ); }