/* * 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"; /** * Monthly partner costs that are charged separately and not included in residual subtotal (e.g. platform fees, minimums). */ export type PartnerFees = { /** * The minimum spending amount that must be met in the billing period. If actual usage is below the minimum amount, account is charged the difference. */ minimumCommitment: AmountDecimal; /** * Fixed recurring fee for the billing period regardless of usage. */ monthlyPlatform: AmountDecimal; /** * Total partner fees. */ total: AmountDecimal; }; /** @internal */ export const PartnerFees$inboundSchema: z.ZodType< PartnerFees, z.ZodTypeDef, unknown > = z.object({ minimumCommitment: AmountDecimal$inboundSchema, monthlyPlatform: AmountDecimal$inboundSchema, total: AmountDecimal$inboundSchema, }); /** @internal */ export type PartnerFees$Outbound = { minimumCommitment: AmountDecimal$Outbound; monthlyPlatform: AmountDecimal$Outbound; total: AmountDecimal$Outbound; }; /** @internal */ export const PartnerFees$outboundSchema: z.ZodType< PartnerFees$Outbound, z.ZodTypeDef, PartnerFees > = z.object({ minimumCommitment: AmountDecimal$outboundSchema, monthlyPlatform: AmountDecimal$outboundSchema, total: AmountDecimal$outboundSchema, }); export function partnerFeesToJSON(partnerFees: PartnerFees): string { return JSON.stringify(PartnerFees$outboundSchema.parse(partnerFees)); } export function partnerFeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartnerFees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartnerFees' from JSON`, ); }