/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Representation of a bank account item */ export type PaymentMethodBankAccount = { /** * The bank account ID */ uuid: string; /** * The bank account name */ name?: string | undefined; /** * Masked bank account number */ hiddenAccountNumber?: string | undefined; /** * The order of priority for each payment split, with priority 1 being the first bank account paid. Priority must be unique and sequential. */ priority?: number | undefined; /** * If `split_by` is 'Amount', this is in cents (e.g., 500 for $5.00) and exactly one account must have a `split_amount` of `null` to capture the remainder. If `split_by` is 'Percentage', this is the percentage value (e.g., 60 for 60%). */ splitAmount?: number | null | undefined; }; /** @internal */ export const PaymentMethodBankAccount$inboundSchema: z.ZodType< PaymentMethodBankAccount, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), name: z.string().optional(), hidden_account_number: z.string().optional(), priority: z.number().int().optional(), split_amount: z.nullable(z.number().int()).optional(), }).transform((v) => { return remap$(v, { "hidden_account_number": "hiddenAccountNumber", "split_amount": "splitAmount", }); }); export function paymentMethodBankAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentMethodBankAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentMethodBankAccount' from JSON`, ); }