/*
 * 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>
    /// TokensCollectibleDefinitions
    /// </summary>
    [DataContract(Name = "Tokens.CollectibleDefinitions")]
    public partial class TokensCollectibleDefinitions : IEquatable<TokensCollectibleDefinitions>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TokensCollectibleDefinitions" /> class.
        /// </summary>
        /// <param name="collectibleDefinition">collectibleDefinition.</param>
        /// <param name="destinyInventoryItemDefinition">destinyInventoryItemDefinition.</param>
        public TokensCollectibleDefinitions(DestinyDefinitionsCollectiblesDestinyCollectibleDefinition collectibleDefinition = default(DestinyDefinitionsCollectiblesDestinyCollectibleDefinition), DestinyDefinitionsDestinyInventoryItemDefinition destinyInventoryItemDefinition = default(DestinyDefinitionsDestinyInventoryItemDefinition))
        {
            this.CollectibleDefinition = collectibleDefinition;
            this.DestinyInventoryItemDefinition = destinyInventoryItemDefinition;
        }

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

        /// <summary>
        /// Gets or Sets DestinyInventoryItemDefinition
        /// </summary>
        [DataMember(Name = "DestinyInventoryItemDefinition", EmitDefaultValue = false)]
        public DestinyDefinitionsDestinyInventoryItemDefinition DestinyInventoryItemDefinition { 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 TokensCollectibleDefinitions {\n");
            sb.Append("  CollectibleDefinition: ").Append(CollectibleDefinition).Append("\n");
            sb.Append("  DestinyInventoryItemDefinition: ").Append(DestinyInventoryItemDefinition).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 TokensCollectibleDefinitions);
        }

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

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

}
