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