<filename>sdks/csharp/src/SnapTrade.Net/Model/PortfolioGroupInfo.cs/*
 * SnapTrade
 *
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: upchh@example.com
 * Generated by: https://konfigthis.com
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = SnapTrade.Net.Client.OpenAPIDateConverter;

namespace SnapTrade.Net.Model
{
    /// <summary>
    /// Summary of all relevant information about a portfolio group.
    /// </summary>
    [DataContract(Name = "PortfolioGroupInfo")]
    public partial class PortfolioGroupInfo : IEquatable<PortfolioGroupInfo>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PortfolioGroupInfo" /> class.
        /// </summary>
        /// <param name="symbols">symbols.</param>
        /// <param name="quotableSymbols">quotableSymbols.</param>
        /// <param name="balances">balances.</param>
        /// <param name="positions">positions.</param>
        /// <param name="targetPositions">targetPositions.</param>
        /// <param name="idealPositions">idealPositions.</param>
        /// <param name="excludedPositions">excludedPositions.</param>
        /// <param name="calculatedTrades">calculatedTrades.</param>
        /// <param name="brokerageAuthorizations">brokerageAuthorizations.</param>
        /// <param name="accuracy">accuracy.</param>
        /// <param name="settings">settings.</param>
        public PortfolioGroupInfo(List<UniversalSymbol> symbols = default(List<UniversalSymbol>), List<UniversalSymbol> quotableSymbols = default(List<UniversalSymbol>), List<Balance> balances = default(List<Balance>), List<Position> positions = default(List<Position>), List<TargetAsset> targetPositions = default(List<TargetAsset>), List<Position> idealPositions = default(List<Position>), List<ExcludedAsset> excludedPositions = default(List<ExcludedAsset>), List<CalculatedTrade> calculatedTrades = default(List<CalculatedTrade>), List<BrokerageAuthorization> brokerageAuthorizations = default(List<BrokerageAuthorization>), decimal accuracy = default(decimal), PortfolioGroupSettings settings = default(PortfolioGroupSettings)) : base()
        {
            this.Symbols = symbols;
            this.QuotableSymbols = quotableSymbols;
            this.Balances = balances;
            this.Positions = positions;
            this.TargetPositions = targetPositions;
            this.IdealPositions = idealPositions;
            this.ExcludedPositions = excludedPositions;
            this.CalculatedTrades = calculatedTrades;
            this.BrokerageAuthorizations = brokerageAuthorizations;
            this.Accuracy = accuracy;
            this.Settings = settings;
            this.AdditionalProperties = new Dictionary<string, object>();
        }

        /// <summary>
        /// Gets or Sets Symbols
        /// </summary>
        [DataMember(Name = "symbols", EmitDefaultValue = false)]
        public List<UniversalSymbol> Symbols { get; set; }

        /// <summary>
        /// Gets or Sets QuotableSymbols
        /// </summary>
        [DataMember(Name = "quotable_symbols", EmitDefaultValue = false)]
        public List<UniversalSymbol> QuotableSymbols { get; set; }

        /// <summary>
        /// Gets or Sets Balances
        /// </summary>
        [DataMember(Name = "balances", EmitDefaultValue = false)]
        public List<Balance> Balances { get; set; }

        /// <summary>
        /// Gets or Sets Positions
        /// </summary>
        [DataMember(Name = "positions", EmitDefaultValue = false)]
        public List<Position> Positions { get; set; }

        /// <summary>
        /// Gets or Sets TargetPositions
        /// </summary>
        [DataMember(Name = "target_positions", EmitDefaultValue = false)]
        public List<TargetAsset> TargetPositions { get; set; }

        /// <summary>
        /// Gets or Sets IdealPositions
        /// </summary>
        [DataMember(Name = "ideal_positions", EmitDefaultValue = false)]
        public List<Position> IdealPositions { get; set; }

        /// <summary>
        /// Gets or Sets ExcludedPositions
        /// </summary>
        [DataMember(Name = "excluded_positions", EmitDefaultValue = false)]
        public List<ExcludedAsset> ExcludedPositions { get; set; }

        /// <summary>
        /// Gets or Sets CalculatedTrades
        /// </summary>
        [DataMember(Name = "calculated_trades", EmitDefaultValue = false)]
        public List<CalculatedTrade> CalculatedTrades { get; set; }

        /// <summary>
        /// Gets or Sets BrokerageAuthorizations
        /// </summary>
        [DataMember(Name = "brokerage_authorizations", EmitDefaultValue = false)]
        public List<BrokerageAuthorization> BrokerageAuthorizations { get; set; }

        /// <summary>
        /// Gets or Sets Accuracy
        /// </summary>
        [DataMember(Name = "accuracy", EmitDefaultValue = false)]
        public decimal Accuracy { get; set; }

        /// <summary>
        /// Gets or Sets Settings
        /// </summary>
        [DataMember(Name = "settings", EmitDefaultValue = false)]
        public PortfolioGroupSettings Settings { get; set; }

        /// <summary>
        /// Gets or Sets additional properties
        /// </summary>
        [JsonExtensionData]
        public IDictionary<string, object> AdditionalProperties { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class PortfolioGroupInfo {\n");
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            sb.Append("  Symbols: ").Append(Symbols).Append("\n");
            sb.Append("  QuotableSymbols: ").Append(QuotableSymbols).Append("\n");
            sb.Append("  Balances: ").Append(Balances).Append("\n");
            sb.Append("  Positions: ").Append(Positions).Append("\n");
            sb.Append("  TargetPositions: ").Append(TargetPositions).Append("\n");
            sb.Append("  IdealPositions: ").Append(IdealPositions).Append("\n");
            sb.Append("  ExcludedPositions: ").Append(ExcludedPositions).Append("\n");
            sb.Append("  CalculatedTrades: ").Append(CalculatedTrades).Append("\n");
            sb.Append("  BrokerageAuthorizations: ").Append(BrokerageAuthorizations).Append("\n");
            sb.Append("  Accuracy: ").Append(Accuracy).Append("\n");
            sb.Append("  Settings: ").Append(Settings).Append("\n");
            sb.Append("  AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as PortfolioGroupInfo);
        }

        /// <summary>
        /// Returns true if PortfolioGroupInfo instances are equal
        /// </summary>
        /// <param name="input">Instance of PortfolioGroupInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PortfolioGroupInfo input)
        {
            if (input == null)
            {
                return false;
            }
            return base.Equals(input) && 
                (
                    this.Symbols == input.Symbols ||
                    this.Symbols != null &&
                    input.Symbols != null &&
                    this.Symbols.SequenceEqual(input.Symbols)
                ) && base.Equals(input) && 
                (
                    this.QuotableSymbols == input.QuotableSymbols ||
                    this.QuotableSymbols != null &&
                    input.QuotableSymbols != null &&
                    this.QuotableSymbols.SequenceEqual(input.QuotableSymbols)
                ) && base.Equals(input) && 
                (
                    this.Balances == input.Balances ||
                    this.Balances != null &&
                    input.Balances != null &&
                    this.Balances.SequenceEqual(input.Balances)
                ) && base.Equals(input) && 
                (
                    this.Positions == input.Positions ||
                    this.Positions != null &&
                    input.Positions != null &&
                    this.Positions.SequenceEqual(input.Positions)
                ) && base.Equals(input) && 
                (
                    this.TargetPositions == input.TargetPositions ||
                    this.TargetPositions != null &&
                    input.TargetPositions != null &&
                    this.TargetPositions.SequenceEqual(input.TargetPositions)
                ) && base.Equals(input) && 
                (
                    this.IdealPositions == input.IdealPositions ||
                    this.IdealPositions != null &&
                    input.IdealPositions != null &&
                    this.IdealPositions.SequenceEqual(input.IdealPositions)
                ) && base.Equals(input) && 
                (
                    this.ExcludedPositions == input.ExcludedPositions ||
                    this.ExcludedPositions != null &&
                    input.ExcludedPositions != null &&
                    this.ExcludedPositions.SequenceEqual(input.ExcludedPositions)
                ) && base.Equals(input) && 
                (
                    this.CalculatedTrades == input.CalculatedTrades ||
                    this.CalculatedTrades != null &&
                    input.CalculatedTrades != null &&
                    this.CalculatedTrades.SequenceEqual(input.CalculatedTrades)
                ) && base.Equals(input) && 
                (
                    this.BrokerageAuthorizations == input.BrokerageAuthorizations ||
                    this.BrokerageAuthorizations != null &&
                    input.BrokerageAuthorizations != null &&
                    this.BrokerageAuthorizations.SequenceEqual(input.BrokerageAuthorizations)
                ) && base.Equals(input) && 
                (
                    this.Accuracy == input.Accuracy ||
                    this.Accuracy.Equals(input.Accuracy)
                ) && base.Equals(input) && 
                (
                    this.Settings == input.Settings ||
                    (this.Settings != null &&
                    this.Settings.Equals(input.Settings))
                )
                && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = base.GetHashCode();
                if (this.Symbols != null)
                {
                    hashCode = (hashCode * 59) + this.Symbols.GetHashCode();
                }
                if (this.QuotableSymbols != null)
                {
                    hashCode = (hashCode * 59) + this.QuotableSymbols.GetHashCode();
                }
                if (this.Balances != null)
                {
                    hashCode = (hashCode * 59) + this.Balances.GetHashCode();
                }
                if (this.Positions != null)
                {
                    hashCode = (hashCode * 59) + this.Positions.GetHashCode();
                }
                if (this.TargetPositions != null)
                {
                    hashCode = (hashCode * 59) + this.TargetPositions.GetHashCode();
                }
                if (this.IdealPositions != null)
                {
                    hashCode = (hashCode * 59) + this.IdealPositions.GetHashCode();
                }
                if (this.ExcludedPositions != null)
                {
                    hashCode = (hashCode * 59) + this.ExcludedPositions.GetHashCode();
                }
                if (this.CalculatedTrades != null)
                {
                    hashCode = (hashCode * 59) + this.CalculatedTrades.GetHashCode();
                }
                if (this.BrokerageAuthorizations != null)
                {
                    hashCode = (hashCode * 59) + this.BrokerageAuthorizations.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Accuracy.GetHashCode();
                if (this.Settings != null)
                {
                    hashCode = (hashCode * 59) + this.Settings.GetHashCode();
                }
                if (this.AdditionalProperties != null)
                {
                    hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
                }
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
