/* * 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 { DateCreate, DateCreate$inboundSchema, DateCreate$Outbound, DateCreate$outboundSchema, } from "./datecreate.js"; import { DecimalCreate, DecimalCreate$inboundSchema, DecimalCreate$Outbound, DecimalCreate$outboundSchema, } from "./decimalcreate.js"; /** * Letter of Intent (LOI). An LOI allows investors to receive sales charge discounts based on a commitment to buy a specified monetary amount of shares over a period of time, usually 13 months. */ export type LetterOfIntentCreate = { /** * 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; /** * Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * * @remarks * * * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date * * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`. */ periodStartDate: DateCreate; }; /** @internal */ export const LetterOfIntentCreate$inboundSchema: z.ZodType< LetterOfIntentCreate, z.ZodTypeDef, unknown > = z.object({ amount: DecimalCreate$inboundSchema, period_start_date: DateCreate$inboundSchema, }).transform((v) => { return remap$(v, { "period_start_date": "periodStartDate", }); }); /** @internal */ export type LetterOfIntentCreate$Outbound = { amount: DecimalCreate$Outbound; period_start_date: DateCreate$Outbound; }; /** @internal */ export const LetterOfIntentCreate$outboundSchema: z.ZodType< LetterOfIntentCreate$Outbound, z.ZodTypeDef, LetterOfIntentCreate > = z.object({ amount: DecimalCreate$outboundSchema, periodStartDate: DateCreate$outboundSchema, }).transform((v) => { return remap$(v, { periodStartDate: "period_start_date", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LetterOfIntentCreate$ { /** @deprecated use `LetterOfIntentCreate$inboundSchema` instead. */ export const inboundSchema = LetterOfIntentCreate$inboundSchema; /** @deprecated use `LetterOfIntentCreate$outboundSchema` instead. */ export const outboundSchema = LetterOfIntentCreate$outboundSchema; /** @deprecated use `LetterOfIntentCreate$Outbound` instead. */ export type Outbound = LetterOfIntentCreate$Outbound; } export function letterOfIntentCreateToJSON( letterOfIntentCreate: LetterOfIntentCreate, ): string { return JSON.stringify( LetterOfIntentCreate$outboundSchema.parse(letterOfIntentCreate), ); } export function letterOfIntentCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LetterOfIntentCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LetterOfIntentCreate' from JSON`, ); }