/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { BusinessPresence, BusinessPresence$inboundSchema, BusinessPresence$outboundSchema, } from "./businesspresence.js"; import { CardVolumeDistribution, CardVolumeDistribution$inboundSchema, CardVolumeDistribution$Outbound, CardVolumeDistribution$outboundSchema, } from "./cardvolumedistribution.js"; import { CollectFunds, CollectFunds$inboundSchema, CollectFunds$Outbound, CollectFunds$outboundSchema, } from "./collectfunds.js"; import { FulfillmentDetails, FulfillmentDetails$inboundSchema, FulfillmentDetails$Outbound, FulfillmentDetails$outboundSchema, } from "./fulfillmentdetails.js"; import { GeographicReach, GeographicReach$inboundSchema, GeographicReach$outboundSchema, } from "./geographicreach.js"; import { MoneyTransfer, MoneyTransfer$inboundSchema, MoneyTransfer$Outbound, MoneyTransfer$outboundSchema, } from "./moneytransfer.js"; import { PendingLitigation, PendingLitigation$inboundSchema, PendingLitigation$outboundSchema, } from "./pendinglitigation.js"; import { SendFunds, SendFunds$inboundSchema, SendFunds$Outbound, SendFunds$outboundSchema, } from "./sendfunds.js"; import { UnderwritingStatus, UnderwritingStatus$inboundSchema, UnderwritingStatus$outboundSchema, } from "./underwritingstatus.js"; import { VolumeByCustomerType, VolumeByCustomerType$inboundSchema, VolumeByCustomerType$Outbound, VolumeByCustomerType$outboundSchema, } from "./volumebycustomertype.js"; import { VolumeShareByCustomerType, VolumeShareByCustomerType$inboundSchema, VolumeShareByCustomerType$Outbound, VolumeShareByCustomerType$outboundSchema, } from "./volumesharebycustomertype.js"; /** * Describes underwriting values (in USD) used for card payment acceptance. */ export type Underwriting = { averageTransactionSize?: number | undefined; maxTransactionSize?: number | undefined; averageMonthlyTransactionVolume?: number | undefined; /** * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ status?: UnderwritingStatus | undefined; volumeByCustomerType?: VolumeByCustomerType | undefined; cardVolumeDistribution?: CardVolumeDistribution | undefined; fulfillment?: FulfillmentDetails | undefined; geographicReach?: GeographicReach | undefined; businessPresence?: BusinessPresence | undefined; pendingLitigation?: PendingLitigation | undefined; volumeShareByCustomerType?: VolumeShareByCustomerType | undefined; collectFunds?: CollectFunds | undefined; moneyTransfer?: MoneyTransfer | undefined; sendFunds?: SendFunds | undefined; }; /** @internal */ export const Underwriting$inboundSchema: z.ZodType< Underwriting, z.ZodTypeDef, unknown > = z.object({ averageTransactionSize: z.number().int().optional(), maxTransactionSize: z.number().int().optional(), averageMonthlyTransactionVolume: z.number().int().optional(), status: UnderwritingStatus$inboundSchema.optional(), volumeByCustomerType: VolumeByCustomerType$inboundSchema.optional(), cardVolumeDistribution: CardVolumeDistribution$inboundSchema.optional(), fulfillment: FulfillmentDetails$inboundSchema.optional(), geographicReach: GeographicReach$inboundSchema.optional(), businessPresence: BusinessPresence$inboundSchema.optional(), pendingLitigation: PendingLitigation$inboundSchema.optional(), volumeShareByCustomerType: VolumeShareByCustomerType$inboundSchema.optional(), collectFunds: CollectFunds$inboundSchema.optional(), moneyTransfer: MoneyTransfer$inboundSchema.optional(), sendFunds: SendFunds$inboundSchema.optional(), }); /** @internal */ export type Underwriting$Outbound = { averageTransactionSize?: number | undefined; maxTransactionSize?: number | undefined; averageMonthlyTransactionVolume?: number | undefined; status?: string | undefined; volumeByCustomerType?: VolumeByCustomerType$Outbound | undefined; cardVolumeDistribution?: CardVolumeDistribution$Outbound | undefined; fulfillment?: FulfillmentDetails$Outbound | undefined; geographicReach?: string | undefined; businessPresence?: string | undefined; pendingLitigation?: string | undefined; volumeShareByCustomerType?: VolumeShareByCustomerType$Outbound | undefined; collectFunds?: CollectFunds$Outbound | undefined; moneyTransfer?: MoneyTransfer$Outbound | undefined; sendFunds?: SendFunds$Outbound | undefined; }; /** @internal */ export const Underwriting$outboundSchema: z.ZodType< Underwriting$Outbound, z.ZodTypeDef, Underwriting > = z.object({ averageTransactionSize: z.number().int().optional(), maxTransactionSize: z.number().int().optional(), averageMonthlyTransactionVolume: z.number().int().optional(), status: UnderwritingStatus$outboundSchema.optional(), volumeByCustomerType: VolumeByCustomerType$outboundSchema.optional(), cardVolumeDistribution: CardVolumeDistribution$outboundSchema.optional(), fulfillment: FulfillmentDetails$outboundSchema.optional(), geographicReach: GeographicReach$outboundSchema.optional(), businessPresence: BusinessPresence$outboundSchema.optional(), pendingLitigation: PendingLitigation$outboundSchema.optional(), volumeShareByCustomerType: VolumeShareByCustomerType$outboundSchema .optional(), collectFunds: CollectFunds$outboundSchema.optional(), moneyTransfer: MoneyTransfer$outboundSchema.optional(), sendFunds: SendFunds$outboundSchema.optional(), }); export function underwritingToJSON(underwriting: Underwriting): string { return JSON.stringify(Underwriting$outboundSchema.parse(underwriting)); } export function underwritingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Underwriting$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Underwriting' from JSON`, ); }