/* * 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 { BankAccountIntegration, BankAccountIntegration$inboundSchema, BankAccountIntegration$Outbound, BankAccountIntegration$outboundSchema, } from "./bankaccountintegration.js"; /** * Describes the bank account to link to the Moov account. */ export type BankAccountPayload = { account: BankAccountIntegration; }; /** @internal */ export const BankAccountPayload$inboundSchema: z.ZodType< BankAccountPayload, z.ZodTypeDef, unknown > = z.object({ account: BankAccountIntegration$inboundSchema, }); /** @internal */ export type BankAccountPayload$Outbound = { account: BankAccountIntegration$Outbound; }; /** @internal */ export const BankAccountPayload$outboundSchema: z.ZodType< BankAccountPayload$Outbound, z.ZodTypeDef, BankAccountPayload > = z.object({ account: BankAccountIntegration$outboundSchema, }); export function bankAccountPayloadToJSON( bankAccountPayload: BankAccountPayload, ): string { return JSON.stringify( BankAccountPayload$outboundSchema.parse(bankAccountPayload), ); } export function bankAccountPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BankAccountPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BankAccountPayload' from JSON`, ); }