/*
 * SMAC API
 *
 * SMAC ASP.NET Core Web API
 *
 * The version of the OpenAPI document: v1
 * 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 = Org.OpenAPITools.Client.OpenAPIDateConverter;

namespace Org.OpenAPITools.Model
{
    /// <summary>
    /// AssociatedSmac
    /// </summary>
    [DataContract(Name = "AssociatedSmac")]
    public partial class AssociatedSmac : IEquatable<AssociatedSmac>, IValidatableObject
    {
        /// <summary>
        /// The associated user type
        /// </summary>
        /// <value>The associated user type</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum TypeEnum
        {
            /// <summary>
            /// Enum Holder for value: Holder
            /// </summary>
            [EnumMember(Value = "Holder")]
            Holder = 1,

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

        }


        /// <summary>
        /// The associated user type
        /// </summary>
        /// <value>The associated user type</value>
        [DataMember(Name = "type", EmitDefaultValue = true)]
        public TypeEnum? Type { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="AssociatedSmac" /> class.
        /// </summary>
        /// <param name="smacId">The SMAC unique identifier.</param>
        /// <param name="type">The associated user type.</param>
        /// <param name="issuer">The name of issuer.</param>
        /// <param name="name">The SMAC name.</param>
        /// <param name="description">The SMAC description.</param>
        /// <param name="datasetsCount">The number of dataset(s) attached.</param>
        /// <param name="scansCount">The number of scan(s) occurred.</param>
        /// <param name="datasets">The attached dataset names.</param>
        /// <param name="qrCode">The base64 string of the QrCode image.</param>
        public AssociatedSmac(Guid smacId = default(Guid), TypeEnum? type = default(TypeEnum?), string issuer = default(string), string name = default(string), string description = default(string), int datasetsCount = default(int), int scansCount = default(int), List<string> datasets = default(List<string>), string qrCode = default(string))
        {
            this.SmacId = smacId;
            this.Type = type;
            this.Issuer = issuer;
            this.Name = name;
            this.Description = description;
            this.DatasetsCount = datasetsCount;
            this.ScansCount = scansCount;
            this.Datasets = datasets;
            this.QrCode = qrCode;
        }

        /// <summary>
        /// The SMAC unique identifier
        /// </summary>
        /// <value>The SMAC unique identifier</value>
        [DataMember(Name = "smacId", EmitDefaultValue = false)]
        public Guid SmacId { get; set; }

        /// <summary>
        /// The name of issuer
        /// </summary>
        /// <value>The name of issuer</value>
        [DataMember(Name = "issuer", EmitDefaultValue = true)]
        public string Issuer { get; set; }

        /// <summary>
        /// The SMAC name
        /// </summary>
        /// <value>The SMAC name</value>
        [DataMember(Name = "name", EmitDefaultValue = true)]
        public string Name { get; set; }

        /// <summary>
        /// The SMAC description
        /// </summary>
        /// <value>The SMAC description</value>
        [DataMember(Name = "description", EmitDefaultValue = true)]
        public string Description { get; set; }

        /// <summary>
        /// The number of dataset(s) attached
        /// </summary>
        /// <value>The number of dataset(s) attached</value>
        [DataMember(Name = "datasetsCount", EmitDefaultValue = false)]
        public int DatasetsCount { get; set; }

        /// <summary>
        /// The number of scan(s) occurred
        /// </summary>
        /// <value>The number of scan(s) occurred</value>
        [DataMember(Name = "scansCount", EmitDefaultValue = false)]
        public int ScansCount { get; set; }

        /// <summary>
        /// The attached dataset names
        /// </summary>
        /// <value>The attached dataset names</value>
        [DataMember(Name = "datasets", EmitDefaultValue = true)]
        public List<string> Datasets { get; set; }

        /// <summary>
        /// The base64 string of the QrCode image
        /// </summary>
        /// <value>The base64 string of the QrCode image</value>
        [DataMember(Name = "qrCode", EmitDefaultValue = true)]
        public string QrCode { 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 AssociatedSmac {\n");
            sb.Append("  SmacId: ").Append(SmacId).Append("\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("  Issuer: ").Append(Issuer).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  DatasetsCount: ").Append(DatasetsCount).Append("\n");
            sb.Append("  ScansCount: ").Append(ScansCount).Append("\n");
            sb.Append("  Datasets: ").Append(Datasets).Append("\n");
            sb.Append("  QrCode: ").Append(QrCode).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 AssociatedSmac);
        }

        /// <summary>
        /// Returns true if AssociatedSmac instances are equal
        /// </summary>
        /// <param name="input">Instance of AssociatedSmac to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AssociatedSmac input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.SmacId == input.SmacId ||
                    (this.SmacId != null &&
                    this.SmacId.Equals(input.SmacId))
                ) && 
                (
                    this.Type == input.Type ||
                    this.Type.Equals(input.Type)
                ) && 
                (
                    this.Issuer == input.Issuer ||
                    (this.Issuer != null &&
                    this.Issuer.Equals(input.Issuer))
                ) && 
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))
                ) && 
                (
                    this.Description == input.Description ||
                    (this.Description != null &&
                    this.Description.Equals(input.Description))
                ) && 
                (
                    this.DatasetsCount == input.DatasetsCount ||
                    this.DatasetsCount.Equals(input.DatasetsCount)
                ) && 
                (
                    this.ScansCount == input.ScansCount ||
                    this.ScansCount.Equals(input.ScansCount)
                ) && 
                (
                    this.Datasets == input.Datasets ||
                    this.Datasets != null &&
                    input.Datasets != null &&
                    this.Datasets.SequenceEqual(input.Datasets)
                ) && 
                (
                    this.QrCode == input.QrCode ||
                    (this.QrCode != null &&
                    this.QrCode.Equals(input.QrCode))
                );
        }

        /// <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.SmacId != null)
                {
                    hashCode = (hashCode * 59) + this.SmacId.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Type.GetHashCode();
                if (this.Issuer != null)
                {
                    hashCode = (hashCode * 59) + this.Issuer.GetHashCode();
                }
                if (this.Name != null)
                {
                    hashCode = (hashCode * 59) + this.Name.GetHashCode();
                }
                if (this.Description != null)
                {
                    hashCode = (hashCode * 59) + this.Description.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.DatasetsCount.GetHashCode();
                hashCode = (hashCode * 59) + this.ScansCount.GetHashCode();
                if (this.Datasets != null)
                {
                    hashCode = (hashCode * 59) + this.Datasets.GetHashCode();
                }
                if (this.QrCode != null)
                {
                    hashCode = (hashCode * 59) + this.QrCode.GetHashCode();
                }
                return hashCode;
            }
        }

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

}
