Lean  $LEAN_TAG$
OrdersResponseWrapper.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using Newtonsoft.Json;
17 using QuantConnect.Api;
18 using System.Collections.Generic;
20 
21 namespace QuantConnect.Orders
22 {
23  /// <summary>
24  /// Collection container for a list of orders for a project
25  /// </summary>
27  {
28  /// <summary>
29  /// Returns the total order collection length, not only the amount we are sending here
30  /// </summary>
31  [JsonProperty(PropertyName = "length")]
32  public int Length { get; set; }
33 
34  /// <summary>
35  /// Collection of summarized Orders objects
36  /// </summary>
37  [JsonProperty(PropertyName = "orders")]
38  public List<ApiOrderResponse> Orders { get; set; } = new();
39  }
40 
41  /// <summary>
42  /// Api order and order events reponse
43  /// </summary>
44  [JsonConverter(typeof(ReadOrdersResponseJsonConverter))]
46  {
47  /// <summary>
48  /// The symbol associated with this order
49  /// </summary>
50  public Symbol Symbol { get; set; }
51 
52  /// <summary>
53  /// The order
54  /// </summary>
55  public Order Order { get; set; }
56 
57  /// <summary>
58  /// The order events
59  /// </summary>
60  public List<SerializedOrderEvent> Events { get; set; }
61 
62  /// <summary>
63  /// ApiOrderResponse empty constructor
64  /// </summary>
66  {
67  }
68 
69  /// <summary>
70  /// Creates an instance of an ApiOrderResponse class using the given arguments
71  /// </summary>
72  public ApiOrderResponse(Order order, List<SerializedOrderEvent> events, Symbol symbol)
73  {
74  Order = order;
75  Events = events;
76  Symbol = symbol;
77  }
78  }
79 }