/* * 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 RebookTradeAllocationResponseAccruedInterestAmount = { /** * 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 RebookTradeAllocationResponseAssetType { AssetTypeUnspecified = "ASSET_TYPE_UNSPECIFIED", Equity = "EQUITY", FixedIncome = "FIXED_INCOME", } /** * Type of the asset being traded. */ export type RebookTradeAllocationResponseAssetTypeOpen = OpenEnum< typeof RebookTradeAllocationResponseAssetType >; /** * Broker capacity for the trade. */ export enum RebookTradeAllocationResponseBrokerCapacity { CapacityUnspecified = "CAPACITY_UNSPECIFIED", Agency = "AGENCY", Principal = "PRINCIPAL", Mixed = "MIXED", } /** * Broker capacity for the trade. */ export type RebookTradeAllocationResponseBrokerCapacityOpen = OpenEnum< typeof RebookTradeAllocationResponseBrokerCapacity >; /** * Commission amount of the trade allocation that will only be applied to the to_account_id. */ export type RebookTradeAllocationResponseCommissionAmount = { /** * 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 RebookTradeAllocationResponseGrossAmount = { /** * 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 RebookTradeAllocationResponseIdentifierType { IdentifierTypeUnspecified = "IDENTIFIER_TYPE_UNSPECIFIED", AssetId = "ASSET_ID", Symbol = "SYMBOL", Cusip = "CUSIP", Isin = "ISIN", } /** * Identifier type for the asset being traded. */ export type RebookTradeAllocationResponseIdentifierTypeOpen = OpenEnum< typeof RebookTradeAllocationResponseIdentifierType >; /** * 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 RebookTradeAllocationResponsePrevailingMarketPrice = { /** * 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 RebookTradeAllocationResponsePrice = { /** * 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 RebookTradeAllocationResponsePriceAdjustmentAmount = { /** * 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 RebookTradeAllocationResponsePriceAdjustmentType { 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 RebookTradeAllocationResponsePriceAdjustmentTypeOpen = OpenEnum< typeof RebookTradeAllocationResponsePriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type RebookTradeAllocationResponsePriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | RebookTradeAllocationResponsePriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: | RebookTradeAllocationResponsePriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type RebookTradeAllocationResponseQuantity = { /** * 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 RebookTradeAllocationResponseSettlementDate = { /** * 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 RebookTradeAllocationResponseSideModifier { SideModifierUnspecified = "SIDE_MODIFIER_UNSPECIFIED", Short = "SHORT", ShortExempt = "SHORT_EXEMPT", ShortCover = "SHORT_COVER", Open = "OPEN", Close = "CLOSE", } /** * Side modifier for the trade allocation. */ export type RebookTradeAllocationResponseSideModifierOpen = OpenEnum< typeof RebookTradeAllocationResponseSideModifier >; export enum RebookTradeAllocationResponseSpecialInstructions { 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 RebookTradeAllocationResponseSpecialInstructionsOpen = OpenEnum< typeof RebookTradeAllocationResponseSpecialInstructions >; /** * The state that the trade allocation is in. */ export enum RebookTradeAllocationResponseState { 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 RebookTradeAllocationResponseStateOpen = OpenEnum< typeof RebookTradeAllocationResponseState >; /** * 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 RebookTradeAllocationResponseToSide { 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 RebookTradeAllocationResponseToSideOpen = OpenEnum< typeof RebookTradeAllocationResponseToSide >; /** * Denotes that this trade allocation was either when_issued or when_distributed. */ export enum RebookTradeAllocationResponseWhenIssued { 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 RebookTradeAllocationResponseWhenIssuedOpen = OpenEnum< typeof RebookTradeAllocationResponseWhenIssued >; /** * The new trade allocation that is booked. */ export type NewTradeAllocation = { /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ accruedInterestAmount?: | RebookTradeAllocationResponseAccruedInterestAmount | 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?: RebookTradeAllocationResponseAssetTypeOpen | 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?: RebookTradeAllocationResponseBrokerCapacityOpen | 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?: | RebookTradeAllocationResponseCommissionAmount | 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?: RebookTradeAllocationResponseGrossAmount | 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?: RebookTradeAllocationResponseIdentifierTypeOpen | 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?: | RebookTradeAllocationResponsePrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: RebookTradeAllocationResponsePrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: | RebookTradeAllocationResponsePriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: RebookTradeAllocationResponseQuantity | null | undefined; /** * Defaults to T+1 for equities if this is not provided. Calculated using the execution_time field in Eastern Time. */ settlementDate?: | RebookTradeAllocationResponseSettlementDate | null | undefined; /** * Side modifier for the trade allocation. */ sideModifier?: RebookTradeAllocationResponseSideModifierOpen | 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?: RebookTradeAllocationResponseStateOpen | 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?: RebookTradeAllocationResponseToSideOpen | 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?: RebookTradeAllocationResponseWhenIssuedOpen | undefined; }; /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ export type RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationAssetType { AssetTypeUnspecified = "ASSET_TYPE_UNSPECIFIED", Equity = "EQUITY", FixedIncome = "FIXED_INCOME", } /** * Type of the asset being traded. */ export type RebookTradeAllocationResponseOriginalTradeAllocationAssetTypeOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationAssetType >; /** * Broker capacity for the trade. */ export enum RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity { CapacityUnspecified = "CAPACITY_UNSPECIFIED", Agency = "AGENCY", Principal = "PRINCIPAL", Mixed = "MIXED", } /** * Broker capacity for the trade. */ export type RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacityOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity >; /** * Commission amount of the trade allocation that will only be applied to the to_account_id. */ export type RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType { IdentifierTypeUnspecified = "IDENTIFIER_TYPE_UNSPECIFIED", AssetId = "ASSET_ID", Symbol = "SYMBOL", Cusip = "CUSIP", Isin = "ISIN", } /** * Identifier type for the asset being traded. */ export type RebookTradeAllocationResponseOriginalTradeAllocationIdentifierTypeOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType >; /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationPrice = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType { 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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentTypeOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: | RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type RebookTradeAllocationResponseOriginalTradeAllocationQuantity = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate = { /** * 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 RebookTradeAllocationResponseOriginalTradeAllocationSideModifier { SideModifierUnspecified = "SIDE_MODIFIER_UNSPECIFIED", Short = "SHORT", ShortExempt = "SHORT_EXEMPT", ShortCover = "SHORT_COVER", Open = "OPEN", Close = "CLOSE", } /** * Side modifier for the trade allocation. */ export type RebookTradeAllocationResponseOriginalTradeAllocationSideModifierOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationSideModifier >; export enum RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions { 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 RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructionsOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions >; /** * The state that the trade allocation is in. */ export enum RebookTradeAllocationResponseOriginalTradeAllocationState { 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 RebookTradeAllocationResponseOriginalTradeAllocationStateOpen = 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 RebookTradeAllocationResponseOriginalTradeAllocationToSide { 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 RebookTradeAllocationResponseOriginalTradeAllocationToSideOpen = OpenEnum; /** * Denotes that this trade allocation was either when_issued or when_distributed. */ export enum RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued { 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 RebookTradeAllocationResponseOriginalTradeAllocationWhenIssuedOpen = OpenEnum< typeof RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued >; /** * The original trade allocation that was rebooked. */ export type OriginalTradeAllocation = { /** * The amount of interest that has been accrued in the issuing currency for a single instrument. */ accruedInterestAmount?: | RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationAssetTypeOpen | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacityOpen | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationIdentifierTypeOpen | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: | RebookTradeAllocationResponseOriginalTradeAllocationPrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: | RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: | RebookTradeAllocationResponseOriginalTradeAllocationQuantity | null | undefined; /** * Defaults to T+1 for equities if this is not provided. Calculated using the execution_time field in Eastern Time. */ settlementDate?: | RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate | null | undefined; /** * Side modifier for the trade allocation. */ sideModifier?: | RebookTradeAllocationResponseOriginalTradeAllocationSideModifierOpen | 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< RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructionsOpen > | undefined; /** * The state that the trade allocation is in. */ state?: | RebookTradeAllocationResponseOriginalTradeAllocationStateOpen | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationToSideOpen | 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?: | RebookTradeAllocationResponseOriginalTradeAllocationWhenIssuedOpen | undefined; }; /** * Rebooking a trade allocation will always return a new resource that contains the rebooked trade allocation. */ export type RebookTradeAllocationResponse = { /** * The new trade allocation that is booked. */ newTradeAllocation?: NewTradeAllocation | null | undefined; /** * The original trade allocation that was rebooked. */ originalTradeAllocation?: OriginalTradeAllocation | null | undefined; }; /** @internal */ export const RebookTradeAllocationResponseAccruedInterestAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseAccruedInterestAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseAccruedInterestAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseAccruedInterestAmount > = 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 RebookTradeAllocationResponseAccruedInterestAmount$ { /** @deprecated use `RebookTradeAllocationResponseAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseAccruedInterestAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseAccruedInterestAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseAccruedInterestAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseAccruedInterestAmount$Outbound; } export function rebookTradeAllocationResponseAccruedInterestAmountToJSON( rebookTradeAllocationResponseAccruedInterestAmount: RebookTradeAllocationResponseAccruedInterestAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseAccruedInterestAmount$outboundSchema.parse( rebookTradeAllocationResponseAccruedInterestAmount, ), ); } export function rebookTradeAllocationResponseAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseAccruedInterestAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseAccruedInterestAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponseAccruedInterestAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseAssetType$inboundSchema: z.ZodType< RebookTradeAllocationResponseAssetTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseAssetType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseAssetType$outboundSchema: z.ZodType< RebookTradeAllocationResponseAssetTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponseAssetTypeOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseAssetType), 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 RebookTradeAllocationResponseAssetType$ { /** @deprecated use `RebookTradeAllocationResponseAssetType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseAssetType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseAssetType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseAssetType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseBrokerCapacity$inboundSchema: z.ZodType< RebookTradeAllocationResponseBrokerCapacityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseBrokerCapacity), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseBrokerCapacity$outboundSchema: z.ZodType< RebookTradeAllocationResponseBrokerCapacityOpen, z.ZodTypeDef, RebookTradeAllocationResponseBrokerCapacityOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseBrokerCapacity), 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 RebookTradeAllocationResponseBrokerCapacity$ { /** @deprecated use `RebookTradeAllocationResponseBrokerCapacity$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseBrokerCapacity$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseBrokerCapacity$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseBrokerCapacity$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseCommissionAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseCommissionAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseCommissionAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseCommissionAmount > = 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 RebookTradeAllocationResponseCommissionAmount$ { /** @deprecated use `RebookTradeAllocationResponseCommissionAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseCommissionAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseCommissionAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseCommissionAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseCommissionAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseCommissionAmount$Outbound; } export function rebookTradeAllocationResponseCommissionAmountToJSON( rebookTradeAllocationResponseCommissionAmount: RebookTradeAllocationResponseCommissionAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseCommissionAmount$outboundSchema.parse( rebookTradeAllocationResponseCommissionAmount, ), ); } export function rebookTradeAllocationResponseCommissionAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseCommissionAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseCommissionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponseCommissionAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseGrossAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseGrossAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseGrossAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseGrossAmount > = 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 RebookTradeAllocationResponseGrossAmount$ { /** @deprecated use `RebookTradeAllocationResponseGrossAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseGrossAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseGrossAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseGrossAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseGrossAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseGrossAmount$Outbound; } export function rebookTradeAllocationResponseGrossAmountToJSON( rebookTradeAllocationResponseGrossAmount: RebookTradeAllocationResponseGrossAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseGrossAmount$outboundSchema.parse( rebookTradeAllocationResponseGrossAmount, ), ); } export function rebookTradeAllocationResponseGrossAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseGrossAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseGrossAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponseGrossAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseIdentifierType$inboundSchema: z.ZodType< RebookTradeAllocationResponseIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseIdentifierType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseIdentifierType$outboundSchema: z.ZodType< RebookTradeAllocationResponseIdentifierTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponseIdentifierTypeOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseIdentifierType), 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 RebookTradeAllocationResponseIdentifierType$ { /** @deprecated use `RebookTradeAllocationResponseIdentifierType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseIdentifierType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseIdentifierType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseIdentifierType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponsePrevailingMarketPrice$inboundSchema: z.ZodType< RebookTradeAllocationResponsePrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponsePrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponsePrevailingMarketPrice$outboundSchema: z.ZodType< RebookTradeAllocationResponsePrevailingMarketPrice$Outbound, z.ZodTypeDef, RebookTradeAllocationResponsePrevailingMarketPrice > = 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 RebookTradeAllocationResponsePrevailingMarketPrice$ { /** @deprecated use `RebookTradeAllocationResponsePrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponsePrevailingMarketPrice$inboundSchema; /** @deprecated use `RebookTradeAllocationResponsePrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponsePrevailingMarketPrice$outboundSchema; /** @deprecated use `RebookTradeAllocationResponsePrevailingMarketPrice$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponsePrevailingMarketPrice$Outbound; } export function rebookTradeAllocationResponsePrevailingMarketPriceToJSON( rebookTradeAllocationResponsePrevailingMarketPrice: RebookTradeAllocationResponsePrevailingMarketPrice, ): string { return JSON.stringify( RebookTradeAllocationResponsePrevailingMarketPrice$outboundSchema.parse( rebookTradeAllocationResponsePrevailingMarketPrice, ), ); } export function rebookTradeAllocationResponsePrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponsePrevailingMarketPrice, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponsePrevailingMarketPrice$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponsePrevailingMarketPrice' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponsePrice$inboundSchema: z.ZodType< RebookTradeAllocationResponsePrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponsePrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponsePrice$outboundSchema: z.ZodType< RebookTradeAllocationResponsePrice$Outbound, z.ZodTypeDef, RebookTradeAllocationResponsePrice > = 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 RebookTradeAllocationResponsePrice$ { /** @deprecated use `RebookTradeAllocationResponsePrice$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponsePrice$inboundSchema; /** @deprecated use `RebookTradeAllocationResponsePrice$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponsePrice$outboundSchema; /** @deprecated use `RebookTradeAllocationResponsePrice$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponsePrice$Outbound; } export function rebookTradeAllocationResponsePriceToJSON( rebookTradeAllocationResponsePrice: RebookTradeAllocationResponsePrice, ): string { return JSON.stringify( RebookTradeAllocationResponsePrice$outboundSchema.parse( rebookTradeAllocationResponsePrice, ), ); } export function rebookTradeAllocationResponsePriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookTradeAllocationResponsePrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponsePrice' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponsePriceAdjustmentAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponsePriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponsePriceAdjustmentAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustmentAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponsePriceAdjustmentAmount > = 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 RebookTradeAllocationResponsePriceAdjustmentAmount$ { /** @deprecated use `RebookTradeAllocationResponsePriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponsePriceAdjustmentAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponsePriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponsePriceAdjustmentAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponsePriceAdjustmentAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponsePriceAdjustmentAmount$Outbound; } export function rebookTradeAllocationResponsePriceAdjustmentAmountToJSON( rebookTradeAllocationResponsePriceAdjustmentAmount: RebookTradeAllocationResponsePriceAdjustmentAmount, ): string { return JSON.stringify( RebookTradeAllocationResponsePriceAdjustmentAmount$outboundSchema.parse( rebookTradeAllocationResponsePriceAdjustmentAmount, ), ); } export function rebookTradeAllocationResponsePriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponsePriceAdjustmentAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponsePriceAdjustmentAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponsePriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponsePriceAdjustmentType$inboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponsePriceAdjustmentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponsePriceAdjustmentType$outboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponsePriceAdjustmentTypeOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponsePriceAdjustmentType), 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 RebookTradeAllocationResponsePriceAdjustmentType$ { /** @deprecated use `RebookTradeAllocationResponsePriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponsePriceAdjustmentType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponsePriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponsePriceAdjustmentType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponsePriceAdjustment$inboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponsePriceAdjustmentAmount$inboundSchema ), ).optional(), price_adjustment_type: RebookTradeAllocationResponsePriceAdjustmentType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type RebookTradeAllocationResponsePriceAdjustment$Outbound = { price_adjustment_amount?: | RebookTradeAllocationResponsePriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponsePriceAdjustment$outboundSchema: z.ZodType< RebookTradeAllocationResponsePriceAdjustment$Outbound, z.ZodTypeDef, RebookTradeAllocationResponsePriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponsePriceAdjustmentAmount$outboundSchema ), ).optional(), priceAdjustmentType: RebookTradeAllocationResponsePriceAdjustmentType$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 RebookTradeAllocationResponsePriceAdjustment$ { /** @deprecated use `RebookTradeAllocationResponsePriceAdjustment$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponsePriceAdjustment$inboundSchema; /** @deprecated use `RebookTradeAllocationResponsePriceAdjustment$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponsePriceAdjustment$outboundSchema; /** @deprecated use `RebookTradeAllocationResponsePriceAdjustment$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponsePriceAdjustment$Outbound; } export function rebookTradeAllocationResponsePriceAdjustmentToJSON( rebookTradeAllocationResponsePriceAdjustment: RebookTradeAllocationResponsePriceAdjustment, ): string { return JSON.stringify( RebookTradeAllocationResponsePriceAdjustment$outboundSchema.parse( rebookTradeAllocationResponsePriceAdjustment, ), ); } export function rebookTradeAllocationResponsePriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponsePriceAdjustment, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponsePriceAdjustment$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponsePriceAdjustment' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseQuantity$inboundSchema: z.ZodType< RebookTradeAllocationResponseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseQuantity$outboundSchema: z.ZodType< RebookTradeAllocationResponseQuantity$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseQuantity > = 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 RebookTradeAllocationResponseQuantity$ { /** @deprecated use `RebookTradeAllocationResponseQuantity$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseQuantity$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseQuantity$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseQuantity$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseQuantity$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseQuantity$Outbound; } export function rebookTradeAllocationResponseQuantityToJSON( rebookTradeAllocationResponseQuantity: RebookTradeAllocationResponseQuantity, ): string { return JSON.stringify( RebookTradeAllocationResponseQuantity$outboundSchema.parse( rebookTradeAllocationResponseQuantity, ), ); } export function rebookTradeAllocationResponseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookTradeAllocationResponseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseQuantity' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseSettlementDate$inboundSchema: z.ZodType< RebookTradeAllocationResponseSettlementDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type RebookTradeAllocationResponseSettlementDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const RebookTradeAllocationResponseSettlementDate$outboundSchema: z.ZodType< RebookTradeAllocationResponseSettlementDate$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseSettlementDate > = 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 RebookTradeAllocationResponseSettlementDate$ { /** @deprecated use `RebookTradeAllocationResponseSettlementDate$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseSettlementDate$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseSettlementDate$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseSettlementDate$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseSettlementDate$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseSettlementDate$Outbound; } export function rebookTradeAllocationResponseSettlementDateToJSON( rebookTradeAllocationResponseSettlementDate: RebookTradeAllocationResponseSettlementDate, ): string { return JSON.stringify( RebookTradeAllocationResponseSettlementDate$outboundSchema.parse( rebookTradeAllocationResponseSettlementDate, ), ); } export function rebookTradeAllocationResponseSettlementDateFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseSettlementDate, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseSettlementDate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookTradeAllocationResponseSettlementDate' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseSideModifier$inboundSchema: z.ZodType< RebookTradeAllocationResponseSideModifierOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseSideModifier), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseSideModifier$outboundSchema: z.ZodType< RebookTradeAllocationResponseSideModifierOpen, z.ZodTypeDef, RebookTradeAllocationResponseSideModifierOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseSideModifier), 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 RebookTradeAllocationResponseSideModifier$ { /** @deprecated use `RebookTradeAllocationResponseSideModifier$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseSideModifier$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseSideModifier$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseSideModifier$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseSpecialInstructions$inboundSchema: z.ZodType< RebookTradeAllocationResponseSpecialInstructionsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseSpecialInstructions), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseSpecialInstructions$outboundSchema: z.ZodType< RebookTradeAllocationResponseSpecialInstructionsOpen, z.ZodTypeDef, RebookTradeAllocationResponseSpecialInstructionsOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseSpecialInstructions), 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 RebookTradeAllocationResponseSpecialInstructions$ { /** @deprecated use `RebookTradeAllocationResponseSpecialInstructions$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseSpecialInstructions$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseSpecialInstructions$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseSpecialInstructions$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseState$inboundSchema: z.ZodType< RebookTradeAllocationResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseState$outboundSchema: z.ZodType< RebookTradeAllocationResponseStateOpen, z.ZodTypeDef, RebookTradeAllocationResponseStateOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseState), 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 RebookTradeAllocationResponseState$ { /** @deprecated use `RebookTradeAllocationResponseState$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseState$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseState$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseState$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseToSide$inboundSchema: z.ZodType< RebookTradeAllocationResponseToSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseToSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseToSide$outboundSchema: z.ZodType< RebookTradeAllocationResponseToSideOpen, z.ZodTypeDef, RebookTradeAllocationResponseToSideOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseToSide), 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 RebookTradeAllocationResponseToSide$ { /** @deprecated use `RebookTradeAllocationResponseToSide$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseToSide$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseToSide$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseToSide$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseWhenIssued$inboundSchema: z.ZodType< RebookTradeAllocationResponseWhenIssuedOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseWhenIssued), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseWhenIssued$outboundSchema: z.ZodType< RebookTradeAllocationResponseWhenIssuedOpen, z.ZodTypeDef, RebookTradeAllocationResponseWhenIssuedOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseWhenIssued), 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 RebookTradeAllocationResponseWhenIssued$ { /** @deprecated use `RebookTradeAllocationResponseWhenIssued$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseWhenIssued$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseWhenIssued$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseWhenIssued$outboundSchema; } /** @internal */ export const NewTradeAllocation$inboundSchema: z.ZodType< NewTradeAllocation, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponseAccruedInterestAmount$inboundSchema ), ).optional(), additional_instructions: z.string().optional(), asset_type: RebookTradeAllocationResponseAssetType$inboundSchema.optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), broker_capacity: RebookTradeAllocationResponseBrokerCapacity$inboundSchema .optional(), client_order_id: z.string().optional(), commission_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponseCommissionAmount$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(() => RebookTradeAllocationResponseGrossAmount$inboundSchema), ).optional(), identifier: z.string().optional(), identifier_type: RebookTradeAllocationResponseIdentifierType$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(() => RebookTradeAllocationResponsePrevailingMarketPrice$inboundSchema ), ).optional(), price: z.nullable( z.lazy(() => RebookTradeAllocationResponsePrice$inboundSchema), ).optional(), price_adjustment: z.nullable( z.lazy(() => RebookTradeAllocationResponsePriceAdjustment$inboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => RebookTradeAllocationResponseQuantity$inboundSchema), ).optional(), settlement_date: z.nullable( z.lazy(() => RebookTradeAllocationResponseSettlementDate$inboundSchema), ).optional(), side_modifier: RebookTradeAllocationResponseSideModifier$inboundSchema .optional(), source_application: z.string().optional(), special_instructions: z.array( RebookTradeAllocationResponseSpecialInstructions$inboundSchema, ).optional(), state: RebookTradeAllocationResponseState$inboundSchema.optional(), to_account_id: z.string().optional(), to_activity_id: z.string().optional(), to_side: RebookTradeAllocationResponseToSide$inboundSchema.optional(), trade_allocation_id: z.string().optional(), when_issued: RebookTradeAllocationResponseWhenIssued$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 NewTradeAllocation$Outbound = { accrued_interest_amount?: | RebookTradeAllocationResponseAccruedInterestAmount$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?: | RebookTradeAllocationResponseCommissionAmount$Outbound | null | undefined; execution_time?: string | null | undefined; fees?: Array | undefined; from_account_id?: string | undefined; from_activity_id?: string | undefined; gross_amount?: | RebookTradeAllocationResponseGrossAmount$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?: | RebookTradeAllocationResponsePrevailingMarketPrice$Outbound | null | undefined; price?: RebookTradeAllocationResponsePrice$Outbound | null | undefined; price_adjustment?: | RebookTradeAllocationResponsePriceAdjustment$Outbound | null | undefined; quantity?: RebookTradeAllocationResponseQuantity$Outbound | null | undefined; settlement_date?: | RebookTradeAllocationResponseSettlementDate$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 NewTradeAllocation$outboundSchema: z.ZodType< NewTradeAllocation$Outbound, z.ZodTypeDef, NewTradeAllocation > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponseAccruedInterestAmount$outboundSchema ), ).optional(), additionalInstructions: z.string().optional(), assetType: RebookTradeAllocationResponseAssetType$outboundSchema.optional(), bondYield: z.array(BondYield$outboundSchema).optional(), brokerCapacity: RebookTradeAllocationResponseBrokerCapacity$outboundSchema .optional(), clientOrderId: z.string().optional(), commissionAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponseCommissionAmount$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(() => RebookTradeAllocationResponseGrossAmount$outboundSchema), ).optional(), identifier: z.string().optional(), identifierType: RebookTradeAllocationResponseIdentifierType$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(() => RebookTradeAllocationResponsePrevailingMarketPrice$outboundSchema ), ).optional(), price: z.nullable( z.lazy(() => RebookTradeAllocationResponsePrice$outboundSchema), ).optional(), priceAdjustment: z.nullable( z.lazy(() => RebookTradeAllocationResponsePriceAdjustment$outboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => RebookTradeAllocationResponseQuantity$outboundSchema), ).optional(), settlementDate: z.nullable( z.lazy(() => RebookTradeAllocationResponseSettlementDate$outboundSchema), ).optional(), sideModifier: RebookTradeAllocationResponseSideModifier$outboundSchema .optional(), sourceApplication: z.string().optional(), specialInstructions: z.array( RebookTradeAllocationResponseSpecialInstructions$outboundSchema, ).optional(), state: RebookTradeAllocationResponseState$outboundSchema.optional(), toAccountId: z.string().optional(), toActivityId: z.string().optional(), toSide: RebookTradeAllocationResponseToSide$outboundSchema.optional(), tradeAllocationId: z.string().optional(), whenIssued: RebookTradeAllocationResponseWhenIssued$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 NewTradeAllocation$ { /** @deprecated use `NewTradeAllocation$inboundSchema` instead. */ export const inboundSchema = NewTradeAllocation$inboundSchema; /** @deprecated use `NewTradeAllocation$outboundSchema` instead. */ export const outboundSchema = NewTradeAllocation$outboundSchema; /** @deprecated use `NewTradeAllocation$Outbound` instead. */ export type Outbound = NewTradeAllocation$Outbound; } export function newTradeAllocationToJSON( newTradeAllocation: NewTradeAllocation, ): string { return JSON.stringify( NewTradeAllocation$outboundSchema.parse(newTradeAllocation), ); } export function newTradeAllocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NewTradeAllocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NewTradeAllocation' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount > = 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 RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmountToJSON( rebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount: RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationAssetType$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationAssetTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationAssetType, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationAssetType$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationAssetTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationAssetTypeOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseOriginalTradeAllocationAssetType), 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 RebookTradeAllocationResponseOriginalTradeAllocationAssetType$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationAssetType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationAssetType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationAssetType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationAssetType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacityOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacityOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacityOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount > = 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 RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationCommissionAmountToJSON( rebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount: RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationCommissionAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount > = 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 RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationGrossAmountToJSON( rebookTradeAllocationResponseOriginalTradeAllocationGrossAmount: RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$outboundSchema .parse(rebookTradeAllocationResponseOriginalTradeAllocationGrossAmount), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationGrossAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationIdentifierTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationIdentifierTypeOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice > = 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 RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPriceToJSON( rebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice: RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPrice$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPrice$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPrice$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationPrice > = 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 RebookTradeAllocationResponseOriginalTradeAllocationPrice$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrice$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPrice$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrice$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPrice$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPrice$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationPrice$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceToJSON( rebookTradeAllocationResponseOriginalTradeAllocationPrice: RebookTradeAllocationResponseOriginalTradeAllocationPrice, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationPrice$outboundSchema .parse(rebookTradeAllocationResponseOriginalTradeAllocationPrice), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationPrice, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationPrice$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationPrice' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount > = 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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmountToJSON( rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount: RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentTypeOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentTypeOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$inboundSchema ), ).optional(), price_adjustment_type: RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$Outbound = { price_adjustment_amount?: | RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentAmount$outboundSchema ), ).optional(), priceAdjustmentType: RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentType$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 RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentToJSON( rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment: RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationQuantity$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationQuantity$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationQuantity$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationQuantity > = 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 RebookTradeAllocationResponseOriginalTradeAllocationQuantity$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationQuantity$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationQuantity$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationQuantity$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationQuantity$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationQuantity$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationQuantity$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationQuantityToJSON( rebookTradeAllocationResponseOriginalTradeAllocationQuantity: RebookTradeAllocationResponseOriginalTradeAllocationQuantity, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationQuantity$outboundSchema .parse(rebookTradeAllocationResponseOriginalTradeAllocationQuantity), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationQuantityFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationQuantity, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationQuantity$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationQuantity' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate, z.ZodTypeDef, unknown > = z.object({ day: z.number().int().optional(), month: z.number().int().optional(), year: z.number().int().optional(), }); /** @internal */ export type RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$Outbound = { day?: number | undefined; month?: number | undefined; year?: number | undefined; }; /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$Outbound, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate > = 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 RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$outboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$Outbound; } export function rebookTradeAllocationResponseOriginalTradeAllocationSettlementDateToJSON( rebookTradeAllocationResponseOriginalTradeAllocationSettlementDate: RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate, ): string { return JSON.stringify( RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$outboundSchema .parse( rebookTradeAllocationResponseOriginalTradeAllocationSettlementDate, ), ); } export function rebookTradeAllocationResponseOriginalTradeAllocationSettlementDateFromJSON( jsonString: string, ): SafeParseResult< RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate, SDKValidationError > { return safeParse( jsonString, (x) => RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSideModifierOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationSideModifier, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSideModifierOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationSideModifierOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationSideModifier, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructionsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructionsOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructionsOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationState$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseOriginalTradeAllocationState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationState$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationStateOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationStateOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseOriginalTradeAllocationState), 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 RebookTradeAllocationResponseOriginalTradeAllocationState$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationState$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationState$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationState$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationState$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationToSide$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationToSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookTradeAllocationResponseOriginalTradeAllocationToSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationToSide$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationToSideOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationToSideOpen > = z.union([ z.nativeEnum(RebookTradeAllocationResponseOriginalTradeAllocationToSide), 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 RebookTradeAllocationResponseOriginalTradeAllocationToSide$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationToSide$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationToSide$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationToSide$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationToSide$outboundSchema; } /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$inboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationWhenIssuedOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued, ), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$outboundSchema: z.ZodType< RebookTradeAllocationResponseOriginalTradeAllocationWhenIssuedOpen, z.ZodTypeDef, RebookTradeAllocationResponseOriginalTradeAllocationWhenIssuedOpen > = z.union([ z.nativeEnum( RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued, ), 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 RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$ { /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$inboundSchema; /** @deprecated use `RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$outboundSchema; } /** @internal */ export const OriginalTradeAllocation$inboundSchema: z.ZodType< OriginalTradeAllocation, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$inboundSchema ), ).optional(), additional_instructions: z.string().optional(), asset_type: RebookTradeAllocationResponseOriginalTradeAllocationAssetType$inboundSchema .optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), broker_capacity: RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$inboundSchema .optional(), client_order_id: z.string().optional(), commission_amount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$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(() => RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$inboundSchema ), ).optional(), identifier: z.string().optional(), identifier_type: RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$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(() => RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$inboundSchema ), ).optional(), price: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPrice$inboundSchema ), ).optional(), price_adjustment: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$inboundSchema ), ).optional(), quantity: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationQuantity$inboundSchema ), ).optional(), settlement_date: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$inboundSchema ), ).optional(), side_modifier: RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$inboundSchema .optional(), source_application: z.string().optional(), special_instructions: z.array( RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$inboundSchema, ).optional(), state: RebookTradeAllocationResponseOriginalTradeAllocationState$inboundSchema .optional(), to_account_id: z.string().optional(), to_activity_id: z.string().optional(), to_side: RebookTradeAllocationResponseOriginalTradeAllocationToSide$inboundSchema .optional(), trade_allocation_id: z.string().optional(), when_issued: RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$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 OriginalTradeAllocation$Outbound = { accrued_interest_amount?: | RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$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?: | RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$Outbound | null | undefined; execution_time?: string | null | undefined; fees?: Array | undefined; from_account_id?: string | undefined; from_activity_id?: string | undefined; gross_amount?: | RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$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?: | RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$Outbound | null | undefined; price?: | RebookTradeAllocationResponseOriginalTradeAllocationPrice$Outbound | null | undefined; price_adjustment?: | RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$Outbound | null | undefined; quantity?: | RebookTradeAllocationResponseOriginalTradeAllocationQuantity$Outbound | null | undefined; settlement_date?: | RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$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 OriginalTradeAllocation$outboundSchema: z.ZodType< OriginalTradeAllocation$Outbound, z.ZodTypeDef, OriginalTradeAllocation > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationAccruedInterestAmount$outboundSchema ), ).optional(), additionalInstructions: z.string().optional(), assetType: RebookTradeAllocationResponseOriginalTradeAllocationAssetType$outboundSchema .optional(), bondYield: z.array(BondYield$outboundSchema).optional(), brokerCapacity: RebookTradeAllocationResponseOriginalTradeAllocationBrokerCapacity$outboundSchema .optional(), clientOrderId: z.string().optional(), commissionAmount: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationCommissionAmount$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(() => RebookTradeAllocationResponseOriginalTradeAllocationGrossAmount$outboundSchema ), ).optional(), identifier: z.string().optional(), identifierType: RebookTradeAllocationResponseOriginalTradeAllocationIdentifierType$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(() => RebookTradeAllocationResponseOriginalTradeAllocationPrevailingMarketPrice$outboundSchema ), ).optional(), price: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPrice$outboundSchema ), ).optional(), priceAdjustment: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationPriceAdjustment$outboundSchema ), ).optional(), quantity: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationQuantity$outboundSchema ), ).optional(), settlementDate: z.nullable( z.lazy(() => RebookTradeAllocationResponseOriginalTradeAllocationSettlementDate$outboundSchema ), ).optional(), sideModifier: RebookTradeAllocationResponseOriginalTradeAllocationSideModifier$outboundSchema .optional(), sourceApplication: z.string().optional(), specialInstructions: z.array( RebookTradeAllocationResponseOriginalTradeAllocationSpecialInstructions$outboundSchema, ).optional(), state: RebookTradeAllocationResponseOriginalTradeAllocationState$outboundSchema .optional(), toAccountId: z.string().optional(), toActivityId: z.string().optional(), toSide: RebookTradeAllocationResponseOriginalTradeAllocationToSide$outboundSchema .optional(), tradeAllocationId: z.string().optional(), whenIssued: RebookTradeAllocationResponseOriginalTradeAllocationWhenIssued$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 OriginalTradeAllocation$ { /** @deprecated use `OriginalTradeAllocation$inboundSchema` instead. */ export const inboundSchema = OriginalTradeAllocation$inboundSchema; /** @deprecated use `OriginalTradeAllocation$outboundSchema` instead. */ export const outboundSchema = OriginalTradeAllocation$outboundSchema; /** @deprecated use `OriginalTradeAllocation$Outbound` instead. */ export type Outbound = OriginalTradeAllocation$Outbound; } export function originalTradeAllocationToJSON( originalTradeAllocation: OriginalTradeAllocation, ): string { return JSON.stringify( OriginalTradeAllocation$outboundSchema.parse(originalTradeAllocation), ); } export function originalTradeAllocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OriginalTradeAllocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OriginalTradeAllocation' from JSON`, ); } /** @internal */ export const RebookTradeAllocationResponse$inboundSchema: z.ZodType< RebookTradeAllocationResponse, z.ZodTypeDef, unknown > = z.object({ new_trade_allocation: z.nullable( z.lazy(() => NewTradeAllocation$inboundSchema), ).optional(), original_trade_allocation: z.nullable( z.lazy(() => OriginalTradeAllocation$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "new_trade_allocation": "newTradeAllocation", "original_trade_allocation": "originalTradeAllocation", }); }); /** @internal */ export type RebookTradeAllocationResponse$Outbound = { new_trade_allocation?: NewTradeAllocation$Outbound | null | undefined; original_trade_allocation?: | OriginalTradeAllocation$Outbound | null | undefined; }; /** @internal */ export const RebookTradeAllocationResponse$outboundSchema: z.ZodType< RebookTradeAllocationResponse$Outbound, z.ZodTypeDef, RebookTradeAllocationResponse > = z.object({ newTradeAllocation: z.nullable( z.lazy(() => NewTradeAllocation$outboundSchema), ).optional(), originalTradeAllocation: z.nullable( z.lazy(() => OriginalTradeAllocation$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { newTradeAllocation: "new_trade_allocation", originalTradeAllocation: "original_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 RebookTradeAllocationResponse$ { /** @deprecated use `RebookTradeAllocationResponse$inboundSchema` instead. */ export const inboundSchema = RebookTradeAllocationResponse$inboundSchema; /** @deprecated use `RebookTradeAllocationResponse$outboundSchema` instead. */ export const outboundSchema = RebookTradeAllocationResponse$outboundSchema; /** @deprecated use `RebookTradeAllocationResponse$Outbound` instead. */ export type Outbound = RebookTradeAllocationResponse$Outbound; } export function rebookTradeAllocationResponseToJSON( rebookTradeAllocationResponse: RebookTradeAllocationResponse, ): string { return JSON.stringify( RebookTradeAllocationResponse$outboundSchema.parse( rebookTradeAllocationResponse, ), ); } export function rebookTradeAllocationResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookTradeAllocationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookTradeAllocationResponse' from JSON`, ); }