/* * 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 { PlaidLinkIntegration, PlaidLinkIntegration$inboundSchema, PlaidLinkIntegration$Outbound, PlaidLinkIntegration$outboundSchema, } from "./plaidlinkintegration.js"; /** * This is used by Moov.js with a Plaid reseller relationship. * * @remarks * * Describes the account to link to the Moov account using a Plaid using a Plaid public token. */ export type PlaidLinkPayload = { /** * This is used by Moov.js with a Plaid reseller relationship. The details of a Plaid link integration for a linked funding source. * * @remarks * * You can simulate linking bank accounts with Plaid in test mode. See our [test mode](https://docs.moov.io/guides/get-started/test-mode/#plaid) * guide for more information. * * Plaid's `sandbox` environment - (requires Plaid reseller setup with Moov). When linking a bank account to a `sandbox` account using a Plaid * public token it will utilize Plaid's sandbox environment. The Plaid public token provided must be generated from Plaid's sandbox environment. * Please see Plaid's sandbox documentation for more * details. */ plaidLink: PlaidLinkIntegration; }; /** @internal */ export const PlaidLinkPayload$inboundSchema: z.ZodType< PlaidLinkPayload, z.ZodTypeDef, unknown > = z.object({ plaidLink: PlaidLinkIntegration$inboundSchema, }); /** @internal */ export type PlaidLinkPayload$Outbound = { plaidLink: PlaidLinkIntegration$Outbound; }; /** @internal */ export const PlaidLinkPayload$outboundSchema: z.ZodType< PlaidLinkPayload$Outbound, z.ZodTypeDef, PlaidLinkPayload > = z.object({ plaidLink: PlaidLinkIntegration$outboundSchema, }); export function plaidLinkPayloadToJSON( plaidLinkPayload: PlaidLinkPayload, ): string { return JSON.stringify( PlaidLinkPayload$outboundSchema.parse(plaidLinkPayload), ); } export function plaidLinkPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PlaidLinkPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PlaidLinkPayload' from JSON`, ); }