/* * 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 { AmountDecimal, AmountDecimal$inboundSchema, AmountDecimal$Outbound, AmountDecimal$outboundSchema, } from "./amountdecimal.js"; /** * A summary of interchange fees by card brand. */ export type BillingSummaryInterchange = { /** * Total interchange fees for Visa. */ visa: AmountDecimal; /** * Total interchange fees for Mastercard. */ mastercard: AmountDecimal; /** * Total interchange fees for Discover. */ discover: AmountDecimal; /** * Total interchange fees for American Express. */ americanExpress: AmountDecimal; }; /** @internal */ export const BillingSummaryInterchange$inboundSchema: z.ZodType< BillingSummaryInterchange, z.ZodTypeDef, unknown > = z.object({ visa: AmountDecimal$inboundSchema, mastercard: AmountDecimal$inboundSchema, discover: AmountDecimal$inboundSchema, americanExpress: AmountDecimal$inboundSchema, }); /** @internal */ export type BillingSummaryInterchange$Outbound = { visa: AmountDecimal$Outbound; mastercard: AmountDecimal$Outbound; discover: AmountDecimal$Outbound; americanExpress: AmountDecimal$Outbound; }; /** @internal */ export const BillingSummaryInterchange$outboundSchema: z.ZodType< BillingSummaryInterchange$Outbound, z.ZodTypeDef, BillingSummaryInterchange > = z.object({ visa: AmountDecimal$outboundSchema, mastercard: AmountDecimal$outboundSchema, discover: AmountDecimal$outboundSchema, americanExpress: AmountDecimal$outboundSchema, }); export function billingSummaryInterchangeToJSON( billingSummaryInterchange: BillingSummaryInterchange, ): string { return JSON.stringify( BillingSummaryInterchange$outboundSchema.parse(billingSummaryInterchange), ); } export function billingSummaryInterchangeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BillingSummaryInterchange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BillingSummaryInterchange' from JSON`, ); }