/* * 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 { CardVolumeDistribution, CardVolumeDistribution$inboundSchema, CardVolumeDistribution$Outbound, CardVolumeDistribution$outboundSchema, } from "./cardvolumedistribution.js"; import { FulfillmentDetails, FulfillmentDetails$inboundSchema, FulfillmentDetails$Outbound, FulfillmentDetails$outboundSchema, } from "./fulfillmentdetails.js"; import { VolumeByCustomerType, VolumeByCustomerType$inboundSchema, VolumeByCustomerType$Outbound, VolumeByCustomerType$outboundSchema, } from "./volumebycustomertype.js"; export type UpdateUnderwriting = { averageTransactionSize: number; maxTransactionSize: number; averageMonthlyTransactionVolume: number; volumeByCustomerType: VolumeByCustomerType; cardVolumeDistribution: CardVolumeDistribution; fulfillment: FulfillmentDetails; }; /** @internal */ export const UpdateUnderwriting$inboundSchema: z.ZodType< UpdateUnderwriting, z.ZodTypeDef, unknown > = z.object({ averageTransactionSize: z.number().int(), maxTransactionSize: z.number().int(), averageMonthlyTransactionVolume: z.number().int(), volumeByCustomerType: VolumeByCustomerType$inboundSchema, cardVolumeDistribution: CardVolumeDistribution$inboundSchema, fulfillment: FulfillmentDetails$inboundSchema, }); /** @internal */ export type UpdateUnderwriting$Outbound = { averageTransactionSize: number; maxTransactionSize: number; averageMonthlyTransactionVolume: number; volumeByCustomerType: VolumeByCustomerType$Outbound; cardVolumeDistribution: CardVolumeDistribution$Outbound; fulfillment: FulfillmentDetails$Outbound; }; /** @internal */ export const UpdateUnderwriting$outboundSchema: z.ZodType< UpdateUnderwriting$Outbound, z.ZodTypeDef, UpdateUnderwriting > = z.object({ averageTransactionSize: z.number().int(), maxTransactionSize: z.number().int(), averageMonthlyTransactionVolume: z.number().int(), volumeByCustomerType: VolumeByCustomerType$outboundSchema, cardVolumeDistribution: CardVolumeDistribution$outboundSchema, fulfillment: FulfillmentDetails$outboundSchema, }); export function updateUnderwritingToJSON( updateUnderwriting: UpdateUnderwriting, ): string { return JSON.stringify( UpdateUnderwriting$outboundSchema.parse(updateUnderwriting), ); } export function updateUnderwritingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateUnderwriting$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateUnderwriting' from JSON`, ); }