/* * 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"; import { BondYield, BondYield$inboundSchema, BondYield$Outbound, BondYield$outboundSchema, } from "./bondyield.js"; import { BookingFee, BookingFee$inboundSchema, BookingFee$Outbound, BookingFee$outboundSchema, } from "./bookingfee.js"; import { BookingLot, BookingLot$inboundSchema, BookingLot$Outbound, BookingLot$outboundSchema, } from "./bookinglot.js"; /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ export type TradeAllocationAccruedInterestAmount = { /** * 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; }; /** * Type of the asset being traded. */ export enum TradeAllocationAssetType { AssetTypeUnspecified = "ASSET_TYPE_UNSPECIFIED", Equity = "EQUITY", FixedIncome = "FIXED_INCOME", } /** * Type of the asset being traded. */ export type TradeAllocationAssetTypeOpen = OpenEnum< typeof TradeAllocationAssetType >; /** * Broker capacity for the trade. */ export enum TradeAllocationBrokerCapacity { CapacityUnspecified = "CAPACITY_UNSPECIFIED", Agency = "AGENCY", Principal = "PRINCIPAL", Mixed = "MIXED", } /** * Broker capacity for the trade. */ export type TradeAllocationBrokerCapacityOpen = OpenEnum< typeof TradeAllocationBrokerCapacity >; /** * Commission amount of the trade allocation that will only be applied to the to_account_id. */ export type TradeAllocationCommissionAmount = { /** * 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; }; /** * Gross amount is calculated by the Booking service by multiplying price and quantity and fixing it to 2 fractional precision. Optionally specifiable. If present, will override the gross_amount calculated above. */ export type TradeAllocationGrossAmount = { /** * 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; }; /** * Identifier type for the asset being traded. */ export enum TradeAllocationIdentifierType { IdentifierTypeUnspecified = "IDENTIFIER_TYPE_UNSPECIFIED", AssetId = "ASSET_ID", Symbol = "SYMBOL", Cusip = "CUSIP", Isin = "ISIN", } /** * Identifier type for the asset being traded. */ export type TradeAllocationIdentifierTypeOpen = OpenEnum< typeof TradeAllocationIdentifierType >; /** * The price for the instrument that is prevailing in the market. Required for FIXED_INCOME trade allocations when the broker_capacity is PRINCIPAL. */ export type TradeAllocationPrevailingMarketPrice = { /** * 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; }; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ export type TradeAllocationPrice = { /** * 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; }; /** * Total monetary value of the price_adjustment */ export type TradeAllocationPriceAdjustmentAmount = { /** * 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 type of price adjustment being applied by the broker to the net price of the security. */ export enum TradeAllocationPriceAdjustmentType { PriceAdjustmentTypeUnspecified = "PRICE_ADJUSTMENT_TYPE_UNSPECIFIED", Markup = "MARKUP", Markdown = "MARKDOWN", GrossCredit = "GROSS_CREDIT", } /** * The type of price adjustment being applied by the broker to the net price of the security. */ export type TradeAllocationPriceAdjustmentTypeOpen = OpenEnum< typeof TradeAllocationPriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type TradeAllocationPriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | TradeAllocationPriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: TradeAllocationPriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type TradeAllocationQuantity = { /** * 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; }; /** * Defaults to T+1 for equities if this is not provided. Calculated using the execution_time field in Eastern Time. */ export type TradeAllocationSettlementDate = { /** * 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; }; /** * Side modifier for the trade allocation. */ export enum TradeAllocationSideModifier { SideModifierUnspecified = "SIDE_MODIFIER_UNSPECIFIED", Short = "SHORT", ShortExempt = "SHORT_EXEMPT", ShortCover = "SHORT_COVER", Open = "OPEN", Close = "CLOSE", } /** * Side modifier for the trade allocation. */ export type TradeAllocationSideModifierOpen = OpenEnum< typeof TradeAllocationSideModifier >; export enum TradeAllocationSpecialInstructions { SpecialInstructionsUnspecified = "SPECIAL_INSTRUCTIONS_UNSPECIFIED", Rule144 = "RULE_144", WithDividend = "WITH_DIVIDEND", WithRights = "WITH_RIGHTS", CloseContract = "CLOSE_CONTRACT", CoverShort = "COVER_SHORT", CrossTrade = "CROSS_TRADE", OpenContractCovered = "OPEN_CONTRACT_COVERED", DiscretionExercised = "DISCRETION_EXERCISED", DiscretionNotExercised = "DISCRETION_NOT_EXERCISED", OptionAssignment = "OPTION_ASSIGNMENT", EmployeeStockOption = "EMPLOYEE_STOCK_OPTION", InvestmentBanking = "INVESTMENT_BANKING", BrokerDealerOrder = "BROKER_DEALER_ORDER", MakeMarketInSecurity = "MAKE_MARKET_IN_SECURITY", MakeMarketSolicited = "MAKE_MARKET_SOLICITED", MakeMarketUnsolicited = "MAKE_MARKET_UNSOLICITED", CustomerDirected = "CUSTOMER_DIRECTED", FullyRegistered = "FULLY_REGISTERED", OpenContract = "OPEN_CONTRACT", OddlotDiffOnRequest = "ODDLOT_DIFF_ON_REQUEST", ProspectusEnclosed = "PROSPECTUS_ENCLOSED", ProspectusSeparateMail = "PROSPECTUS_SEPARATE_MAIL", Solicited = "SOLICITED", Unsolicited = "UNSOLICITED", XDividend = "X_DIVIDEND", ActingAsPrincipal = "ACTING_AS_PRINCIPAL", AveragePrice = "AVERAGE_PRICE", BrokerLiquidation = "BROKER_LIQUIDATION", CouponBooks = "COUPON_BOOKS", HasPostageFee = "HAS_POSTAGE_FEE", InternetOrder = "INTERNET_ORDER", MarginSellout = "MARGIN_SELLOUT", MarketMakersAsPrincipal = "MARKET_MAKERS_AS_PRINCIPAL", NegativeNetProceed = "NEGATIVE_NET_PROCEED", PreFigIndicator = "PRE_FIG_INDICATOR", RisklessPrincipalInstruction = "RISKLESS_PRINCIPAL_INSTRUCTION", ShortInstruction = "SHORT_INSTRUCTION", ThirdMarket = "THIRD_MARKET", SuppressMsrbTransmission = "SUPPRESS_MSRB_TRANSMISSION", SuppressTraceReporting = "SUPPRESS_TRACE_REPORTING", SuppressEmailNotification = "SUPPRESS_EMAIL_NOTIFICATION", StockReward = "STOCK_REWARD", SuppressRegFees = "SUPPRESS_REG_FEES", SuppressSecFee = "SUPPRESS_SEC_FEE", SuppressTafFee = "SUPPRESS_TAF_FEE", DividendReinvestment = "DIVIDEND_REINVESTMENT", } export type TradeAllocationSpecialInstructionsOpen = OpenEnum< typeof TradeAllocationSpecialInstructions >; /** * The state that the trade allocation is in. */ export enum TradeAllocationState { StateUnspecified = "STATE_UNSPECIFIED", Creating = "CREATING", Rebooking = "REBOOKING", Canceling = "CANCELING", Booked = "BOOKED", Rebooked = "REBOOKED", Canceled = "CANCELED", Failed = "FAILED", } /** * The state that the trade allocation is in. */ export type TradeAllocationStateOpen = OpenEnum; /** * Denotes the side of the position going into the to_account_id. A to_side of SELL indicates the position will be allocated with a BUY out of the from_account, and a SELL into the to_account. */ export enum TradeAllocationToSide { SideUnspecified = "SIDE_UNSPECIFIED", Buy = "BUY", Sell = "SELL", } /** * Denotes the side of the position going into the to_account_id. A to_side of SELL indicates the position will be allocated with a BUY out of the from_account, and a SELL into the to_account. */ export type TradeAllocationToSideOpen = OpenEnum; /** * Denotes that this trade allocation was either when_issued or when_distributed. */ export enum TradeAllocationWhenIssued { WhenIssuedTypeUnspecified = "WHEN_ISSUED_TYPE_UNSPECIFIED", WhenIssued = "WHEN_ISSUED", WhenDistributed = "WHEN_DISTRIBUTED", } /** * Denotes that this trade allocation was either when_issued or when_distributed. */ export type TradeAllocationWhenIssuedOpen = OpenEnum< typeof TradeAllocationWhenIssued >; /** * A TradeAllocation represents the movement of positions between two ascend accounts. */ export type TradeAllocation = { /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ accruedInterestAmount?: | TradeAllocationAccruedInterestAmount | null | undefined; /** * Free form instructions that can be used to provide additional instructions (that are not captured by existing special instructions) and will be put on the trade confirm. */ additionalInstructions?: string | undefined; /** * Type of the asset being traded. */ assetType?: TradeAllocationAssetTypeOpen | undefined; /** * The yield associated with an individual fill of a fixed income trade. Required for FIXED_INCOME trades. Not allowed for trades of other instrument types. */ bondYield?: Array | undefined; /** * Broker capacity for the trade. */ brokerCapacity?: TradeAllocationBrokerCapacityOpen | undefined; /** * The unique identifier that is associated with an order. This is useful for associating the trade allocation with the original trade. This will be assigned a unique UUID if not provided. */ clientOrderId?: string | undefined; /** * Commission amount of the trade allocation that will only be applied to the to_account_id. */ commissionAmount?: TradeAllocationCommissionAmount | null | undefined; /** * Timestamp of when the trade allocation took place. If settlement_date is not provided, this field will be converted into Eastern Time and used to calculate settlement_date. */ executionTime?: Date | null | undefined; /** * Client calculated fees that will only be applied to the to_account_id. Regulatory fees will be calculated automatically if they are not explicitly overwritten or suppressed. */ fees?: Array | undefined; /** * The ULID formatted account_id that the positions will be moved from. */ fromAccountId?: string | undefined; /** * The current activity_id of the trade allocation that positions will be moved from in the Ledger. */ fromActivityId?: string | undefined; /** * Gross amount is calculated by the Booking service by multiplying price and quantity and fixing it to 2 fractional precision. Optionally specifiable. If present, will override the gross_amount calculated above. */ grossAmount?: TradeAllocationGrossAmount | null | undefined; /** * Identifier (of the type specified in `identifier_type`). Responses will supply the originally requested identifier. */ identifier?: string | undefined; /** * Identifier type for the asset being traded. */ identifierType?: TradeAllocationIdentifierTypeOpen | undefined; /** * Unicode CLDR region code. Issuing Region Code is required for some `identifier_type`s, especially CUSIP. */ issuingRegionCode?: string | undefined; /** * One or many lot matching instructions for the trade allocation. */ lotMatchingInstructions?: Array | undefined; /** * Caller provided but can be used for booking-service to note original trade details when booking into the error account or using the error asset. */ memo?: string | undefined; /** * The resource name of the trade allocation. */ name?: string | undefined; /** * The price for the instrument that is prevailing in the market. Required for FIXED_INCOME trade allocations when the broker_capacity is PRINCIPAL. */ prevailingMarketPrice?: | TradeAllocationPrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: TradeAllocationPrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: TradeAllocationPriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: TradeAllocationQuantity | null | undefined; /** * Defaults to T+1 for equities if this is not provided. Calculated using the execution_time field in Eastern Time. */ settlementDate?: TradeAllocationSettlementDate | null | undefined; /** * Side modifier for the trade allocation. */ sideModifier?: TradeAllocationSideModifierOpen | undefined; /** * The source of the submission. */ sourceApplication?: string | undefined; /** * An enumerated list of values used to indicate certain attributes about a trade allocation (E.g. BROKER_LIQUIDATION) and/or trigger downstream processing rules (e.g. SUPPRESS_TRACE_REPORTING) */ specialInstructions?: | Array | undefined; /** * The state that the trade allocation is in. */ state?: TradeAllocationStateOpen | undefined; /** * The ULID formatted account_id that the positions will be moved to. */ toAccountId?: string | undefined; /** * The current activity_id of the trade allocation that positions will be moved to in the Ledger. */ toActivityId?: string | undefined; /** * Denotes the side of the position going into the to_account_id. A to_side of SELL indicates the position will be allocated with a BUY out of the from_account, and a SELL into the to_account. */ toSide?: TradeAllocationToSideOpen | undefined; /** * A ULID to uniquely identify the trade allocation globally. */ tradeAllocationId?: string | undefined; /** * Denotes that this trade allocation was either when_issued or when_distributed. */ whenIssued?: TradeAllocationWhenIssuedOpen | undefined; }; /** @internal */ export const TradeAllocationAccruedInterestAmount$inboundSchema: z.ZodType< TradeAllocationAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationAccruedInterestAmount$outboundSchema: z.ZodType< TradeAllocationAccruedInterestAmount$Outbound, z.ZodTypeDef, TradeAllocationAccruedInterestAmount > = 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 TradeAllocationAccruedInterestAmount$ { /** @deprecated use `TradeAllocationAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = TradeAllocationAccruedInterestAmount$inboundSchema; /** @deprecated use `TradeAllocationAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = TradeAllocationAccruedInterestAmount$outboundSchema; /** @deprecated use `TradeAllocationAccruedInterestAmount$Outbound` instead. */ export type Outbound = TradeAllocationAccruedInterestAmount$Outbound; } export function tradeAllocationAccruedInterestAmountToJSON( tradeAllocationAccruedInterestAmount: TradeAllocationAccruedInterestAmount, ): string { return JSON.stringify( TradeAllocationAccruedInterestAmount$outboundSchema.parse( tradeAllocationAccruedInterestAmount, ), ); } export function tradeAllocationAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationAccruedInterestAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationAccruedInterestAmount' from JSON`, ); } /** @internal */ export const TradeAllocationAssetType$inboundSchema: z.ZodType< TradeAllocationAssetTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationAssetType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationAssetType$outboundSchema: z.ZodType< TradeAllocationAssetTypeOpen, z.ZodTypeDef, TradeAllocationAssetTypeOpen > = z.union([ z.nativeEnum(TradeAllocationAssetType), 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 TradeAllocationAssetType$ { /** @deprecated use `TradeAllocationAssetType$inboundSchema` instead. */ export const inboundSchema = TradeAllocationAssetType$inboundSchema; /** @deprecated use `TradeAllocationAssetType$outboundSchema` instead. */ export const outboundSchema = TradeAllocationAssetType$outboundSchema; } /** @internal */ export const TradeAllocationBrokerCapacity$inboundSchema: z.ZodType< TradeAllocationBrokerCapacityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationBrokerCapacity), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationBrokerCapacity$outboundSchema: z.ZodType< TradeAllocationBrokerCapacityOpen, z.ZodTypeDef, TradeAllocationBrokerCapacityOpen > = z.union([ z.nativeEnum(TradeAllocationBrokerCapacity), 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 TradeAllocationBrokerCapacity$ { /** @deprecated use `TradeAllocationBrokerCapacity$inboundSchema` instead. */ export const inboundSchema = TradeAllocationBrokerCapacity$inboundSchema; /** @deprecated use `TradeAllocationBrokerCapacity$outboundSchema` instead. */ export const outboundSchema = TradeAllocationBrokerCapacity$outboundSchema; } /** @internal */ export const TradeAllocationCommissionAmount$inboundSchema: z.ZodType< TradeAllocationCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationCommissionAmount$outboundSchema: z.ZodType< TradeAllocationCommissionAmount$Outbound, z.ZodTypeDef, TradeAllocationCommissionAmount > = 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 TradeAllocationCommissionAmount$ { /** @deprecated use `TradeAllocationCommissionAmount$inboundSchema` instead. */ export const inboundSchema = TradeAllocationCommissionAmount$inboundSchema; /** @deprecated use `TradeAllocationCommissionAmount$outboundSchema` instead. */ export const outboundSchema = TradeAllocationCommissionAmount$outboundSchema; /** @deprecated use `TradeAllocationCommissionAmount$Outbound` instead. */ export type Outbound = TradeAllocationCommissionAmount$Outbound; } export function tradeAllocationCommissionAmountToJSON( tradeAllocationCommissionAmount: TradeAllocationCommissionAmount, ): string { return JSON.stringify( TradeAllocationCommissionAmount$outboundSchema.parse( tradeAllocationCommissionAmount, ), ); } export function tradeAllocationCommissionAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationCommissionAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationCommissionAmount' from JSON`, ); } /** @internal */ export const TradeAllocationGrossAmount$inboundSchema: z.ZodType< TradeAllocationGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationGrossAmount$outboundSchema: z.ZodType< TradeAllocationGrossAmount$Outbound, z.ZodTypeDef, TradeAllocationGrossAmount > = 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 TradeAllocationGrossAmount$ { /** @deprecated use `TradeAllocationGrossAmount$inboundSchema` instead. */ export const inboundSchema = TradeAllocationGrossAmount$inboundSchema; /** @deprecated use `TradeAllocationGrossAmount$outboundSchema` instead. */ export const outboundSchema = TradeAllocationGrossAmount$outboundSchema; /** @deprecated use `TradeAllocationGrossAmount$Outbound` instead. */ export type Outbound = TradeAllocationGrossAmount$Outbound; } export function tradeAllocationGrossAmountToJSON( tradeAllocationGrossAmount: TradeAllocationGrossAmount, ): string { return JSON.stringify( TradeAllocationGrossAmount$outboundSchema.parse(tradeAllocationGrossAmount), ); } export function tradeAllocationGrossAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationGrossAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationGrossAmount' from JSON`, ); } /** @internal */ export const TradeAllocationIdentifierType$inboundSchema: z.ZodType< TradeAllocationIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationIdentifierType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationIdentifierType$outboundSchema: z.ZodType< TradeAllocationIdentifierTypeOpen, z.ZodTypeDef, TradeAllocationIdentifierTypeOpen > = z.union([ z.nativeEnum(TradeAllocationIdentifierType), 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 TradeAllocationIdentifierType$ { /** @deprecated use `TradeAllocationIdentifierType$inboundSchema` instead. */ export const inboundSchema = TradeAllocationIdentifierType$inboundSchema; /** @deprecated use `TradeAllocationIdentifierType$outboundSchema` instead. */ export const outboundSchema = TradeAllocationIdentifierType$outboundSchema; } /** @internal */ export const TradeAllocationPrevailingMarketPrice$inboundSchema: z.ZodType< TradeAllocationPrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationPrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationPrevailingMarketPrice$outboundSchema: z.ZodType< TradeAllocationPrevailingMarketPrice$Outbound, z.ZodTypeDef, TradeAllocationPrevailingMarketPrice > = 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 TradeAllocationPrevailingMarketPrice$ { /** @deprecated use `TradeAllocationPrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = TradeAllocationPrevailingMarketPrice$inboundSchema; /** @deprecated use `TradeAllocationPrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = TradeAllocationPrevailingMarketPrice$outboundSchema; /** @deprecated use `TradeAllocationPrevailingMarketPrice$Outbound` instead. */ export type Outbound = TradeAllocationPrevailingMarketPrice$Outbound; } export function tradeAllocationPrevailingMarketPriceToJSON( tradeAllocationPrevailingMarketPrice: TradeAllocationPrevailingMarketPrice, ): string { return JSON.stringify( TradeAllocationPrevailingMarketPrice$outboundSchema.parse( tradeAllocationPrevailingMarketPrice, ), ); } export function tradeAllocationPrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationPrevailingMarketPrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationPrevailingMarketPrice' from JSON`, ); } /** @internal */ export const TradeAllocationPrice$inboundSchema: z.ZodType< TradeAllocationPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationPrice$outboundSchema: z.ZodType< TradeAllocationPrice$Outbound, z.ZodTypeDef, TradeAllocationPrice > = 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 TradeAllocationPrice$ { /** @deprecated use `TradeAllocationPrice$inboundSchema` instead. */ export const inboundSchema = TradeAllocationPrice$inboundSchema; /** @deprecated use `TradeAllocationPrice$outboundSchema` instead. */ export const outboundSchema = TradeAllocationPrice$outboundSchema; /** @deprecated use `TradeAllocationPrice$Outbound` instead. */ export type Outbound = TradeAllocationPrice$Outbound; } export function tradeAllocationPriceToJSON( tradeAllocationPrice: TradeAllocationPrice, ): string { return JSON.stringify( TradeAllocationPrice$outboundSchema.parse(tradeAllocationPrice), ); } export function tradeAllocationPriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationPrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationPrice' from JSON`, ); } /** @internal */ export const TradeAllocationPriceAdjustmentAmount$inboundSchema: z.ZodType< TradeAllocationPriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationPriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationPriceAdjustmentAmount$outboundSchema: z.ZodType< TradeAllocationPriceAdjustmentAmount$Outbound, z.ZodTypeDef, TradeAllocationPriceAdjustmentAmount > = 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 TradeAllocationPriceAdjustmentAmount$ { /** @deprecated use `TradeAllocationPriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = TradeAllocationPriceAdjustmentAmount$inboundSchema; /** @deprecated use `TradeAllocationPriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = TradeAllocationPriceAdjustmentAmount$outboundSchema; /** @deprecated use `TradeAllocationPriceAdjustmentAmount$Outbound` instead. */ export type Outbound = TradeAllocationPriceAdjustmentAmount$Outbound; } export function tradeAllocationPriceAdjustmentAmountToJSON( tradeAllocationPriceAdjustmentAmount: TradeAllocationPriceAdjustmentAmount, ): string { return JSON.stringify( TradeAllocationPriceAdjustmentAmount$outboundSchema.parse( tradeAllocationPriceAdjustmentAmount, ), ); } export function tradeAllocationPriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationPriceAdjustmentAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationPriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const TradeAllocationPriceAdjustmentType$inboundSchema: z.ZodType< TradeAllocationPriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationPriceAdjustmentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationPriceAdjustmentType$outboundSchema: z.ZodType< TradeAllocationPriceAdjustmentTypeOpen, z.ZodTypeDef, TradeAllocationPriceAdjustmentTypeOpen > = z.union([ z.nativeEnum(TradeAllocationPriceAdjustmentType), 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 TradeAllocationPriceAdjustmentType$ { /** @deprecated use `TradeAllocationPriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = TradeAllocationPriceAdjustmentType$inboundSchema; /** @deprecated use `TradeAllocationPriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = TradeAllocationPriceAdjustmentType$outboundSchema; } /** @internal */ export const TradeAllocationPriceAdjustment$inboundSchema: z.ZodType< TradeAllocationPriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => TradeAllocationPriceAdjustmentAmount$inboundSchema), ).optional(), price_adjustment_type: TradeAllocationPriceAdjustmentType$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type TradeAllocationPriceAdjustment$Outbound = { price_adjustment_amount?: | TradeAllocationPriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const TradeAllocationPriceAdjustment$outboundSchema: z.ZodType< TradeAllocationPriceAdjustment$Outbound, z.ZodTypeDef, TradeAllocationPriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => TradeAllocationPriceAdjustmentAmount$outboundSchema), ).optional(), priceAdjustmentType: TradeAllocationPriceAdjustmentType$outboundSchema .optional(), }).transform((v) => { return remap$(v, { priceAdjustmentAmount: "price_adjustment_amount", priceAdjustmentType: "price_adjustment_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TradeAllocationPriceAdjustment$ { /** @deprecated use `TradeAllocationPriceAdjustment$inboundSchema` instead. */ export const inboundSchema = TradeAllocationPriceAdjustment$inboundSchema; /** @deprecated use `TradeAllocationPriceAdjustment$outboundSchema` instead. */ export const outboundSchema = TradeAllocationPriceAdjustment$outboundSchema; /** @deprecated use `TradeAllocationPriceAdjustment$Outbound` instead. */ export type Outbound = TradeAllocationPriceAdjustment$Outbound; } export function tradeAllocationPriceAdjustmentToJSON( tradeAllocationPriceAdjustment: TradeAllocationPriceAdjustment, ): string { return JSON.stringify( TradeAllocationPriceAdjustment$outboundSchema.parse( tradeAllocationPriceAdjustment, ), ); } export function tradeAllocationPriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationPriceAdjustment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationPriceAdjustment' from JSON`, ); } /** @internal */ export const TradeAllocationQuantity$inboundSchema: z.ZodType< TradeAllocationQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type TradeAllocationQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const TradeAllocationQuantity$outboundSchema: z.ZodType< TradeAllocationQuantity$Outbound, z.ZodTypeDef, TradeAllocationQuantity > = 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 TradeAllocationQuantity$ { /** @deprecated use `TradeAllocationQuantity$inboundSchema` instead. */ export const inboundSchema = TradeAllocationQuantity$inboundSchema; /** @deprecated use `TradeAllocationQuantity$outboundSchema` instead. */ export const outboundSchema = TradeAllocationQuantity$outboundSchema; /** @deprecated use `TradeAllocationQuantity$Outbound` instead. */ export type Outbound = TradeAllocationQuantity$Outbound; } export function tradeAllocationQuantityToJSON( tradeAllocationQuantity: TradeAllocationQuantity, ): string { return JSON.stringify( TradeAllocationQuantity$outboundSchema.parse(tradeAllocationQuantity), ); } export function tradeAllocationQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationQuantity' from JSON`, ); } /** @internal */ export const TradeAllocationSettlementDate$inboundSchema: z.ZodType< TradeAllocationSettlementDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type TradeAllocationSettlementDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const TradeAllocationSettlementDate$outboundSchema: z.ZodType< TradeAllocationSettlementDate$Outbound, z.ZodTypeDef, TradeAllocationSettlementDate > = 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 TradeAllocationSettlementDate$ { /** @deprecated use `TradeAllocationSettlementDate$inboundSchema` instead. */ export const inboundSchema = TradeAllocationSettlementDate$inboundSchema; /** @deprecated use `TradeAllocationSettlementDate$outboundSchema` instead. */ export const outboundSchema = TradeAllocationSettlementDate$outboundSchema; /** @deprecated use `TradeAllocationSettlementDate$Outbound` instead. */ export type Outbound = TradeAllocationSettlementDate$Outbound; } export function tradeAllocationSettlementDateToJSON( tradeAllocationSettlementDate: TradeAllocationSettlementDate, ): string { return JSON.stringify( TradeAllocationSettlementDate$outboundSchema.parse( tradeAllocationSettlementDate, ), ); } export function tradeAllocationSettlementDateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocationSettlementDate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocationSettlementDate' from JSON`, ); } /** @internal */ export const TradeAllocationSideModifier$inboundSchema: z.ZodType< TradeAllocationSideModifierOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationSideModifier), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationSideModifier$outboundSchema: z.ZodType< TradeAllocationSideModifierOpen, z.ZodTypeDef, TradeAllocationSideModifierOpen > = z.union([ z.nativeEnum(TradeAllocationSideModifier), 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 TradeAllocationSideModifier$ { /** @deprecated use `TradeAllocationSideModifier$inboundSchema` instead. */ export const inboundSchema = TradeAllocationSideModifier$inboundSchema; /** @deprecated use `TradeAllocationSideModifier$outboundSchema` instead. */ export const outboundSchema = TradeAllocationSideModifier$outboundSchema; } /** @internal */ export const TradeAllocationSpecialInstructions$inboundSchema: z.ZodType< TradeAllocationSpecialInstructionsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationSpecialInstructions), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationSpecialInstructions$outboundSchema: z.ZodType< TradeAllocationSpecialInstructionsOpen, z.ZodTypeDef, TradeAllocationSpecialInstructionsOpen > = z.union([ z.nativeEnum(TradeAllocationSpecialInstructions), 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 TradeAllocationSpecialInstructions$ { /** @deprecated use `TradeAllocationSpecialInstructions$inboundSchema` instead. */ export const inboundSchema = TradeAllocationSpecialInstructions$inboundSchema; /** @deprecated use `TradeAllocationSpecialInstructions$outboundSchema` instead. */ export const outboundSchema = TradeAllocationSpecialInstructions$outboundSchema; } /** @internal */ export const TradeAllocationState$inboundSchema: z.ZodType< TradeAllocationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationState$outboundSchema: z.ZodType< TradeAllocationStateOpen, z.ZodTypeDef, TradeAllocationStateOpen > = z.union([ z.nativeEnum(TradeAllocationState), 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 TradeAllocationState$ { /** @deprecated use `TradeAllocationState$inboundSchema` instead. */ export const inboundSchema = TradeAllocationState$inboundSchema; /** @deprecated use `TradeAllocationState$outboundSchema` instead. */ export const outboundSchema = TradeAllocationState$outboundSchema; } /** @internal */ export const TradeAllocationToSide$inboundSchema: z.ZodType< TradeAllocationToSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationToSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationToSide$outboundSchema: z.ZodType< TradeAllocationToSideOpen, z.ZodTypeDef, TradeAllocationToSideOpen > = z.union([ z.nativeEnum(TradeAllocationToSide), 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 TradeAllocationToSide$ { /** @deprecated use `TradeAllocationToSide$inboundSchema` instead. */ export const inboundSchema = TradeAllocationToSide$inboundSchema; /** @deprecated use `TradeAllocationToSide$outboundSchema` instead. */ export const outboundSchema = TradeAllocationToSide$outboundSchema; } /** @internal */ export const TradeAllocationWhenIssued$inboundSchema: z.ZodType< TradeAllocationWhenIssuedOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(TradeAllocationWhenIssued), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const TradeAllocationWhenIssued$outboundSchema: z.ZodType< TradeAllocationWhenIssuedOpen, z.ZodTypeDef, TradeAllocationWhenIssuedOpen > = z.union([ z.nativeEnum(TradeAllocationWhenIssued), 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 TradeAllocationWhenIssued$ { /** @deprecated use `TradeAllocationWhenIssued$inboundSchema` instead. */ export const inboundSchema = TradeAllocationWhenIssued$inboundSchema; /** @deprecated use `TradeAllocationWhenIssued$outboundSchema` instead. */ export const outboundSchema = TradeAllocationWhenIssued$outboundSchema; } /** @internal */ export const TradeAllocation$inboundSchema: z.ZodType< TradeAllocation, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => TradeAllocationAccruedInterestAmount$inboundSchema), ).optional(), additional_instructions: z.string().optional(), asset_type: TradeAllocationAssetType$inboundSchema.optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), broker_capacity: TradeAllocationBrokerCapacity$inboundSchema.optional(), client_order_id: z.string().optional(), commission_amount: z.nullable( z.lazy(() => TradeAllocationCommissionAmount$inboundSchema), ).optional(), execution_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), fees: z.array(BookingFee$inboundSchema).optional(), from_account_id: z.string().optional(), from_activity_id: z.string().optional(), gross_amount: z.nullable( z.lazy(() => TradeAllocationGrossAmount$inboundSchema), ).optional(), identifier: z.string().optional(), identifier_type: TradeAllocationIdentifierType$inboundSchema.optional(), issuing_region_code: z.string().optional(), lot_matching_instructions: z.array(BookingLot$inboundSchema).optional(), memo: z.string().optional(), name: z.string().optional(), prevailing_market_price: z.nullable( z.lazy(() => TradeAllocationPrevailingMarketPrice$inboundSchema), ).optional(), price: z.nullable(z.lazy(() => TradeAllocationPrice$inboundSchema)) .optional(), price_adjustment: z.nullable( z.lazy(() => TradeAllocationPriceAdjustment$inboundSchema), ).optional(), quantity: z.nullable(z.lazy(() => TradeAllocationQuantity$inboundSchema)) .optional(), settlement_date: z.nullable( z.lazy(() => TradeAllocationSettlementDate$inboundSchema), ).optional(), side_modifier: TradeAllocationSideModifier$inboundSchema.optional(), source_application: z.string().optional(), special_instructions: z.array( TradeAllocationSpecialInstructions$inboundSchema, ).optional(), state: TradeAllocationState$inboundSchema.optional(), to_account_id: z.string().optional(), to_activity_id: z.string().optional(), to_side: TradeAllocationToSide$inboundSchema.optional(), trade_allocation_id: z.string().optional(), when_issued: TradeAllocationWhenIssued$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "accrued_interest_amount": "accruedInterestAmount", "additional_instructions": "additionalInstructions", "asset_type": "assetType", "bond_yield": "bondYield", "broker_capacity": "brokerCapacity", "client_order_id": "clientOrderId", "commission_amount": "commissionAmount", "execution_time": "executionTime", "from_account_id": "fromAccountId", "from_activity_id": "fromActivityId", "gross_amount": "grossAmount", "identifier_type": "identifierType", "issuing_region_code": "issuingRegionCode", "lot_matching_instructions": "lotMatchingInstructions", "prevailing_market_price": "prevailingMarketPrice", "price_adjustment": "priceAdjustment", "settlement_date": "settlementDate", "side_modifier": "sideModifier", "source_application": "sourceApplication", "special_instructions": "specialInstructions", "to_account_id": "toAccountId", "to_activity_id": "toActivityId", "to_side": "toSide", "trade_allocation_id": "tradeAllocationId", "when_issued": "whenIssued", }); }); /** @internal */ export type TradeAllocation$Outbound = { accrued_interest_amount?: | TradeAllocationAccruedInterestAmount$Outbound | null | undefined; additional_instructions?: string | undefined; asset_type?: string | undefined; bond_yield?: Array | undefined; broker_capacity?: string | undefined; client_order_id?: string | undefined; commission_amount?: | TradeAllocationCommissionAmount$Outbound | null | undefined; execution_time?: string | null | undefined; fees?: Array | undefined; from_account_id?: string | undefined; from_activity_id?: string | undefined; gross_amount?: TradeAllocationGrossAmount$Outbound | null | undefined; identifier?: string | undefined; identifier_type?: string | undefined; issuing_region_code?: string | undefined; lot_matching_instructions?: Array | undefined; memo?: string | undefined; name?: string | undefined; prevailing_market_price?: | TradeAllocationPrevailingMarketPrice$Outbound | null | undefined; price?: TradeAllocationPrice$Outbound | null | undefined; price_adjustment?: TradeAllocationPriceAdjustment$Outbound | null | undefined; quantity?: TradeAllocationQuantity$Outbound | null | undefined; settlement_date?: TradeAllocationSettlementDate$Outbound | null | undefined; side_modifier?: string | undefined; source_application?: string | undefined; special_instructions?: Array | undefined; state?: string | undefined; to_account_id?: string | undefined; to_activity_id?: string | undefined; to_side?: string | undefined; trade_allocation_id?: string | undefined; when_issued?: string | undefined; }; /** @internal */ export const TradeAllocation$outboundSchema: z.ZodType< TradeAllocation$Outbound, z.ZodTypeDef, TradeAllocation > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => TradeAllocationAccruedInterestAmount$outboundSchema), ).optional(), additionalInstructions: z.string().optional(), assetType: TradeAllocationAssetType$outboundSchema.optional(), bondYield: z.array(BondYield$outboundSchema).optional(), brokerCapacity: TradeAllocationBrokerCapacity$outboundSchema.optional(), clientOrderId: z.string().optional(), commissionAmount: z.nullable( z.lazy(() => TradeAllocationCommissionAmount$outboundSchema), ).optional(), executionTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), fees: z.array(BookingFee$outboundSchema).optional(), fromAccountId: z.string().optional(), fromActivityId: z.string().optional(), grossAmount: z.nullable( z.lazy(() => TradeAllocationGrossAmount$outboundSchema), ).optional(), identifier: z.string().optional(), identifierType: TradeAllocationIdentifierType$outboundSchema.optional(), issuingRegionCode: z.string().optional(), lotMatchingInstructions: z.array(BookingLot$outboundSchema).optional(), memo: z.string().optional(), name: z.string().optional(), prevailingMarketPrice: z.nullable( z.lazy(() => TradeAllocationPrevailingMarketPrice$outboundSchema), ).optional(), price: z.nullable(z.lazy(() => TradeAllocationPrice$outboundSchema)) .optional(), priceAdjustment: z.nullable( z.lazy(() => TradeAllocationPriceAdjustment$outboundSchema), ).optional(), quantity: z.nullable(z.lazy(() => TradeAllocationQuantity$outboundSchema)) .optional(), settlementDate: z.nullable( z.lazy(() => TradeAllocationSettlementDate$outboundSchema), ).optional(), sideModifier: TradeAllocationSideModifier$outboundSchema.optional(), sourceApplication: z.string().optional(), specialInstructions: z.array( TradeAllocationSpecialInstructions$outboundSchema, ).optional(), state: TradeAllocationState$outboundSchema.optional(), toAccountId: z.string().optional(), toActivityId: z.string().optional(), toSide: TradeAllocationToSide$outboundSchema.optional(), tradeAllocationId: z.string().optional(), whenIssued: TradeAllocationWhenIssued$outboundSchema.optional(), }).transform((v) => { return remap$(v, { accruedInterestAmount: "accrued_interest_amount", additionalInstructions: "additional_instructions", assetType: "asset_type", bondYield: "bond_yield", brokerCapacity: "broker_capacity", clientOrderId: "client_order_id", commissionAmount: "commission_amount", executionTime: "execution_time", fromAccountId: "from_account_id", fromActivityId: "from_activity_id", grossAmount: "gross_amount", identifierType: "identifier_type", issuingRegionCode: "issuing_region_code", lotMatchingInstructions: "lot_matching_instructions", prevailingMarketPrice: "prevailing_market_price", priceAdjustment: "price_adjustment", settlementDate: "settlement_date", sideModifier: "side_modifier", sourceApplication: "source_application", specialInstructions: "special_instructions", toAccountId: "to_account_id", toActivityId: "to_activity_id", toSide: "to_side", tradeAllocationId: "trade_allocation_id", whenIssued: "when_issued", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TradeAllocation$ { /** @deprecated use `TradeAllocation$inboundSchema` instead. */ export const inboundSchema = TradeAllocation$inboundSchema; /** @deprecated use `TradeAllocation$outboundSchema` instead. */ export const outboundSchema = TradeAllocation$outboundSchema; /** @deprecated use `TradeAllocation$Outbound` instead. */ export type Outbound = TradeAllocation$Outbound; } export function tradeAllocationToJSON( tradeAllocation: TradeAllocation, ): string { return JSON.stringify(TradeAllocation$outboundSchema.parse(tradeAllocation)); } export function tradeAllocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TradeAllocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TradeAllocation' from JSON`, ); }