/* * 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 { BillingCountAndAmount, BillingCountAndAmount$inboundSchema, BillingCountAndAmount$Outbound, BillingCountAndAmount$outboundSchema, } from "./billingcountandamount.js"; /** * A detailed breakdown of other card-related fees. */ export type OtherCardFees = { /** * Fees for disputes. */ disputes: BillingCountAndAmount; /** * Fees for card account updater services. */ cardAccountUpdater: BillingCountAndAmount; /** * Fees for card verification. */ cardVerification: BillingCountAndAmount; /** * Fees for name verification. */ nameVerification: BillingCountAndAmount; /** * Total other card fees. */ total: BillingCountAndAmount; }; /** @internal */ export const OtherCardFees$inboundSchema: z.ZodType< OtherCardFees, z.ZodTypeDef, unknown > = z.object({ disputes: BillingCountAndAmount$inboundSchema, cardAccountUpdater: BillingCountAndAmount$inboundSchema, cardVerification: BillingCountAndAmount$inboundSchema, nameVerification: BillingCountAndAmount$inboundSchema, total: BillingCountAndAmount$inboundSchema, }); /** @internal */ export type OtherCardFees$Outbound = { disputes: BillingCountAndAmount$Outbound; cardAccountUpdater: BillingCountAndAmount$Outbound; cardVerification: BillingCountAndAmount$Outbound; nameVerification: BillingCountAndAmount$Outbound; total: BillingCountAndAmount$Outbound; }; /** @internal */ export const OtherCardFees$outboundSchema: z.ZodType< OtherCardFees$Outbound, z.ZodTypeDef, OtherCardFees > = z.object({ disputes: BillingCountAndAmount$outboundSchema, cardAccountUpdater: BillingCountAndAmount$outboundSchema, cardVerification: BillingCountAndAmount$outboundSchema, nameVerification: BillingCountAndAmount$outboundSchema, total: BillingCountAndAmount$outboundSchema, }); export function otherCardFeesToJSON(otherCardFees: OtherCardFees): string { return JSON.stringify(OtherCardFees$outboundSchema.parse(otherCardFees)); } export function otherCardFeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OtherCardFees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OtherCardFees' from JSON`, ); }