/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { MoovError } from "./mooverror.js"; export type CreateWalletValidationErrorData = { name?: string | undefined; description?: string | undefined; metadata?: string | undefined; }; export class CreateWalletValidationError extends MoovError { description?: string | undefined; metadata?: string | undefined; /** The original data that was passed to this error instance. */ data$: CreateWalletValidationErrorData; constructor( err: CreateWalletValidationErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.description != null) this.description = err.description; if (err.metadata != null) this.metadata = err.metadata; this.name = "CreateWalletValidationError"; } } /** @internal */ export const CreateWalletValidationError$inboundSchema: z.ZodType< CreateWalletValidationError, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), description: z.string().optional(), metadata: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new CreateWalletValidationError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type CreateWalletValidationError$Outbound = { name?: string | undefined; description?: string | undefined; metadata?: string | undefined; }; /** @internal */ export const CreateWalletValidationError$outboundSchema: z.ZodType< CreateWalletValidationError$Outbound, z.ZodTypeDef, CreateWalletValidationError > = z.instanceof(CreateWalletValidationError) .transform(v => v.data$) .pipe(z.object({ name: z.string().optional(), description: z.string().optional(), metadata: z.string().optional(), }));