/* * 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 { Amount, Amount$inboundSchema, Amount$Outbound, Amount$outboundSchema, } from "./amount.js"; import { SourceDestinationOptions, SourceDestinationOptions$inboundSchema, SourceDestinationOptions$Outbound, SourceDestinationOptions$outboundSchema, } from "./sourcedestinationoptions.js"; export type CreateTransferOptions = { source: SourceDestinationOptions; destination: SourceDestinationOptions; amount: Amount; }; /** @internal */ export const CreateTransferOptions$inboundSchema: z.ZodType< CreateTransferOptions, z.ZodTypeDef, unknown > = z.object({ source: SourceDestinationOptions$inboundSchema, destination: SourceDestinationOptions$inboundSchema, amount: Amount$inboundSchema, }); /** @internal */ export type CreateTransferOptions$Outbound = { source: SourceDestinationOptions$Outbound; destination: SourceDestinationOptions$Outbound; amount: Amount$Outbound; }; /** @internal */ export const CreateTransferOptions$outboundSchema: z.ZodType< CreateTransferOptions$Outbound, z.ZodTypeDef, CreateTransferOptions > = z.object({ source: SourceDestinationOptions$outboundSchema, destination: SourceDestinationOptions$outboundSchema, amount: Amount$outboundSchema, }); export function createTransferOptionsToJSON( createTransferOptions: CreateTransferOptions, ): string { return JSON.stringify( CreateTransferOptions$outboundSchema.parse(createTransferOptions), ); } export function createTransferOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateTransferOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTransferOptions' from JSON`, ); }