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