/* * 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"; /** * The date on which the trader meets or exceeds the large trader reporting threshold, which is defined by the U.S. Securities and Exchange Commission (SEC) as trades of 2 million shares or $20 million in a single day or 20 million shares or $200 million during a calendar month */ export type EffectiveDate = { /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ day?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ month?: number | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ year?: number | undefined; }; /** * A large trader. */ export type LargeTrader = { /** * The date on which the trader meets or exceeds the large trader reporting threshold, which is defined by the U.S. Securities and Exchange Commission (SEC) as trades of 2 million shares or $20 million in a single day or 20 million shares or $200 million during a calendar month */ effectiveDate?: EffectiveDate | null | undefined; /** * SEC-issued ID signifying the person/entity as a large trader; Required for CAIS regulatory reporting. */ largeTraderId?: string | undefined; }; /** @internal */ export const EffectiveDate$inboundSchema: z.ZodType< EffectiveDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type EffectiveDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const EffectiveDate$outboundSchema: z.ZodType< EffectiveDate$Outbound, z.ZodTypeDef, EffectiveDate > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EffectiveDate$ { /** @deprecated use `EffectiveDate$inboundSchema` instead. */ export const inboundSchema = EffectiveDate$inboundSchema; /** @deprecated use `EffectiveDate$outboundSchema` instead. */ export const outboundSchema = EffectiveDate$outboundSchema; /** @deprecated use `EffectiveDate$Outbound` instead. */ export type Outbound = EffectiveDate$Outbound; } export function effectiveDateToJSON(effectiveDate: EffectiveDate): string { return JSON.stringify(EffectiveDate$outboundSchema.parse(effectiveDate)); } export function effectiveDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EffectiveDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EffectiveDate' from JSON`, ); } /** @internal */ export const LargeTrader$inboundSchema: z.ZodType< LargeTrader, z.ZodTypeDef, unknown > = z.object({ effective_date: z.nullable(z.lazy(() => EffectiveDate$inboundSchema)) .optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type LargeTrader$Outbound = { effective_date?: EffectiveDate$Outbound | null | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const LargeTrader$outboundSchema: z.ZodType< LargeTrader$Outbound, z.ZodTypeDef, LargeTrader > = z.object({ effectiveDate: z.nullable(z.lazy(() => EffectiveDate$outboundSchema)) .optional(), largeTraderId: z.string().optional(), }).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 LargeTrader$ { /** @deprecated use `LargeTrader$inboundSchema` instead. */ export const inboundSchema = LargeTrader$inboundSchema; /** @deprecated use `LargeTrader$outboundSchema` instead. */ export const outboundSchema = LargeTrader$outboundSchema; /** @deprecated use `LargeTrader$Outbound` instead. */ export type Outbound = LargeTrader$Outbound; } export function largeTraderToJSON(largeTrader: LargeTrader): string { return JSON.stringify(LargeTrader$outboundSchema.parse(largeTrader)); } export function largeTraderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LargeTrader$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LargeTrader' from JSON`, ); }