/*
 * Bungie.Net API
 *
 * These endpoints constitute the functionality exposed by Bungie.net, both for more traditional website functionality and for connectivity to Bungie video games and their related functionality.
 *
 * The version of the OpenAPI document: 2.18.0
 * Contact: support@bungie.com
 * 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 = Destiny.Client.OpenAPIDateConverter;

namespace Destiny.Model
{
    /// <summary>
    /// An artificial construct provided by Bungie.Net, where we attempt to group talent nodes by functionality.  This is a single set of references to Talent Nodes that share a common trait or purpose.
    /// </summary>
    [DataContract(Name = "Destiny.Definitions.DestinyTalentNodeCategory")]
    public partial class DestinyDefinitionsDestinyTalentNodeCategory : IEquatable<DestinyDefinitionsDestinyTalentNodeCategory>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DestinyDefinitionsDestinyTalentNodeCategory" /> class.
        /// </summary>
        /// <param name="identifier">Mostly just for debug purposes, but if you find it useful you can have it. This is BNet&#39;s manually created identifier for this category..</param>
        /// <param name="isLoreDriven">If true, we found the localized content in a related DestinyLoreDefinition instead of local BNet localization files. This is mostly for ease of my own future investigations..</param>
        /// <param name="displayProperties">displayProperties.</param>
        /// <param name="nodeHashes">The set of all hash identifiers for Talent Nodes (DestinyTalentNodeDefinition) in this Talent Grid that are part of this Category..</param>
        public DestinyDefinitionsDestinyTalentNodeCategory(string identifier = default(string), bool isLoreDriven = default(bool), DestinyDefinitionsCommonDestinyDisplayPropertiesDefinition displayProperties = default(DestinyDefinitionsCommonDestinyDisplayPropertiesDefinition), List<int> nodeHashes = default(List<int>))
        {
            this.Identifier = identifier;
            this.IsLoreDriven = isLoreDriven;
            this.DisplayProperties = displayProperties;
            this.NodeHashes = nodeHashes;
        }

        /// <summary>
        /// Mostly just for debug purposes, but if you find it useful you can have it. This is BNet&#39;s manually created identifier for this category.
        /// </summary>
        /// <value>Mostly just for debug purposes, but if you find it useful you can have it. This is BNet&#39;s manually created identifier for this category.</value>
        [DataMember(Name = "identifier", EmitDefaultValue = false)]
        public string Identifier { get; set; }

        /// <summary>
        /// If true, we found the localized content in a related DestinyLoreDefinition instead of local BNet localization files. This is mostly for ease of my own future investigations.
        /// </summary>
        /// <value>If true, we found the localized content in a related DestinyLoreDefinition instead of local BNet localization files. This is mostly for ease of my own future investigations.</value>
        [DataMember(Name = "isLoreDriven", EmitDefaultValue = true)]
        public bool IsLoreDriven { get; set; }

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

        /// <summary>
        /// The set of all hash identifiers for Talent Nodes (DestinyTalentNodeDefinition) in this Talent Grid that are part of this Category.
        /// </summary>
        /// <value>The set of all hash identifiers for Talent Nodes (DestinyTalentNodeDefinition) in this Talent Grid that are part of this Category.</value>
        [DataMember(Name = "nodeHashes", EmitDefaultValue = false)]
        public List<int> NodeHashes { 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 DestinyDefinitionsDestinyTalentNodeCategory {\n");
            sb.Append("  Identifier: ").Append(Identifier).Append("\n");
            sb.Append("  IsLoreDriven: ").Append(IsLoreDriven).Append("\n");
            sb.Append("  DisplayProperties: ").Append(DisplayProperties).Append("\n");
            sb.Append("  NodeHashes: ").Append(NodeHashes).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 DestinyDefinitionsDestinyTalentNodeCategory);
        }

        /// <summary>
        /// Returns true if DestinyDefinitionsDestinyTalentNodeCategory instances are equal
        /// </summary>
        /// <param name="input">Instance of DestinyDefinitionsDestinyTalentNodeCategory to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DestinyDefinitionsDestinyTalentNodeCategory input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Identifier == input.Identifier ||
                    (this.Identifier != null &&
                    this.Identifier.Equals(input.Identifier))
                ) && 
                (
                    this.IsLoreDriven == input.IsLoreDriven ||
                    this.IsLoreDriven.Equals(input.IsLoreDriven)
                ) && 
                (
                    this.DisplayProperties == input.DisplayProperties ||
                    (this.DisplayProperties != null &&
                    this.DisplayProperties.Equals(input.DisplayProperties))
                ) && 
                (
                    this.NodeHashes == input.NodeHashes ||
                    this.NodeHashes != null &&
                    input.NodeHashes != null &&
                    this.NodeHashes.SequenceEqual(input.NodeHashes)
                );
        }

        /// <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.Identifier != null)
                {
                    hashCode = (hashCode * 59) + this.Identifier.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.IsLoreDriven.GetHashCode();
                if (this.DisplayProperties != null)
                {
                    hashCode = (hashCode * 59) + this.DisplayProperties.GetHashCode();
                }
                if (this.NodeHashes != null)
                {
                    hashCode = (hashCode * 59) + this.NodeHashes.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;
        }
    }

}
