/* * 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 UpsertUnderwritingErrorData = { geographicReach?: string | undefined; businessPresence?: string | undefined; pendingLitigation?: string | undefined; volumeShareByCustomerType?: | components.VolumeShareByCustomerTypeError | undefined; collectFunds?: components.CollectFundsError | undefined; moneyTransfer?: components.MoneyTransferError | undefined; sendFunds?: components.SendFundsError | undefined; averageMonthlyTransactionVolume?: string | undefined; error?: string | undefined; averageTransactionSize?: string | undefined; maxTransactionSize?: string | undefined; volumeByCustomerType?: components.VolumeByCustomerTypeError | undefined; cardVolumeDistribution?: components.CardVolumeDistributionError | undefined; fulfillment?: components.FulfillmentDetailsError | undefined; }; export class UpsertUnderwritingError extends MoovError { geographicReach?: string | undefined; businessPresence?: string | undefined; pendingLitigation?: string | undefined; volumeShareByCustomerType?: | components.VolumeShareByCustomerTypeError | undefined; collectFunds?: components.CollectFundsError | undefined; moneyTransfer?: components.MoneyTransferError | undefined; sendFunds?: components.SendFundsError | undefined; averageMonthlyTransactionVolume?: string | undefined; error?: string | undefined; averageTransactionSize?: string | undefined; maxTransactionSize?: string | undefined; volumeByCustomerType?: components.VolumeByCustomerTypeError | undefined; cardVolumeDistribution?: components.CardVolumeDistributionError | undefined; fulfillment?: components.FulfillmentDetailsError | undefined; /** The original data that was passed to this error instance. */ data$: UpsertUnderwritingErrorData; constructor( err: UpsertUnderwritingErrorData, 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.geographicReach != null) this.geographicReach = err.geographicReach; if (err.businessPresence != null) { this.businessPresence = err.businessPresence; } if (err.pendingLitigation != null) { this.pendingLitigation = err.pendingLitigation; } if (err.volumeShareByCustomerType != null) { this.volumeShareByCustomerType = err.volumeShareByCustomerType; } if (err.collectFunds != null) this.collectFunds = err.collectFunds; if (err.moneyTransfer != null) this.moneyTransfer = err.moneyTransfer; if (err.sendFunds != null) this.sendFunds = err.sendFunds; if (err.averageMonthlyTransactionVolume != null) { this.averageMonthlyTransactionVolume = err.averageMonthlyTransactionVolume; } if (err.error != null) this.error = err.error; if (err.averageTransactionSize != null) { this.averageTransactionSize = err.averageTransactionSize; } if (err.maxTransactionSize != null) { this.maxTransactionSize = err.maxTransactionSize; } if (err.volumeByCustomerType != null) { this.volumeByCustomerType = err.volumeByCustomerType; } if (err.cardVolumeDistribution != null) { this.cardVolumeDistribution = err.cardVolumeDistribution; } if (err.fulfillment != null) this.fulfillment = err.fulfillment; this.name = "UpsertUnderwritingError"; } } /** @internal */ export const UpsertUnderwritingError$inboundSchema: z.ZodType< UpsertUnderwritingError, z.ZodTypeDef, unknown > = z.object({ geographicReach: z.string().optional(), businessPresence: z.string().optional(), pendingLitigation: z.string().optional(), volumeShareByCustomerType: components .VolumeShareByCustomerTypeError$inboundSchema.optional(), collectFunds: components.CollectFundsError$inboundSchema.optional(), moneyTransfer: components.MoneyTransferError$inboundSchema.optional(), sendFunds: components.SendFundsError$inboundSchema.optional(), averageMonthlyTransactionVolume: z.string().optional(), error: z.string().optional(), averageTransactionSize: z.string().optional(), maxTransactionSize: z.string().optional(), volumeByCustomerType: components.VolumeByCustomerTypeError$inboundSchema .optional(), cardVolumeDistribution: components.CardVolumeDistributionError$inboundSchema .optional(), fulfillment: components.FulfillmentDetailsError$inboundSchema.optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new UpsertUnderwritingError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type UpsertUnderwritingError$Outbound = { geographicReach?: string | undefined; businessPresence?: string | undefined; pendingLitigation?: string | undefined; volumeShareByCustomerType?: | components.VolumeShareByCustomerTypeError$Outbound | undefined; collectFunds?: components.CollectFundsError$Outbound | undefined; moneyTransfer?: components.MoneyTransferError$Outbound | undefined; sendFunds?: components.SendFundsError$Outbound | undefined; averageMonthlyTransactionVolume?: string | undefined; error?: string | undefined; averageTransactionSize?: string | undefined; maxTransactionSize?: string | undefined; volumeByCustomerType?: | components.VolumeByCustomerTypeError$Outbound | undefined; cardVolumeDistribution?: | components.CardVolumeDistributionError$Outbound | undefined; fulfillment?: components.FulfillmentDetailsError$Outbound | undefined; }; /** @internal */ export const UpsertUnderwritingError$outboundSchema: z.ZodType< UpsertUnderwritingError$Outbound, z.ZodTypeDef, UpsertUnderwritingError > = z.instanceof(UpsertUnderwritingError) .transform(v => v.data$) .pipe(z.object({ geographicReach: z.string().optional(), businessPresence: z.string().optional(), pendingLitigation: z.string().optional(), volumeShareByCustomerType: components .VolumeShareByCustomerTypeError$outboundSchema.optional(), collectFunds: components.CollectFundsError$outboundSchema.optional(), moneyTransfer: components.MoneyTransferError$outboundSchema.optional(), sendFunds: components.SendFundsError$outboundSchema.optional(), averageMonthlyTransactionVolume: z.string().optional(), error: z.string().optional(), averageTransactionSize: z.string().optional(), maxTransactionSize: z.string().optional(), volumeByCustomerType: components.VolumeByCustomerTypeError$outboundSchema .optional(), cardVolumeDistribution: components .CardVolumeDistributionError$outboundSchema.optional(), fulfillment: components.FulfillmentDetailsError$outboundSchema.optional(), }));