/// <summary> /// Initializes a new instance of the <see cref="UserTrade" /> class. /// </summary> /// <param name="direction">Trade direction of the taker (required).</param> /// <param name="feeCurrency">Currency, i.e `\"BTC\"`, `\"ETH\"` (required).</param> /// <param name="orderId">Id of the user order (maker or taker), i.e. subscriber's order id that took part in the trade (required).</param> /// <param name="timestamp">The timestamp of the trade (required).</param> /// <param name="price">The price of the trade (required).</param> /// <param name="iv">Option implied volatility for the price (Option only).</param> /// <param name="tradeId">Unique (per currency) trade identifier (required).</param> /// <param name="fee">User's fee in units of the specified `fee_currency` (required).</param> /// <param name="orderType">Order type: `\"limit`, `\"market\"`, or `\"liquidation\"`.</param> /// <param name="tradeSeq">The sequence number of the trade within instrument (required).</param> /// <param name="selfTrade">`true` if the trade is against own order. This can only happen when your account has self-trading enabled. Contact an administrator if you think you need that (required).</param> /// <param name="state">order state, `\"open\"`, `\"filled\"`, `\"rejected\"`, `\"cancelled\"`, `\"untriggered\"` or `\"archive\"` (if order was archived) (required).</param> /// <param name="label">User defined label (presented only when previously set for order by user).</param> /// <param name="indexPrice">Index Price at the moment of trade (required).</param> /// <param name="amount">Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH. (required).</param> /// <param name="instrumentName">Unique instrument identifier (required).</param> /// <param name="tickDirection">Direction of the \"tick\" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` = Minus Tick, `3` = Zero-Minus Tick). (required).</param> /// <param name="matchingId">Always `null`, except for a self-trade which is possible only if self-trading is switched on for the account (in that case this will be id of the maker order of the subscriber) (required).</param> /// <param name="liquidity">Describes what was role of users order: `\"M\"` when it was maker order, `\"T\"` when it was taker order.</param> public UserTrade(DirectionEnum direction = default(DirectionEnum), FeeCurrencyEnum feeCurrency = default(FeeCurrencyEnum), string orderId = default(string), int?timestamp = default(int?), decimal?price = default(decimal?), decimal?iv = default(decimal?), string tradeId = default(string), decimal?fee = default(decimal?), OrderTypeEnum?orderType = default(OrderTypeEnum?), int?tradeSeq = default(int?), bool?selfTrade = default(bool?), StateEnum state = default(StateEnum), string label = default(string), decimal?indexPrice = default(decimal?), decimal?amount = default(decimal?), string instrumentName = default(string), TickDirectionEnum tickDirection = default(TickDirectionEnum), string matchingId = default(string), LiquidityEnum?liquidity = default(LiquidityEnum?)) { // to ensure "direction" is required (not null) if (direction == null) { throw new InvalidDataException("direction is a required property for UserTrade and cannot be null"); } else { this.Direction = direction; } // to ensure "feeCurrency" is required (not null) if (feeCurrency == null) { throw new InvalidDataException("feeCurrency is a required property for UserTrade and cannot be null"); } else { this.FeeCurrency = feeCurrency; } // to ensure "orderId" is required (not null) if (orderId == null) { throw new InvalidDataException("orderId is a required property for UserTrade and cannot be null"); } else { this.OrderId = orderId; } // to ensure "timestamp" is required (not null) if (timestamp == null) { throw new InvalidDataException("timestamp is a required property for UserTrade and cannot be null"); } else { this.Timestamp = timestamp; } // to ensure "price" is required (not null) if (price == null) { throw new InvalidDataException("price is a required property for UserTrade and cannot be null"); } else { this.Price = price; } // to ensure "tradeId" is required (not null) if (tradeId == null) { throw new InvalidDataException("tradeId is a required property for UserTrade and cannot be null"); } else { this.TradeId = tradeId; } // to ensure "fee" is required (not null) if (fee == null) { throw new InvalidDataException("fee is a required property for UserTrade and cannot be null"); } else { this.Fee = fee; } // to ensure "tradeSeq" is required (not null) if (tradeSeq == null) { throw new InvalidDataException("tradeSeq is a required property for UserTrade and cannot be null"); } else { this.TradeSeq = tradeSeq; } // to ensure "selfTrade" is required (not null) if (selfTrade == null) { throw new InvalidDataException("selfTrade is a required property for UserTrade and cannot be null"); } else { this.SelfTrade = selfTrade; } // to ensure "state" is required (not null) if (state == null) { throw new InvalidDataException("state is a required property for UserTrade and cannot be null"); } else { this.State = state; } // to ensure "indexPrice" is required (not null) if (indexPrice == null) { throw new InvalidDataException("indexPrice is a required property for UserTrade and cannot be null"); } else { this.IndexPrice = indexPrice; } // to ensure "amount" is required (not null) if (amount == null) { throw new InvalidDataException("amount is a required property for UserTrade and cannot be null"); } else { this.Amount = amount; } // to ensure "instrumentName" is required (not null) if (instrumentName == null) { throw new InvalidDataException("instrumentName is a required property for UserTrade and cannot be null"); } else { this.InstrumentName = instrumentName; } // to ensure "tickDirection" is required (not null) if (tickDirection == null) { throw new InvalidDataException("tickDirection is a required property for UserTrade and cannot be null"); } else { this.TickDirection = tickDirection; } // to ensure "matchingId" is required (not null) if (matchingId == null) { throw new InvalidDataException("matchingId is a required property for UserTrade and cannot be null"); } else { this.MatchingId = matchingId; } this.Iv = iv; this.OrderType = orderType; this.Label = label; this.Liquidity = liquidity; }
/// <summary> /// Initializes a new instance of the <see cref="PublicTrade" /> class. /// </summary> /// <param name="direction">Trade direction of the taker (required).</param> /// <param name="tickDirection">Direction of the \"tick\" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` = Minus Tick, `3` = Zero-Minus Tick). (required).</param> /// <param name="timestamp">The timestamp of the trade (required).</param> /// <param name="price">The price of the trade (required).</param> /// <param name="tradeSeq">The sequence number of the trade within instrument (required).</param> /// <param name="tradeId">Unique (per currency) trade identifier (required).</param> /// <param name="iv">Option implied volatility for the price (Option only).</param> /// <param name="indexPrice">Index Price at the moment of trade (required).</param> /// <param name="amount">Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH. (required).</param> /// <param name="instrumentName">Unique instrument identifier (required).</param> public PublicTrade(DirectionEnum direction = default(DirectionEnum), TickDirectionEnum tickDirection = default(TickDirectionEnum), int?timestamp = default(int?), decimal?price = default(decimal?), int?tradeSeq = default(int?), string tradeId = default(string), decimal?iv = default(decimal?), decimal?indexPrice = default(decimal?), decimal?amount = default(decimal?), string instrumentName = default(string)) { // to ensure "direction" is required (not null) if (direction == null) { throw new InvalidDataException("direction is a required property for PublicTrade and cannot be null"); } else { this.Direction = direction; } // to ensure "tickDirection" is required (not null) if (tickDirection == null) { throw new InvalidDataException("tickDirection is a required property for PublicTrade and cannot be null"); } else { this.TickDirection = tickDirection; } // to ensure "timestamp" is required (not null) if (timestamp == null) { throw new InvalidDataException("timestamp is a required property for PublicTrade and cannot be null"); } else { this.Timestamp = timestamp; } // to ensure "price" is required (not null) if (price == null) { throw new InvalidDataException("price is a required property for PublicTrade and cannot be null"); } else { this.Price = price; } // to ensure "tradeSeq" is required (not null) if (tradeSeq == null) { throw new InvalidDataException("tradeSeq is a required property for PublicTrade and cannot be null"); } else { this.TradeSeq = tradeSeq; } // to ensure "tradeId" is required (not null) if (tradeId == null) { throw new InvalidDataException("tradeId is a required property for PublicTrade and cannot be null"); } else { this.TradeId = tradeId; } // to ensure "indexPrice" is required (not null) if (indexPrice == null) { throw new InvalidDataException("indexPrice is a required property for PublicTrade and cannot be null"); } else { this.IndexPrice = indexPrice; } // to ensure "amount" is required (not null) if (amount == null) { throw new InvalidDataException("amount is a required property for PublicTrade and cannot be null"); } else { this.Amount = amount; } // to ensure "instrumentName" is required (not null) if (instrumentName == null) { throw new InvalidDataException("instrumentName is a required property for PublicTrade and cannot be null"); } else { this.InstrumentName = instrumentName; } this.Iv = iv; }