/* * 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"; import { ErrorValidationItem, ErrorValidationItem$inboundSchema, } from "./errorvalidationitem.js"; /** * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. */ export type ErrorValidation = { errors?: Array | null | undefined; warnings?: Array | null | undefined; }; /** @internal */ export const ErrorValidation$inboundSchema: z.ZodType< ErrorValidation, z.ZodTypeDef, unknown > = z.object({ errors: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), warnings: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), }); export function errorValidationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorValidation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorValidation' from JSON`, ); }