/* 
 * 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>
    /// MG12_SOTTOCAT - Sottocategoria cli/for&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;CategMg11&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;DittaCg18&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;MacrocatMg11&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Sottcat&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;TipocfMg11&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class SubCategoryCODTO :  IEquatable<SubCategoryCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SubCategoryCODTO" /> class.
        /// </summary>
        /// <param name="categMg11">MG12_CATEG_MG11 - Categoria (required).</param>
        /// <param name="descrsottocat">MG12_DESCRSOTTOCAT - Descrizione.</param>
        /// <param name="dittaCg18">MG12_DITTA_CG18 - Ditta (default to 0).</param>
        /// <param name="macrocatMg11">MG12_MACROCAT_MG11 - Macrocategoria (required).</param>
        /// <param name="sottcat">MG12_SOTTCAT - Sottocategoria (required).</param>
        /// <param name="tipocfMg11">MG12_TIPOCF_MG11 - Tipo Cli/For&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; -  Cliente&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; -  Fornitore&lt;/li&gt;&lt;/ul&gt; (default to 0).</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public SubCategoryCODTO(string categMg11 = default(string), string descrsottocat = default(string), double? dittaCg18 = 0, string macrocatMg11 = default(string), string sottcat = default(string), double? tipocfMg11 = 0, Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "categMg11" is required (not null)
            if (categMg11 == null)
            {
                throw new InvalidDataException("categMg11 is a required property for SubCategoryCODTO and cannot be null");
            }
            else
            {
                this.CategMg11 = categMg11;
            }
            // to ensure "macrocatMg11" is required (not null)
            if (macrocatMg11 == null)
            {
                throw new InvalidDataException("macrocatMg11 is a required property for SubCategoryCODTO and cannot be null");
            }
            else
            {
                this.MacrocatMg11 = macrocatMg11;
            }
            // to ensure "sottcat" is required (not null)
            if (sottcat == null)
            {
                throw new InvalidDataException("sottcat is a required property for SubCategoryCODTO and cannot be null");
            }
            else
            {
                this.Sottcat = sottcat;
            }
            this.Descrsottocat = descrsottocat;
            // use default value if no "dittaCg18" provided
            if (dittaCg18 == null)
            {
                this.DittaCg18 = 0;
            }
            else
            {
                this.DittaCg18 = dittaCg18;
            }
            // use default value if no "tipocfMg11" provided
            if (tipocfMg11 == null)
            {
                this.TipocfMg11 = 0;
            }
            else
            {
                this.TipocfMg11 = tipocfMg11;
            }
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// MG12_CATEG_MG11 - Categoria
        /// </summary>
        /// <value>MG12_CATEG_MG11 - Categoria</value>
        [DataMember(Name="categMg11", EmitDefaultValue=false)]
        public string CategMg11 { get; set; }

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

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

        /// <summary>
        /// MG12_MACROCAT_MG11 - Macrocategoria
        /// </summary>
        /// <value>MG12_MACROCAT_MG11 - Macrocategoria</value>
        [DataMember(Name="macrocatMg11", EmitDefaultValue=false)]
        public string MacrocatMg11 { get; set; }

        /// <summary>
        /// MG12_SOTTCAT - Sottocategoria
        /// </summary>
        /// <value>MG12_SOTTCAT - Sottocategoria</value>
        [DataMember(Name="sottcat", EmitDefaultValue=false)]
        public string Sottcat { get; set; }

        /// <summary>
        /// MG12_TIPOCF_MG11 - Tipo Cli/For&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; -  Cliente&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; -  Fornitore&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>MG12_TIPOCF_MG11 - Tipo Cli/For&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; -  Cliente&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; -  Fornitore&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="tipocfMg11", EmitDefaultValue=false)]
        public double? TipocfMg11 { 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 SubCategoryCODTO {\n");
            sb.Append("  CategMg11: ").Append(CategMg11).Append("\n");
            sb.Append("  Descrsottocat: ").Append(Descrsottocat).Append("\n");
            sb.Append("  DittaCg18: ").Append(DittaCg18).Append("\n");
            sb.Append("  MacrocatMg11: ").Append(MacrocatMg11).Append("\n");
            sb.Append("  Sottcat: ").Append(Sottcat).Append("\n");
            sb.Append("  TipocfMg11: ").Append(TipocfMg11).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 SubCategoryCODTO);
        }

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

            return 
                (
                    this.CategMg11 == input.CategMg11 ||
                    (this.CategMg11 != null &&
                    this.CategMg11.Equals(input.CategMg11))
                ) && 
                (
                    this.Descrsottocat == input.Descrsottocat ||
                    (this.Descrsottocat != null &&
                    this.Descrsottocat.Equals(input.Descrsottocat))
                ) && 
                (
                    this.DittaCg18 == input.DittaCg18 ||
                    (this.DittaCg18 != null &&
                    this.DittaCg18.Equals(input.DittaCg18))
                ) && 
                (
                    this.MacrocatMg11 == input.MacrocatMg11 ||
                    (this.MacrocatMg11 != null &&
                    this.MacrocatMg11.Equals(input.MacrocatMg11))
                ) && 
                (
                    this.Sottcat == input.Sottcat ||
                    (this.Sottcat != null &&
                    this.Sottcat.Equals(input.Sottcat))
                ) && 
                (
                    this.TipocfMg11 == input.TipocfMg11 ||
                    (this.TipocfMg11 != null &&
                    this.TipocfMg11.Equals(input.TipocfMg11))
                ) && 
                (
                    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.CategMg11 != null)
                    hashCode = hashCode * 59 + this.CategMg11.GetHashCode();
                if (this.Descrsottocat != null)
                    hashCode = hashCode * 59 + this.Descrsottocat.GetHashCode();
                if (this.DittaCg18 != null)
                    hashCode = hashCode * 59 + this.DittaCg18.GetHashCode();
                if (this.MacrocatMg11 != null)
                    hashCode = hashCode * 59 + this.MacrocatMg11.GetHashCode();
                if (this.Sottcat != null)
                    hashCode = hashCode * 59 + this.Sottcat.GetHashCode();
                if (this.TipocfMg11 != null)
                    hashCode = hashCode * 59 + this.TipocfMg11.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;
        }
    }
}
