/* * 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 { TransactionSource, TransactionSource$inboundSchema, TransactionSource$outboundSchema, } from "./transactionsource.js"; export type CreateTransferSourceCard = { /** * An optional override of the default card statement descriptor for a transfer. Accounts must be enabled by Moov to set this field. */ dynamicDescriptor?: string | undefined; /** * Specifies the nature and initiator of a transaction. * * @remarks * * Crucial for recurring and merchant-initiated transactions as per card scheme rules. * Omit for customer-initiated e-commerce transactions. */ transactionSource?: TransactionSource | undefined; }; /** @internal */ export const CreateTransferSourceCard$inboundSchema: z.ZodType< CreateTransferSourceCard, z.ZodTypeDef, unknown > = z.object({ dynamicDescriptor: z.string().optional(), transactionSource: TransactionSource$inboundSchema.optional(), }); /** @internal */ export type CreateTransferSourceCard$Outbound = { dynamicDescriptor?: string | undefined; transactionSource?: string | undefined; }; /** @internal */ export const CreateTransferSourceCard$outboundSchema: z.ZodType< CreateTransferSourceCard$Outbound, z.ZodTypeDef, CreateTransferSourceCard > = z.object({ dynamicDescriptor: z.string().optional(), transactionSource: TransactionSource$outboundSchema.optional(), }); export function createTransferSourceCardToJSON( createTransferSourceCard: CreateTransferSourceCard, ): string { return JSON.stringify( CreateTransferSourceCard$outboundSchema.parse(createTransferSourceCard), ); } export function createTransferSourceCardFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateTransferSourceCard$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTransferSourceCard' from JSON`, ); }