/* * 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 ACH fees. */ export type ACHFees = { /** * Fees for standard credit transfers. */ standardCredit: BillingCountAndAmount; /** * Fees for same-day credit transfers. */ sameDayCredit: BillingCountAndAmount; /** * Fees for debit transfers. */ debits: BillingCountAndAmount; /** * Fees for authorized returns. */ return: BillingCountAndAmount; /** * Fees for unauthorized returns. */ unauthorizedReturn: BillingCountAndAmount; /** * Fees for notices of change. */ noticeOfChange: BillingCountAndAmount; /** * Fees for successful bank account verifications via Plaid or MX. */ bankAccountVerification: BillingCountAndAmount; /** * Total ACH fees. */ total: BillingCountAndAmount; }; /** @internal */ export const ACHFees$inboundSchema: z.ZodType = z.object({ standardCredit: BillingCountAndAmount$inboundSchema, sameDayCredit: BillingCountAndAmount$inboundSchema, debits: BillingCountAndAmount$inboundSchema, return: BillingCountAndAmount$inboundSchema, unauthorizedReturn: BillingCountAndAmount$inboundSchema, noticeOfChange: BillingCountAndAmount$inboundSchema, bankAccountVerification: BillingCountAndAmount$inboundSchema, total: BillingCountAndAmount$inboundSchema, }); /** @internal */ export type ACHFees$Outbound = { standardCredit: BillingCountAndAmount$Outbound; sameDayCredit: BillingCountAndAmount$Outbound; debits: BillingCountAndAmount$Outbound; return: BillingCountAndAmount$Outbound; unauthorizedReturn: BillingCountAndAmount$Outbound; noticeOfChange: BillingCountAndAmount$Outbound; bankAccountVerification: BillingCountAndAmount$Outbound; total: BillingCountAndAmount$Outbound; }; /** @internal */ export const ACHFees$outboundSchema: z.ZodType< ACHFees$Outbound, z.ZodTypeDef, ACHFees > = z.object({ standardCredit: BillingCountAndAmount$outboundSchema, sameDayCredit: BillingCountAndAmount$outboundSchema, debits: BillingCountAndAmount$outboundSchema, return: BillingCountAndAmount$outboundSchema, unauthorizedReturn: BillingCountAndAmount$outboundSchema, noticeOfChange: BillingCountAndAmount$outboundSchema, bankAccountVerification: BillingCountAndAmount$outboundSchema, total: BillingCountAndAmount$outboundSchema, }); export function achFeesToJSON(achFees: ACHFees): string { return JSON.stringify(ACHFees$outboundSchema.parse(achFees)); } export function achFeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ACHFees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ACHFees' from JSON`, ); }