/* * 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 { DecimalCreate, DecimalCreate$inboundSchema, DecimalCreate$Outbound, DecimalCreate$outboundSchema, } from "./decimalcreate.js"; /** * Request to simulate a wire deposit - FOR TESTING */ export type SimulateWireDepositRequestCreate = { /** * 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; /** * Whether the transfer should be treated like a domestic wire */ domestic?: boolean | undefined; /** * The parent account of the wire deposit */ parent: string; /** * Whether the transfer should be treated like a third-party wire */ thirdParty?: boolean | undefined; }; /** @internal */ export const SimulateWireDepositRequestCreate$inboundSchema: z.ZodType< SimulateWireDepositRequestCreate, z.ZodTypeDef, unknown > = z.object({ amount: DecimalCreate$inboundSchema, domestic: z.boolean().optional(), parent: z.string(), third_party: z.boolean().optional(), }).transform((v) => { return remap$(v, { "third_party": "thirdParty", }); }); /** @internal */ export type SimulateWireDepositRequestCreate$Outbound = { amount: DecimalCreate$Outbound; domestic?: boolean | undefined; parent: string; third_party?: boolean | undefined; }; /** @internal */ export const SimulateWireDepositRequestCreate$outboundSchema: z.ZodType< SimulateWireDepositRequestCreate$Outbound, z.ZodTypeDef, SimulateWireDepositRequestCreate > = z.object({ amount: DecimalCreate$outboundSchema, domestic: z.boolean().optional(), parent: z.string(), thirdParty: z.boolean().optional(), }).transform((v) => { return remap$(v, { thirdParty: "third_party", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SimulateWireDepositRequestCreate$ { /** @deprecated use `SimulateWireDepositRequestCreate$inboundSchema` instead. */ export const inboundSchema = SimulateWireDepositRequestCreate$inboundSchema; /** @deprecated use `SimulateWireDepositRequestCreate$outboundSchema` instead. */ export const outboundSchema = SimulateWireDepositRequestCreate$outboundSchema; /** @deprecated use `SimulateWireDepositRequestCreate$Outbound` instead. */ export type Outbound = SimulateWireDepositRequestCreate$Outbound; } export function simulateWireDepositRequestCreateToJSON( simulateWireDepositRequestCreate: SimulateWireDepositRequestCreate, ): string { return JSON.stringify( SimulateWireDepositRequestCreate$outboundSchema.parse( simulateWireDepositRequestCreate, ), ); } export function simulateWireDepositRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SimulateWireDepositRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SimulateWireDepositRequestCreate' from JSON`, ); }