/* * 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 CancelTradeAllocationResponseAccruedInterestAmount = { /** * 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 CancelTradeAllocationResponseAssetType { AssetTypeUnspecified = "ASSET_TYPE_UNSPECIFIED", Equity = "EQUITY", FixedIncome = "FIXED_INCOME", } /** * Type of the asset being traded. */ export type CancelTradeAllocationResponseAssetTypeOpen = OpenEnum< typeof CancelTradeAllocationResponseAssetType >; /** * Broker capacity for the trade. */ export enum CancelTradeAllocationResponseBrokerCapacity { CapacityUnspecified = "CAPACITY_UNSPECIFIED", Agency = "AGENCY", Principal = "PRINCIPAL", Mixed = "MIXED", } /** * Broker capacity for the trade. */ export type CancelTradeAllocationResponseBrokerCapacityOpen = OpenEnum< typeof CancelTradeAllocationResponseBrokerCapacity >; /** * Commission amount of the trade allocation that will only be applied to the to_account_id. */ export type CancelTradeAllocationResponseCommissionAmount = { /** * 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 CancelTradeAllocationResponseGrossAmount = { /** * 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 CancelTradeAllocationResponseIdentifierType { IdentifierTypeUnspecified = "IDENTIFIER_TYPE_UNSPECIFIED", AssetId = "ASSET_ID", Symbol = "SYMBOL", Cusip = "CUSIP", Isin = "ISIN", } /** * Identifier type for the asset being traded. */ export type CancelTradeAllocationResponseIdentifierTypeOpen = OpenEnum< typeof CancelTradeAllocationResponseIdentifierType >; /** * 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 CancelTradeAllocationResponsePrevailingMarketPrice = { /** * 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 CancelTradeAllocationResponsePrice = { /** * 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 CancelTradeAllocationResponsePriceAdjustmentAmount = { /** * 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 CancelTradeAllocationResponsePriceAdjustmentType { 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 CancelTradeAllocationResponsePriceAdjustmentTypeOpen = OpenEnum< typeof CancelTradeAllocationResponsePriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type CancelTradeAllocationResponsePriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | CancelTradeAllocationResponsePriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: | CancelTradeAllocationResponsePriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type CancelTradeAllocationResponseQuantity = { /** * 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 CancelTradeAllocationResponseSettlementDate = { /** * 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 CancelTradeAllocationResponseSideModifier { SideModifierUnspecified = "SIDE_MODIFIER_UNSPECIFIED", Short = "SHORT", ShortExempt = "SHORT_EXEMPT", ShortCover = "SHORT_COVER", Open = "OPEN", Close = "CLOSE", } /** * Side modifier for the trade allocation. */ export type CancelTradeAllocationResponseSideModifierOpen = OpenEnum< typeof CancelTradeAllocationResponseSideModifier >; export enum CancelTradeAllocationResponseSpecialInstructions { 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 CancelTradeAllocationResponseSpecialInstructionsOpen = OpenEnum< typeof CancelTradeAllocationResponseSpecialInstructions >; /** * The state that the trade allocation is in. */ export enum CancelTradeAllocationResponseState { 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 CancelTradeAllocationResponseStateOpen = OpenEnum< typeof CancelTradeAllocationResponseState >; /** * 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 CancelTradeAllocationResponseToSide { 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 CancelTradeAllocationResponseToSideOpen = OpenEnum< typeof CancelTradeAllocationResponseToSide >; /** * Denotes that this trade allocation was either when_issued or when_distributed. */ export enum CancelTradeAllocationResponseWhenIssued { 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 CancelTradeAllocationResponseWhenIssuedOpen = OpenEnum< typeof CancelTradeAllocationResponseWhenIssued >; /** * The trade allocation that was canceled. */ export type CancelTradeAllocationResponseTradeAllocation = { /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ accruedInterestAmount?: | CancelTradeAllocationResponseAccruedInterestAmount | 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?: CancelTradeAllocationResponseAssetTypeOpen | 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?: CancelTradeAllocationResponseBrokerCapacityOpen | 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?: | CancelTradeAllocationResponseCommissionAmount | 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?: CancelTradeAllocationResponseGrossAmount | 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?: CancelTradeAllocationResponseIdentifierTypeOpen | 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?: | CancelTradeAllocationResponsePrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: CancelTradeAllocationResponsePrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: | CancelTradeAllocationResponsePriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: CancelTradeAllocationResponseQuantity | null | undefined; /** * Defaults to T+1 for equities if this is not provided. Calculated using the execution_time field in Eastern Time. */ settlementDate?: | CancelTradeAllocationResponseSettlementDate | null | undefined; /** * Side modifier for the trade allocation. */ sideModifier?: CancelTradeAllocationResponseSideModifierOpen | 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?: CancelTradeAllocationResponseStateOpen | 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?: CancelTradeAllocationResponseToSideOpen | 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?: CancelTradeAllocationResponseWhenIssuedOpen | undefined; }; /** * A response for the cancel trade allocation method. */ export type CancelTradeAllocationResponse = { /** * The trade allocation that was canceled. */ tradeAllocation?: | CancelTradeAllocationResponseTradeAllocation | null | undefined; }; /** @internal */ export const CancelTradeAllocationResponseAccruedInterestAmount$inboundSchema: z.ZodType< CancelTradeAllocationResponseAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponseAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponseAccruedInterestAmount$outboundSchema: z.ZodType< CancelTradeAllocationResponseAccruedInterestAmount$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseAccruedInterestAmount > = 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 CancelTradeAllocationResponseAccruedInterestAmount$ { /** @deprecated use `CancelTradeAllocationResponseAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseAccruedInterestAmount$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseAccruedInterestAmount$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseAccruedInterestAmount$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseAccruedInterestAmount$Outbound; } export function cancelTradeAllocationResponseAccruedInterestAmountToJSON( cancelTradeAllocationResponseAccruedInterestAmount: CancelTradeAllocationResponseAccruedInterestAmount, ): string { return JSON.stringify( CancelTradeAllocationResponseAccruedInterestAmount$outboundSchema.parse( cancelTradeAllocationResponseAccruedInterestAmount, ), ); } export function cancelTradeAllocationResponseAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponseAccruedInterestAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponseAccruedInterestAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponseAccruedInterestAmount' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseAssetType$inboundSchema: z.ZodType< CancelTradeAllocationResponseAssetTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseAssetType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseAssetType$outboundSchema: z.ZodType< CancelTradeAllocationResponseAssetTypeOpen, z.ZodTypeDef, CancelTradeAllocationResponseAssetTypeOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseAssetType), 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 CancelTradeAllocationResponseAssetType$ { /** @deprecated use `CancelTradeAllocationResponseAssetType$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseAssetType$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseAssetType$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseAssetType$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseBrokerCapacity$inboundSchema: z.ZodType< CancelTradeAllocationResponseBrokerCapacityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseBrokerCapacity), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseBrokerCapacity$outboundSchema: z.ZodType< CancelTradeAllocationResponseBrokerCapacityOpen, z.ZodTypeDef, CancelTradeAllocationResponseBrokerCapacityOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseBrokerCapacity), 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 CancelTradeAllocationResponseBrokerCapacity$ { /** @deprecated use `CancelTradeAllocationResponseBrokerCapacity$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseBrokerCapacity$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseBrokerCapacity$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseBrokerCapacity$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseCommissionAmount$inboundSchema: z.ZodType< CancelTradeAllocationResponseCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponseCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponseCommissionAmount$outboundSchema: z.ZodType< CancelTradeAllocationResponseCommissionAmount$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseCommissionAmount > = 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 CancelTradeAllocationResponseCommissionAmount$ { /** @deprecated use `CancelTradeAllocationResponseCommissionAmount$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseCommissionAmount$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseCommissionAmount$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseCommissionAmount$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseCommissionAmount$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseCommissionAmount$Outbound; } export function cancelTradeAllocationResponseCommissionAmountToJSON( cancelTradeAllocationResponseCommissionAmount: CancelTradeAllocationResponseCommissionAmount, ): string { return JSON.stringify( CancelTradeAllocationResponseCommissionAmount$outboundSchema.parse( cancelTradeAllocationResponseCommissionAmount, ), ); } export function cancelTradeAllocationResponseCommissionAmountFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponseCommissionAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponseCommissionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponseCommissionAmount' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseGrossAmount$inboundSchema: z.ZodType< CancelTradeAllocationResponseGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponseGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponseGrossAmount$outboundSchema: z.ZodType< CancelTradeAllocationResponseGrossAmount$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseGrossAmount > = 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 CancelTradeAllocationResponseGrossAmount$ { /** @deprecated use `CancelTradeAllocationResponseGrossAmount$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseGrossAmount$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseGrossAmount$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseGrossAmount$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseGrossAmount$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseGrossAmount$Outbound; } export function cancelTradeAllocationResponseGrossAmountToJSON( cancelTradeAllocationResponseGrossAmount: CancelTradeAllocationResponseGrossAmount, ): string { return JSON.stringify( CancelTradeAllocationResponseGrossAmount$outboundSchema.parse( cancelTradeAllocationResponseGrossAmount, ), ); } export function cancelTradeAllocationResponseGrossAmountFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponseGrossAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponseGrossAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponseGrossAmount' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseIdentifierType$inboundSchema: z.ZodType< CancelTradeAllocationResponseIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseIdentifierType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseIdentifierType$outboundSchema: z.ZodType< CancelTradeAllocationResponseIdentifierTypeOpen, z.ZodTypeDef, CancelTradeAllocationResponseIdentifierTypeOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseIdentifierType), 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 CancelTradeAllocationResponseIdentifierType$ { /** @deprecated use `CancelTradeAllocationResponseIdentifierType$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseIdentifierType$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseIdentifierType$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseIdentifierType$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponsePrevailingMarketPrice$inboundSchema: z.ZodType< CancelTradeAllocationResponsePrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponsePrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponsePrevailingMarketPrice$outboundSchema: z.ZodType< CancelTradeAllocationResponsePrevailingMarketPrice$Outbound, z.ZodTypeDef, CancelTradeAllocationResponsePrevailingMarketPrice > = 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 CancelTradeAllocationResponsePrevailingMarketPrice$ { /** @deprecated use `CancelTradeAllocationResponsePrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponsePrevailingMarketPrice$inboundSchema; /** @deprecated use `CancelTradeAllocationResponsePrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponsePrevailingMarketPrice$outboundSchema; /** @deprecated use `CancelTradeAllocationResponsePrevailingMarketPrice$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponsePrevailingMarketPrice$Outbound; } export function cancelTradeAllocationResponsePrevailingMarketPriceToJSON( cancelTradeAllocationResponsePrevailingMarketPrice: CancelTradeAllocationResponsePrevailingMarketPrice, ): string { return JSON.stringify( CancelTradeAllocationResponsePrevailingMarketPrice$outboundSchema.parse( cancelTradeAllocationResponsePrevailingMarketPrice, ), ); } export function cancelTradeAllocationResponsePrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponsePrevailingMarketPrice, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponsePrevailingMarketPrice$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponsePrevailingMarketPrice' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponsePrice$inboundSchema: z.ZodType< CancelTradeAllocationResponsePrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponsePrice$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponsePrice$outboundSchema: z.ZodType< CancelTradeAllocationResponsePrice$Outbound, z.ZodTypeDef, CancelTradeAllocationResponsePrice > = 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 CancelTradeAllocationResponsePrice$ { /** @deprecated use `CancelTradeAllocationResponsePrice$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponsePrice$inboundSchema; /** @deprecated use `CancelTradeAllocationResponsePrice$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponsePrice$outboundSchema; /** @deprecated use `CancelTradeAllocationResponsePrice$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponsePrice$Outbound; } export function cancelTradeAllocationResponsePriceToJSON( cancelTradeAllocationResponsePrice: CancelTradeAllocationResponsePrice, ): string { return JSON.stringify( CancelTradeAllocationResponsePrice$outboundSchema.parse( cancelTradeAllocationResponsePrice, ), ); } export function cancelTradeAllocationResponsePriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelTradeAllocationResponsePrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelTradeAllocationResponsePrice' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponsePriceAdjustmentAmount$inboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponsePriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponsePriceAdjustmentAmount$outboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustmentAmount$Outbound, z.ZodTypeDef, CancelTradeAllocationResponsePriceAdjustmentAmount > = 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 CancelTradeAllocationResponsePriceAdjustmentAmount$ { /** @deprecated use `CancelTradeAllocationResponsePriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponsePriceAdjustmentAmount$inboundSchema; /** @deprecated use `CancelTradeAllocationResponsePriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponsePriceAdjustmentAmount$outboundSchema; /** @deprecated use `CancelTradeAllocationResponsePriceAdjustmentAmount$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponsePriceAdjustmentAmount$Outbound; } export function cancelTradeAllocationResponsePriceAdjustmentAmountToJSON( cancelTradeAllocationResponsePriceAdjustmentAmount: CancelTradeAllocationResponsePriceAdjustmentAmount, ): string { return JSON.stringify( CancelTradeAllocationResponsePriceAdjustmentAmount$outboundSchema.parse( cancelTradeAllocationResponsePriceAdjustmentAmount, ), ); } export function cancelTradeAllocationResponsePriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponsePriceAdjustmentAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponsePriceAdjustmentAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponsePriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponsePriceAdjustmentType$inboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponsePriceAdjustmentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponsePriceAdjustmentType$outboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, CancelTradeAllocationResponsePriceAdjustmentTypeOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponsePriceAdjustmentType), 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 CancelTradeAllocationResponsePriceAdjustmentType$ { /** @deprecated use `CancelTradeAllocationResponsePriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponsePriceAdjustmentType$inboundSchema; /** @deprecated use `CancelTradeAllocationResponsePriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponsePriceAdjustmentType$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponsePriceAdjustment$inboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => CancelTradeAllocationResponsePriceAdjustmentAmount$inboundSchema ), ).optional(), price_adjustment_type: CancelTradeAllocationResponsePriceAdjustmentType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type CancelTradeAllocationResponsePriceAdjustment$Outbound = { price_adjustment_amount?: | CancelTradeAllocationResponsePriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponsePriceAdjustment$outboundSchema: z.ZodType< CancelTradeAllocationResponsePriceAdjustment$Outbound, z.ZodTypeDef, CancelTradeAllocationResponsePriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => CancelTradeAllocationResponsePriceAdjustmentAmount$outboundSchema ), ).optional(), priceAdjustmentType: CancelTradeAllocationResponsePriceAdjustmentType$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 CancelTradeAllocationResponsePriceAdjustment$ { /** @deprecated use `CancelTradeAllocationResponsePriceAdjustment$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponsePriceAdjustment$inboundSchema; /** @deprecated use `CancelTradeAllocationResponsePriceAdjustment$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponsePriceAdjustment$outboundSchema; /** @deprecated use `CancelTradeAllocationResponsePriceAdjustment$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponsePriceAdjustment$Outbound; } export function cancelTradeAllocationResponsePriceAdjustmentToJSON( cancelTradeAllocationResponsePriceAdjustment: CancelTradeAllocationResponsePriceAdjustment, ): string { return JSON.stringify( CancelTradeAllocationResponsePriceAdjustment$outboundSchema.parse( cancelTradeAllocationResponsePriceAdjustment, ), ); } export function cancelTradeAllocationResponsePriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponsePriceAdjustment, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponsePriceAdjustment$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponsePriceAdjustment' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseQuantity$inboundSchema: z.ZodType< CancelTradeAllocationResponseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelTradeAllocationResponseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelTradeAllocationResponseQuantity$outboundSchema: z.ZodType< CancelTradeAllocationResponseQuantity$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseQuantity > = 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 CancelTradeAllocationResponseQuantity$ { /** @deprecated use `CancelTradeAllocationResponseQuantity$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseQuantity$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseQuantity$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseQuantity$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseQuantity$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseQuantity$Outbound; } export function cancelTradeAllocationResponseQuantityToJSON( cancelTradeAllocationResponseQuantity: CancelTradeAllocationResponseQuantity, ): string { return JSON.stringify( CancelTradeAllocationResponseQuantity$outboundSchema.parse( cancelTradeAllocationResponseQuantity, ), ); } export function cancelTradeAllocationResponseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelTradeAllocationResponseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelTradeAllocationResponseQuantity' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseSettlementDate$inboundSchema: z.ZodType< CancelTradeAllocationResponseSettlementDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type CancelTradeAllocationResponseSettlementDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const CancelTradeAllocationResponseSettlementDate$outboundSchema: z.ZodType< CancelTradeAllocationResponseSettlementDate$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseSettlementDate > = 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 CancelTradeAllocationResponseSettlementDate$ { /** @deprecated use `CancelTradeAllocationResponseSettlementDate$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseSettlementDate$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseSettlementDate$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseSettlementDate$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseSettlementDate$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseSettlementDate$Outbound; } export function cancelTradeAllocationResponseSettlementDateToJSON( cancelTradeAllocationResponseSettlementDate: CancelTradeAllocationResponseSettlementDate, ): string { return JSON.stringify( CancelTradeAllocationResponseSettlementDate$outboundSchema.parse( cancelTradeAllocationResponseSettlementDate, ), ); } export function cancelTradeAllocationResponseSettlementDateFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponseSettlementDate, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponseSettlementDate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponseSettlementDate' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponseSideModifier$inboundSchema: z.ZodType< CancelTradeAllocationResponseSideModifierOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseSideModifier), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseSideModifier$outboundSchema: z.ZodType< CancelTradeAllocationResponseSideModifierOpen, z.ZodTypeDef, CancelTradeAllocationResponseSideModifierOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseSideModifier), 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 CancelTradeAllocationResponseSideModifier$ { /** @deprecated use `CancelTradeAllocationResponseSideModifier$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseSideModifier$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseSideModifier$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseSideModifier$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseSpecialInstructions$inboundSchema: z.ZodType< CancelTradeAllocationResponseSpecialInstructionsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseSpecialInstructions), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseSpecialInstructions$outboundSchema: z.ZodType< CancelTradeAllocationResponseSpecialInstructionsOpen, z.ZodTypeDef, CancelTradeAllocationResponseSpecialInstructionsOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseSpecialInstructions), 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 CancelTradeAllocationResponseSpecialInstructions$ { /** @deprecated use `CancelTradeAllocationResponseSpecialInstructions$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseSpecialInstructions$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseSpecialInstructions$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseSpecialInstructions$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseState$inboundSchema: z.ZodType< CancelTradeAllocationResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseState$outboundSchema: z.ZodType< CancelTradeAllocationResponseStateOpen, z.ZodTypeDef, CancelTradeAllocationResponseStateOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseState), 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 CancelTradeAllocationResponseState$ { /** @deprecated use `CancelTradeAllocationResponseState$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseState$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseState$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseState$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseToSide$inboundSchema: z.ZodType< CancelTradeAllocationResponseToSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseToSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseToSide$outboundSchema: z.ZodType< CancelTradeAllocationResponseToSideOpen, z.ZodTypeDef, CancelTradeAllocationResponseToSideOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseToSide), 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 CancelTradeAllocationResponseToSide$ { /** @deprecated use `CancelTradeAllocationResponseToSide$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseToSide$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseToSide$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseToSide$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseWhenIssued$inboundSchema: z.ZodType< CancelTradeAllocationResponseWhenIssuedOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelTradeAllocationResponseWhenIssued), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelTradeAllocationResponseWhenIssued$outboundSchema: z.ZodType< CancelTradeAllocationResponseWhenIssuedOpen, z.ZodTypeDef, CancelTradeAllocationResponseWhenIssuedOpen > = z.union([ z.nativeEnum(CancelTradeAllocationResponseWhenIssued), 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 CancelTradeAllocationResponseWhenIssued$ { /** @deprecated use `CancelTradeAllocationResponseWhenIssued$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseWhenIssued$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseWhenIssued$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseWhenIssued$outboundSchema; } /** @internal */ export const CancelTradeAllocationResponseTradeAllocation$inboundSchema: z.ZodType< CancelTradeAllocationResponseTradeAllocation, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => CancelTradeAllocationResponseAccruedInterestAmount$inboundSchema ), ).optional(), additional_instructions: z.string().optional(), asset_type: CancelTradeAllocationResponseAssetType$inboundSchema.optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), broker_capacity: CancelTradeAllocationResponseBrokerCapacity$inboundSchema .optional(), client_order_id: z.string().optional(), commission_amount: z.nullable( z.lazy(() => CancelTradeAllocationResponseCommissionAmount$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(() => CancelTradeAllocationResponseGrossAmount$inboundSchema), ).optional(), identifier: z.string().optional(), identifier_type: CancelTradeAllocationResponseIdentifierType$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(() => CancelTradeAllocationResponsePrevailingMarketPrice$inboundSchema ), ).optional(), price: z.nullable( z.lazy(() => CancelTradeAllocationResponsePrice$inboundSchema), ).optional(), price_adjustment: z.nullable( z.lazy(() => CancelTradeAllocationResponsePriceAdjustment$inboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => CancelTradeAllocationResponseQuantity$inboundSchema), ).optional(), settlement_date: z.nullable( z.lazy(() => CancelTradeAllocationResponseSettlementDate$inboundSchema), ).optional(), side_modifier: CancelTradeAllocationResponseSideModifier$inboundSchema .optional(), source_application: z.string().optional(), special_instructions: z.array( CancelTradeAllocationResponseSpecialInstructions$inboundSchema, ).optional(), state: CancelTradeAllocationResponseState$inboundSchema.optional(), to_account_id: z.string().optional(), to_activity_id: z.string().optional(), to_side: CancelTradeAllocationResponseToSide$inboundSchema.optional(), trade_allocation_id: z.string().optional(), when_issued: CancelTradeAllocationResponseWhenIssued$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 CancelTradeAllocationResponseTradeAllocation$Outbound = { accrued_interest_amount?: | CancelTradeAllocationResponseAccruedInterestAmount$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?: | CancelTradeAllocationResponseCommissionAmount$Outbound | null | undefined; execution_time?: string | null | undefined; fees?: Array | undefined; from_account_id?: string | undefined; from_activity_id?: string | undefined; gross_amount?: | CancelTradeAllocationResponseGrossAmount$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?: | CancelTradeAllocationResponsePrevailingMarketPrice$Outbound | null | undefined; price?: CancelTradeAllocationResponsePrice$Outbound | null | undefined; price_adjustment?: | CancelTradeAllocationResponsePriceAdjustment$Outbound | null | undefined; quantity?: CancelTradeAllocationResponseQuantity$Outbound | null | undefined; settlement_date?: | CancelTradeAllocationResponseSettlementDate$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 CancelTradeAllocationResponseTradeAllocation$outboundSchema: z.ZodType< CancelTradeAllocationResponseTradeAllocation$Outbound, z.ZodTypeDef, CancelTradeAllocationResponseTradeAllocation > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => CancelTradeAllocationResponseAccruedInterestAmount$outboundSchema ), ).optional(), additionalInstructions: z.string().optional(), assetType: CancelTradeAllocationResponseAssetType$outboundSchema.optional(), bondYield: z.array(BondYield$outboundSchema).optional(), brokerCapacity: CancelTradeAllocationResponseBrokerCapacity$outboundSchema .optional(), clientOrderId: z.string().optional(), commissionAmount: z.nullable( z.lazy(() => CancelTradeAllocationResponseCommissionAmount$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(() => CancelTradeAllocationResponseGrossAmount$outboundSchema), ).optional(), identifier: z.string().optional(), identifierType: CancelTradeAllocationResponseIdentifierType$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(() => CancelTradeAllocationResponsePrevailingMarketPrice$outboundSchema ), ).optional(), price: z.nullable( z.lazy(() => CancelTradeAllocationResponsePrice$outboundSchema), ).optional(), priceAdjustment: z.nullable( z.lazy(() => CancelTradeAllocationResponsePriceAdjustment$outboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => CancelTradeAllocationResponseQuantity$outboundSchema), ).optional(), settlementDate: z.nullable( z.lazy(() => CancelTradeAllocationResponseSettlementDate$outboundSchema), ).optional(), sideModifier: CancelTradeAllocationResponseSideModifier$outboundSchema .optional(), sourceApplication: z.string().optional(), specialInstructions: z.array( CancelTradeAllocationResponseSpecialInstructions$outboundSchema, ).optional(), state: CancelTradeAllocationResponseState$outboundSchema.optional(), toAccountId: z.string().optional(), toActivityId: z.string().optional(), toSide: CancelTradeAllocationResponseToSide$outboundSchema.optional(), tradeAllocationId: z.string().optional(), whenIssued: CancelTradeAllocationResponseWhenIssued$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 CancelTradeAllocationResponseTradeAllocation$ { /** @deprecated use `CancelTradeAllocationResponseTradeAllocation$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponseTradeAllocation$inboundSchema; /** @deprecated use `CancelTradeAllocationResponseTradeAllocation$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponseTradeAllocation$outboundSchema; /** @deprecated use `CancelTradeAllocationResponseTradeAllocation$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponseTradeAllocation$Outbound; } export function cancelTradeAllocationResponseTradeAllocationToJSON( cancelTradeAllocationResponseTradeAllocation: CancelTradeAllocationResponseTradeAllocation, ): string { return JSON.stringify( CancelTradeAllocationResponseTradeAllocation$outboundSchema.parse( cancelTradeAllocationResponseTradeAllocation, ), ); } export function cancelTradeAllocationResponseTradeAllocationFromJSON( jsonString: string, ): SafeParseResult< CancelTradeAllocationResponseTradeAllocation, SDKValidationError > { return safeParse( jsonString, (x) => CancelTradeAllocationResponseTradeAllocation$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelTradeAllocationResponseTradeAllocation' from JSON`, ); } /** @internal */ export const CancelTradeAllocationResponse$inboundSchema: z.ZodType< CancelTradeAllocationResponse, z.ZodTypeDef, unknown > = z.object({ trade_allocation: z.nullable( z.lazy(() => CancelTradeAllocationResponseTradeAllocation$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "trade_allocation": "tradeAllocation", }); }); /** @internal */ export type CancelTradeAllocationResponse$Outbound = { trade_allocation?: | CancelTradeAllocationResponseTradeAllocation$Outbound | null | undefined; }; /** @internal */ export const CancelTradeAllocationResponse$outboundSchema: z.ZodType< CancelTradeAllocationResponse$Outbound, z.ZodTypeDef, CancelTradeAllocationResponse > = z.object({ tradeAllocation: z.nullable( z.lazy(() => CancelTradeAllocationResponseTradeAllocation$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { tradeAllocation: "trade_allocation", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelTradeAllocationResponse$ { /** @deprecated use `CancelTradeAllocationResponse$inboundSchema` instead. */ export const inboundSchema = CancelTradeAllocationResponse$inboundSchema; /** @deprecated use `CancelTradeAllocationResponse$outboundSchema` instead. */ export const outboundSchema = CancelTradeAllocationResponse$outboundSchema; /** @deprecated use `CancelTradeAllocationResponse$Outbound` instead. */ export type Outbound = CancelTradeAllocationResponse$Outbound; } export function cancelTradeAllocationResponseToJSON( cancelTradeAllocationResponse: CancelTradeAllocationResponse, ): string { return JSON.stringify( CancelTradeAllocationResponse$outboundSchema.parse( cancelTradeAllocationResponse, ), ); } export function cancelTradeAllocationResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelTradeAllocationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelTradeAllocationResponse' from JSON`, ); }