/* * 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"; /** * Total or markup fee. */ export type FacilitatorFee = { /** * Total facilitator fee in cents. Only either `total` or `totalDecimal` can be set. */ total?: number | undefined; /** * Same as `total`, but a decimal-formatted numerical string that represents up to 9 decimal place precision. * * @remarks * * Only either `total` or `totalDecimal` can be set. Set this field if you expect the fee to be in fractions of a cent. */ totalDecimal?: string | undefined; /** * Markup facilitator fee in cents. Only either `markup` or `markupDecimal` can be set. */ markup?: number | undefined; /** * Same as `markup`, but a decimal-formatted numerical string that represents up to 9 decimal place precision. * * @remarks * Only either `markup` or `markupDecimal` can be set. Set this field if you expect the fee to be in fractions of a cent. */ markupDecimal?: string | undefined; }; /** @internal */ export const FacilitatorFee$inboundSchema: z.ZodType< FacilitatorFee, z.ZodTypeDef, unknown > = z.object({ total: z.number().int().optional(), totalDecimal: z.string().optional(), markup: z.number().int().optional(), markupDecimal: z.string().optional(), }); /** @internal */ export type FacilitatorFee$Outbound = { total?: number | undefined; totalDecimal?: string | undefined; markup?: number | undefined; markupDecimal?: string | undefined; }; /** @internal */ export const FacilitatorFee$outboundSchema: z.ZodType< FacilitatorFee$Outbound, z.ZodTypeDef, FacilitatorFee > = z.object({ total: z.number().int().optional(), totalDecimal: z.string().optional(), markup: z.number().int().optional(), markupDecimal: z.string().optional(), }); export function facilitatorFeeToJSON(facilitatorFee: FacilitatorFee): string { return JSON.stringify(FacilitatorFee$outboundSchema.parse(facilitatorFee)); } export function facilitatorFeeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FacilitatorFee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FacilitatorFee' from JSON`, ); }