/* * 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 { PlaidIntegration, PlaidIntegration$inboundSchema, PlaidIntegration$Outbound, PlaidIntegration$outboundSchema, } from "./plaidintegration.js"; /** * Describes the account to link to the Moov account using a Plaid processor token. */ export type PlaidPayload = { /** * The details of a Plaid processor integration for a linked funding source. * * @remarks * * `sandbox` - When linking a bank account to a `sandbox` account using a Plaid processor token a default bank account * response will be used. The following default data will be used to generate the bank account in this flow: * * ``` * RoutingNumber: "011401533", * AccountNumber: "1111222233330000", * AccountType: "checking", * Mask: "0000" * ``` */ plaid: PlaidIntegration; }; /** @internal */ export const PlaidPayload$inboundSchema: z.ZodType< PlaidPayload, z.ZodTypeDef, unknown > = z.object({ plaid: PlaidIntegration$inboundSchema, }); /** @internal */ export type PlaidPayload$Outbound = { plaid: PlaidIntegration$Outbound; }; /** @internal */ export const PlaidPayload$outboundSchema: z.ZodType< PlaidPayload$Outbound, z.ZodTypeDef, PlaidPayload > = z.object({ plaid: PlaidIntegration$outboundSchema, }); export function plaidPayloadToJSON(plaidPayload: PlaidPayload): string { return JSON.stringify(PlaidPayload$outboundSchema.parse(plaidPayload)); } export function plaidPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PlaidPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PlaidPayload' from JSON`, ); }