/* 
 * 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>
    /// CP02_PROVINCIA -  Provincia &lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;IdProvince&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class ProvinceCODTO :  IEquatable<ProvinceCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ProvinceCODTO" /> class.
        /// </summary>
        /// <param name="acronym">CP02_SIGLA - Sigla provincia (required).</param>
        /// <param name="idProvince">CP02_ID - Cod. Provincia (required).</param>
        /// <param name="idRegion">CP02_IDREGIONE_CP01 - Cod. Regione (required).</param>
        /// <param name="istatCapitalCityCode">CP02_CODISTATCAPOLUOGO - Codice ISTAT capoluogo (required).</param>
        /// <param name="istatCode">CP02_CODISTAT - Codici Istat (required).</param>
        /// <param name="name">CP02_DENOMINAZIONE -  Provincia  (required).</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public ProvinceCODTO(string acronym = default(string), long? idProvince = default(long?), int? idRegion = default(int?), string istatCapitalCityCode = default(string), string istatCode = default(string), string name = default(string), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "acronym" is required (not null)
            if (acronym == null)
            {
                throw new InvalidDataException("acronym is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.Acronym = acronym;
            }
            // to ensure "idProvince" is required (not null)
            if (idProvince == null)
            {
                throw new InvalidDataException("idProvince is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.IdProvince = idProvince;
            }
            // to ensure "idRegion" is required (not null)
            if (idRegion == null)
            {
                throw new InvalidDataException("idRegion is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.IdRegion = idRegion;
            }
            // to ensure "istatCapitalCityCode" is required (not null)
            if (istatCapitalCityCode == null)
            {
                throw new InvalidDataException("istatCapitalCityCode is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.IstatCapitalCityCode = istatCapitalCityCode;
            }
            // to ensure "istatCode" is required (not null)
            if (istatCode == null)
            {
                throw new InvalidDataException("istatCode is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.IstatCode = istatCode;
            }
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for ProvinceCODTO and cannot be null");
            }
            else
            {
                this.Name = name;
            }
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CP02_SIGLA - Sigla provincia
        /// </summary>
        /// <value>CP02_SIGLA - Sigla provincia</value>
        [DataMember(Name="acronym", EmitDefaultValue=false)]
        public string Acronym { get; set; }

        /// <summary>
        /// CP02_ID - Cod. Provincia
        /// </summary>
        /// <value>CP02_ID - Cod. Provincia</value>
        [DataMember(Name="idProvince", EmitDefaultValue=false)]
        public long? IdProvince { get; set; }

        /// <summary>
        /// CP02_IDREGIONE_CP01 - Cod. Regione
        /// </summary>
        /// <value>CP02_IDREGIONE_CP01 - Cod. Regione</value>
        [DataMember(Name="idRegion", EmitDefaultValue=false)]
        public int? IdRegion { get; set; }

        /// <summary>
        /// CP02_CODISTATCAPOLUOGO - Codice ISTAT capoluogo
        /// </summary>
        /// <value>CP02_CODISTATCAPOLUOGO - Codice ISTAT capoluogo</value>
        [DataMember(Name="istatCapitalCityCode", EmitDefaultValue=false)]
        public string IstatCapitalCityCode { get; set; }

        /// <summary>
        /// CP02_CODISTAT - Codici Istat
        /// </summary>
        /// <value>CP02_CODISTAT - Codici Istat</value>
        [DataMember(Name="istatCode", EmitDefaultValue=false)]
        public string IstatCode { get; set; }

        /// <summary>
        /// CP02_DENOMINAZIONE -  Provincia 
        /// </summary>
        /// <value>CP02_DENOMINAZIONE -  Provincia </value>
        [DataMember(Name="name", EmitDefaultValue=false)]
        public string Name { 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 ProvinceCODTO {\n");
            sb.Append("  Acronym: ").Append(Acronym).Append("\n");
            sb.Append("  IdProvince: ").Append(IdProvince).Append("\n");
            sb.Append("  IdRegion: ").Append(IdRegion).Append("\n");
            sb.Append("  IstatCapitalCityCode: ").Append(IstatCapitalCityCode).Append("\n");
            sb.Append("  IstatCode: ").Append(IstatCode).Append("\n");
            sb.Append("  Name: ").Append(Name).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 ProvinceCODTO);
        }

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

            return 
                (
                    this.Acronym == input.Acronym ||
                    (this.Acronym != null &&
                    this.Acronym.Equals(input.Acronym))
                ) && 
                (
                    this.IdProvince == input.IdProvince ||
                    (this.IdProvince != null &&
                    this.IdProvince.Equals(input.IdProvince))
                ) && 
                (
                    this.IdRegion == input.IdRegion ||
                    (this.IdRegion != null &&
                    this.IdRegion.Equals(input.IdRegion))
                ) && 
                (
                    this.IstatCapitalCityCode == input.IstatCapitalCityCode ||
                    (this.IstatCapitalCityCode != null &&
                    this.IstatCapitalCityCode.Equals(input.IstatCapitalCityCode))
                ) && 
                (
                    this.IstatCode == input.IstatCode ||
                    (this.IstatCode != null &&
                    this.IstatCode.Equals(input.IstatCode))
                ) && 
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))
                ) && 
                (
                    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.Acronym != null)
                    hashCode = hashCode * 59 + this.Acronym.GetHashCode();
                if (this.IdProvince != null)
                    hashCode = hashCode * 59 + this.IdProvince.GetHashCode();
                if (this.IdRegion != null)
                    hashCode = hashCode * 59 + this.IdRegion.GetHashCode();
                if (this.IstatCapitalCityCode != null)
                    hashCode = hashCode * 59 + this.IstatCapitalCityCode.GetHashCode();
                if (this.IstatCode != null)
                    hashCode = hashCode * 59 + this.IstatCode.GetHashCode();
                if (this.Name != null)
                    hashCode = hashCode * 59 + this.Name.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;
        }
    }
}
