/* * 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"; import { TransferParty, TransferParty$inboundSchema, TransferParty$outboundSchema, } from "./transferparty.js"; /** * Moov fee charged to an account involved in a transfer. */ export type MoovFee = { /** * ID of the account that fees were charged to. */ accountID: string; /** * Indicates whether the account charged was the partner, source, or destination of the transfer. */ transferParty: TransferParty; /** * The total amount of fees charged to the account. */ totalAmount: AmountDecimal; /** * List of fee IDs that sum to the totalAmount. */ feeIDs: Array; }; /** @internal */ export const MoovFee$inboundSchema: z.ZodType = z.object({ accountID: z.string(), transferParty: TransferParty$inboundSchema, totalAmount: AmountDecimal$inboundSchema, feeIDs: z.array(z.string()), }); /** @internal */ export type MoovFee$Outbound = { accountID: string; transferParty: string; totalAmount: AmountDecimal$Outbound; feeIDs: Array; }; /** @internal */ export const MoovFee$outboundSchema: z.ZodType< MoovFee$Outbound, z.ZodTypeDef, MoovFee > = z.object({ accountID: z.string(), transferParty: TransferParty$outboundSchema, totalAmount: AmountDecimal$outboundSchema, feeIDs: z.array(z.string()), }); export function moovFeeToJSON(moovFee: MoovFee): string { return JSON.stringify(MoovFee$outboundSchema.parse(moovFee)); } export function moovFeeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MoovFee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MoovFee' from JSON`, ); }