/* * 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 { BasketTradingExecutedPrice, BasketTradingExecutedPrice$inboundSchema, BasketTradingExecutedPrice$Outbound, BasketTradingExecutedPrice$outboundSchema, } from "./baskettradingexecutedprice.js"; import { BasketTradingExecutions, BasketTradingExecutions$inboundSchema, BasketTradingExecutions$Outbound, BasketTradingExecutions$outboundSchema, } from "./baskettradingexecutions.js"; /** * The type of the asset in this order */ export enum SetExtraReportingDataResponseAssetType { AssetTypeUnspecified = "ASSET_TYPE_UNSPECIFIED", Equity = "EQUITY", MutualFund = "MUTUAL_FUND", } /** * The type of the asset in this order */ export type SetExtraReportingDataResponseAssetTypeOpen = OpenEnum< typeof SetExtraReportingDataResponseAssetType >; /** * Output only field that is required for Equity Orders for any client who is having Apex do CAT reporting on their behalf. This field denotes the initiator of the cancel request. This field will be present when provided on the RemoveOrderRequest */ export enum SetExtraReportingDataResponseCancelInitiator { InitiatorUnspecified = "INITIATOR_UNSPECIFIED", Firm = "FIRM", Client = "CLIENT", } /** * Output only field that is required for Equity Orders for any client who is having Apex do CAT reporting on their behalf. This field denotes the initiator of the cancel request. This field will be present when provided on the RemoveOrderRequest */ export type SetExtraReportingDataResponseCancelInitiatorOpen = OpenEnum< typeof SetExtraReportingDataResponseCancelInitiator >; /** * The product of order quantity & price, summed across all fills, reported in the currency specified in the order. (This will be rounded to 2 decimal places for USD currencies). Will be absent if an order has no fill information. */ export type SetExtraReportingDataResponseCumulativeNotionalValue = { /** * 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; }; /** * Any reporting data provided by the SetExtraReportingData endpoint. */ export type SetExtraReportingDataResponseExtraReportingData = { cancelConfirmedTime?: Date | null | undefined; }; /** * The summed quantity value across all fills in this order, up to a maximum of 5 decimal places. Will be absent if an order has no fill information. */ export type SetExtraReportingDataResponseFilledQuantity = { /** * 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 identifier type of the asset being ordered. For Equities: only SYMBOL is supported For Mutual Funds: only SYMBOL and CUSIP are supported */ export enum SetExtraReportingDataResponseIdentifierType { Symbol = "SYMBOL", Cusip = "CUSIP", Isin = "ISIN", } /** * The identifier type of the asset being ordered. For Equities: only SYMBOL is supported For Mutual Funds: only SYMBOL and CUSIP are supported */ export type SetExtraReportingDataResponseIdentifierTypeOpen = OpenEnum< typeof SetExtraReportingDataResponseIdentifierType >; /** * The maximum number of shares to be sold if this is a notional SELL order of an Equity asset type. (Prohibited for other side or asset_type inputs.) * * @remarks * * This will only be recognized for clients configured to bypass the short sale risk check. When specified, must be greater than 0 and can't exceed 5 decimal places. */ export type SetExtraReportingDataResponseMaxSellQuantity = { /** * 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; }; /** * Notional quantity of the order, measured in USD. Maximum 2 decimal place precision. Either a quantity or notional_value MUST be specified (but not both). For Equities: currently not supported yet For Mutual Funds: Only supported for BUY orders. The order will be transacted at the full notional amount specified. */ export type SetExtraReportingDataResponseNotionalValue = { /** * 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; }; /** * When an order has the REJECTED status, this will be populated with a system code describing the rejection. */ export enum SetExtraReportingDataResponseOrderRejectedReason { OrderRejectReasonUnspecified = "ORDER_REJECT_REASON_UNSPECIFIED", BrokerOption = "BROKER_OPTION", UnknownSecurity = "UNKNOWN_SECURITY", ExchangeClosed = "EXCHANGE_CLOSED", TooLateToEnter = "TOO_LATE_TO_ENTER", UnknownOrder = "UNKNOWN_ORDER", DuplicateOrder = "DUPLICATE_ORDER", StaleOrder = "STALE_ORDER", BelowNotionalMinimum = "BELOW_NOTIONAL_MINIMUM", AccountNotEntitled = "ACCOUNT_NOT_ENTITLED", SystemError = "SYSTEM_ERROR", BlockingCorporateAction = "BLOCKING_CORPORATE_ACTION", UnavailablePriceQuote = "UNAVAILABLE_PRICE_QUOTE", ExecutionMisconfiguredClient = "EXECUTION_MISCONFIGURED_CLIENT", NotionalQuantityNotAllowedForSecurity = "NOTIONAL_QUANTITY_NOT_ALLOWED_FOR_SECURITY", FractionalQuantityNotAllowedForSecurity = "FRACTIONAL_QUANTITY_NOT_ALLOWED_FOR_SECURITY", OnlyFractionalSellOrWholeOrdersAllowedForSecurity = "ONLY_FRACTIONAL_SELL_OR_WHOLE_ORDERS_ALLOWED_FOR_SECURITY", SymbolNotTradeable = "SYMBOL_NOT_TRADEABLE", AboveNotionalMaximum = "ABOVE_NOTIONAL_MAXIMUM", AboveShareMaximum = "ABOVE_SHARE_MAXIMUM", MaxSellQuantityRequired = "MAX_SELL_QUANTITY_REQUIRED", MaxSellQuantityProhibited = "MAX_SELL_QUANTITY_PROHIBITED", StockTradesDisabled = "STOCK_TRADES_DISABLED", AssetNotSetUpToTrade = "ASSET_NOT_SET_UP_TO_TRADE", AnotherBasketOrderForAccountHasFailedRiskChecks = "ANOTHER_BASKET_ORDER_FOR_ACCOUNT_HAS_FAILED_RISK_CHECKS", InsufficientPosition = "INSUFFICIENT_POSITION", FailedBuyingPower = "FAILED_BUYING_POWER", RoundUpAmountTooSmall = "ROUND_UP_AMOUNT_TOO_SMALL", AssetNotSetUpForRoundUps = "ASSET_NOT_SET_UP_FOR_ROUND_UPS", } /** * When an order has the REJECTED status, this will be populated with a system code describing the rejection. */ export type SetExtraReportingDataResponseOrderRejectedReasonOpen = OpenEnum< typeof SetExtraReportingDataResponseOrderRejectedReason >; /** * The processing status of the order */ export enum SetExtraReportingDataResponseOrderStatus { OrderStatusUnspecified = "ORDER_STATUS_UNSPECIFIED", PendingNew = "PENDING_NEW", New = "NEW", PartiallyFilled = "PARTIALLY_FILLED", Filled = "FILLED", Rejected = "REJECTED", RemovedBeforeSubmission = "REMOVED_BEFORE_SUBMISSION", } /** * The processing status of the order */ export type SetExtraReportingDataResponseOrderStatusOpen = OpenEnum< typeof SetExtraReportingDataResponseOrderStatus >; /** * The execution type of this order. */ export enum SetExtraReportingDataResponseOrderType { OrderTypeUnspecified = "ORDER_TYPE_UNSPECIFIED", Market = "MARKET", } /** * The execution type of this order. */ export type SetExtraReportingDataResponseOrderTypeOpen = OpenEnum< typeof SetExtraReportingDataResponseOrderType >; /** * Numeric quantity of the order. Either a quantity or notional_value MUST be specified (but not both). For Equities: Represents the number of shares, must be greater than zero and may not exceed 5 decimal places. For Mutual Funds: Only supported for SELL orders. Represents the number of shares, up to a maximum of 3 decimal places. */ export type SetExtraReportingDataResponseQuantity = { /** * 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 side of this order. */ export enum SetExtraReportingDataResponseSide { SideUnspecified = "SIDE_UNSPECIFIED", Buy = "BUY", Sell = "SELL", } /** * The side of this order. */ export type SetExtraReportingDataResponseSideOpen = OpenEnum< typeof SetExtraReportingDataResponseSide >; export enum SetExtraReportingDataResponseSpecialReportingInstructions { SpecialReportingInstructionsUnspecified = "SPECIAL_REPORTING_INSTRUCTIONS_UNSPECIFIED", Solicited = "SOLICITED", Unsolicited = "UNSOLICITED", RoundUp = "ROUND_UP", } export type SetExtraReportingDataResponseSpecialReportingInstructionsOpen = OpenEnum; /** * Must be the value "DAY". Regulatory requirements dictate that the system capture the intended time_in_force, which is why this a mandatory field. */ export enum SetExtraReportingDataResponseTimeInForce { TimeInForceUnspecified = "TIME_IN_FORCE_UNSPECIFIED", Day = "DAY", } /** * Must be the value "DAY". Regulatory requirements dictate that the system capture the intended time_in_force, which is why this a mandatory field. */ export type SetExtraReportingDataResponseTimeInForceOpen = OpenEnum< typeof SetExtraReportingDataResponseTimeInForce >; /** * The basket order that was updated */ export type SetExtraReportingDataResponseBasketOrder = { /** * The identifier of the account transacting this order */ accountId?: string | undefined; /** * Apex Asset ID for this asset. This will not be returned in the initial CreateOrder response and will be available after an order completes validation. If the provided identifier does not match any Apex asset available for trading, an OrderRejectReason of "UNKNOWN_SECURITY" will be returned and the asset_id will not be set. */ assetId?: string | undefined; /** * The type of the asset in this order */ assetType?: SetExtraReportingDataResponseAssetTypeOpen | undefined; /** * The average prices, as weighted averages, across all executions in this order. Will be absent if an order has no executions. * * @remarks * * When asset_type = EQUITY, there will be at most one value present, with a type of PRICE_PER_UNIT. This will have up to 4 decimal places for USD amounts less than $1, and a maximum of two for larger USD amounts. */ averagePrices?: Array | undefined; /** * System generated unique id for the basket order. */ basketOrderId?: string | undefined; /** * Output only field that is required for Equity Orders for any client who is having Apex do CAT reporting on their behalf. This field denotes the initiator of the cancel request. This field will be present when provided on the RemoveOrderRequest */ cancelInitiator?: | SetExtraReportingDataResponseCancelInitiatorOpen | undefined; /** * Output only field for Equity Orders related to CAT reporting on behalf of clients. This field will be present when provided on the RemoveOrderRequest */ clientCancelReceivedTime?: Date | null | undefined; /** * Output only field for Equity Orders related to CAT reporting on behalf of clients. This field will be present when provided on the RemoveOrderRequest */ clientCancelSentTime?: Date | null | undefined; /** * User-supplied unique order ID. Cannot be more than 40 characters long. */ clientOrderId?: string | undefined; /** * Time the order request was received by the client. Must be in the past. Timezone will default to UTC if not provided. */ clientOrderReceivedTime?: Date | null | undefined; /** * Time of the order creation */ createTime?: Date | null | undefined; /** * The product of order quantity & price, summed across all fills, reported in the currency specified in the order. (This will be rounded to 2 decimal places for USD currencies). Will be absent if an order has no fill information. */ cumulativeNotionalValue?: | SetExtraReportingDataResponseCumulativeNotionalValue | null | undefined; /** * Defaults to "USD". Only "USD" is supported. Full list of currency codes is defined at: https://en.wikipedia.org/wiki/ISO_4217 */ currencyCode?: string | undefined; /** * The execution-level details that compose this order */ executions?: Array | undefined; /** * Any reporting data provided by the SetExtraReportingData endpoint. */ extraReportingData?: | SetExtraReportingDataResponseExtraReportingData | null | undefined; /** * The summed quantity value across all fills in this order, up to a maximum of 5 decimal places. Will be absent if an order has no fill information. */ filledQuantity?: | SetExtraReportingDataResponseFilledQuantity | null | undefined; /** * Identifier of the asset (of the type specified in `identifier_type`). */ identifier?: string | undefined; /** * The identifier type of the asset being ordered. For Equities: only SYMBOL is supported For Mutual Funds: only SYMBOL and CUSIP are supported */ identifierType?: SetExtraReportingDataResponseIdentifierTypeOpen | undefined; /** * Time of the last order update */ lastUpdateTime?: Date | null | undefined; /** * The maximum number of shares to be sold if this is a notional SELL order of an Equity asset type. (Prohibited for other side or asset_type inputs.) * * @remarks * * This will only be recognized for clients configured to bypass the short sale risk check. When specified, must be greater than 0 and can't exceed 5 decimal places. */ maxSellQuantity?: | SetExtraReportingDataResponseMaxSellQuantity | null | undefined; /** * System generated name of the basket order. */ name?: string | undefined; /** * Notional quantity of the order, measured in USD. Maximum 2 decimal place precision. Either a quantity or notional_value MUST be specified (but not both). For Equities: currently not supported yet For Mutual Funds: Only supported for BUY orders. The order will be transacted at the full notional amount specified. */ notionalValue?: SetExtraReportingDataResponseNotionalValue | null | undefined; /** * When an order has the REJECTED status, this will be populated with a system code describing the rejection. */ orderRejectedReason?: | SetExtraReportingDataResponseOrderRejectedReasonOpen | undefined; /** * The processing status of the order */ orderStatus?: SetExtraReportingDataResponseOrderStatusOpen | undefined; /** * The execution type of this order. */ orderType?: SetExtraReportingDataResponseOrderTypeOpen | undefined; /** * Numeric quantity of the order. Either a quantity or notional_value MUST be specified (but not both). For Equities: Represents the number of shares, must be greater than zero and may not exceed 5 decimal places. For Mutual Funds: Only supported for SELL orders. Represents the number of shares, up to a maximum of 3 decimal places. */ quantity?: SetExtraReportingDataResponseQuantity | null | undefined; /** * The side of this order. */ side?: SetExtraReportingDataResponseSideOpen | undefined; /** * Special Reporting Instructions to be applied to this order. Can include multiple Instructions. */ specialReportingInstructions?: | Array | undefined; /** * Must be the value "DAY". Regulatory requirements dictate that the system capture the intended time_in_force, which is why this a mandatory field. */ timeInForce?: SetExtraReportingDataResponseTimeInForceOpen | undefined; }; /** * The response message for setting extra reporting data onto a basket order */ export type SetExtraReportingDataResponse = { /** * The basket order that was updated */ basketOrder?: SetExtraReportingDataResponseBasketOrder | null | undefined; /** * Format: correspondents/{correspondent}/baskets/{basket} */ name?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseAssetType$inboundSchema: z.ZodType< SetExtraReportingDataResponseAssetTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseAssetType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseAssetType$outboundSchema: z.ZodType< SetExtraReportingDataResponseAssetTypeOpen, z.ZodTypeDef, SetExtraReportingDataResponseAssetTypeOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseAssetType), 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 SetExtraReportingDataResponseAssetType$ { /** @deprecated use `SetExtraReportingDataResponseAssetType$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseAssetType$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseAssetType$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseAssetType$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseCancelInitiator$inboundSchema: z.ZodType< SetExtraReportingDataResponseCancelInitiatorOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseCancelInitiator), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseCancelInitiator$outboundSchema: z.ZodType< SetExtraReportingDataResponseCancelInitiatorOpen, z.ZodTypeDef, SetExtraReportingDataResponseCancelInitiatorOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseCancelInitiator), 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 SetExtraReportingDataResponseCancelInitiator$ { /** @deprecated use `SetExtraReportingDataResponseCancelInitiator$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseCancelInitiator$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseCancelInitiator$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseCancelInitiator$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseCumulativeNotionalValue$inboundSchema: z.ZodType< SetExtraReportingDataResponseCumulativeNotionalValue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type SetExtraReportingDataResponseCumulativeNotionalValue$Outbound = { value?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseCumulativeNotionalValue$outboundSchema: z.ZodType< SetExtraReportingDataResponseCumulativeNotionalValue$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseCumulativeNotionalValue > = 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 SetExtraReportingDataResponseCumulativeNotionalValue$ { /** @deprecated use `SetExtraReportingDataResponseCumulativeNotionalValue$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseCumulativeNotionalValue$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseCumulativeNotionalValue$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseCumulativeNotionalValue$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseCumulativeNotionalValue$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseCumulativeNotionalValue$Outbound; } export function setExtraReportingDataResponseCumulativeNotionalValueToJSON( setExtraReportingDataResponseCumulativeNotionalValue: SetExtraReportingDataResponseCumulativeNotionalValue, ): string { return JSON.stringify( SetExtraReportingDataResponseCumulativeNotionalValue$outboundSchema.parse( setExtraReportingDataResponseCumulativeNotionalValue, ), ); } export function setExtraReportingDataResponseCumulativeNotionalValueFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseCumulativeNotionalValue, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseCumulativeNotionalValue$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseCumulativeNotionalValue' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseExtraReportingData$inboundSchema: z.ZodType< SetExtraReportingDataResponseExtraReportingData, z.ZodTypeDef, unknown > = z.object({ cancel_confirmed_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "cancel_confirmed_time": "cancelConfirmedTime", }); }); /** @internal */ export type SetExtraReportingDataResponseExtraReportingData$Outbound = { cancel_confirmed_time?: string | null | undefined; }; /** @internal */ export const SetExtraReportingDataResponseExtraReportingData$outboundSchema: z.ZodType< SetExtraReportingDataResponseExtraReportingData$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseExtraReportingData > = z.object({ cancelConfirmedTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), }).transform((v) => { return remap$(v, { cancelConfirmedTime: "cancel_confirmed_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SetExtraReportingDataResponseExtraReportingData$ { /** @deprecated use `SetExtraReportingDataResponseExtraReportingData$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseExtraReportingData$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseExtraReportingData$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseExtraReportingData$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseExtraReportingData$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseExtraReportingData$Outbound; } export function setExtraReportingDataResponseExtraReportingDataToJSON( setExtraReportingDataResponseExtraReportingData: SetExtraReportingDataResponseExtraReportingData, ): string { return JSON.stringify( SetExtraReportingDataResponseExtraReportingData$outboundSchema.parse( setExtraReportingDataResponseExtraReportingData, ), ); } export function setExtraReportingDataResponseExtraReportingDataFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseExtraReportingData, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseExtraReportingData$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseExtraReportingData' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseFilledQuantity$inboundSchema: z.ZodType< SetExtraReportingDataResponseFilledQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type SetExtraReportingDataResponseFilledQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseFilledQuantity$outboundSchema: z.ZodType< SetExtraReportingDataResponseFilledQuantity$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseFilledQuantity > = 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 SetExtraReportingDataResponseFilledQuantity$ { /** @deprecated use `SetExtraReportingDataResponseFilledQuantity$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseFilledQuantity$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseFilledQuantity$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseFilledQuantity$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseFilledQuantity$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseFilledQuantity$Outbound; } export function setExtraReportingDataResponseFilledQuantityToJSON( setExtraReportingDataResponseFilledQuantity: SetExtraReportingDataResponseFilledQuantity, ): string { return JSON.stringify( SetExtraReportingDataResponseFilledQuantity$outboundSchema.parse( setExtraReportingDataResponseFilledQuantity, ), ); } export function setExtraReportingDataResponseFilledQuantityFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseFilledQuantity, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseFilledQuantity$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseFilledQuantity' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseIdentifierType$inboundSchema: z.ZodType< SetExtraReportingDataResponseIdentifierTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseIdentifierType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseIdentifierType$outboundSchema: z.ZodType< SetExtraReportingDataResponseIdentifierTypeOpen, z.ZodTypeDef, SetExtraReportingDataResponseIdentifierTypeOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseIdentifierType), 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 SetExtraReportingDataResponseIdentifierType$ { /** @deprecated use `SetExtraReportingDataResponseIdentifierType$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseIdentifierType$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseIdentifierType$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseIdentifierType$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseMaxSellQuantity$inboundSchema: z.ZodType< SetExtraReportingDataResponseMaxSellQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type SetExtraReportingDataResponseMaxSellQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseMaxSellQuantity$outboundSchema: z.ZodType< SetExtraReportingDataResponseMaxSellQuantity$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseMaxSellQuantity > = 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 SetExtraReportingDataResponseMaxSellQuantity$ { /** @deprecated use `SetExtraReportingDataResponseMaxSellQuantity$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseMaxSellQuantity$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseMaxSellQuantity$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseMaxSellQuantity$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseMaxSellQuantity$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseMaxSellQuantity$Outbound; } export function setExtraReportingDataResponseMaxSellQuantityToJSON( setExtraReportingDataResponseMaxSellQuantity: SetExtraReportingDataResponseMaxSellQuantity, ): string { return JSON.stringify( SetExtraReportingDataResponseMaxSellQuantity$outboundSchema.parse( setExtraReportingDataResponseMaxSellQuantity, ), ); } export function setExtraReportingDataResponseMaxSellQuantityFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseMaxSellQuantity, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseMaxSellQuantity$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseMaxSellQuantity' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseNotionalValue$inboundSchema: z.ZodType = z.object({ value: z.string().optional(), }); /** @internal */ export type SetExtraReportingDataResponseNotionalValue$Outbound = { value?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseNotionalValue$outboundSchema: z.ZodType< SetExtraReportingDataResponseNotionalValue$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseNotionalValue > = 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 SetExtraReportingDataResponseNotionalValue$ { /** @deprecated use `SetExtraReportingDataResponseNotionalValue$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseNotionalValue$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseNotionalValue$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseNotionalValue$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseNotionalValue$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseNotionalValue$Outbound; } export function setExtraReportingDataResponseNotionalValueToJSON( setExtraReportingDataResponseNotionalValue: SetExtraReportingDataResponseNotionalValue, ): string { return JSON.stringify( SetExtraReportingDataResponseNotionalValue$outboundSchema.parse( setExtraReportingDataResponseNotionalValue, ), ); } export function setExtraReportingDataResponseNotionalValueFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseNotionalValue, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseNotionalValue$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseNotionalValue' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseOrderRejectedReason$inboundSchema: z.ZodType< SetExtraReportingDataResponseOrderRejectedReasonOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseOrderRejectedReason), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseOrderRejectedReason$outboundSchema: z.ZodType< SetExtraReportingDataResponseOrderRejectedReasonOpen, z.ZodTypeDef, SetExtraReportingDataResponseOrderRejectedReasonOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseOrderRejectedReason), 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 SetExtraReportingDataResponseOrderRejectedReason$ { /** @deprecated use `SetExtraReportingDataResponseOrderRejectedReason$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseOrderRejectedReason$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseOrderRejectedReason$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseOrderRejectedReason$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseOrderStatus$inboundSchema: z.ZodType< SetExtraReportingDataResponseOrderStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseOrderStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseOrderStatus$outboundSchema: z.ZodType< SetExtraReportingDataResponseOrderStatusOpen, z.ZodTypeDef, SetExtraReportingDataResponseOrderStatusOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseOrderStatus), 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 SetExtraReportingDataResponseOrderStatus$ { /** @deprecated use `SetExtraReportingDataResponseOrderStatus$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseOrderStatus$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseOrderStatus$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseOrderStatus$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseOrderType$inboundSchema: z.ZodType< SetExtraReportingDataResponseOrderTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseOrderType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseOrderType$outboundSchema: z.ZodType< SetExtraReportingDataResponseOrderTypeOpen, z.ZodTypeDef, SetExtraReportingDataResponseOrderTypeOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseOrderType), 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 SetExtraReportingDataResponseOrderType$ { /** @deprecated use `SetExtraReportingDataResponseOrderType$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseOrderType$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseOrderType$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseOrderType$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseQuantity$inboundSchema: z.ZodType< SetExtraReportingDataResponseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type SetExtraReportingDataResponseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseQuantity$outboundSchema: z.ZodType< SetExtraReportingDataResponseQuantity$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseQuantity > = 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 SetExtraReportingDataResponseQuantity$ { /** @deprecated use `SetExtraReportingDataResponseQuantity$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseQuantity$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseQuantity$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseQuantity$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseQuantity$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseQuantity$Outbound; } export function setExtraReportingDataResponseQuantityToJSON( setExtraReportingDataResponseQuantity: SetExtraReportingDataResponseQuantity, ): string { return JSON.stringify( SetExtraReportingDataResponseQuantity$outboundSchema.parse( setExtraReportingDataResponseQuantity, ), ); } export function setExtraReportingDataResponseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SetExtraReportingDataResponseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SetExtraReportingDataResponseQuantity' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponseSide$inboundSchema: z.ZodType< SetExtraReportingDataResponseSideOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseSide), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseSide$outboundSchema: z.ZodType< SetExtraReportingDataResponseSideOpen, z.ZodTypeDef, SetExtraReportingDataResponseSideOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseSide), 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 SetExtraReportingDataResponseSide$ { /** @deprecated use `SetExtraReportingDataResponseSide$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseSide$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseSide$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseSide$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseSpecialReportingInstructions$inboundSchema: z.ZodType< SetExtraReportingDataResponseSpecialReportingInstructionsOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseSpecialReportingInstructions), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseSpecialReportingInstructions$outboundSchema: z.ZodType< SetExtraReportingDataResponseSpecialReportingInstructionsOpen, z.ZodTypeDef, SetExtraReportingDataResponseSpecialReportingInstructionsOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseSpecialReportingInstructions), 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 SetExtraReportingDataResponseSpecialReportingInstructions$ { /** @deprecated use `SetExtraReportingDataResponseSpecialReportingInstructions$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseSpecialReportingInstructions$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseSpecialReportingInstructions$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseSpecialReportingInstructions$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseTimeInForce$inboundSchema: z.ZodType< SetExtraReportingDataResponseTimeInForceOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(SetExtraReportingDataResponseTimeInForce), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const SetExtraReportingDataResponseTimeInForce$outboundSchema: z.ZodType< SetExtraReportingDataResponseTimeInForceOpen, z.ZodTypeDef, SetExtraReportingDataResponseTimeInForceOpen > = z.union([ z.nativeEnum(SetExtraReportingDataResponseTimeInForce), 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 SetExtraReportingDataResponseTimeInForce$ { /** @deprecated use `SetExtraReportingDataResponseTimeInForce$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseTimeInForce$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseTimeInForce$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseTimeInForce$outboundSchema; } /** @internal */ export const SetExtraReportingDataResponseBasketOrder$inboundSchema: z.ZodType< SetExtraReportingDataResponseBasketOrder, z.ZodTypeDef, unknown > = z.object({ account_id: z.string().optional(), asset_id: z.string().optional(), asset_type: SetExtraReportingDataResponseAssetType$inboundSchema.optional(), average_prices: z.array(BasketTradingExecutedPrice$inboundSchema).optional(), basket_order_id: z.string().optional(), cancel_initiator: SetExtraReportingDataResponseCancelInitiator$inboundSchema .optional(), client_cancel_received_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), client_cancel_sent_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), client_order_id: z.string().optional(), client_order_received_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), create_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), cumulative_notional_value: z.nullable( z.lazy(() => SetExtraReportingDataResponseCumulativeNotionalValue$inboundSchema ), ).optional(), currency_code: z.string().optional(), executions: z.array(BasketTradingExecutions$inboundSchema).optional(), extra_reporting_data: z.nullable( z.lazy(() => SetExtraReportingDataResponseExtraReportingData$inboundSchema), ).optional(), filled_quantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseFilledQuantity$inboundSchema), ).optional(), identifier: z.string().optional(), identifier_type: SetExtraReportingDataResponseIdentifierType$inboundSchema .optional(), last_update_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), max_sell_quantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseMaxSellQuantity$inboundSchema), ).optional(), name: z.string().optional(), notional_value: z.nullable( z.lazy(() => SetExtraReportingDataResponseNotionalValue$inboundSchema), ).optional(), order_rejected_reason: SetExtraReportingDataResponseOrderRejectedReason$inboundSchema.optional(), order_status: SetExtraReportingDataResponseOrderStatus$inboundSchema .optional(), order_type: SetExtraReportingDataResponseOrderType$inboundSchema.optional(), quantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseQuantity$inboundSchema), ).optional(), side: SetExtraReportingDataResponseSide$inboundSchema.optional(), special_reporting_instructions: z.array( SetExtraReportingDataResponseSpecialReportingInstructions$inboundSchema, ).optional(), time_in_force: SetExtraReportingDataResponseTimeInForce$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "asset_id": "assetId", "asset_type": "assetType", "average_prices": "averagePrices", "basket_order_id": "basketOrderId", "cancel_initiator": "cancelInitiator", "client_cancel_received_time": "clientCancelReceivedTime", "client_cancel_sent_time": "clientCancelSentTime", "client_order_id": "clientOrderId", "client_order_received_time": "clientOrderReceivedTime", "create_time": "createTime", "cumulative_notional_value": "cumulativeNotionalValue", "currency_code": "currencyCode", "extra_reporting_data": "extraReportingData", "filled_quantity": "filledQuantity", "identifier_type": "identifierType", "last_update_time": "lastUpdateTime", "max_sell_quantity": "maxSellQuantity", "notional_value": "notionalValue", "order_rejected_reason": "orderRejectedReason", "order_status": "orderStatus", "order_type": "orderType", "special_reporting_instructions": "specialReportingInstructions", "time_in_force": "timeInForce", }); }); /** @internal */ export type SetExtraReportingDataResponseBasketOrder$Outbound = { account_id?: string | undefined; asset_id?: string | undefined; asset_type?: string | undefined; average_prices?: Array | undefined; basket_order_id?: string | undefined; cancel_initiator?: string | undefined; client_cancel_received_time?: string | null | undefined; client_cancel_sent_time?: string | null | undefined; client_order_id?: string | undefined; client_order_received_time?: string | null | undefined; create_time?: string | null | undefined; cumulative_notional_value?: | SetExtraReportingDataResponseCumulativeNotionalValue$Outbound | null | undefined; currency_code?: string | undefined; executions?: Array | undefined; extra_reporting_data?: | SetExtraReportingDataResponseExtraReportingData$Outbound | null | undefined; filled_quantity?: | SetExtraReportingDataResponseFilledQuantity$Outbound | null | undefined; identifier?: string | undefined; identifier_type?: string | undefined; last_update_time?: string | null | undefined; max_sell_quantity?: | SetExtraReportingDataResponseMaxSellQuantity$Outbound | null | undefined; name?: string | undefined; notional_value?: | SetExtraReportingDataResponseNotionalValue$Outbound | null | undefined; order_rejected_reason?: string | undefined; order_status?: string | undefined; order_type?: string | undefined; quantity?: SetExtraReportingDataResponseQuantity$Outbound | null | undefined; side?: string | undefined; special_reporting_instructions?: Array | undefined; time_in_force?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponseBasketOrder$outboundSchema: z.ZodType< SetExtraReportingDataResponseBasketOrder$Outbound, z.ZodTypeDef, SetExtraReportingDataResponseBasketOrder > = z.object({ accountId: z.string().optional(), assetId: z.string().optional(), assetType: SetExtraReportingDataResponseAssetType$outboundSchema.optional(), averagePrices: z.array(BasketTradingExecutedPrice$outboundSchema).optional(), basketOrderId: z.string().optional(), cancelInitiator: SetExtraReportingDataResponseCancelInitiator$outboundSchema .optional(), clientCancelReceivedTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), clientCancelSentTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), clientOrderId: z.string().optional(), clientOrderReceivedTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), createTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), cumulativeNotionalValue: z.nullable( z.lazy(() => SetExtraReportingDataResponseCumulativeNotionalValue$outboundSchema ), ).optional(), currencyCode: z.string().optional(), executions: z.array(BasketTradingExecutions$outboundSchema).optional(), extraReportingData: z.nullable( z.lazy(() => SetExtraReportingDataResponseExtraReportingData$outboundSchema ), ).optional(), filledQuantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseFilledQuantity$outboundSchema), ).optional(), identifier: z.string().optional(), identifierType: SetExtraReportingDataResponseIdentifierType$outboundSchema .optional(), lastUpdateTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), maxSellQuantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseMaxSellQuantity$outboundSchema), ).optional(), name: z.string().optional(), notionalValue: z.nullable( z.lazy(() => SetExtraReportingDataResponseNotionalValue$outboundSchema), ).optional(), orderRejectedReason: SetExtraReportingDataResponseOrderRejectedReason$outboundSchema.optional(), orderStatus: SetExtraReportingDataResponseOrderStatus$outboundSchema .optional(), orderType: SetExtraReportingDataResponseOrderType$outboundSchema.optional(), quantity: z.nullable( z.lazy(() => SetExtraReportingDataResponseQuantity$outboundSchema), ).optional(), side: SetExtraReportingDataResponseSide$outboundSchema.optional(), specialReportingInstructions: z.array( SetExtraReportingDataResponseSpecialReportingInstructions$outboundSchema, ).optional(), timeInForce: SetExtraReportingDataResponseTimeInForce$outboundSchema .optional(), }).transform((v) => { return remap$(v, { accountId: "account_id", assetId: "asset_id", assetType: "asset_type", averagePrices: "average_prices", basketOrderId: "basket_order_id", cancelInitiator: "cancel_initiator", clientCancelReceivedTime: "client_cancel_received_time", clientCancelSentTime: "client_cancel_sent_time", clientOrderId: "client_order_id", clientOrderReceivedTime: "client_order_received_time", createTime: "create_time", cumulativeNotionalValue: "cumulative_notional_value", currencyCode: "currency_code", extraReportingData: "extra_reporting_data", filledQuantity: "filled_quantity", identifierType: "identifier_type", lastUpdateTime: "last_update_time", maxSellQuantity: "max_sell_quantity", notionalValue: "notional_value", orderRejectedReason: "order_rejected_reason", orderStatus: "order_status", orderType: "order_type", specialReportingInstructions: "special_reporting_instructions", timeInForce: "time_in_force", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SetExtraReportingDataResponseBasketOrder$ { /** @deprecated use `SetExtraReportingDataResponseBasketOrder$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponseBasketOrder$inboundSchema; /** @deprecated use `SetExtraReportingDataResponseBasketOrder$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponseBasketOrder$outboundSchema; /** @deprecated use `SetExtraReportingDataResponseBasketOrder$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponseBasketOrder$Outbound; } export function setExtraReportingDataResponseBasketOrderToJSON( setExtraReportingDataResponseBasketOrder: SetExtraReportingDataResponseBasketOrder, ): string { return JSON.stringify( SetExtraReportingDataResponseBasketOrder$outboundSchema.parse( setExtraReportingDataResponseBasketOrder, ), ); } export function setExtraReportingDataResponseBasketOrderFromJSON( jsonString: string, ): SafeParseResult< SetExtraReportingDataResponseBasketOrder, SDKValidationError > { return safeParse( jsonString, (x) => SetExtraReportingDataResponseBasketOrder$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'SetExtraReportingDataResponseBasketOrder' from JSON`, ); } /** @internal */ export const SetExtraReportingDataResponse$inboundSchema: z.ZodType< SetExtraReportingDataResponse, z.ZodTypeDef, unknown > = z.object({ basket_order: z.nullable( z.lazy(() => SetExtraReportingDataResponseBasketOrder$inboundSchema), ).optional(), name: z.string().optional(), }).transform((v) => { return remap$(v, { "basket_order": "basketOrder", }); }); /** @internal */ export type SetExtraReportingDataResponse$Outbound = { basket_order?: | SetExtraReportingDataResponseBasketOrder$Outbound | null | undefined; name?: string | undefined; }; /** @internal */ export const SetExtraReportingDataResponse$outboundSchema: z.ZodType< SetExtraReportingDataResponse$Outbound, z.ZodTypeDef, SetExtraReportingDataResponse > = z.object({ basketOrder: z.nullable( z.lazy(() => SetExtraReportingDataResponseBasketOrder$outboundSchema), ).optional(), name: z.string().optional(), }).transform((v) => { return remap$(v, { basketOrder: "basket_order", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SetExtraReportingDataResponse$ { /** @deprecated use `SetExtraReportingDataResponse$inboundSchema` instead. */ export const inboundSchema = SetExtraReportingDataResponse$inboundSchema; /** @deprecated use `SetExtraReportingDataResponse$outboundSchema` instead. */ export const outboundSchema = SetExtraReportingDataResponse$outboundSchema; /** @deprecated use `SetExtraReportingDataResponse$Outbound` instead. */ export type Outbound = SetExtraReportingDataResponse$Outbound; } export function setExtraReportingDataResponseToJSON( setExtraReportingDataResponse: SetExtraReportingDataResponse, ): string { return JSON.stringify( SetExtraReportingDataResponse$outboundSchema.parse( setExtraReportingDataResponse, ), ); } export function setExtraReportingDataResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SetExtraReportingDataResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SetExtraReportingDataResponse' from JSON`, ); }