/* 
 * 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>
    /// CO1H_CIGCUP - CIGCUPMasterDataCO&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Id&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class CIGCUPMasterDataCODTO :  IEquatable<CIGCUPMasterDataCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CIGCUPMasterDataCODTO" /> class.
        /// </summary>
        /// <param name="cig">CO1H_CIG - Cig (required).</param>
        /// <param name="cup">CO1H_CUP - Cup.</param>
        /// <param name="descrizione">CO1H_DESCRIZIONE - Descrizione.</param>
        /// <param name="docrifData">CO1H_DOCRIF_DATA - DocrifData.</param>
        /// <param name="docrifId">CO1H_DOCRIF_ID - DocrifId.</param>
        /// <param name="flgAttivo">CO1H_FLGATTIVO - FlgAttivo&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Si&lt;/li&gt;&lt;/ul&gt; (default to 0).</param>
        /// <param name="id">CO1H_ID - ID (Required only in PUT/PATCH).</param>
        /// <param name="indTipocontr">CO1H_INDTIPOCONTR - IndTipocontr&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Appalto&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Subappalto&lt;/li&gt;&lt;/ul&gt; (default to 0).</param>
        /// <param name="indTipodocrif">CO1H_INDTIPODOCRIF - IndTipodocrif (required).</param>
        /// <param name="rowversion">CO1H_ROWVERSION - Rowversion.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CIGCUPMasterDataCODTO(string cig = default(string), string cup = default(string), string descrizione = default(string), DateTime? docrifData = default(DateTime?), string docrifId = default(string), double? flgAttivo = 0, int? id = default(int?), int? indTipocontr = 0, int? indTipodocrif = default(int?), byte[] rowversion = default(byte[]), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "cig" is required (not null)
            if (cig == null)
            {
                throw new InvalidDataException("cig is a required property for CIGCUPMasterDataCODTO and cannot be null");
            }
            else
            {
                this.Cig = cig;
            }
            // to ensure "indTipodocrif" is required (not null)
            if (indTipodocrif == null)
            {
                throw new InvalidDataException("indTipodocrif is a required property for CIGCUPMasterDataCODTO and cannot be null");
            }
            else
            {
                this.IndTipodocrif = indTipodocrif;
            }
            this.Cup = cup;
            this.Descrizione = descrizione;
            this.DocrifData = docrifData;
            this.DocrifId = docrifId;
            // use default value if no "flgAttivo" provided
            if (flgAttivo == null)
            {
                this.FlgAttivo = 0;
            }
            else
            {
                this.FlgAttivo = flgAttivo;
            }
            this.Id = id;
            // use default value if no "indTipocontr" provided
            if (indTipocontr == null)
            {
                this.IndTipocontr = 0;
            }
            else
            {
                this.IndTipocontr = indTipocontr;
            }
            this.Rowversion = rowversion;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CO1H_CIG - Cig
        /// </summary>
        /// <value>CO1H_CIG - Cig</value>
        [DataMember(Name="cig", EmitDefaultValue=false)]
        public string Cig { get; set; }

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

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

        /// <summary>
        /// CO1H_DOCRIF_DATA - DocrifData
        /// </summary>
        /// <value>CO1H_DOCRIF_DATA - DocrifData</value>
        [DataMember(Name="docrifData", EmitDefaultValue=false)]
        public DateTime? DocrifData { get; set; }

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

        /// <summary>
        /// CO1H_FLGATTIVO - FlgAttivo&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Si&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>CO1H_FLGATTIVO - FlgAttivo&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Si&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="flgAttivo", EmitDefaultValue=false)]
        public double? FlgAttivo { get; set; }

        /// <summary>
        /// CO1H_ID - ID (Required only in PUT/PATCH)
        /// </summary>
        /// <value>CO1H_ID - ID (Required only in PUT/PATCH)</value>
        [DataMember(Name="id", EmitDefaultValue=false)]
        public int? Id { get; set; }

        /// <summary>
        /// CO1H_INDTIPOCONTR - IndTipocontr&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Appalto&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Subappalto&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>CO1H_INDTIPOCONTR - IndTipocontr&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - Appalto&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Subappalto&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="indTipocontr", EmitDefaultValue=false)]
        public int? IndTipocontr { get; set; }

        /// <summary>
        /// CO1H_INDTIPODOCRIF - IndTipodocrif
        /// </summary>
        /// <value>CO1H_INDTIPODOCRIF - IndTipodocrif</value>
        [DataMember(Name="indTipodocrif", EmitDefaultValue=false)]
        public int? IndTipodocrif { get; set; }

        /// <summary>
        /// CO1H_ROWVERSION - Rowversion
        /// </summary>
        /// <value>CO1H_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 CIGCUPMasterDataCODTO {\n");
            sb.Append("  Cig: ").Append(Cig).Append("\n");
            sb.Append("  Cup: ").Append(Cup).Append("\n");
            sb.Append("  Descrizione: ").Append(Descrizione).Append("\n");
            sb.Append("  DocrifData: ").Append(DocrifData).Append("\n");
            sb.Append("  DocrifId: ").Append(DocrifId).Append("\n");
            sb.Append("  FlgAttivo: ").Append(FlgAttivo).Append("\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  IndTipocontr: ").Append(IndTipocontr).Append("\n");
            sb.Append("  IndTipodocrif: ").Append(IndTipodocrif).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 CIGCUPMasterDataCODTO);
        }

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

            return 
                (
                    this.Cig == input.Cig ||
                    (this.Cig != null &&
                    this.Cig.Equals(input.Cig))
                ) && 
                (
                    this.Cup == input.Cup ||
                    (this.Cup != null &&
                    this.Cup.Equals(input.Cup))
                ) && 
                (
                    this.Descrizione == input.Descrizione ||
                    (this.Descrizione != null &&
                    this.Descrizione.Equals(input.Descrizione))
                ) && 
                (
                    this.DocrifData == input.DocrifData ||
                    (this.DocrifData != null &&
                    this.DocrifData.Equals(input.DocrifData))
                ) && 
                (
                    this.DocrifId == input.DocrifId ||
                    (this.DocrifId != null &&
                    this.DocrifId.Equals(input.DocrifId))
                ) && 
                (
                    this.FlgAttivo == input.FlgAttivo ||
                    (this.FlgAttivo != null &&
                    this.FlgAttivo.Equals(input.FlgAttivo))
                ) && 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.IndTipocontr == input.IndTipocontr ||
                    (this.IndTipocontr != null &&
                    this.IndTipocontr.Equals(input.IndTipocontr))
                ) && 
                (
                    this.IndTipodocrif == input.IndTipodocrif ||
                    (this.IndTipodocrif != null &&
                    this.IndTipodocrif.Equals(input.IndTipodocrif))
                ) && 
                (
                    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.Cig != null)
                    hashCode = hashCode * 59 + this.Cig.GetHashCode();
                if (this.Cup != null)
                    hashCode = hashCode * 59 + this.Cup.GetHashCode();
                if (this.Descrizione != null)
                    hashCode = hashCode * 59 + this.Descrizione.GetHashCode();
                if (this.DocrifData != null)
                    hashCode = hashCode * 59 + this.DocrifData.GetHashCode();
                if (this.DocrifId != null)
                    hashCode = hashCode * 59 + this.DocrifId.GetHashCode();
                if (this.FlgAttivo != null)
                    hashCode = hashCode * 59 + this.FlgAttivo.GetHashCode();
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.IndTipocontr != null)
                    hashCode = hashCode * 59 + this.IndTipocontr.GetHashCode();
                if (this.IndTipodocrif != null)
                    hashCode = hashCode * 59 + this.IndTipodocrif.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;
        }
    }
}
