/* * 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 { DateUpdate, DateUpdate$inboundSchema, DateUpdate$Outbound, DateUpdate$outboundSchema, } from "./dateupdate.js"; /** * A large trader. */ export type LargeTraderUpdate = { /** * 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?: DateUpdate | undefined; /** * SEC-issued ID signifying the person/entity as a large trader; Required for CAIS regulatory reporting. */ largeTraderId?: string | undefined; }; /** @internal */ export const LargeTraderUpdate$inboundSchema: z.ZodType< LargeTraderUpdate, z.ZodTypeDef, unknown > = z.object({ effective_date: DateUpdate$inboundSchema.optional(), large_trader_id: z.string().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "large_trader_id": "largeTraderId", }); }); /** @internal */ export type LargeTraderUpdate$Outbound = { effective_date?: DateUpdate$Outbound | undefined; large_trader_id?: string | undefined; }; /** @internal */ export const LargeTraderUpdate$outboundSchema: z.ZodType< LargeTraderUpdate$Outbound, z.ZodTypeDef, LargeTraderUpdate > = z.object({ effectiveDate: DateUpdate$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 LargeTraderUpdate$ { /** @deprecated use `LargeTraderUpdate$inboundSchema` instead. */ export const inboundSchema = LargeTraderUpdate$inboundSchema; /** @deprecated use `LargeTraderUpdate$outboundSchema` instead. */ export const outboundSchema = LargeTraderUpdate$outboundSchema; /** @deprecated use `LargeTraderUpdate$Outbound` instead. */ export type Outbound = LargeTraderUpdate$Outbound; } export function largeTraderUpdateToJSON( largeTraderUpdate: LargeTraderUpdate, ): string { return JSON.stringify( LargeTraderUpdate$outboundSchema.parse(largeTraderUpdate), ); } export function largeTraderUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LargeTraderUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LargeTraderUpdate' from JSON`, ); }