/* * 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 ErrorT = { errors?: Array | undefined; }; /** @internal */ export const ErrorT$inboundSchema: z.ZodType = z .object({ errors: z.array(z.string()).optional(), }); /** @internal */ export type ErrorT$Outbound = { errors?: Array | undefined; }; /** @internal */ export const ErrorT$outboundSchema: z.ZodType< ErrorT$Outbound, z.ZodTypeDef, ErrorT > = z.object({ errors: z.array(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ErrorT$ { /** @deprecated use `ErrorT$inboundSchema` instead. */ export const inboundSchema = ErrorT$inboundSchema; /** @deprecated use `ErrorT$outboundSchema` instead. */ export const outboundSchema = ErrorT$outboundSchema; /** @deprecated use `ErrorT$Outbound` instead. */ export type Outbound = ErrorT$Outbound; } export function errorTToJSON(errorT: ErrorT): string { return JSON.stringify(ErrorT$outboundSchema.parse(errorT)); } export function errorTFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorT' from JSON`, ); }