/* * 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 actual amount of the order, which is determined after the issuer accepts the order. May differ from the requested `notional_value`. */ export type AlternativeOrderCumulativeNotionalValue = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Identifies the distribution type for buy side orders (that is, when `side` value = `BUY`). - Orders will be rejected if the alternative investment asset does not allow the requested distribution type. - Not relevant for sell orders (that is, when `side` value = `SELL`). - Confirm the asset’s `cash_distribution_allowed` and `reinvestment_distribution_allowed` properties to know what it allows. */ export enum AlternativeOrderDistributionType { DistributionTypeUnspecified = "DISTRIBUTION_TYPE_UNSPECIFIED", Cash = "CASH", Reinvestment = "REINVESTMENT", } /** * Identifies the distribution type for buy side orders (that is, when `side` value = `BUY`). - Orders will be rejected if the alternative investment asset does not allow the requested distribution type. - Not relevant for sell orders (that is, when `side` value = `SELL`). - Confirm the asset’s `cash_distribution_allowed` and `reinvestment_distribution_allowed` properties to know what it allows. */ export type AlternativeOrderDistributionTypeOpen = OpenEnum< typeof AlternativeOrderDistributionType >; /** * The actual filled share quantity of the order, which is determined after the issuer accepts the order. May differ from the requested `quantity`. */ export type AlternativeOrderFilledQuantity = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Identifies which parameter value is used to identify the asset in the order. The value for that parameter is used in the `identifier` field. */ export enum AlternativeOrderIdentifierType { IdentifierTypeUnspecified = "IDENTIFIER_TYPE_UNSPECIFIED", AssetId = "ASSET_ID", } /** * Identifies which parameter value is used to identify the asset in the order. The value for that parameter is used in the `identifier` field. */ export type AlternativeOrderIdentifierTypeOpen = OpenEnum< typeof AlternativeOrderIdentifierType >; /** * The requested notional value for the order. - Orders can specify only one of `full`, `notional_value`, or `quantity`. - The value must be positive. - Values are scaled to two decimal places. - Note that the issuer may allow only an order for less than the requested amount. */ export type AlternativeOrderNotionalValue = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The order’s status at the time of the response. */ export enum AlternativeOrderOrderStatus { OrderStatusUnspecified = "ORDER_STATUS_UNSPECIFIED", Received = "RECEIVED", Filled = "FILLED", Rejected = "REJECTED", AwaitingSignature = "AWAITING_SIGNATURE", PendingSettlement = "PENDING_SETTLEMENT", Booked = "BOOKED", } /** * The order’s status at the time of the response. */ export type AlternativeOrderOrderStatusOpen = OpenEnum< typeof AlternativeOrderOrderStatus >; /** * The requested quantity of shares for the order. - Orders can specify only one of `full`, `notional_value`, or `quantity`. - Only relevant to redemption orders. - The value must be positive. - Note that the issuer may allow only an order for less than the requested quantity. */ export type AlternativeOrderQuantity = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The date the order will be/was settled. Value will be `null` until the issuer sets a settlement date. */ export type SettlementDate = { /** * 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; }; /** * The side of the order. */ export enum AlternativeOrderSide { SideUnspecified = "SIDE_UNSPECIFIED", Buy = "BUY", Sell = "SELL", } /** * The side of the order. */ export type AlternativeOrderSideOpen = OpenEnum; /** * An order for an alternative investment. */ export type AlternativeOrder = { /** * The ID of the account. */ accountId?: string | undefined; /** * The ID of the alternative investment order. */ alternativeOrderId?: string | undefined; /** * A client-supplied unique ID to enforce idempotency. Each ID must be unique within the account. * * @remarks * * If a create request includes a `client_order_id` that matches an existing order’s `client_order_id`, the service will respond with `ALREADY_EXISTS` and will not create a new order resource. */ clientOrderId?: string | undefined; /** * The date and time the order was created. Uses [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). */ createTime?: Date | null | undefined; /** * The actual amount of the order, which is determined after the issuer accepts the order. May differ from the requested `notional_value`. */ cumulativeNotionalValue?: | AlternativeOrderCumulativeNotionalValue | null | undefined; /** * The currency code of the order. Supports only "USD" and will default to "USD" if unspecified in the request. */ currencyCode?: string | undefined; /** * Identifies the distribution type for buy side orders (that is, when `side` value = `BUY`). - Orders will be rejected if the alternative investment asset does not allow the requested distribution type. - Not relevant for sell orders (that is, when `side` value = `SELL`). - Confirm the asset’s `cash_distribution_allowed` and `reinvestment_distribution_allowed` properties to know what it allows. */ distributionType?: AlternativeOrderDistributionTypeOpen | undefined; /** * The actual filled share quantity of the order, which is determined after the issuer accepts the order. May differ from the requested `quantity`. */ filledQuantity?: AlternativeOrderFilledQuantity | null | undefined; /** * Indicates whether this order is for a full redemption (as in, all shares redeemed). - Orders can specify only one of `full`, `notional_value`, or `quantity`. - Note that the issuer may allow only partial redemption. - Not relevant to subscription orders. */ full?: boolean | undefined; /** * The asset identifier value, dependent on enum value set for `identifier_type`. * * @remarks * * For example, if `identifier_type` = `ASSET_ID`, then the value for `identifier` is the `asset_id` value. */ identifier?: string | undefined; /** * Identifies which parameter value is used to identify the asset in the order. The value for that parameter is used in the `identifier` field. */ identifierType?: AlternativeOrderIdentifierTypeOpen | undefined; /** * The system-generated resource name of the alternative investment order. * * @remarks * * Format: accounts/{account}/alternativeOrders/{alternative_order} * * Note that `{account}` will be the `account_id` value and `{alternative_order}` will be the `alternative_order_id` value. */ name?: string | undefined; /** * The requested notional value for the order. - Orders can specify only one of `full`, `notional_value`, or `quantity`. - The value must be positive. - Values are scaled to two decimal places. - Note that the issuer may allow only an order for less than the requested amount. */ notionalValue?: AlternativeOrderNotionalValue | null | undefined; /** * The order’s status at the time of the response. */ orderStatus?: AlternativeOrderOrderStatusOpen | undefined; /** * The requested quantity of shares for the order. - Orders can specify only one of `full`, `notional_value`, or `quantity`. - Only relevant to redemption orders. - The value must be positive. - Note that the issuer may allow only an order for less than the requested quantity. */ quantity?: AlternativeOrderQuantity | null | undefined; /** * The date the order will be/was settled. Value will be `null` until the issuer sets a settlement date. */ settlementDate?: SettlementDate | null | undefined; /** * The side of the order. */ side?: AlternativeOrderSideOpen | undefined; /** * A system-generated, user-friendly message about the order’s status. */ statusMessage?: string | undefined; /** * The date and time the order was last updated. Uses [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). */ updateTime?: Date | null | undefined; }; /** @internal */ export const AlternativeOrderCumulativeNotionalValue$inboundSchema: z.ZodType< AlternativeOrderCumulativeNotionalValue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AlternativeOrderCumulativeNotionalValue$Outbound = { value?: string | undefined; }; /** @internal */ export const AlternativeOrderCumulativeNotionalValue$outboundSchema: z.ZodType< AlternativeOrderCumulativeNotionalValue$Outbound, z.ZodTypeDef, AlternativeOrderCumulativeNotionalValue > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrderCumulativeNotionalValue$ { /** @deprecated use `AlternativeOrderCumulativeNotionalValue$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderCumulativeNotionalValue$inboundSchema; /** @deprecated use `AlternativeOrderCumulativeNotionalValue$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderCumulativeNotionalValue$outboundSchema; /** @deprecated use `AlternativeOrderCumulativeNotionalValue$Outbound` instead. */ export type Outbound = AlternativeOrderCumulativeNotionalValue$Outbound; } export function alternativeOrderCumulativeNotionalValueToJSON( alternativeOrderCumulativeNotionalValue: AlternativeOrderCumulativeNotionalValue, ): string { return JSON.stringify( AlternativeOrderCumulativeNotionalValue$outboundSchema.parse( alternativeOrderCumulativeNotionalValue, ), ); } export function alternativeOrderCumulativeNotionalValueFromJSON( jsonString: string, ): SafeParseResult< AlternativeOrderCumulativeNotionalValue, SDKValidationError > { return safeParse( jsonString, (x) => AlternativeOrderCumulativeNotionalValue$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AlternativeOrderCumulativeNotionalValue' from JSON`, ); } /** @internal */ export const AlternativeOrderDistributionType$inboundSchema: z.ZodType< AlternativeOrderDistributionTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AlternativeOrderDistributionType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AlternativeOrderDistributionType$outboundSchema: z.ZodType< AlternativeOrderDistributionTypeOpen, z.ZodTypeDef, AlternativeOrderDistributionTypeOpen > = z.union([ z.nativeEnum(AlternativeOrderDistributionType), 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 AlternativeOrderDistributionType$ { /** @deprecated use `AlternativeOrderDistributionType$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderDistributionType$inboundSchema; /** @deprecated use `AlternativeOrderDistributionType$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderDistributionType$outboundSchema; } /** @internal */ export const AlternativeOrderFilledQuantity$inboundSchema: z.ZodType< AlternativeOrderFilledQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AlternativeOrderFilledQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const AlternativeOrderFilledQuantity$outboundSchema: z.ZodType< AlternativeOrderFilledQuantity$Outbound, z.ZodTypeDef, AlternativeOrderFilledQuantity > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrderFilledQuantity$ { /** @deprecated use `AlternativeOrderFilledQuantity$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderFilledQuantity$inboundSchema; /** @deprecated use `AlternativeOrderFilledQuantity$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderFilledQuantity$outboundSchema; /** @deprecated use `AlternativeOrderFilledQuantity$Outbound` instead. */ export type Outbound = AlternativeOrderFilledQuantity$Outbound; } export function alternativeOrderFilledQuantityToJSON( alternativeOrderFilledQuantity: AlternativeOrderFilledQuantity, ): string { return JSON.stringify( AlternativeOrderFilledQuantity$outboundSchema.parse( alternativeOrderFilledQuantity, ), ); } export function alternativeOrderFilledQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeOrderFilledQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeOrderFilledQuantity' from JSON`, ); } /** @internal */ export const AlternativeOrderIdentifierType$inboundSchema: z.ZodType< AlternativeOrderIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AlternativeOrderIdentifierType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AlternativeOrderIdentifierType$outboundSchema: z.ZodType< AlternativeOrderIdentifierTypeOpen, z.ZodTypeDef, AlternativeOrderIdentifierTypeOpen > = z.union([ z.nativeEnum(AlternativeOrderIdentifierType), 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 AlternativeOrderIdentifierType$ { /** @deprecated use `AlternativeOrderIdentifierType$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderIdentifierType$inboundSchema; /** @deprecated use `AlternativeOrderIdentifierType$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderIdentifierType$outboundSchema; } /** @internal */ export const AlternativeOrderNotionalValue$inboundSchema: z.ZodType< AlternativeOrderNotionalValue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AlternativeOrderNotionalValue$Outbound = { value?: string | undefined; }; /** @internal */ export const AlternativeOrderNotionalValue$outboundSchema: z.ZodType< AlternativeOrderNotionalValue$Outbound, z.ZodTypeDef, AlternativeOrderNotionalValue > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrderNotionalValue$ { /** @deprecated use `AlternativeOrderNotionalValue$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderNotionalValue$inboundSchema; /** @deprecated use `AlternativeOrderNotionalValue$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderNotionalValue$outboundSchema; /** @deprecated use `AlternativeOrderNotionalValue$Outbound` instead. */ export type Outbound = AlternativeOrderNotionalValue$Outbound; } export function alternativeOrderNotionalValueToJSON( alternativeOrderNotionalValue: AlternativeOrderNotionalValue, ): string { return JSON.stringify( AlternativeOrderNotionalValue$outboundSchema.parse( alternativeOrderNotionalValue, ), ); } export function alternativeOrderNotionalValueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeOrderNotionalValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeOrderNotionalValue' from JSON`, ); } /** @internal */ export const AlternativeOrderOrderStatus$inboundSchema: z.ZodType< AlternativeOrderOrderStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AlternativeOrderOrderStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AlternativeOrderOrderStatus$outboundSchema: z.ZodType< AlternativeOrderOrderStatusOpen, z.ZodTypeDef, AlternativeOrderOrderStatusOpen > = z.union([ z.nativeEnum(AlternativeOrderOrderStatus), 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 AlternativeOrderOrderStatus$ { /** @deprecated use `AlternativeOrderOrderStatus$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderOrderStatus$inboundSchema; /** @deprecated use `AlternativeOrderOrderStatus$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderOrderStatus$outboundSchema; } /** @internal */ export const AlternativeOrderQuantity$inboundSchema: z.ZodType< AlternativeOrderQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AlternativeOrderQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const AlternativeOrderQuantity$outboundSchema: z.ZodType< AlternativeOrderQuantity$Outbound, z.ZodTypeDef, AlternativeOrderQuantity > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrderQuantity$ { /** @deprecated use `AlternativeOrderQuantity$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderQuantity$inboundSchema; /** @deprecated use `AlternativeOrderQuantity$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderQuantity$outboundSchema; /** @deprecated use `AlternativeOrderQuantity$Outbound` instead. */ export type Outbound = AlternativeOrderQuantity$Outbound; } export function alternativeOrderQuantityToJSON( alternativeOrderQuantity: AlternativeOrderQuantity, ): string { return JSON.stringify( AlternativeOrderQuantity$outboundSchema.parse(alternativeOrderQuantity), ); } export function alternativeOrderQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeOrderQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeOrderQuantity' from JSON`, ); } /** @internal */ export const SettlementDate$inboundSchema: z.ZodType< SettlementDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type SettlementDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const SettlementDate$outboundSchema: z.ZodType< SettlementDate$Outbound, z.ZodTypeDef, SettlementDate > = 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 SettlementDate$ { /** @deprecated use `SettlementDate$inboundSchema` instead. */ export const inboundSchema = SettlementDate$inboundSchema; /** @deprecated use `SettlementDate$outboundSchema` instead. */ export const outboundSchema = SettlementDate$outboundSchema; /** @deprecated use `SettlementDate$Outbound` instead. */ export type Outbound = SettlementDate$Outbound; } export function settlementDateToJSON(settlementDate: SettlementDate): string { return JSON.stringify(SettlementDate$outboundSchema.parse(settlementDate)); } export function settlementDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SettlementDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SettlementDate' from JSON`, ); } /** @internal */ export const AlternativeOrderSide$inboundSchema: z.ZodType< AlternativeOrderSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AlternativeOrderSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AlternativeOrderSide$outboundSchema: z.ZodType< AlternativeOrderSideOpen, z.ZodTypeDef, AlternativeOrderSideOpen > = z.union([ z.nativeEnum(AlternativeOrderSide), 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 AlternativeOrderSide$ { /** @deprecated use `AlternativeOrderSide$inboundSchema` instead. */ export const inboundSchema = AlternativeOrderSide$inboundSchema; /** @deprecated use `AlternativeOrderSide$outboundSchema` instead. */ export const outboundSchema = AlternativeOrderSide$outboundSchema; } /** @internal */ export const AlternativeOrder$inboundSchema: z.ZodType< AlternativeOrder, z.ZodTypeDef, unknown > = z.object({ account_id: z.string().optional(), alternative_order_id: z.string().optional(), client_order_id: z.string().optional(), create_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), cumulative_notional_value: z.nullable( z.lazy(() => AlternativeOrderCumulativeNotionalValue$inboundSchema), ).optional(), currency_code: z.string().optional(), distribution_type: AlternativeOrderDistributionType$inboundSchema.optional(), filled_quantity: z.nullable( z.lazy(() => AlternativeOrderFilledQuantity$inboundSchema), ).optional(), full: z.boolean().optional(), identifier: z.string().optional(), identifier_type: AlternativeOrderIdentifierType$inboundSchema.optional(), name: z.string().optional(), notional_value: z.nullable( z.lazy(() => AlternativeOrderNotionalValue$inboundSchema), ).optional(), order_status: AlternativeOrderOrderStatus$inboundSchema.optional(), quantity: z.nullable(z.lazy(() => AlternativeOrderQuantity$inboundSchema)) .optional(), settlement_date: z.nullable(z.lazy(() => SettlementDate$inboundSchema)) .optional(), side: AlternativeOrderSide$inboundSchema.optional(), status_message: z.string().optional(), update_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "alternative_order_id": "alternativeOrderId", "client_order_id": "clientOrderId", "create_time": "createTime", "cumulative_notional_value": "cumulativeNotionalValue", "currency_code": "currencyCode", "distribution_type": "distributionType", "filled_quantity": "filledQuantity", "identifier_type": "identifierType", "notional_value": "notionalValue", "order_status": "orderStatus", "settlement_date": "settlementDate", "status_message": "statusMessage", "update_time": "updateTime", }); }); /** @internal */ export type AlternativeOrder$Outbound = { account_id?: string | undefined; alternative_order_id?: string | undefined; client_order_id?: string | undefined; create_time?: string | null | undefined; cumulative_notional_value?: | AlternativeOrderCumulativeNotionalValue$Outbound | null | undefined; currency_code?: string | undefined; distribution_type?: string | undefined; filled_quantity?: AlternativeOrderFilledQuantity$Outbound | null | undefined; full?: boolean | undefined; identifier?: string | undefined; identifier_type?: string | undefined; name?: string | undefined; notional_value?: AlternativeOrderNotionalValue$Outbound | null | undefined; order_status?: string | undefined; quantity?: AlternativeOrderQuantity$Outbound | null | undefined; settlement_date?: SettlementDate$Outbound | null | undefined; side?: string | undefined; status_message?: string | undefined; update_time?: string | null | undefined; }; /** @internal */ export const AlternativeOrder$outboundSchema: z.ZodType< AlternativeOrder$Outbound, z.ZodTypeDef, AlternativeOrder > = z.object({ accountId: z.string().optional(), alternativeOrderId: z.string().optional(), clientOrderId: z.string().optional(), createTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), cumulativeNotionalValue: z.nullable( z.lazy(() => AlternativeOrderCumulativeNotionalValue$outboundSchema), ).optional(), currencyCode: z.string().optional(), distributionType: AlternativeOrderDistributionType$outboundSchema.optional(), filledQuantity: z.nullable( z.lazy(() => AlternativeOrderFilledQuantity$outboundSchema), ).optional(), full: z.boolean().optional(), identifier: z.string().optional(), identifierType: AlternativeOrderIdentifierType$outboundSchema.optional(), name: z.string().optional(), notionalValue: z.nullable( z.lazy(() => AlternativeOrderNotionalValue$outboundSchema), ).optional(), orderStatus: AlternativeOrderOrderStatus$outboundSchema.optional(), quantity: z.nullable(z.lazy(() => AlternativeOrderQuantity$outboundSchema)) .optional(), settlementDate: z.nullable(z.lazy(() => SettlementDate$outboundSchema)) .optional(), side: AlternativeOrderSide$outboundSchema.optional(), statusMessage: z.string().optional(), updateTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { accountId: "account_id", alternativeOrderId: "alternative_order_id", clientOrderId: "client_order_id", createTime: "create_time", cumulativeNotionalValue: "cumulative_notional_value", currencyCode: "currency_code", distributionType: "distribution_type", filledQuantity: "filled_quantity", identifierType: "identifier_type", notionalValue: "notional_value", orderStatus: "order_status", settlementDate: "settlement_date", statusMessage: "status_message", updateTime: "update_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AlternativeOrder$ { /** @deprecated use `AlternativeOrder$inboundSchema` instead. */ export const inboundSchema = AlternativeOrder$inboundSchema; /** @deprecated use `AlternativeOrder$outboundSchema` instead. */ export const outboundSchema = AlternativeOrder$outboundSchema; /** @deprecated use `AlternativeOrder$Outbound` instead. */ export type Outbound = AlternativeOrder$Outbound; } export function alternativeOrderToJSON( alternativeOrder: AlternativeOrder, ): string { return JSON.stringify( AlternativeOrder$outboundSchema.parse(alternativeOrder), ); } export function alternativeOrderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeOrder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeOrder' from JSON`, ); }