Lean  $LEAN_TAG$
ObjectStoreResponse.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 System.Collections.Generic;
18 using System;
19 
20 namespace QuantConnect.Api
21 {
22  /// <summary>
23  /// Response received when fetching Object Store
24  /// </summary>
26  {
27  /// <summary>
28  /// Job ID which can be used for querying state or packaging
29  /// </summary>
30  [JsonProperty("jobId")]
31  public string JobId { get; set; }
32 
33  /// <summary>
34  /// The URL to download the object. This can also be null
35  /// </summary>
36  [JsonProperty("url")]
37  public string Url { get; set; }
38  }
39 
40  /// <summary>
41  /// Class contining basic store properties present in the REST response from QC API
42  /// </summary>
43  public class BasicObjectStore
44  {
45  /// <summary>
46  /// Object store key
47  /// </summary>
48  [JsonProperty(PropertyName = "key")]
49  public string Key { get; set; }
50 
51  /// <summary>
52  /// Last time it was modified
53  /// </summary>
54  [JsonProperty(PropertyName = "modified")]
55  public DateTime? Modified { get; set; }
56 
57  /// <summary>
58  /// MIME type
59  /// </summary>
60  [JsonProperty(PropertyName = "mime")]
61  public string Mime { get; set; }
62 
63  /// <summary>
64  /// File size
65  /// </summary>
66  [JsonProperty(PropertyName = "size")]
67  public decimal? Size { get; set; }
68  }
69 
70  /// <summary>
71  /// Summary information of the Object Store
72  /// </summary>
74  {
75  /// <summary>
76  /// File or folder name
77  /// </summary>
78  [JsonProperty(PropertyName = "name")]
79  public string Name { get; set; }
80 
81  /// <summary>
82  /// True if it is a folder, false otherwise
83  /// </summary>
84  [JsonProperty(PropertyName = "isFolder")]
85  public bool IsFolder { get; set; }
86  }
87 
88  /// <summary>
89  /// Object Store file properties
90  /// </summary>
92  {
93  /// <summary>
94  /// Date this object was created
95  /// </summary>
96  [JsonProperty(PropertyName = "created")]
97  public DateTime Created { get; set; }
98 
99  /// <summary>
100  /// MD5 (hashing algorithm) hash authentication code
101  /// </summary>
102  [JsonProperty(PropertyName = "md5")]
103  public string Md5 { get; set; }
104 
105  /// <summary>
106  /// Preview of the Object Store file content
107  /// </summary>
108  [JsonProperty(PropertyName = "preview")]
109  public string Preview { get; set; }
110  }
111 
112  /// <summary>
113  /// Response received containing a list of stored objects metadata, as well as the total size of all of them.
114  /// </summary>
116  {
117  /// <summary>
118  /// Path to the files in the Object Store
119  /// </summary>
120  [JsonProperty(PropertyName = "path")]
121  public string Path { get; set; }
122 
123  /// <summary>
124  /// List of objects stored
125  /// </summary>
126  [JsonProperty(PropertyName = "objects")]
127  public List<SummaryObjectStore> Objects { get; set; }
128 
129  /// <summary>
130  /// Size of all objects stored in bytes
131  /// </summary>
132  [JsonProperty(PropertyName = "objectStorageUsed")]
133  public int ObjectStorageUsed { get; set; }
134 
135  /// <summary>
136  /// Size of all the objects stored in human-readable format
137  /// </summary>
138  [JsonProperty(PropertyName = "objectStorageUsedHuman")]
139  public string ObjectStorageUsedHuman { get; set; }
140  }
141 
142  /// <summary>
143  /// Response received containing the properties of the requested Object Store
144  /// </summary>
146  {
147  /// <summary>
148  /// Object Store properties
149  /// </summary>
150  [JsonProperty(PropertyName = "metadata")]
151  public PropertiesObjectStore Properties { get; set; }
152  }
153 }