/* * 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"; import { SchedulePropertiesCreate, SchedulePropertiesCreate$inboundSchema, SchedulePropertiesCreate$Outbound, SchedulePropertiesCreate$outboundSchema, } from "./schedulepropertiescreate.js"; /** * Details of deposit schedule transfers */ export type DepositScheduleDetailsCreate = { /** * 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_schedule_id and account */ clientScheduleId: string; /** * Properties common to all transfer schedules */ scheduleProperties: SchedulePropertiesCreate; }; /** @internal */ export const DepositScheduleDetailsCreate$inboundSchema: z.ZodType< DepositScheduleDetailsCreate, z.ZodTypeDef, unknown > = z.object({ amount: DecimalCreate$inboundSchema, client_schedule_id: z.string(), schedule_properties: SchedulePropertiesCreate$inboundSchema, }).transform((v) => { return remap$(v, { "client_schedule_id": "clientScheduleId", "schedule_properties": "scheduleProperties", }); }); /** @internal */ export type DepositScheduleDetailsCreate$Outbound = { amount: DecimalCreate$Outbound; client_schedule_id: string; schedule_properties: SchedulePropertiesCreate$Outbound; }; /** @internal */ export const DepositScheduleDetailsCreate$outboundSchema: z.ZodType< DepositScheduleDetailsCreate$Outbound, z.ZodTypeDef, DepositScheduleDetailsCreate > = z.object({ amount: DecimalCreate$outboundSchema, clientScheduleId: z.string(), scheduleProperties: SchedulePropertiesCreate$outboundSchema, }).transform((v) => { return remap$(v, { clientScheduleId: "client_schedule_id", scheduleProperties: "schedule_properties", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DepositScheduleDetailsCreate$ { /** @deprecated use `DepositScheduleDetailsCreate$inboundSchema` instead. */ export const inboundSchema = DepositScheduleDetailsCreate$inboundSchema; /** @deprecated use `DepositScheduleDetailsCreate$outboundSchema` instead. */ export const outboundSchema = DepositScheduleDetailsCreate$outboundSchema; /** @deprecated use `DepositScheduleDetailsCreate$Outbound` instead. */ export type Outbound = DepositScheduleDetailsCreate$Outbound; } export function depositScheduleDetailsCreateToJSON( depositScheduleDetailsCreate: DepositScheduleDetailsCreate, ): string { return JSON.stringify( DepositScheduleDetailsCreate$outboundSchema.parse( depositScheduleDetailsCreate, ), ); } export function depositScheduleDetailsCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DepositScheduleDetailsCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DepositScheduleDetailsCreate' from JSON`, ); }