/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DecimalCreate, DecimalCreate$inboundSchema, DecimalCreate$Outbound, DecimalCreate$outboundSchema, } from "./decimalcreate.js"; import { IctDepositTravelRuleCreate, IctDepositTravelRuleCreate$inboundSchema, IctDepositTravelRuleCreate$Outbound, IctDepositTravelRuleCreate$outboundSchema, } from "./ictdeposittravelrulecreate.js"; import { RetirementContributionCreate, RetirementContributionCreate$inboundSchema, RetirementContributionCreate$Outbound, RetirementContributionCreate$outboundSchema, } from "./retirementcontributioncreate.js"; /** * The name of the program the ICT deposit is associated with */ export enum Program { IctProgramUnspecified = "ICT_PROGRAM_UNSPECIFIED", BrokerPartner = "BROKER_PARTNER", DepositOnly = "DEPOSIT_ONLY", BankingPartner = "BANKING_PARTNER", MoneyTransmitter = "MONEY_TRANSMITTER", WithdrawalOnly = "WITHDRAWAL_ONLY", DigitalPartner = "DIGITAL_PARTNER", } /** * The name of the program the ICT deposit is associated with */ export type ProgramOpen = OpenEnum; /** * An Instant Cash Transfer. Funds are moved from a configured Firm account to a customer's brokerage account. */ export type IctDepositCreate = { /** * A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's [BigDecimal][] or Python's [decimal.Decimal][]. * * @remarks * * [BigDecimal]: * https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html * [decimal.Decimal]: https://docs.python.org/3/library/decimal.html */ amount: DecimalCreate; /** * External identifier supplied by the API caller. Each request must have a unique pairing of client_transfer_id and account. */ clientTransferId: string; /** * The name of the program the ICT deposit is associated with */ program: ProgramOpen; /** * A contribution to a retirement account. */ retirementContribution?: RetirementContributionCreate | undefined; /** * The travel rules associated with an ICT deposit */ travelRule: IctDepositTravelRuleCreate; }; /** @internal */ export const Program$inboundSchema: z.ZodType< ProgramOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(Program), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const Program$outboundSchema: z.ZodType< ProgramOpen, z.ZodTypeDef, ProgramOpen > = z.union([ z.nativeEnum(Program), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Program$ { /** @deprecated use `Program$inboundSchema` instead. */ export const inboundSchema = Program$inboundSchema; /** @deprecated use `Program$outboundSchema` instead. */ export const outboundSchema = Program$outboundSchema; } /** @internal */ export const IctDepositCreate$inboundSchema: z.ZodType< IctDepositCreate, z.ZodTypeDef, unknown > = z.object({ amount: DecimalCreate$inboundSchema, client_transfer_id: z.string(), program: Program$inboundSchema, retirement_contribution: RetirementContributionCreate$inboundSchema .optional(), travel_rule: IctDepositTravelRuleCreate$inboundSchema, }).transform((v) => { return remap$(v, { "client_transfer_id": "clientTransferId", "retirement_contribution": "retirementContribution", "travel_rule": "travelRule", }); }); /** @internal */ export type IctDepositCreate$Outbound = { amount: DecimalCreate$Outbound; client_transfer_id: string; program: string; retirement_contribution?: RetirementContributionCreate$Outbound | undefined; travel_rule: IctDepositTravelRuleCreate$Outbound; }; /** @internal */ export const IctDepositCreate$outboundSchema: z.ZodType< IctDepositCreate$Outbound, z.ZodTypeDef, IctDepositCreate > = z.object({ amount: DecimalCreate$outboundSchema, clientTransferId: z.string(), program: Program$outboundSchema, retirementContribution: RetirementContributionCreate$outboundSchema .optional(), travelRule: IctDepositTravelRuleCreate$outboundSchema, }).transform((v) => { return remap$(v, { clientTransferId: "client_transfer_id", retirementContribution: "retirement_contribution", travelRule: "travel_rule", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IctDepositCreate$ { /** @deprecated use `IctDepositCreate$inboundSchema` instead. */ export const inboundSchema = IctDepositCreate$inboundSchema; /** @deprecated use `IctDepositCreate$outboundSchema` instead. */ export const outboundSchema = IctDepositCreate$outboundSchema; /** @deprecated use `IctDepositCreate$Outbound` instead. */ export type Outbound = IctDepositCreate$Outbound; } export function ictDepositCreateToJSON( ictDepositCreate: IctDepositCreate, ): string { return JSON.stringify( IctDepositCreate$outboundSchema.parse(ictDepositCreate), ); } export function ictDepositCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IctDepositCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IctDepositCreate' from JSON`, ); }