/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AssetCreate, AssetCreate$inboundSchema, AssetCreate$Outbound, AssetCreate$outboundSchema, } from "./assetcreate.js"; import { TransferAccountCreate, TransferAccountCreate$inboundSchema, TransferAccountCreate$Outbound, TransferAccountCreate$outboundSchema, } from "./transferaccountcreate.js"; /** * An account transfer which contains the receiving and delivering party information, assets being transferred, NSCC status information, etc. */ export type TransferCreate = { /** * The assets being transferred (Cash, Equities, etc.) */ assets?: Array | undefined; /** * User supplied comment */ comment?: string | undefined; /** * The delivering/receiving party information */ deliverer: TransferAccountCreate; /** * An associated NSCC transfer identifier, if applicable */ originalControlNumber?: string | undefined; }; /** @internal */ export const TransferCreate$inboundSchema: z.ZodType< TransferCreate, z.ZodTypeDef, unknown > = z.object({ assets: z.array(AssetCreate$inboundSchema).optional(), comment: z.string().optional(), deliverer: TransferAccountCreate$inboundSchema, original_control_number: z.string().optional(), }).transform((v) => { return remap$(v, { "original_control_number": "originalControlNumber", }); }); /** @internal */ export type TransferCreate$Outbound = { assets?: Array | undefined; comment?: string | undefined; deliverer: TransferAccountCreate$Outbound; original_control_number?: string | undefined; }; /** @internal */ export const TransferCreate$outboundSchema: z.ZodType< TransferCreate$Outbound, z.ZodTypeDef, TransferCreate > = z.object({ assets: z.array(AssetCreate$outboundSchema).optional(), comment: z.string().optional(), deliverer: TransferAccountCreate$outboundSchema, originalControlNumber: z.string().optional(), }).transform((v) => { return remap$(v, { originalControlNumber: "original_control_number", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TransferCreate$ { /** @deprecated use `TransferCreate$inboundSchema` instead. */ export const inboundSchema = TransferCreate$inboundSchema; /** @deprecated use `TransferCreate$outboundSchema` instead. */ export const outboundSchema = TransferCreate$outboundSchema; /** @deprecated use `TransferCreate$Outbound` instead. */ export type Outbound = TransferCreate$Outbound; } export function transferCreateToJSON(transferCreate: TransferCreate): string { return JSON.stringify(TransferCreate$outboundSchema.parse(transferCreate)); } export function transferCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TransferCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransferCreate' from JSON`, ); }