<filename>sdks/csharp/src/SnapTrade.Net/Model/SnapTradeLoginUserRequestBody.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>
    /// Data to login a user via SnapTrade Partner
    /// </summary>
    [DataContract(Name = "SnapTradeLoginUserRequestBody")]
    public partial class SnapTradeLoginUserRequestBody : IEquatable<SnapTradeLoginUserRequestBody>, IValidatableObject
    {
        /// <summary>
        /// Defines ConnectionType
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum ConnectionTypeEnum
        {
            /// <summary>
            /// Enum Read for value: read
            /// </summary>
            [EnumMember(Value = "read")]
            Read = 1,

            /// <summary>
            /// Enum Trade for value: trade
            /// </summary>
            [EnumMember(Value = "trade")]
            Trade = 2

        }


        /// <summary>
        /// Gets or Sets ConnectionType
        /// </summary>
        [DataMember(Name = "connectionType", EmitDefaultValue = false)]
        public ConnectionTypeEnum? ConnectionType { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="SnapTradeLoginUserRequestBody" /> class.
        /// </summary>
        /// <param name="broker">broker.</param>
        /// <param name="immediateRedirect">immediateRedirect.</param>
        /// <param name="customRedirect">customRedirect.</param>
        /// <param name="reconnect">reconnect.</param>
        /// <param name="connectionType">connectionType.</param>
        public SnapTradeLoginUserRequestBody(string broker = default(string), bool immediateRedirect = default(bool), string customRedirect = default(string), string reconnect = default(string), ConnectionTypeEnum? connectionType = default(ConnectionTypeEnum?))
        {
            this.Broker = broker;
            this.ImmediateRedirect = immediateRedirect;
            this.CustomRedirect = customRedirect;
            this.Reconnect = reconnect;
            this.ConnectionType = connectionType;
        }

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

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

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

        /// <summary>
        /// Gets or Sets Reconnect
        /// </summary>
        [DataMember(Name = "reconnect", EmitDefaultValue = false)]
        public string Reconnect { 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 SnapTradeLoginUserRequestBody {\n");
            sb.Append("  Broker: ").Append(Broker).Append("\n");
            sb.Append("  ImmediateRedirect: ").Append(ImmediateRedirect).Append("\n");
            sb.Append("  CustomRedirect: ").Append(CustomRedirect).Append("\n");
            sb.Append("  Reconnect: ").Append(Reconnect).Append("\n");
            sb.Append("  ConnectionType: ").Append(ConnectionType).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 virtual 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 SnapTradeLoginUserRequestBody);
        }

        /// <summary>
        /// Returns true if SnapTradeLoginUserRequestBody instances are equal
        /// </summary>
        /// <param name="input">Instance of SnapTradeLoginUserRequestBody to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SnapTradeLoginUserRequestBody input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Broker == input.Broker ||
                    (this.Broker != null &&
                    this.Broker.Equals(input.Broker))
                ) && 
                (
                    this.ImmediateRedirect == input.ImmediateRedirect ||
                    this.ImmediateRedirect.Equals(input.ImmediateRedirect)
                ) && 
                (
                    this.CustomRedirect == input.CustomRedirect ||
                    (this.CustomRedirect != null &&
                    this.CustomRedirect.Equals(input.CustomRedirect))
                ) && 
                (
                    this.Reconnect == input.Reconnect ||
                    (this.Reconnect != null &&
                    this.Reconnect.Equals(input.Reconnect))
                ) && 
                (
                    this.ConnectionType == input.ConnectionType ||
                    this.ConnectionType.Equals(input.ConnectionType)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Broker != null)
                {
                    hashCode = (hashCode * 59) + this.Broker.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.ImmediateRedirect.GetHashCode();
                if (this.CustomRedirect != null)
                {
                    hashCode = (hashCode * 59) + this.CustomRedirect.GetHashCode();
                }
                if (this.Reconnect != null)
                {
                    hashCode = (hashCode * 59) + this.Reconnect.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.ConnectionType.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;
        }
    }

}
