/* * 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 BatchErrorData = { code: string; message: string; param?: string | null | undefined; line?: number | null | undefined; }; /** @internal */ export const BatchErrorData$inboundSchema: z.ZodType< BatchErrorData, z.ZodTypeDef, unknown > = z.object({ code: z.string(), message: z.string(), param: z.nullable(z.string()).optional(), line: z.nullable(z.number().int()).optional(), }); /** @internal */ export type BatchErrorData$Outbound = { code: string; message: string; param?: string | null | undefined; line?: number | null | undefined; }; /** @internal */ export const BatchErrorData$outboundSchema: z.ZodType< BatchErrorData$Outbound, z.ZodTypeDef, BatchErrorData > = z.object({ code: z.string(), message: z.string(), param: z.nullable(z.string()).optional(), line: z.nullable(z.number().int()).optional(), }); export function batchErrorDataToJSON(batchErrorData: BatchErrorData): string { return JSON.stringify(BatchErrorData$outboundSchema.parse(batchErrorData)); } export function batchErrorDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BatchErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchErrorData' from JSON`, ); }