/* * 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 { BankAccountHolderType, BankAccountHolderType$inboundSchema, BankAccountHolderType$outboundSchema, } from "./bankaccountholdertype.js"; import { BankAccountType, BankAccountType$inboundSchema, BankAccountType$outboundSchema, } from "./bankaccounttype.js"; export type BankAccountIntegration = { holderName: string; /** * The type of holder on a funding source. */ holderType: BankAccountHolderType; accountNumber: string; /** * The bank account type. */ bankAccountType: BankAccountType; routingNumber: string; }; /** @internal */ export const BankAccountIntegration$inboundSchema: z.ZodType< BankAccountIntegration, z.ZodTypeDef, unknown > = z.object({ holderName: z.string(), holderType: BankAccountHolderType$inboundSchema, accountNumber: z.string(), bankAccountType: BankAccountType$inboundSchema, routingNumber: z.string(), }); /** @internal */ export type BankAccountIntegration$Outbound = { holderName: string; holderType: string; accountNumber: string; bankAccountType: string; routingNumber: string; }; /** @internal */ export const BankAccountIntegration$outboundSchema: z.ZodType< BankAccountIntegration$Outbound, z.ZodTypeDef, BankAccountIntegration > = z.object({ holderName: z.string(), holderType: BankAccountHolderType$outboundSchema, accountNumber: z.string(), bankAccountType: BankAccountType$outboundSchema, routingNumber: z.string(), }); export function bankAccountIntegrationToJSON( bankAccountIntegration: BankAccountIntegration, ): string { return JSON.stringify( BankAccountIntegration$outboundSchema.parse(bankAccountIntegration), ); } export function bankAccountIntegrationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BankAccountIntegration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BankAccountIntegration' from JSON`, ); }