/* * 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 { ValidationItem, ValidationItem$inboundSchema, } from "./validationitem.js"; /** * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. */ export type Validation = { errors?: Array | null | undefined; warnings?: Array | null | undefined; }; /** @internal */ export const Validation$inboundSchema: z.ZodType< Validation, z.ZodTypeDef, unknown > = z.object({ errors: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), warnings: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), }); export function validationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Validation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Validation' from JSON`, ); }