/*
 * SnapTrade
 *
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: lyhxr@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>
    /// StrategyQuotes
    /// </summary>
    [DataContract(Name = "StrategyQuotes")]
    public partial class StrategyQuotes : IEquatable<StrategyQuotes>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StrategyQuotes" /> class.
        /// </summary>
        /// <param name="strategy">strategy.</param>
        /// <param name="openPrice">Trade Price if limit or stop limit order.</param>
        /// <param name="bidPrice">Trade Price if limit or stop limit order.</param>
        /// <param name="askPrice">Trade Price if limit or stop limit order.</param>
        /// <param name="volatility">volatility.</param>
        /// <param name="greek">greek.</param>
        public StrategyQuotes(OptionStrategy strategy = default(OptionStrategy), decimal? openPrice = default(decimal?), decimal? bidPrice = default(decimal?), decimal? askPrice = default(decimal?), decimal volatility = default(decimal), StrategyQuotesGreek greek = default(StrategyQuotesGreek)) : base()
        {
            this.Strategy = strategy;
            this.OpenPrice = openPrice;
            this.BidPrice = bidPrice;
            this.AskPrice = askPrice;
            this.Volatility = volatility;
            this.Greek = greek;
            this.AdditionalProperties = new Dictionary<string, object>();
        }

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

        /// <summary>
        /// Trade Price if limit or stop limit order
        /// </summary>
        /// <value>Trade Price if limit or stop limit order</value>
        [DataMember(Name = "open_price", EmitDefaultValue = true)]
        public decimal? OpenPrice { get; set; }

        /// <summary>
        /// Trade Price if limit or stop limit order
        /// </summary>
        /// <value>Trade Price if limit or stop limit order</value>
        [DataMember(Name = "bid_price", EmitDefaultValue = true)]
        public decimal? BidPrice { get; set; }

        /// <summary>
        /// Trade Price if limit or stop limit order
        /// </summary>
        /// <value>Trade Price if limit or stop limit order</value>
        [DataMember(Name = "ask_price", EmitDefaultValue = true)]
        public decimal? AskPrice { get; set; }

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

        /// <summary>
        /// Gets or Sets Greek
        /// </summary>
        [DataMember(Name = "greek", EmitDefaultValue = false)]
        public StrategyQuotesGreek Greek { 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 StrategyQuotes {\n");
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            sb.Append("  Strategy: ").Append(Strategy).Append("\n");
            sb.Append("  OpenPrice: ").Append(OpenPrice).Append("\n");
            sb.Append("  BidPrice: ").Append(BidPrice).Append("\n");
            sb.Append("  AskPrice: ").Append(AskPrice).Append("\n");
            sb.Append("  Volatility: ").Append(Volatility).Append("\n");
            sb.Append("  Greek: ").Append(Greek).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 StrategyQuotes);
        }

        /// <summary>
        /// Returns true if StrategyQuotes instances are equal
        /// </summary>
        /// <param name="input">Instance of StrategyQuotes to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StrategyQuotes input)
        {
            if (input == null)
            {
                return false;
            }
            return base.Equals(input) && 
                (
                    this.Strategy == input.Strategy ||
                    (this.Strategy != null &&
                    this.Strategy.Equals(input.Strategy))
                ) && base.Equals(input) && 
                (
                    this.OpenPrice == input.OpenPrice ||
                    (this.OpenPrice != null &&
                    this.OpenPrice.Equals(input.OpenPrice))
                ) && base.Equals(input) && 
                (
                    this.BidPrice == input.BidPrice ||
                    (this.BidPrice != null &&
                    this.BidPrice.Equals(input.BidPrice))
                ) && base.Equals(input) && 
                (
                    this.AskPrice == input.AskPrice ||
                    (this.AskPrice != null &&
                    this.AskPrice.Equals(input.AskPrice))
                ) && base.Equals(input) && 
                (
                    this.Volatility == input.Volatility ||
                    this.Volatility.Equals(input.Volatility)
                ) && base.Equals(input) && 
                (
                    this.Greek == input.Greek ||
                    (this.Greek != null &&
                    this.Greek.Equals(input.Greek))
                )
                && (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.Strategy != null)
                {
                    hashCode = (hashCode * 59) + this.Strategy.GetHashCode();
                }
                if (this.OpenPrice != null)
                {
                    hashCode = (hashCode * 59) + this.OpenPrice.GetHashCode();
                }
                if (this.BidPrice != null)
                {
                    hashCode = (hashCode * 59) + this.BidPrice.GetHashCode();
                }
                if (this.AskPrice != null)
                {
                    hashCode = (hashCode * 59) + this.AskPrice.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Volatility.GetHashCode();
                if (this.Greek != null)
                {
                    hashCode = (hashCode * 59) + this.Greek.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;
        }
    }

}
