<gh_stars>0/*
 * SnapTrade
 *
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: kenaa@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>
    /// The strategy impact
    /// </summary>
    [DataContract(Name = "StrategyImpact")]
    public partial class StrategyImpact : IEquatable<StrategyImpact>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StrategyImpact" /> class.
        /// </summary>
        /// <param name="estimatedCommissions">estimatedCommissions.</param>
        /// <param name="buyingPowerEffect">buyingPowerEffect.</param>
        /// <param name="buyingPowerResult">buyingPowerResult.</param>
        /// <param name="maintExcessEffect">maintExcessEffect.</param>
        /// <param name="maintExcessResult">maintExcessResult.</param>
        /// <param name="tradeValueCalculation">tradeValueCalculation.</param>
        /// <param name="legs">legs.</param>
        /// <param name="side">side.</param>
        /// <param name="effect">effect.</param>
        /// <param name="price">price.</param>
        /// <param name="strategy">strategy.</param>
        public StrategyImpact(decimal estimatedCommissions = default(decimal), decimal buyingPowerEffect = default(decimal), decimal buyingPowerResult = default(decimal), decimal maintExcessEffect = default(decimal), decimal maintExcessResult = default(decimal), string tradeValueCalculation = default(string), List<StrategyImpactLegsInner> legs = default(List<StrategyImpactLegsInner>), string side = default(string), string effect = default(string), decimal price = default(decimal), string strategy = default(string)) : base()
        {
            this.EstimatedCommissions = estimatedCommissions;
            this.BuyingPowerEffect = buyingPowerEffect;
            this.BuyingPowerResult = buyingPowerResult;
            this.MaintExcessEffect = maintExcessEffect;
            this.MaintExcessResult = maintExcessResult;
            this.TradeValueCalculation = tradeValueCalculation;
            this.Legs = legs;
            this.Side = side;
            this.Effect = effect;
            this.Price = price;
            this.Strategy = strategy;
            this.AdditionalProperties = new Dictionary<string, object>();
        }

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

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

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

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

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

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

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

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

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

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

        /// <summary>
        /// Gets or Sets Strategy
        /// </summary>
        [DataMember(Name = "strategy", EmitDefaultValue = false)]
        public string Strategy { 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 StrategyImpact {\n");
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            sb.Append("  EstimatedCommissions: ").Append(EstimatedCommissions).Append("\n");
            sb.Append("  BuyingPowerEffect: ").Append(BuyingPowerEffect).Append("\n");
            sb.Append("  BuyingPowerResult: ").Append(BuyingPowerResult).Append("\n");
            sb.Append("  MaintExcessEffect: ").Append(MaintExcessEffect).Append("\n");
            sb.Append("  MaintExcessResult: ").Append(MaintExcessResult).Append("\n");
            sb.Append("  TradeValueCalculation: ").Append(TradeValueCalculation).Append("\n");
            sb.Append("  Legs: ").Append(Legs).Append("\n");
            sb.Append("  Side: ").Append(Side).Append("\n");
            sb.Append("  Effect: ").Append(Effect).Append("\n");
            sb.Append("  Price: ").Append(Price).Append("\n");
            sb.Append("  Strategy: ").Append(Strategy).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 StrategyImpact);
        }

        /// <summary>
        /// Returns true if StrategyImpact instances are equal
        /// </summary>
        /// <param name="input">Instance of StrategyImpact to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StrategyImpact input)
        {
            if (input == null)
            {
                return false;
            }
            return base.Equals(input) && 
                (
                    this.EstimatedCommissions == input.EstimatedCommissions ||
                    this.EstimatedCommissions.Equals(input.EstimatedCommissions)
                ) && base.Equals(input) && 
                (
                    this.BuyingPowerEffect == input.BuyingPowerEffect ||
                    this.BuyingPowerEffect.Equals(input.BuyingPowerEffect)
                ) && base.Equals(input) && 
                (
                    this.BuyingPowerResult == input.BuyingPowerResult ||
                    this.BuyingPowerResult.Equals(input.BuyingPowerResult)
                ) && base.Equals(input) && 
                (
                    this.MaintExcessEffect == input.MaintExcessEffect ||
                    this.MaintExcessEffect.Equals(input.MaintExcessEffect)
                ) && base.Equals(input) && 
                (
                    this.MaintExcessResult == input.MaintExcessResult ||
                    this.MaintExcessResult.Equals(input.MaintExcessResult)
                ) && base.Equals(input) && 
                (
                    this.TradeValueCalculation == input.TradeValueCalculation ||
                    (this.TradeValueCalculation != null &&
                    this.TradeValueCalculation.Equals(input.TradeValueCalculation))
                ) && base.Equals(input) && 
                (
                    this.Legs == input.Legs ||
                    this.Legs != null &&
                    input.Legs != null &&
                    this.Legs.SequenceEqual(input.Legs)
                ) && base.Equals(input) && 
                (
                    this.Side == input.Side ||
                    (this.Side != null &&
                    this.Side.Equals(input.Side))
                ) && base.Equals(input) && 
                (
                    this.Effect == input.Effect ||
                    (this.Effect != null &&
                    this.Effect.Equals(input.Effect))
                ) && base.Equals(input) && 
                (
                    this.Price == input.Price ||
                    this.Price.Equals(input.Price)
                ) && base.Equals(input) && 
                (
                    this.Strategy == input.Strategy ||
                    (this.Strategy != null &&
                    this.Strategy.Equals(input.Strategy))
                )
                && (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();
                hashCode = (hashCode * 59) + this.EstimatedCommissions.GetHashCode();
                hashCode = (hashCode * 59) + this.BuyingPowerEffect.GetHashCode();
                hashCode = (hashCode * 59) + this.BuyingPowerResult.GetHashCode();
                hashCode = (hashCode * 59) + this.MaintExcessEffect.GetHashCode();
                hashCode = (hashCode * 59) + this.MaintExcessResult.GetHashCode();
                if (this.TradeValueCalculation != null)
                {
                    hashCode = (hashCode * 59) + this.TradeValueCalculation.GetHashCode();
                }
                if (this.Legs != null)
                {
                    hashCode = (hashCode * 59) + this.Legs.GetHashCode();
                }
                if (this.Side != null)
                {
                    hashCode = (hashCode * 59) + this.Side.GetHashCode();
                }
                if (this.Effect != null)
                {
                    hashCode = (hashCode * 59) + this.Effect.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Price.GetHashCode();
                if (this.Strategy != null)
                {
                    hashCode = (hashCode * 59) + this.Strategy.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;
        }
    }

}
