/* 
 * 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>
    /// CG01_ANAGCOMUNI - Comuni e uffici&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Code&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class CityCODTO :  IEquatable<CityCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CityCODTO" /> class.
        /// </summary>
        /// <param name="buildingFundOfficeCode">CG01_CODUFFCASSA - Codice Cassa Edile.</param>
        /// <param name="cciaaOfficeCode">CG01_CODUFFCCIAA - Ufficio CCIAA.</param>
        /// <param name="code">CG01_CODICE - Codice (required).</param>
        /// <param name="courtOfficeCode">CG01_CODUFFTRIB - Codice Ufficio del Tribunale.</param>
        /// <param name="description">CG01_DESCR - Descrizione.</param>
        /// <param name="enasarcoOfficeCode">CG01_CODUFFENAS - Codice ENASARCO.</param>
        /// <param name="grantCode">CG01_CODICE_CG03 - Concessione.</param>
        /// <param name="hyperMediaId">CG01_IDMEDIA_CG99 - ID HyperMedia.</param>
        /// <param name="inailOfficeCode">CG01_CODUFFINAIL - Codice Ufficio INAIL.</param>
        /// <param name="inpsOfficeCode">CG01_CODUFFINPS - Codice Ufficio INPS.</param>
        /// <param name="municipalOfficeCode">CG01_CODUFFCOM - Codice Ufficio Comune.</param>
        /// <param name="nrOfCensusZones">CG01_ZONECENS - N. zone censuarie.</param>
        /// <param name="paymentCity">CG01_COMVERS - Comune di versamento.</param>
        /// <param name="postalAccount">CG01_CCESATT - C/C postale esattoria comunale.</param>
        /// <param name="province">CG01_PROV - Prov.</param>
        /// <param name="region">CG01_REGIONE - Regione.</param>
        /// <param name="registryOfficeCode">CG01_CODUFFREG - Codice Ufficio del Registro.</param>
        /// <param name="serviceCenterCode">CG01_CODICE_CG05 - Centro servizi.</param>
        /// <param name="taxOfficeCode">CG01_CODICE_CG04 - Codice ufficio imposte.</param>
        /// <param name="telephoneNumber">CG01_TELNUM - Numero di telefono.</param>
        /// <param name="vatOfficeCode">CG01_CODICE_CG02 - Codice ufficio IVA.</param>
        /// <param name="zipCode">CG01_CAP - Cap.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CityCODTO(double? buildingFundOfficeCode = default(double?), double? cciaaOfficeCode = default(double?), string code = default(string), double? courtOfficeCode = default(double?), string description = default(string), double? enasarcoOfficeCode = default(double?), double? grantCode = default(double?), double? hyperMediaId = default(double?), double? inailOfficeCode = default(double?), double? inpsOfficeCode = default(double?), double? municipalOfficeCode = default(double?), double? nrOfCensusZones = default(double?), string paymentCity = default(string), string postalAccount = default(string), string province = default(string), string region = default(string), double? registryOfficeCode = default(double?), double? serviceCenterCode = default(double?), double? taxOfficeCode = default(double?), string telephoneNumber = default(string), double? vatOfficeCode = default(double?), string zipCode = default(string), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "code" is required (not null)
            if (code == null)
            {
                throw new InvalidDataException("code is a required property for CityCODTO and cannot be null");
            }
            else
            {
                this.Code = code;
            }
            this.BuildingFundOfficeCode = buildingFundOfficeCode;
            this.CciaaOfficeCode = cciaaOfficeCode;
            this.CourtOfficeCode = courtOfficeCode;
            this.Description = description;
            this.EnasarcoOfficeCode = enasarcoOfficeCode;
            this.GrantCode = grantCode;
            this.HyperMediaId = hyperMediaId;
            this.InailOfficeCode = inailOfficeCode;
            this.InpsOfficeCode = inpsOfficeCode;
            this.MunicipalOfficeCode = municipalOfficeCode;
            this.NrOfCensusZones = nrOfCensusZones;
            this.PaymentCity = paymentCity;
            this.PostalAccount = postalAccount;
            this.Province = province;
            this.Region = region;
            this.RegistryOfficeCode = registryOfficeCode;
            this.ServiceCenterCode = serviceCenterCode;
            this.TaxOfficeCode = taxOfficeCode;
            this.TelephoneNumber = telephoneNumber;
            this.VatOfficeCode = vatOfficeCode;
            this.ZipCode = zipCode;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CG01_CODUFFCASSA - Codice Cassa Edile
        /// </summary>
        /// <value>CG01_CODUFFCASSA - Codice Cassa Edile</value>
        [DataMember(Name="buildingFundOfficeCode", EmitDefaultValue=false)]
        public double? BuildingFundOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODUFFCCIAA - Ufficio CCIAA
        /// </summary>
        /// <value>CG01_CODUFFCCIAA - Ufficio CCIAA</value>
        [DataMember(Name="cciaaOfficeCode", EmitDefaultValue=false)]
        public double? CciaaOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODICE - Codice
        /// </summary>
        /// <value>CG01_CODICE - Codice</value>
        [DataMember(Name="code", EmitDefaultValue=false)]
        public string Code { get; set; }

        /// <summary>
        /// CG01_CODUFFTRIB - Codice Ufficio del Tribunale
        /// </summary>
        /// <value>CG01_CODUFFTRIB - Codice Ufficio del Tribunale</value>
        [DataMember(Name="courtOfficeCode", EmitDefaultValue=false)]
        public double? CourtOfficeCode { get; set; }

        /// <summary>
        /// CG01_DESCR - Descrizione
        /// </summary>
        /// <value>CG01_DESCR - Descrizione</value>
        [DataMember(Name="description", EmitDefaultValue=false)]
        public string Description { get; set; }

        /// <summary>
        /// CG01_CODUFFENAS - Codice ENASARCO
        /// </summary>
        /// <value>CG01_CODUFFENAS - Codice ENASARCO</value>
        [DataMember(Name="enasarcoOfficeCode", EmitDefaultValue=false)]
        public double? EnasarcoOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODICE_CG03 - Concessione
        /// </summary>
        /// <value>CG01_CODICE_CG03 - Concessione</value>
        [DataMember(Name="grantCode", EmitDefaultValue=false)]
        public double? GrantCode { get; set; }

        /// <summary>
        /// CG01_IDMEDIA_CG99 - ID HyperMedia
        /// </summary>
        /// <value>CG01_IDMEDIA_CG99 - ID HyperMedia</value>
        [DataMember(Name="hyperMediaId", EmitDefaultValue=false)]
        public double? HyperMediaId { get; set; }

        /// <summary>
        /// CG01_CODUFFINAIL - Codice Ufficio INAIL
        /// </summary>
        /// <value>CG01_CODUFFINAIL - Codice Ufficio INAIL</value>
        [DataMember(Name="inailOfficeCode", EmitDefaultValue=false)]
        public double? InailOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODUFFINPS - Codice Ufficio INPS
        /// </summary>
        /// <value>CG01_CODUFFINPS - Codice Ufficio INPS</value>
        [DataMember(Name="inpsOfficeCode", EmitDefaultValue=false)]
        public double? InpsOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODUFFCOM - Codice Ufficio Comune
        /// </summary>
        /// <value>CG01_CODUFFCOM - Codice Ufficio Comune</value>
        [DataMember(Name="municipalOfficeCode", EmitDefaultValue=false)]
        public double? MunicipalOfficeCode { get; set; }

        /// <summary>
        /// CG01_ZONECENS - N. zone censuarie
        /// </summary>
        /// <value>CG01_ZONECENS - N. zone censuarie</value>
        [DataMember(Name="nrOfCensusZones", EmitDefaultValue=false)]
        public double? NrOfCensusZones { get; set; }

        /// <summary>
        /// CG01_COMVERS - Comune di versamento
        /// </summary>
        /// <value>CG01_COMVERS - Comune di versamento</value>
        [DataMember(Name="paymentCity", EmitDefaultValue=false)]
        public string PaymentCity { get; set; }

        /// <summary>
        /// CG01_CCESATT - C/C postale esattoria comunale
        /// </summary>
        /// <value>CG01_CCESATT - C/C postale esattoria comunale</value>
        [DataMember(Name="postalAccount", EmitDefaultValue=false)]
        public string PostalAccount { get; set; }

        /// <summary>
        /// CG01_PROV - Prov
        /// </summary>
        /// <value>CG01_PROV - Prov</value>
        [DataMember(Name="province", EmitDefaultValue=false)]
        public string Province { get; set; }

        /// <summary>
        /// CG01_REGIONE - Regione
        /// </summary>
        /// <value>CG01_REGIONE - Regione</value>
        [DataMember(Name="region", EmitDefaultValue=false)]
        public string Region { get; set; }

        /// <summary>
        /// CG01_CODUFFREG - Codice Ufficio del Registro
        /// </summary>
        /// <value>CG01_CODUFFREG - Codice Ufficio del Registro</value>
        [DataMember(Name="registryOfficeCode", EmitDefaultValue=false)]
        public double? RegistryOfficeCode { get; set; }

        /// <summary>
        /// CG01_CODICE_CG05 - Centro servizi
        /// </summary>
        /// <value>CG01_CODICE_CG05 - Centro servizi</value>
        [DataMember(Name="serviceCenterCode", EmitDefaultValue=false)]
        public double? ServiceCenterCode { get; set; }

        /// <summary>
        /// CG01_CODICE_CG04 - Codice ufficio imposte
        /// </summary>
        /// <value>CG01_CODICE_CG04 - Codice ufficio imposte</value>
        [DataMember(Name="taxOfficeCode", EmitDefaultValue=false)]
        public double? TaxOfficeCode { get; set; }

        /// <summary>
        /// CG01_TELNUM - Numero di telefono
        /// </summary>
        /// <value>CG01_TELNUM - Numero di telefono</value>
        [DataMember(Name="telephoneNumber", EmitDefaultValue=false)]
        public string TelephoneNumber { get; set; }

        /// <summary>
        /// CG01_CODICE_CG02 - Codice ufficio IVA
        /// </summary>
        /// <value>CG01_CODICE_CG02 - Codice ufficio IVA</value>
        [DataMember(Name="vatOfficeCode", EmitDefaultValue=false)]
        public double? VatOfficeCode { get; set; }

        /// <summary>
        /// CG01_CAP - Cap
        /// </summary>
        /// <value>CG01_CAP - Cap</value>
        [DataMember(Name="zipCode", EmitDefaultValue=false)]
        public string ZipCode { 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 CityCODTO {\n");
            sb.Append("  BuildingFundOfficeCode: ").Append(BuildingFundOfficeCode).Append("\n");
            sb.Append("  CciaaOfficeCode: ").Append(CciaaOfficeCode).Append("\n");
            sb.Append("  Code: ").Append(Code).Append("\n");
            sb.Append("  CourtOfficeCode: ").Append(CourtOfficeCode).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  EnasarcoOfficeCode: ").Append(EnasarcoOfficeCode).Append("\n");
            sb.Append("  GrantCode: ").Append(GrantCode).Append("\n");
            sb.Append("  HyperMediaId: ").Append(HyperMediaId).Append("\n");
            sb.Append("  InailOfficeCode: ").Append(InailOfficeCode).Append("\n");
            sb.Append("  InpsOfficeCode: ").Append(InpsOfficeCode).Append("\n");
            sb.Append("  MunicipalOfficeCode: ").Append(MunicipalOfficeCode).Append("\n");
            sb.Append("  NrOfCensusZones: ").Append(NrOfCensusZones).Append("\n");
            sb.Append("  PaymentCity: ").Append(PaymentCity).Append("\n");
            sb.Append("  PostalAccount: ").Append(PostalAccount).Append("\n");
            sb.Append("  Province: ").Append(Province).Append("\n");
            sb.Append("  Region: ").Append(Region).Append("\n");
            sb.Append("  RegistryOfficeCode: ").Append(RegistryOfficeCode).Append("\n");
            sb.Append("  ServiceCenterCode: ").Append(ServiceCenterCode).Append("\n");
            sb.Append("  TaxOfficeCode: ").Append(TaxOfficeCode).Append("\n");
            sb.Append("  TelephoneNumber: ").Append(TelephoneNumber).Append("\n");
            sb.Append("  VatOfficeCode: ").Append(VatOfficeCode).Append("\n");
            sb.Append("  ZipCode: ").Append(ZipCode).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 CityCODTO);
        }

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

            return 
                (
                    this.BuildingFundOfficeCode == input.BuildingFundOfficeCode ||
                    (this.BuildingFundOfficeCode != null &&
                    this.BuildingFundOfficeCode.Equals(input.BuildingFundOfficeCode))
                ) && 
                (
                    this.CciaaOfficeCode == input.CciaaOfficeCode ||
                    (this.CciaaOfficeCode != null &&
                    this.CciaaOfficeCode.Equals(input.CciaaOfficeCode))
                ) && 
                (
                    this.Code == input.Code ||
                    (this.Code != null &&
                    this.Code.Equals(input.Code))
                ) && 
                (
                    this.CourtOfficeCode == input.CourtOfficeCode ||
                    (this.CourtOfficeCode != null &&
                    this.CourtOfficeCode.Equals(input.CourtOfficeCode))
                ) && 
                (
                    this.Description == input.Description ||
                    (this.Description != null &&
                    this.Description.Equals(input.Description))
                ) && 
                (
                    this.EnasarcoOfficeCode == input.EnasarcoOfficeCode ||
                    (this.EnasarcoOfficeCode != null &&
                    this.EnasarcoOfficeCode.Equals(input.EnasarcoOfficeCode))
                ) && 
                (
                    this.GrantCode == input.GrantCode ||
                    (this.GrantCode != null &&
                    this.GrantCode.Equals(input.GrantCode))
                ) && 
                (
                    this.HyperMediaId == input.HyperMediaId ||
                    (this.HyperMediaId != null &&
                    this.HyperMediaId.Equals(input.HyperMediaId))
                ) && 
                (
                    this.InailOfficeCode == input.InailOfficeCode ||
                    (this.InailOfficeCode != null &&
                    this.InailOfficeCode.Equals(input.InailOfficeCode))
                ) && 
                (
                    this.InpsOfficeCode == input.InpsOfficeCode ||
                    (this.InpsOfficeCode != null &&
                    this.InpsOfficeCode.Equals(input.InpsOfficeCode))
                ) && 
                (
                    this.MunicipalOfficeCode == input.MunicipalOfficeCode ||
                    (this.MunicipalOfficeCode != null &&
                    this.MunicipalOfficeCode.Equals(input.MunicipalOfficeCode))
                ) && 
                (
                    this.NrOfCensusZones == input.NrOfCensusZones ||
                    (this.NrOfCensusZones != null &&
                    this.NrOfCensusZones.Equals(input.NrOfCensusZones))
                ) && 
                (
                    this.PaymentCity == input.PaymentCity ||
                    (this.PaymentCity != null &&
                    this.PaymentCity.Equals(input.PaymentCity))
                ) && 
                (
                    this.PostalAccount == input.PostalAccount ||
                    (this.PostalAccount != null &&
                    this.PostalAccount.Equals(input.PostalAccount))
                ) && 
                (
                    this.Province == input.Province ||
                    (this.Province != null &&
                    this.Province.Equals(input.Province))
                ) && 
                (
                    this.Region == input.Region ||
                    (this.Region != null &&
                    this.Region.Equals(input.Region))
                ) && 
                (
                    this.RegistryOfficeCode == input.RegistryOfficeCode ||
                    (this.RegistryOfficeCode != null &&
                    this.RegistryOfficeCode.Equals(input.RegistryOfficeCode))
                ) && 
                (
                    this.ServiceCenterCode == input.ServiceCenterCode ||
                    (this.ServiceCenterCode != null &&
                    this.ServiceCenterCode.Equals(input.ServiceCenterCode))
                ) && 
                (
                    this.TaxOfficeCode == input.TaxOfficeCode ||
                    (this.TaxOfficeCode != null &&
                    this.TaxOfficeCode.Equals(input.TaxOfficeCode))
                ) && 
                (
                    this.TelephoneNumber == input.TelephoneNumber ||
                    (this.TelephoneNumber != null &&
                    this.TelephoneNumber.Equals(input.TelephoneNumber))
                ) && 
                (
                    this.VatOfficeCode == input.VatOfficeCode ||
                    (this.VatOfficeCode != null &&
                    this.VatOfficeCode.Equals(input.VatOfficeCode))
                ) && 
                (
                    this.ZipCode == input.ZipCode ||
                    (this.ZipCode != null &&
                    this.ZipCode.Equals(input.ZipCode))
                ) && 
                (
                    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.BuildingFundOfficeCode != null)
                    hashCode = hashCode * 59 + this.BuildingFundOfficeCode.GetHashCode();
                if (this.CciaaOfficeCode != null)
                    hashCode = hashCode * 59 + this.CciaaOfficeCode.GetHashCode();
                if (this.Code != null)
                    hashCode = hashCode * 59 + this.Code.GetHashCode();
                if (this.CourtOfficeCode != null)
                    hashCode = hashCode * 59 + this.CourtOfficeCode.GetHashCode();
                if (this.Description != null)
                    hashCode = hashCode * 59 + this.Description.GetHashCode();
                if (this.EnasarcoOfficeCode != null)
                    hashCode = hashCode * 59 + this.EnasarcoOfficeCode.GetHashCode();
                if (this.GrantCode != null)
                    hashCode = hashCode * 59 + this.GrantCode.GetHashCode();
                if (this.HyperMediaId != null)
                    hashCode = hashCode * 59 + this.HyperMediaId.GetHashCode();
                if (this.InailOfficeCode != null)
                    hashCode = hashCode * 59 + this.InailOfficeCode.GetHashCode();
                if (this.InpsOfficeCode != null)
                    hashCode = hashCode * 59 + this.InpsOfficeCode.GetHashCode();
                if (this.MunicipalOfficeCode != null)
                    hashCode = hashCode * 59 + this.MunicipalOfficeCode.GetHashCode();
                if (this.NrOfCensusZones != null)
                    hashCode = hashCode * 59 + this.NrOfCensusZones.GetHashCode();
                if (this.PaymentCity != null)
                    hashCode = hashCode * 59 + this.PaymentCity.GetHashCode();
                if (this.PostalAccount != null)
                    hashCode = hashCode * 59 + this.PostalAccount.GetHashCode();
                if (this.Province != null)
                    hashCode = hashCode * 59 + this.Province.GetHashCode();
                if (this.Region != null)
                    hashCode = hashCode * 59 + this.Region.GetHashCode();
                if (this.RegistryOfficeCode != null)
                    hashCode = hashCode * 59 + this.RegistryOfficeCode.GetHashCode();
                if (this.ServiceCenterCode != null)
                    hashCode = hashCode * 59 + this.ServiceCenterCode.GetHashCode();
                if (this.TaxOfficeCode != null)
                    hashCode = hashCode * 59 + this.TaxOfficeCode.GetHashCode();
                if (this.TelephoneNumber != null)
                    hashCode = hashCode * 59 + this.TelephoneNumber.GetHashCode();
                if (this.VatOfficeCode != null)
                    hashCode = hashCode * 59 + this.VatOfficeCode.GetHashCode();
                if (this.ZipCode != null)
                    hashCode = hashCode * 59 + this.ZipCode.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;
        }
    }
}
