/*
 * 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>
    /// RivenAuction
    /// </summary>
    [DataContract(Name = "rivenAuction")]
    public partial class RivenAuction : IEquatable<RivenAuction>, IValidatableObject
    {
        /// <summary>
        /// Defines Polarity
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum PolarityEnum
        {
            /// <summary>
            /// Enum Madurai for value: madurai
            /// </summary>
            [EnumMember(Value = "madurai")]
            Madurai = 1,

            /// <summary>
            /// Enum Vazarin for value: vazarin
            /// </summary>
            [EnumMember(Value = "vazarin")]
            Vazarin = 2,

            /// <summary>
            /// Enum Naramon for value: naramon
            /// </summary>
            [EnumMember(Value = "naramon")]
            Naramon = 3,

            /// <summary>
            /// Enum Zenurik for value: zenurik
            /// </summary>
            [EnumMember(Value = "zenurik")]
            Zenurik = 4
        }


        /// <summary>
        /// Gets or Sets Polarity
        /// </summary>
        [DataMember(Name = "polarity", EmitDefaultValue = false)]
        public PolarityEnum? Polarity { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="RivenAuction" /> class.
        /// </summary>
        /// <param name="type">type of the item, in this case it&#39;s &#x60;riven&#x60;.</param>
        /// <param name="attributes">attributes.</param>
        /// <param name="name">Riven mod name.</param>
        /// <param name="masteryLevel">Mastery level requirennment for that mod..</param>
        /// <param name="reRolls">reRolls.</param>
        /// <param name="weaponUrlName">weapon name in url format..</param>
        /// <param name="polarity">polarity.</param>
        /// <param name="modRank">modRank.</param>
        public RivenAuction(string type = default(string), List<RivenAuctionAttributesInner> attributes = default(List<RivenAuctionAttributesInner>), string name = default(string), int masteryLevel = default(int), int reRolls = default(int), string weaponUrlName = default(string), PolarityEnum? polarity = default(PolarityEnum?), int modRank = default(int))
        {
            this.Type = type;
            this.Attributes = attributes;
            this.Name = name;
            this.MasteryLevel = masteryLevel;
            this.ReRolls = reRolls;
            this.WeaponUrlName = weaponUrlName;
            this.Polarity = polarity;
            this.ModRank = modRank;
        }

        /// <summary>
        /// type of the item, in this case it&#39;s &#x60;riven&#x60;
        /// </summary>
        /// <value>type of the item, in this case it&#39;s &#x60;riven&#x60;</value>
        /// <example>riven</example>
        [DataMember(Name = "type", EmitDefaultValue = false)]
        public string Type { get; set; }

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

        /// <summary>
        /// Riven mod name
        /// </summary>
        /// <value>Riven mod name</value>
        /// <example>conci-hexacron</example>
        [DataMember(Name = "name", EmitDefaultValue = false)]
        public string Name { get; set; }

        /// <summary>
        /// Mastery level requirennment for that mod.
        /// </summary>
        /// <value>Mastery level requirennment for that mod.</value>
        [DataMember(Name = "mastery_level", EmitDefaultValue = false)]
        public int MasteryLevel { get; set; }

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

        /// <summary>
        /// weapon name in url format.
        /// </summary>
        /// <value>weapon name in url format.</value>
        [DataMember(Name = "weapon_url_name", EmitDefaultValue = false)]
        public string WeaponUrlName { get; set; }

        /// <summary>
        /// Gets or Sets ModRank
        /// </summary>
        [DataMember(Name = "mod_rank", EmitDefaultValue = false)]
        public int ModRank { 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 RivenAuction {\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("  Attributes: ").Append(Attributes).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  MasteryLevel: ").Append(MasteryLevel).Append("\n");
            sb.Append("  ReRolls: ").Append(ReRolls).Append("\n");
            sb.Append("  WeaponUrlName: ").Append(WeaponUrlName).Append("\n");
            sb.Append("  Polarity: ").Append(Polarity).Append("\n");
            sb.Append("  ModRank: ").Append(ModRank).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 RivenAuction);
        }

        /// <summary>
        /// Returns true if RivenAuction instances are equal
        /// </summary>
        /// <param name="input">Instance of RivenAuction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RivenAuction input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Type == input.Type ||
                    (this.Type != null &&
                    this.Type.Equals(input.Type))
                ) && 
                (
                    this.Attributes == input.Attributes ||
                    this.Attributes != null &&
                    input.Attributes != null &&
                    this.Attributes.SequenceEqual(input.Attributes)
                ) && 
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))
                ) && 
                (
                    this.MasteryLevel == input.MasteryLevel ||
                    this.MasteryLevel.Equals(input.MasteryLevel)
                ) && 
                (
                    this.ReRolls == input.ReRolls ||
                    this.ReRolls.Equals(input.ReRolls)
                ) && 
                (
                    this.WeaponUrlName == input.WeaponUrlName ||
                    (this.WeaponUrlName != null &&
                    this.WeaponUrlName.Equals(input.WeaponUrlName))
                ) && 
                (
                    this.Polarity == input.Polarity ||
                    this.Polarity.Equals(input.Polarity)
                ) && 
                (
                    this.ModRank == input.ModRank ||
                    this.ModRank.Equals(input.ModRank)
                );
        }

        /// <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.Type != null)
                {
                    hashCode = (hashCode * 59) + this.Type.GetHashCode();
                }
                if (this.Attributes != null)
                {
                    hashCode = (hashCode * 59) + this.Attributes.GetHashCode();
                }
                if (this.Name != null)
                {
                    hashCode = (hashCode * 59) + this.Name.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.MasteryLevel.GetHashCode();
                hashCode = (hashCode * 59) + this.ReRolls.GetHashCode();
                if (this.WeaponUrlName != null)
                {
                    hashCode = (hashCode * 59) + this.WeaponUrlName.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Polarity.GetHashCode();
                hashCode = (hashCode * 59) + this.ModRank.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)
        {
            // MasteryLevel (int) maximum
            if (this.MasteryLevel > (int)16)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MasteryLevel, must be a value less than or equal to 16.", new [] { "MasteryLevel" });
            }

            // MasteryLevel (int) minimum
            if (this.MasteryLevel < (int)8)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for MasteryLevel, must be a value greater than or equal to 8.", new [] { "MasteryLevel" });
            }

            // ModRank (int) maximum
            if (this.ModRank > (int)10)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ModRank, must be a value less than or equal to 10.", new [] { "ModRank" });
            }

            // ModRank (int) minimum
            if (this.ModRank < (int)0)
            {
                yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ModRank, must be a value greater than or equal to 0.", new [] { "ModRank" });
            }

            yield break;
        }
    }

}
