/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import * as components from "../components/index.js"; import { MoovError } from "./mooverror.js"; export type BrandValidationErrorData = { colors?: components.ColorsValidationError | undefined; }; export class BrandValidationError extends MoovError { colors?: components.ColorsValidationError | undefined; /** The original data that was passed to this error instance. */ data$: BrandValidationErrorData; constructor( err: BrandValidationErrorData, 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.colors != null) this.colors = err.colors; this.name = "BrandValidationError"; } } /** @internal */ export const BrandValidationError$inboundSchema: z.ZodType< BrandValidationError, z.ZodTypeDef, unknown > = z.object({ colors: components.ColorsValidationError$inboundSchema.optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new BrandValidationError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type BrandValidationError$Outbound = { colors?: components.ColorsValidationError$Outbound | undefined; }; /** @internal */ export const BrandValidationError$outboundSchema: z.ZodType< BrandValidationError$Outbound, z.ZodTypeDef, BrandValidationError > = z.instanceof(BrandValidationError) .transform(v => v.data$) .pipe(z.object({ colors: components.ColorsValidationError$outboundSchema.optional(), }));