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