/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using Newtonsoft.Json; using QuantConnect.Api.Serialization; // Collection of response objects for QuantConnect Organization/ endpoints namespace QuantConnect.Api { /// /// Response wrapper for Organizations/Read /// public class OrganizationResponse : RestResponse { /// /// Organization read from the response /// public Organization Organization { get; set; } } /// /// Object representation of Organization from QuantConnect Api /// public class Organization: StringRepresentation { /// /// Data Agreement information /// [JsonProperty(PropertyName = "data")] public DataAgreement DataAgreement { get; set; } /// /// Organization Product Subscriptions /// public List Products { get; set; } /// /// Organization Credit Balance and Transactions /// public Credit Credit { get; set; } } /// /// Organization Data Agreement /// public class DataAgreement { /// /// Epoch time the Data Agreement was Signed /// [JsonProperty(PropertyName = "signedTime")] public long? EpochSignedTime { get; set; } /// /// DateTime the agreement was signed. /// Uses EpochSignedTime converted to a standard datetime. /// public DateTime? SignedTime => EpochSignedTime.HasValue ? DateTimeOffset.FromUnixTimeSeconds(EpochSignedTime.Value).DateTime : null; /// /// True/False if it is currently signed /// [JsonProperty(PropertyName = "current")] public bool Signed { get; set; } } /// /// Organization Credit Object /// public class Credit { /// /// QCC Current Balance /// public decimal Balance { get; set; } } /// /// QuantConnect Products /// [JsonConverter(typeof(ProductJsonConverter))] public class Product { /// /// Product Type /// public ProductType Type { get; set; } /// /// Collection of item subscriptions /// Nodes/Data/Seats/etc /// public List Items { get; set; } } /// /// QuantConnect ProductItem /// public class ProductItem { /// /// ID for this product /// [JsonProperty(PropertyName = "productId")] public int Id { get; set; } /// /// Quantity for this product /// public int Quantity { get; set; } } /// /// Product types offered by QuantConnect /// Used by Product class /// public enum ProductType { /// /// Professional Seats Subscriptions /// ProfessionalSeats, /// /// Backtest Nodes Subscriptions /// BacktestNode, /// /// Research Nodes Subscriptions /// ResearchNode, /// /// Live Trading Nodes Subscriptions /// LiveNode, /// /// Support Subscriptions /// Support, /// /// Data Subscriptions /// Data, /// /// Modules Subscriptions /// Modules } }