/* * 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"; /** * A large trader. */ export type LargeTraderCreate = { /** * 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`. */ effectiveDate: DateCreate; /** * SEC-issued ID signifying the person/entity as a large trader; Required for CAIS regulatory reporting. */ largeTraderId: string; }; /** @internal */ export const LargeTraderCreate$inboundSchema: z.ZodType< LargeTraderCreate, z.ZodTypeDef, unknown > = z.object({ effective_date: DateCreate$inboundSchema, large_trader_id: z.string(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type LargeTraderCreate$Outbound = { effective_date: DateCreate$Outbound; large_trader_id: string; }; /** @internal */ export const LargeTraderCreate$outboundSchema: z.ZodType< LargeTraderCreate$Outbound, z.ZodTypeDef, LargeTraderCreate > = z.object({ effectiveDate: DateCreate$outboundSchema, largeTraderId: z.string(), }).transform((v) => { return remap$(v, { effectiveDate: "effective_date", largeTraderId: "large_trader_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace LargeTraderCreate$ { /** @deprecated use `LargeTraderCreate$inboundSchema` instead. */ export const inboundSchema = LargeTraderCreate$inboundSchema; /** @deprecated use `LargeTraderCreate$outboundSchema` instead. */ export const outboundSchema = LargeTraderCreate$outboundSchema; /** @deprecated use `LargeTraderCreate$Outbound` instead. */ export type Outbound = LargeTraderCreate$Outbound; } export function largeTraderCreateToJSON( largeTraderCreate: LargeTraderCreate, ): string { return JSON.stringify( LargeTraderCreate$outboundSchema.parse(largeTraderCreate), ); } export function largeTraderCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LargeTraderCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LargeTraderCreate' from JSON`, ); }