/* 
 * TSE Cloud - CO
 *
 * This is Swagger Docs for Document WebApi Teamsystemn Enterprise Cloud, more detail at [https://swagger.io](https://swagger.io).
 *
 * OpenAPI spec version: v2025.3000
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter;
namespace IO.Swagger.Model
{
    /// <summary>
    /// Anagrafica stato
    /// </summary>
    [DataContract]
        public partial class StatoDTO :  IEquatable<StatoDTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StatoDTO" /> class.
        /// </summary>
        /// <param name="idStato">Codice stato (required).</param>
        /// <param name="seq">Numero sequenziale di stato (required).</param>
        /// <param name="indTipoStato">Indicatore tipo stato: 0 - stato standard, 1 - stato decisionale, 2 - stato autorizzato, 3 -  stato non autorizzato (required).</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public StatoDTO(int? idStato = default(int?), int? seq = default(int?), int? indTipoStato = default(int?), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "idStato" is required (not null)
            if (idStato == null)
            {
                throw new InvalidDataException("idStato is a required property for StatoDTO and cannot be null");
            }
            else
            {
                this.IdStato = idStato;
            }
            // to ensure "seq" is required (not null)
            if (seq == null)
            {
                throw new InvalidDataException("seq is a required property for StatoDTO and cannot be null");
            }
            else
            {
                this.Seq = seq;
            }
            // to ensure "indTipoStato" is required (not null)
            if (indTipoStato == null)
            {
                throw new InvalidDataException("indTipoStato is a required property for StatoDTO and cannot be null");
            }
            else
            {
                this.IndTipoStato = indTipoStato;
            }
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// Codice stato
        /// </summary>
        /// <value>Codice stato</value>
        [DataMember(Name="idStato", EmitDefaultValue=false)]
        public int? IdStato { get; set; }

        /// <summary>
        /// Numero sequenziale di stato
        /// </summary>
        /// <value>Numero sequenziale di stato</value>
        [DataMember(Name="seq", EmitDefaultValue=false)]
        public int? Seq { get; set; }

        /// <summary>
        /// Indicatore tipo stato: 0 - stato standard, 1 - stato decisionale, 2 - stato autorizzato, 3 -  stato non autorizzato
        /// </summary>
        /// <value>Indicatore tipo stato: 0 - stato standard, 1 - stato decisionale, 2 - stato autorizzato, 3 -  stato non autorizzato</value>
        [DataMember(Name="indTipoStato", EmitDefaultValue=false)]
        public int? IndTipoStato { get; set; }

        /// <summary>
        /// Gets or Sets AdditionalData
        /// </summary>
        [DataMember(Name="additionalData", EmitDefaultValue=false)]
        public Dictionary<string, Object> AdditionalData { get; set; }

        /// <summary>
        /// Gets or Sets PluginData
        /// </summary>
        [DataMember(Name="pluginData", EmitDefaultValue=false)]
        public Dictionary<string, Object> PluginData { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class StatoDTO {\n");
            sb.Append("  IdStato: ").Append(IdStato).Append("\n");
            sb.Append("  Seq: ").Append(Seq).Append("\n");
            sb.Append("  IndTipoStato: ").Append(IndTipoStato).Append("\n");
            sb.Append("  AdditionalData: ").Append(AdditionalData).Append("\n");
            sb.Append("  PluginData: ").Append(PluginData).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 JsonConvert.SerializeObject(this, 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 StatoDTO);
        }

        /// <summary>
        /// Returns true if StatoDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of StatoDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StatoDTO input)
        {
            if (input == null)
                return false;

            return 
                (
                    this.IdStato == input.IdStato ||
                    (this.IdStato != null &&
                    this.IdStato.Equals(input.IdStato))
                ) && 
                (
                    this.Seq == input.Seq ||
                    (this.Seq != null &&
                    this.Seq.Equals(input.Seq))
                ) && 
                (
                    this.IndTipoStato == input.IndTipoStato ||
                    (this.IndTipoStato != null &&
                    this.IndTipoStato.Equals(input.IndTipoStato))
                ) && 
                (
                    this.AdditionalData == input.AdditionalData ||
                    this.AdditionalData != null &&
                    input.AdditionalData != null &&
                    this.AdditionalData.SequenceEqual(input.AdditionalData)
                ) && 
                (
                    this.PluginData == input.PluginData ||
                    this.PluginData != null &&
                    input.PluginData != null &&
                    this.PluginData.SequenceEqual(input.PluginData)
                );
        }

        /// <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.IdStato != null)
                    hashCode = hashCode * 59 + this.IdStato.GetHashCode();
                if (this.Seq != null)
                    hashCode = hashCode * 59 + this.Seq.GetHashCode();
                if (this.IndTipoStato != null)
                    hashCode = hashCode * 59 + this.IndTipoStato.GetHashCode();
                if (this.AdditionalData != null)
                    hashCode = hashCode * 59 + this.AdditionalData.GetHashCode();
                if (this.PluginData != null)
                    hashCode = hashCode * 59 + this.PluginData.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;
        }
    }
}
