/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7f5955a97454 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { smartUnion } from "../../types/smartUnion.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Loc = string | number; export type Context = {}; export type ValidationError = { loc: Array; msg: string; type: string; input?: any | undefined; ctx?: Context | undefined; }; /** @internal */ export const Loc$inboundSchema: z.ZodType = smartUnion([ z.string(), z.int(), ]); export function locFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Loc$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Loc' from JSON`, ); } /** @internal */ export const Context$inboundSchema: z.ZodType = z.object({}); export function contextFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Context$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Context' from JSON`, ); } /** @internal */ export const ValidationError$inboundSchema: z.ZodType< ValidationError, unknown > = z.object({ loc: z.array(smartUnion([z.string(), z.int()])), msg: z.string(), type: z.string(), input: z.any().optional(), ctx: z.lazy(() => Context$inboundSchema).optional(), }); export function validationErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ValidationError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValidationError' from JSON`, ); }