/*
 * 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>
    /// Passiv user account settings
    /// </summary>
    [DataContract(Name = "UserSettings")]
    public partial class UserSettings : IEquatable<UserSettings>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UserSettings" /> class.
        /// </summary>
        /// <param name="email">email.</param>
        /// <param name="name">name.</param>
        /// <param name="receiveCashNotification">receiveCashNotification.</param>
        /// <param name="receiveDriftNotification">receiveDriftNotification.</param>
        /// <param name="userTrialActivated">userTrialActivated.</param>
        /// <param name="activatedTrialDate">activatedTrialDate.</param>
        /// <param name="demo">demo.</param>
        /// <param name="apiEnabled">apiEnabled.</param>
        /// <param name="driftThreshold">driftThreshold.</param>
        /// <param name="preferredCurrency">preferredCurrency.</param>
        public UserSettings(string email = default(string), string name = default(string), bool receiveCashNotification = default(bool), bool receiveDriftNotification = default(bool), bool userTrialActivated = default(bool), string activatedTrialDate = default(string), bool demo = default(bool), bool apiEnabled = default(bool), decimal driftThreshold = default(decimal), Currency preferredCurrency = default(Currency)) : base()
        {
            this.Email = email;
            this.Name = name;
            this.ReceiveCashNotification = receiveCashNotification;
            this.ReceiveDriftNotification = receiveDriftNotification;
            this.UserTrialActivated = userTrialActivated;
            this.ActivatedTrialDate = activatedTrialDate;
            this.Demo = demo;
            this.ApiEnabled = apiEnabled;
            this.DriftThreshold = driftThreshold;
            this.PreferredCurrency = preferredCurrency;
            this.AdditionalProperties = new Dictionary<string, object>();
        }

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

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

        /// <summary>
        /// Gets or Sets ReceiveCashNotification
        /// </summary>
        [DataMember(Name = "receive_cash_notification", EmitDefaultValue = true)]
        public bool ReceiveCashNotification { get; set; }

        /// <summary>
        /// Gets or Sets ReceiveDriftNotification
        /// </summary>
        [DataMember(Name = "receive_drift_notification", EmitDefaultValue = true)]
        public bool ReceiveDriftNotification { get; set; }

        /// <summary>
        /// Gets or Sets UserTrialActivated
        /// </summary>
        [DataMember(Name = "user_trial_activated", EmitDefaultValue = true)]
        public bool UserTrialActivated { get; set; }

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

        /// <summary>
        /// Gets or Sets Demo
        /// </summary>
        [DataMember(Name = "demo", EmitDefaultValue = true)]
        public bool Demo { get; set; }

        /// <summary>
        /// Gets or Sets ApiEnabled
        /// </summary>
        [DataMember(Name = "api_enabled", EmitDefaultValue = true)]
        public bool ApiEnabled { get; set; }

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

        /// <summary>
        /// Gets or Sets PreferredCurrency
        /// </summary>
        [DataMember(Name = "preferred_currency", EmitDefaultValue = false)]
        public Currency PreferredCurrency { 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 UserSettings {\n");
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            sb.Append("  Email: ").Append(Email).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  ReceiveCashNotification: ").Append(ReceiveCashNotification).Append("\n");
            sb.Append("  ReceiveDriftNotification: ").Append(ReceiveDriftNotification).Append("\n");
            sb.Append("  UserTrialActivated: ").Append(UserTrialActivated).Append("\n");
            sb.Append("  ActivatedTrialDate: ").Append(ActivatedTrialDate).Append("\n");
            sb.Append("  Demo: ").Append(Demo).Append("\n");
            sb.Append("  ApiEnabled: ").Append(ApiEnabled).Append("\n");
            sb.Append("  DriftThreshold: ").Append(DriftThreshold).Append("\n");
            sb.Append("  PreferredCurrency: ").Append(PreferredCurrency).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 UserSettings);
        }

        /// <summary>
        /// Returns true if UserSettings instances are equal
        /// </summary>
        /// <param name="input">Instance of UserSettings to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserSettings input)
        {
            if (input == null)
            {
                return false;
            }
            return base.Equals(input) && 
                (
                    this.Email == input.Email ||
                    (this.Email != null &&
                    this.Email.Equals(input.Email))
                ) && base.Equals(input) && 
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))
                ) && base.Equals(input) && 
                (
                    this.ReceiveCashNotification == input.ReceiveCashNotification ||
                    this.ReceiveCashNotification.Equals(input.ReceiveCashNotification)
                ) && base.Equals(input) && 
                (
                    this.ReceiveDriftNotification == input.ReceiveDriftNotification ||
                    this.ReceiveDriftNotification.Equals(input.ReceiveDriftNotification)
                ) && base.Equals(input) && 
                (
                    this.UserTrialActivated == input.UserTrialActivated ||
                    this.UserTrialActivated.Equals(input.UserTrialActivated)
                ) && base.Equals(input) && 
                (
                    this.ActivatedTrialDate == input.ActivatedTrialDate ||
                    (this.ActivatedTrialDate != null &&
                    this.ActivatedTrialDate.Equals(input.ActivatedTrialDate))
                ) && base.Equals(input) && 
                (
                    this.Demo == input.Demo ||
                    this.Demo.Equals(input.Demo)
                ) && base.Equals(input) && 
                (
                    this.ApiEnabled == input.ApiEnabled ||
                    this.ApiEnabled.Equals(input.ApiEnabled)
                ) && base.Equals(input) && 
                (
                    this.DriftThreshold == input.DriftThreshold ||
                    this.DriftThreshold.Equals(input.DriftThreshold)
                ) && base.Equals(input) && 
                (
                    this.PreferredCurrency == input.PreferredCurrency ||
                    (this.PreferredCurrency != null &&
                    this.PreferredCurrency.Equals(input.PreferredCurrency))
                )
                && (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.Email != null)
                {
                    hashCode = (hashCode * 59) + this.Email.GetHashCode();
                }
                if (this.Name != null)
                {
                    hashCode = (hashCode * 59) + this.Name.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.ReceiveCashNotification.GetHashCode();
                hashCode = (hashCode * 59) + this.ReceiveDriftNotification.GetHashCode();
                hashCode = (hashCode * 59) + this.UserTrialActivated.GetHashCode();
                if (this.ActivatedTrialDate != null)
                {
                    hashCode = (hashCode * 59) + this.ActivatedTrialDate.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Demo.GetHashCode();
                hashCode = (hashCode * 59) + this.ApiEnabled.GetHashCode();
                hashCode = (hashCode * 59) + this.DriftThreshold.GetHashCode();
                if (this.PreferredCurrency != null)
                {
                    hashCode = (hashCode * 59) + this.PreferredCurrency.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;
        }
    }

}
