/* * 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 UpdateIssuedCardErrorData = { state?: string | undefined; memo?: string | undefined; authorizedUser?: components.CreateAuthorizedUserError | undefined; }; export class UpdateIssuedCardError extends MoovError { state?: string | undefined; memo?: string | undefined; authorizedUser?: components.CreateAuthorizedUserError | undefined; /** The original data that was passed to this error instance. */ data$: UpdateIssuedCardErrorData; constructor( err: UpdateIssuedCardErrorData, 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.state != null) this.state = err.state; if (err.memo != null) this.memo = err.memo; if (err.authorizedUser != null) this.authorizedUser = err.authorizedUser; this.name = "UpdateIssuedCardError"; } } /** @internal */ export const UpdateIssuedCardError$inboundSchema: z.ZodType< UpdateIssuedCardError, z.ZodTypeDef, unknown > = z.object({ state: z.string().optional(), memo: z.string().optional(), authorizedUser: components.CreateAuthorizedUserError$inboundSchema.optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new UpdateIssuedCardError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type UpdateIssuedCardError$Outbound = { state?: string | undefined; memo?: string | undefined; authorizedUser?: components.CreateAuthorizedUserError$Outbound | undefined; }; /** @internal */ export const UpdateIssuedCardError$outboundSchema: z.ZodType< UpdateIssuedCardError$Outbound, z.ZodTypeDef, UpdateIssuedCardError > = z.instanceof(UpdateIssuedCardError) .transform(v => v.data$) .pipe(z.object({ state: z.string().optional(), memo: z.string().optional(), authorizedUser: components.CreateAuthorizedUserError$outboundSchema .optional(), }));