/* 
 * 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>
    /// CG31_ANADITTASEDI - Sedi azienda&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Codice&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;DittaCg18&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class OfficeCODTO :  IEquatable<OfficeCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="OfficeCODTO" /> class.
        /// </summary>
        /// <param name="cap">CG31_CAP - Cap.</param>
        /// <param name="citta">CG31_CITTA - Citta.</param>
        /// <param name="codice">CG31_CODICE - Sede (required).</param>
        /// <param name="dittaCg18">CG31_DITTA_CG18 - Ditta (default to 0).</param>
        /// <param name="idmediaCg99">CG31_IDMEDIA_CG99 - ID HyperMedia.</param>
        /// <param name="indDimcentrocomm">CG31_INDDIMCENTROCOMM - Dimensione centro commerciale&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Non centro commerciale&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Grande&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Media&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Piccola&lt;/li&gt;&lt;/ul&gt; (default to 0).</param>
        /// <param name="indIrizzo">CG31_INDIRIZZO - Indirizzo.</param>
        /// <param name="numerorea">CG31_NUMEROREA - Numero REA.</param>
        /// <param name="progRea">CG31_PROGREA -  Progressivo REA.</param>
        /// <param name="prov">CG31_PROV - Provincia.</param>
        /// <param name="rowversion">CG31_ROWVERSION - RowVersion.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public OfficeCODTO(string cap = default(string), string citta = default(string), double? codice = default(double?), double? dittaCg18 = 0, double? idmediaCg99 = default(double?), double? indDimcentrocomm = 0, string indIrizzo = default(string), string numerorea = default(string), double? progRea = default(double?), string prov = default(string), byte[] rowversion = default(byte[]), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "codice" is required (not null)
            if (codice == null)
            {
                throw new InvalidDataException("codice is a required property for OfficeCODTO and cannot be null");
            }
            else
            {
                this.Codice = codice;
            }
            this.Cap = cap;
            this.Citta = citta;
            // use default value if no "dittaCg18" provided
            if (dittaCg18 == null)
            {
                this.DittaCg18 = 0;
            }
            else
            {
                this.DittaCg18 = dittaCg18;
            }
            this.IdmediaCg99 = idmediaCg99;
            // use default value if no "indDimcentrocomm" provided
            if (indDimcentrocomm == null)
            {
                this.IndDimcentrocomm = 0;
            }
            else
            {
                this.IndDimcentrocomm = indDimcentrocomm;
            }
            this.IndIrizzo = indIrizzo;
            this.Numerorea = numerorea;
            this.ProgRea = progRea;
            this.Prov = prov;
            this.Rowversion = rowversion;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CG31_CAP - Cap
        /// </summary>
        /// <value>CG31_CAP - Cap</value>
        [DataMember(Name="cap", EmitDefaultValue=false)]
        public string Cap { get; set; }

        /// <summary>
        /// CG31_CITTA - Citta
        /// </summary>
        /// <value>CG31_CITTA - Citta</value>
        [DataMember(Name="citta", EmitDefaultValue=false)]
        public string Citta { get; set; }

        /// <summary>
        /// CG31_CODICE - Sede
        /// </summary>
        /// <value>CG31_CODICE - Sede</value>
        [DataMember(Name="codice", EmitDefaultValue=false)]
        public double? Codice { get; set; }

        /// <summary>
        /// CG31_DITTA_CG18 - Ditta
        /// </summary>
        /// <value>CG31_DITTA_CG18 - Ditta</value>
        [DataMember(Name="dittaCg18", EmitDefaultValue=false)]
        public double? DittaCg18 { get; set; }

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

        /// <summary>
        /// CG31_INDDIMCENTROCOMM - Dimensione centro commerciale&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Non centro commerciale&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Grande&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Media&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Piccola&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>CG31_INDDIMCENTROCOMM - Dimensione centro commerciale&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Non centro commerciale&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Grande&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Media&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Piccola&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="indDimcentrocomm", EmitDefaultValue=false)]
        public double? IndDimcentrocomm { get; set; }

        /// <summary>
        /// CG31_INDIRIZZO - Indirizzo
        /// </summary>
        /// <value>CG31_INDIRIZZO - Indirizzo</value>
        [DataMember(Name="indIrizzo", EmitDefaultValue=false)]
        public string IndIrizzo { get; set; }

        /// <summary>
        /// CG31_NUMEROREA - Numero REA
        /// </summary>
        /// <value>CG31_NUMEROREA - Numero REA</value>
        [DataMember(Name="numerorea", EmitDefaultValue=false)]
        public string Numerorea { get; set; }

        /// <summary>
        /// CG31_PROGREA -  Progressivo REA
        /// </summary>
        /// <value>CG31_PROGREA -  Progressivo REA</value>
        [DataMember(Name="progRea", EmitDefaultValue=false)]
        public double? ProgRea { get; set; }

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

        /// <summary>
        /// CG31_ROWVERSION - RowVersion
        /// </summary>
        /// <value>CG31_ROWVERSION - RowVersion</value>
        [DataMember(Name="rowversion", EmitDefaultValue=false)]
        public byte[] Rowversion { 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 OfficeCODTO {\n");
            sb.Append("  Cap: ").Append(Cap).Append("\n");
            sb.Append("  Citta: ").Append(Citta).Append("\n");
            sb.Append("  Codice: ").Append(Codice).Append("\n");
            sb.Append("  DittaCg18: ").Append(DittaCg18).Append("\n");
            sb.Append("  IdmediaCg99: ").Append(IdmediaCg99).Append("\n");
            sb.Append("  IndDimcentrocomm: ").Append(IndDimcentrocomm).Append("\n");
            sb.Append("  IndIrizzo: ").Append(IndIrizzo).Append("\n");
            sb.Append("  Numerorea: ").Append(Numerorea).Append("\n");
            sb.Append("  ProgRea: ").Append(ProgRea).Append("\n");
            sb.Append("  Prov: ").Append(Prov).Append("\n");
            sb.Append("  Rowversion: ").Append(Rowversion).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 OfficeCODTO);
        }

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

            return 
                (
                    this.Cap == input.Cap ||
                    (this.Cap != null &&
                    this.Cap.Equals(input.Cap))
                ) && 
                (
                    this.Citta == input.Citta ||
                    (this.Citta != null &&
                    this.Citta.Equals(input.Citta))
                ) && 
                (
                    this.Codice == input.Codice ||
                    (this.Codice != null &&
                    this.Codice.Equals(input.Codice))
                ) && 
                (
                    this.DittaCg18 == input.DittaCg18 ||
                    (this.DittaCg18 != null &&
                    this.DittaCg18.Equals(input.DittaCg18))
                ) && 
                (
                    this.IdmediaCg99 == input.IdmediaCg99 ||
                    (this.IdmediaCg99 != null &&
                    this.IdmediaCg99.Equals(input.IdmediaCg99))
                ) && 
                (
                    this.IndDimcentrocomm == input.IndDimcentrocomm ||
                    (this.IndDimcentrocomm != null &&
                    this.IndDimcentrocomm.Equals(input.IndDimcentrocomm))
                ) && 
                (
                    this.IndIrizzo == input.IndIrizzo ||
                    (this.IndIrizzo != null &&
                    this.IndIrizzo.Equals(input.IndIrizzo))
                ) && 
                (
                    this.Numerorea == input.Numerorea ||
                    (this.Numerorea != null &&
                    this.Numerorea.Equals(input.Numerorea))
                ) && 
                (
                    this.ProgRea == input.ProgRea ||
                    (this.ProgRea != null &&
                    this.ProgRea.Equals(input.ProgRea))
                ) && 
                (
                    this.Prov == input.Prov ||
                    (this.Prov != null &&
                    this.Prov.Equals(input.Prov))
                ) && 
                (
                    this.Rowversion == input.Rowversion ||
                    (this.Rowversion != null &&
                    this.Rowversion.Equals(input.Rowversion))
                ) && 
                (
                    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.Cap != null)
                    hashCode = hashCode * 59 + this.Cap.GetHashCode();
                if (this.Citta != null)
                    hashCode = hashCode * 59 + this.Citta.GetHashCode();
                if (this.Codice != null)
                    hashCode = hashCode * 59 + this.Codice.GetHashCode();
                if (this.DittaCg18 != null)
                    hashCode = hashCode * 59 + this.DittaCg18.GetHashCode();
                if (this.IdmediaCg99 != null)
                    hashCode = hashCode * 59 + this.IdmediaCg99.GetHashCode();
                if (this.IndDimcentrocomm != null)
                    hashCode = hashCode * 59 + this.IndDimcentrocomm.GetHashCode();
                if (this.IndIrizzo != null)
                    hashCode = hashCode * 59 + this.IndIrizzo.GetHashCode();
                if (this.Numerorea != null)
                    hashCode = hashCode * 59 + this.Numerorea.GetHashCode();
                if (this.ProgRea != null)
                    hashCode = hashCode * 59 + this.ProgRea.GetHashCode();
                if (this.Prov != null)
                    hashCode = hashCode * 59 + this.Prov.GetHashCode();
                if (this.Rowversion != null)
                    hashCode = hashCode * 59 + this.Rowversion.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;
        }
    }
}
