/*
 * 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>
    /// Defines a plug \&quot;Category\&quot; that is allowed to be plugged into a socket of this type.  This should be compared against a given plug item&#39;s DestinyInventoryItemDefinition.plug.plugCategoryHash, which indicates the plug item&#39;s category.
    /// </summary>
    [DataContract(Name = "Destiny.Definitions.Sockets.DestinyPlugWhitelistEntryDefinition")]
    public partial class DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition : IEquatable<DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition" /> class.
        /// </summary>
        /// <param name="categoryHash">The hash identifier of the Plug Category to compare against the plug item&#39;s plug.plugCategoryHash.  Note that this does NOT relate to any Definition in itself, it is only used for comparison purposes..</param>
        /// <param name="categoryIdentifier">The string identifier for the category, which is here mostly for debug purposes..</param>
        /// <param name="reinitializationPossiblePlugHashes">The list of all plug items (DestinyInventoryItemDefinition) that the socket may randomly be populated with when reinitialized.  Which ones you should actually show are determined by the plug being inserted into the socket, and the socket’s type.  When you inspect the plug that could go into a Masterwork Socket, look up the socket type of the socket being inspected and find the DestinySocketTypeDefinition.  Then, look at the Plugs that can fit in that socket. Find the Whitelist in the DestinySocketTypeDefinition that matches the plug item’s categoryhash.  That whitelist entry will potentially have a new “reinitializationPossiblePlugHashes” property.If it does, that means we know what it will roll if you try to insert this plug into this socket..</param>
        public DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition(int categoryHash = default(int), string categoryIdentifier = default(string), List<int> reinitializationPossiblePlugHashes = default(List<int>))
        {
            this.CategoryHash = categoryHash;
            this.CategoryIdentifier = categoryIdentifier;
            this.ReinitializationPossiblePlugHashes = reinitializationPossiblePlugHashes;
        }

        /// <summary>
        /// The hash identifier of the Plug Category to compare against the plug item&#39;s plug.plugCategoryHash.  Note that this does NOT relate to any Definition in itself, it is only used for comparison purposes.
        /// </summary>
        /// <value>The hash identifier of the Plug Category to compare against the plug item&#39;s plug.plugCategoryHash.  Note that this does NOT relate to any Definition in itself, it is only used for comparison purposes.</value>
        [DataMember(Name = "categoryHash", EmitDefaultValue = false)]
        public int CategoryHash { get; set; }

        /// <summary>
        /// The string identifier for the category, which is here mostly for debug purposes.
        /// </summary>
        /// <value>The string identifier for the category, which is here mostly for debug purposes.</value>
        [DataMember(Name = "categoryIdentifier", EmitDefaultValue = false)]
        public string CategoryIdentifier { get; set; }

        /// <summary>
        /// The list of all plug items (DestinyInventoryItemDefinition) that the socket may randomly be populated with when reinitialized.  Which ones you should actually show are determined by the plug being inserted into the socket, and the socket’s type.  When you inspect the plug that could go into a Masterwork Socket, look up the socket type of the socket being inspected and find the DestinySocketTypeDefinition.  Then, look at the Plugs that can fit in that socket. Find the Whitelist in the DestinySocketTypeDefinition that matches the plug item’s categoryhash.  That whitelist entry will potentially have a new “reinitializationPossiblePlugHashes” property.If it does, that means we know what it will roll if you try to insert this plug into this socket.
        /// </summary>
        /// <value>The list of all plug items (DestinyInventoryItemDefinition) that the socket may randomly be populated with when reinitialized.  Which ones you should actually show are determined by the plug being inserted into the socket, and the socket’s type.  When you inspect the plug that could go into a Masterwork Socket, look up the socket type of the socket being inspected and find the DestinySocketTypeDefinition.  Then, look at the Plugs that can fit in that socket. Find the Whitelist in the DestinySocketTypeDefinition that matches the plug item’s categoryhash.  That whitelist entry will potentially have a new “reinitializationPossiblePlugHashes” property.If it does, that means we know what it will roll if you try to insert this plug into this socket.</value>
        [DataMember(Name = "reinitializationPossiblePlugHashes", EmitDefaultValue = false)]
        public List<int> ReinitializationPossiblePlugHashes { 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 DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition {\n");
            sb.Append("  CategoryHash: ").Append(CategoryHash).Append("\n");
            sb.Append("  CategoryIdentifier: ").Append(CategoryIdentifier).Append("\n");
            sb.Append("  ReinitializationPossiblePlugHashes: ").Append(ReinitializationPossiblePlugHashes).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 DestinyDefinitionsSocketsDestinyPlugWhitelistEntryDefinition);
        }

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

        /// <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.CategoryHash.GetHashCode();
                if (this.CategoryIdentifier != null)
                {
                    hashCode = (hashCode * 59) + this.CategoryIdentifier.GetHashCode();
                }
                if (this.ReinitializationPossiblePlugHashes != null)
                {
                    hashCode = (hashCode * 59) + this.ReinitializationPossiblePlugHashes.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;
        }
    }

}
