/* 
 * 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>
    /// CO1I_CFCIGCUP - Anagrafica CIG/CUP&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 CustomerSupplierCIGCUPCODTO :  IEquatable<CustomerSupplierCIGCUPCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomerSupplierCIGCUPCODTO" /> class.
        /// </summary>
        /// <param name="cliforCg44">CO1I_CLIFOR_CG44 - Codice cli/for (required).</param>
        /// <param name="dittaCg18">CO1I_DITTA_CG18 - Ditta (required).</param>
        /// <param name="id">CO1I_ID - ID (Required only in PUT/PATCH).</param>
        /// <param name="idcigcupCo1h">CO1I_IDCIGCUP_CO1H - Ident. Cig/Cup testata (required).</param>
        /// <param name="progREf08">CO1I_PROGR_EF08 - Codice banca aziendale.</param>
        /// <param name="progRMg35">CO1I_PROGR_MG35 - Banca cliente.</param>
        /// <param name="rowversion">CO1I_ROWVERSION - RowVersion.</param>
        /// <param name="tipocfCg44">CO1I_TIPOCF_CG44 - Tipo Cliente / Fornitore (required).</param>
        /// <param name="cigcuPcode">cigcuPcode (required).</param>
        /// <param name="companyBank">companyBank.</param>
        /// <param name="csBankCO">csBankCO.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CustomerSupplierCIGCUPCODTO(double? cliforCg44 = default(double?), double? dittaCg18 = default(double?), int? id = default(int?), int? idcigcupCo1h = default(int?), double? progREf08 = default(double?), int? progRMg35 = default(int?), byte[] rowversion = default(byte[]), double? tipocfCg44 = default(double?), CIGCUPMasterDataCODTO cigcuPcode = default(CIGCUPMasterDataCODTO), CompanyBankCODTO companyBank = default(CompanyBankCODTO), CSBankCODTO csBankCO = default(CSBankCODTO), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "cliforCg44" is required (not null)
            if (cliforCg44 == null)
            {
                throw new InvalidDataException("cliforCg44 is a required property for CustomerSupplierCIGCUPCODTO and cannot be null");
            }
            else
            {
                this.CliforCg44 = cliforCg44;
            }
            // to ensure "dittaCg18" is required (not null)
            if (dittaCg18 == null)
            {
                throw new InvalidDataException("dittaCg18 is a required property for CustomerSupplierCIGCUPCODTO and cannot be null");
            }
            else
            {
                this.DittaCg18 = dittaCg18;
            }
            // to ensure "idcigcupCo1h" is required (not null)
            if (idcigcupCo1h == null)
            {
                throw new InvalidDataException("idcigcupCo1h is a required property for CustomerSupplierCIGCUPCODTO and cannot be null");
            }
            else
            {
                this.IdcigcupCo1h = idcigcupCo1h;
            }
            // to ensure "tipocfCg44" is required (not null)
            if (tipocfCg44 == null)
            {
                throw new InvalidDataException("tipocfCg44 is a required property for CustomerSupplierCIGCUPCODTO and cannot be null");
            }
            else
            {
                this.TipocfCg44 = tipocfCg44;
            }
            // to ensure "cigcuPcode" is required (not null)
            if (cigcuPcode == null)
            {
                throw new InvalidDataException("cigcuPcode is a required property for CustomerSupplierCIGCUPCODTO and cannot be null");
            }
            else
            {
                this.CigcuPcode = cigcuPcode;
            }
            this.Id = id;
            this.ProgREf08 = progREf08;
            this.ProgRMg35 = progRMg35;
            this.Rowversion = rowversion;
            this.CompanyBank = companyBank;
            this.CsBankCO = csBankCO;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CO1I_CLIFOR_CG44 - Codice cli/for
        /// </summary>
        /// <value>CO1I_CLIFOR_CG44 - Codice cli/for</value>
        [DataMember(Name="cliforCg44", EmitDefaultValue=false)]
        public double? CliforCg44 { get; set; }

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

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

        /// <summary>
        /// CO1I_IDCIGCUP_CO1H - Ident. Cig/Cup testata
        /// </summary>
        /// <value>CO1I_IDCIGCUP_CO1H - Ident. Cig/Cup testata</value>
        [DataMember(Name="idcigcupCo1h", EmitDefaultValue=false)]
        public int? IdcigcupCo1h { get; set; }

        /// <summary>
        /// CO1I_PROGR_EF08 - Codice banca aziendale
        /// </summary>
        /// <value>CO1I_PROGR_EF08 - Codice banca aziendale</value>
        [DataMember(Name="progREf08", EmitDefaultValue=false)]
        public double? ProgREf08 { get; set; }

        /// <summary>
        /// CO1I_PROGR_MG35 - Banca cliente
        /// </summary>
        /// <value>CO1I_PROGR_MG35 - Banca cliente</value>
        [DataMember(Name="progRMg35", EmitDefaultValue=false)]
        public int? ProgRMg35 { get; set; }

        /// <summary>
        /// CO1I_ROWVERSION - RowVersion
        /// </summary>
        /// <value>CO1I_ROWVERSION - RowVersion</value>
        [DataMember(Name="rowversion", EmitDefaultValue=false)]
        public byte[] Rowversion { get; set; }

        /// <summary>
        /// CO1I_TIPOCF_CG44 - Tipo Cliente / Fornitore
        /// </summary>
        /// <value>CO1I_TIPOCF_CG44 - Tipo Cliente / Fornitore</value>
        [DataMember(Name="tipocfCg44", EmitDefaultValue=false)]
        public double? TipocfCg44 { get; set; }

        /// <summary>
        /// Gets or Sets CigcuPcode
        /// </summary>
        [DataMember(Name="cigcuPcode", EmitDefaultValue=false)]
        public CIGCUPMasterDataCODTO CigcuPcode { get; set; }

        /// <summary>
        /// Gets or Sets CompanyBank
        /// </summary>
        [DataMember(Name="companyBank", EmitDefaultValue=false)]
        public CompanyBankCODTO CompanyBank { get; set; }

        /// <summary>
        /// Gets or Sets CsBankCO
        /// </summary>
        [DataMember(Name="csBankCO", EmitDefaultValue=false)]
        public CSBankCODTO CsBankCO { 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 CustomerSupplierCIGCUPCODTO {\n");
            sb.Append("  CliforCg44: ").Append(CliforCg44).Append("\n");
            sb.Append("  DittaCg18: ").Append(DittaCg18).Append("\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  IdcigcupCo1h: ").Append(IdcigcupCo1h).Append("\n");
            sb.Append("  ProgREf08: ").Append(ProgREf08).Append("\n");
            sb.Append("  ProgRMg35: ").Append(ProgRMg35).Append("\n");
            sb.Append("  Rowversion: ").Append(Rowversion).Append("\n");
            sb.Append("  TipocfCg44: ").Append(TipocfCg44).Append("\n");
            sb.Append("  CigcuPcode: ").Append(CigcuPcode).Append("\n");
            sb.Append("  CompanyBank: ").Append(CompanyBank).Append("\n");
            sb.Append("  CsBankCO: ").Append(CsBankCO).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 CustomerSupplierCIGCUPCODTO);
        }

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

            return 
                (
                    this.CliforCg44 == input.CliforCg44 ||
                    (this.CliforCg44 != null &&
                    this.CliforCg44.Equals(input.CliforCg44))
                ) && 
                (
                    this.DittaCg18 == input.DittaCg18 ||
                    (this.DittaCg18 != null &&
                    this.DittaCg18.Equals(input.DittaCg18))
                ) && 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.IdcigcupCo1h == input.IdcigcupCo1h ||
                    (this.IdcigcupCo1h != null &&
                    this.IdcigcupCo1h.Equals(input.IdcigcupCo1h))
                ) && 
                (
                    this.ProgREf08 == input.ProgREf08 ||
                    (this.ProgREf08 != null &&
                    this.ProgREf08.Equals(input.ProgREf08))
                ) && 
                (
                    this.ProgRMg35 == input.ProgRMg35 ||
                    (this.ProgRMg35 != null &&
                    this.ProgRMg35.Equals(input.ProgRMg35))
                ) && 
                (
                    this.Rowversion == input.Rowversion ||
                    (this.Rowversion != null &&
                    this.Rowversion.Equals(input.Rowversion))
                ) && 
                (
                    this.TipocfCg44 == input.TipocfCg44 ||
                    (this.TipocfCg44 != null &&
                    this.TipocfCg44.Equals(input.TipocfCg44))
                ) && 
                (
                    this.CigcuPcode == input.CigcuPcode ||
                    (this.CigcuPcode != null &&
                    this.CigcuPcode.Equals(input.CigcuPcode))
                ) && 
                (
                    this.CompanyBank == input.CompanyBank ||
                    (this.CompanyBank != null &&
                    this.CompanyBank.Equals(input.CompanyBank))
                ) && 
                (
                    this.CsBankCO == input.CsBankCO ||
                    (this.CsBankCO != null &&
                    this.CsBankCO.Equals(input.CsBankCO))
                ) && 
                (
                    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.CliforCg44 != null)
                    hashCode = hashCode * 59 + this.CliforCg44.GetHashCode();
                if (this.DittaCg18 != null)
                    hashCode = hashCode * 59 + this.DittaCg18.GetHashCode();
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.IdcigcupCo1h != null)
                    hashCode = hashCode * 59 + this.IdcigcupCo1h.GetHashCode();
                if (this.ProgREf08 != null)
                    hashCode = hashCode * 59 + this.ProgREf08.GetHashCode();
                if (this.ProgRMg35 != null)
                    hashCode = hashCode * 59 + this.ProgRMg35.GetHashCode();
                if (this.Rowversion != null)
                    hashCode = hashCode * 59 + this.Rowversion.GetHashCode();
                if (this.TipocfCg44 != null)
                    hashCode = hashCode * 59 + this.TipocfCg44.GetHashCode();
                if (this.CigcuPcode != null)
                    hashCode = hashCode * 59 + this.CigcuPcode.GetHashCode();
                if (this.CompanyBank != null)
                    hashCode = hashCode * 59 + this.CompanyBank.GetHashCode();
                if (this.CsBankCO != null)
                    hashCode = hashCode * 59 + this.CsBankCO.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;
        }
    }
}
