/* * 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 { PaymentMethod, PaymentMethod$inboundSchema, PaymentMethod$Outbound, PaymentMethod$outboundSchema, } from "./paymentmethod.js"; export type TransferOptions = { sourceOptions?: Array | undefined; destinationOptions?: Array | undefined; }; /** @internal */ export const TransferOptions$inboundSchema: z.ZodType< TransferOptions, z.ZodTypeDef, unknown > = z.object({ sourceOptions: z.array(PaymentMethod$inboundSchema).optional(), destinationOptions: z.array(PaymentMethod$inboundSchema).optional(), }); /** @internal */ export type TransferOptions$Outbound = { sourceOptions?: Array | undefined; destinationOptions?: Array | undefined; }; /** @internal */ export const TransferOptions$outboundSchema: z.ZodType< TransferOptions$Outbound, z.ZodTypeDef, TransferOptions > = z.object({ sourceOptions: z.array(PaymentMethod$outboundSchema).optional(), destinationOptions: z.array(PaymentMethod$outboundSchema).optional(), }); export function transferOptionsToJSON( transferOptions: TransferOptions, ): string { return JSON.stringify(TransferOptions$outboundSchema.parse(transferOptions)); } export function transferOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TransferOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferOptions' from JSON`, ); }