/*
 * Warframe.market API
 *
 * ## Documentation is under very slow and heavy development  This document will gradually be supplemented and updated over some extended period of time.  ## Unstable endpoints Endpoint that is not stable and probably will be changed in the future will be marked with exclamation sign -> âš  
 *
 * The version of the OpenAPI document: 1.14.0
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


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 = WarframeMarket.Client.OpenAPIDateConverter;

namespace WarframeMarket.Model
{
    /// <summary>
    /// AuthRegistrationPostRequest
    /// </summary>
    [DataContract(Name = "_auth_registration_post_request")]
    public partial class AuthRegistrationPostRequest : IEquatable<AuthRegistrationPostRequest>, IValidatableObject
    {
        /// <summary>
        /// Defines AuthType
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum AuthTypeEnum
        {
            /// <summary>
            /// Enum Cookie for value: cookie
            /// </summary>
            [EnumMember(Value = "cookie")]
            Cookie = 1,

            /// <summary>
            /// Enum Header for value: header
            /// </summary>
            [EnumMember(Value = "header")]
            Header = 2
        }


        /// <summary>
        /// Gets or Sets AuthType
        /// </summary>
        [DataMember(Name = "auth_type", EmitDefaultValue = false)]
        public AuthTypeEnum? AuthType { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthRegistrationPostRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected AuthRegistrationPostRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthRegistrationPostRequest" /> class.
        /// </summary>
        /// <param name="authType">authType (default to AuthTypeEnum.Cookie).</param>
        /// <param name="email">email (required).</param>
        /// <param name="password">password (required).</param>
        /// <param name="passwordSecond">passwordSecond (required).</param>
        /// <param name="region">region (default to &quot;en&quot;).</param>
        /// <param name="deviceId">Optional device_id, defined on client side. This param help us to keep push subscription between login and logout. And clearer identify your device..</param>
        /// <param name="recaptcha">Google reCaptcha, required if you are not using special device auth..</param>
        public AuthRegistrationPostRequest(AuthTypeEnum? authType = AuthTypeEnum.Cookie, string email = default(string), string password = default(string), string passwordSecond = default(string), string region = @"en", string deviceId = default(string), string recaptcha = default(string))
        {
            // to ensure "email" is required (not null)
            if (email == null)
            {
                throw new ArgumentNullException("email is a required property for AuthRegistrationPostRequest and cannot be null");
            }
            this.Email = email;
            // to ensure "password" is required (not null)
            if (password == null)
            {
                throw new ArgumentNullException("password is a required property for AuthRegistrationPostRequest and cannot be null");
            }
            this.Password = password;
            // to ensure "passwordSecond" is required (not null)
            if (passwordSecond == null)
            {
                throw new ArgumentNullException("passwordSecond is a required property for AuthRegistrationPostRequest and cannot be null");
            }
            this.PasswordSecond = passwordSecond;
            this.AuthType = authType;
            // use default value if no "region" provided
            this.Region = region ?? @"en";
            this.DeviceId = deviceId;
            this.Recaptcha = recaptcha;
        }

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

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

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

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

        /// <summary>
        /// Optional device_id, defined on client side. This param help us to keep push subscription between login and logout. And clearer identify your device.
        /// </summary>
        /// <value>Optional device_id, defined on client side. This param help us to keep push subscription between login and logout. And clearer identify your device.</value>
        [DataMember(Name = "device_id", EmitDefaultValue = false)]
        public string DeviceId { get; set; }

        /// <summary>
        /// Google reCaptcha, required if you are not using special device auth.
        /// </summary>
        /// <value>Google reCaptcha, required if you are not using special device auth.</value>
        [DataMember(Name = "recaptcha", EmitDefaultValue = false)]
        public string Recaptcha { 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 AuthRegistrationPostRequest {\n");
            sb.Append("  AuthType: ").Append(AuthType).Append("\n");
            sb.Append("  Email: ").Append(Email).Append("\n");
            sb.Append("  Password: ").Append(Password).Append("\n");
            sb.Append("  PasswordSecond: ").Append(PasswordSecond).Append("\n");
            sb.Append("  Region: ").Append(Region).Append("\n");
            sb.Append("  DeviceId: ").Append(DeviceId).Append("\n");
            sb.Append("  Recaptcha: ").Append(Recaptcha).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 AuthRegistrationPostRequest);
        }

        /// <summary>
        /// Returns true if AuthRegistrationPostRequest instances are equal
        /// </summary>
        /// <param name="input">Instance of AuthRegistrationPostRequest to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AuthRegistrationPostRequest input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.AuthType == input.AuthType ||
                    this.AuthType.Equals(input.AuthType)
                ) && 
                (
                    this.Email == input.Email ||
                    (this.Email != null &&
                    this.Email.Equals(input.Email))
                ) && 
                (
                    this.Password == input.Password ||
                    (this.Password != null &&
                    this.Password.Equals(input.Password))
                ) && 
                (
                    this.PasswordSecond == input.PasswordSecond ||
                    (this.PasswordSecond != null &&
                    this.PasswordSecond.Equals(input.PasswordSecond))
                ) && 
                (
                    this.Region == input.Region ||
                    (this.Region != null &&
                    this.Region.Equals(input.Region))
                ) && 
                (
                    this.DeviceId == input.DeviceId ||
                    (this.DeviceId != null &&
                    this.DeviceId.Equals(input.DeviceId))
                ) && 
                (
                    this.Recaptcha == input.Recaptcha ||
                    (this.Recaptcha != null &&
                    this.Recaptcha.Equals(input.Recaptcha))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                hashCode = (hashCode * 59) + this.AuthType.GetHashCode();
                if (this.Email != null)
                {
                    hashCode = (hashCode * 59) + this.Email.GetHashCode();
                }
                if (this.Password != null)
                {
                    hashCode = (hashCode * 59) + this.Password.GetHashCode();
                }
                if (this.PasswordSecond != null)
                {
                    hashCode = (hashCode * 59) + this.PasswordSecond.GetHashCode();
                }
                if (this.Region != null)
                {
                    hashCode = (hashCode * 59) + this.Region.GetHashCode();
                }
                if (this.DeviceId != null)
                {
                    hashCode = (hashCode * 59) + this.DeviceId.GetHashCode();
                }
                if (this.Recaptcha != null)
                {
                    hashCode = (hashCode * 59) + this.Recaptcha.GetHashCode();
                }
                return hashCode;
            }
        }

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

}
