/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The end reason of the LTID. */ export enum EndReason { ReportableAccountEventReasonUnspecified = "REPORTABLE_ACCOUNT_EVENT_REASON_UNSPECIFIED", EventReasonCreated = "EVENT_REASON_CREATED", EventReasonCorrection = "EVENT_REASON_CORRECTION", EventReasonEnded = "EVENT_REASON_ENDED", EventReasonReplaced = "EVENT_REASON_REPLACED", EventReasonTransfer = "EVENT_REASON_TRANSFER", EventReasonOther = "EVENT_REASON_OTHER", } /** * The end reason of the LTID. */ export type EndReasonOpen = OpenEnum; /** * The request to end a Large Trader on a Legal Natural Person/Legal Entity. */ export type EndLargeTraderRequestCreate = { /** * The end reason of the LTID. */ endReason: EndReasonOpen; }; /** @internal */ export const EndReason$inboundSchema: z.ZodType< EndReasonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(EndReason), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const EndReason$outboundSchema: z.ZodType< EndReasonOpen, z.ZodTypeDef, EndReasonOpen > = z.union([ z.nativeEnum(EndReason), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EndReason$ { /** @deprecated use `EndReason$inboundSchema` instead. */ export const inboundSchema = EndReason$inboundSchema; /** @deprecated use `EndReason$outboundSchema` instead. */ export const outboundSchema = EndReason$outboundSchema; } /** @internal */ export const EndLargeTraderRequestCreate$inboundSchema: z.ZodType< EndLargeTraderRequestCreate, z.ZodTypeDef, unknown > = z.object({ end_reason: EndReason$inboundSchema, }).transform((v) => { return remap$(v, { "end_reason": "endReason", }); }); /** @internal */ export type EndLargeTraderRequestCreate$Outbound = { end_reason: string; }; /** @internal */ export const EndLargeTraderRequestCreate$outboundSchema: z.ZodType< EndLargeTraderRequestCreate$Outbound, z.ZodTypeDef, EndLargeTraderRequestCreate > = z.object({ endReason: EndReason$outboundSchema, }).transform((v) => { return remap$(v, { endReason: "end_reason", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EndLargeTraderRequestCreate$ { /** @deprecated use `EndLargeTraderRequestCreate$inboundSchema` instead. */ export const inboundSchema = EndLargeTraderRequestCreate$inboundSchema; /** @deprecated use `EndLargeTraderRequestCreate$outboundSchema` instead. */ export const outboundSchema = EndLargeTraderRequestCreate$outboundSchema; /** @deprecated use `EndLargeTraderRequestCreate$Outbound` instead. */ export type Outbound = EndLargeTraderRequestCreate$Outbound; } export function endLargeTraderRequestCreateToJSON( endLargeTraderRequestCreate: EndLargeTraderRequestCreate, ): string { return JSON.stringify( EndLargeTraderRequestCreate$outboundSchema.parse( endLargeTraderRequestCreate, ), ); } export function endLargeTraderRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EndLargeTraderRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EndLargeTraderRequestCreate' from JSON`, ); }