/* 
 * 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>
    /// MG2H_CLIFORBANCHEAZ - Banche aziendali&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 CSCompanyBankCODTO :  IEquatable<CSCompanyBankCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CSCompanyBankCODTO" /> class.
        /// </summary>
        /// <param name="cliforCg44">MG2H_CLIFOR_CG44 - Codice Cliente / Fornitore (required).</param>
        /// <param name="dittaCg18">MG2H_DITTA_CG18 - Ditta (required).</param>
        /// <param name="flgPref">MG2H_FLGPREF - Banca preferenziale (required).</param>
        /// <param name="id">MG2H_ID - ID (Required only in PUT/PATCH).</param>
        /// <param name="progR">MG2H_PROGR - PROGR (required).</param>
        /// <param name="progREf08">MG2H_PROGR_EF08 - Codice banca aziendale (required).</param>
        /// <param name="rowversion">MG2H_ROWVERSION - Rowversion.</param>
        /// <param name="tipocfCg44">MG2H_TIPOCF_CG44 - Tipo cliente fornitore (required).</param>
        /// <param name="companyBankCO">companyBankCO (required).</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CSCompanyBankCODTO(double? cliforCg44 = default(double?), double? dittaCg18 = default(double?), int? flgPref = default(int?), int? id = default(int?), int? progR = default(int?), double? progREf08 = default(double?), byte[] rowversion = default(byte[]), double? tipocfCg44 = default(double?), CompanyBankCODTO companyBankCO = default(CompanyBankCODTO), 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 CSCompanyBankCODTO 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 CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.DittaCg18 = dittaCg18;
            }
            // to ensure "flgPref" is required (not null)
            if (flgPref == null)
            {
                throw new InvalidDataException("flgPref is a required property for CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.FlgPref = flgPref;
            }
            // to ensure "progR" is required (not null)
            if (progR == null)
            {
                throw new InvalidDataException("progR is a required property for CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.ProgR = progR;
            }
            // to ensure "progREf08" is required (not null)
            if (progREf08 == null)
            {
                throw new InvalidDataException("progREf08 is a required property for CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.ProgREf08 = progREf08;
            }
            // to ensure "tipocfCg44" is required (not null)
            if (tipocfCg44 == null)
            {
                throw new InvalidDataException("tipocfCg44 is a required property for CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.TipocfCg44 = tipocfCg44;
            }
            // to ensure "companyBankCO" is required (not null)
            if (companyBankCO == null)
            {
                throw new InvalidDataException("companyBankCO is a required property for CSCompanyBankCODTO and cannot be null");
            }
            else
            {
                this.CompanyBankCO = companyBankCO;
            }
            this.Id = id;
            this.Rowversion = rowversion;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// MG2H_CLIFOR_CG44 - Codice Cliente / Fornitore
        /// </summary>
        /// <value>MG2H_CLIFOR_CG44 - Codice Cliente / Fornitore</value>
        [DataMember(Name="cliforCg44", EmitDefaultValue=false)]
        public double? CliforCg44 { get; set; }

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

        /// <summary>
        /// MG2H_FLGPREF - Banca preferenziale
        /// </summary>
        /// <value>MG2H_FLGPREF - Banca preferenziale</value>
        [DataMember(Name="flgPref", EmitDefaultValue=false)]
        public int? FlgPref { get; set; }

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

        /// <summary>
        /// MG2H_PROGR - PROGR
        /// </summary>
        /// <value>MG2H_PROGR - PROGR</value>
        [DataMember(Name="progR", EmitDefaultValue=false)]
        public int? ProgR { get; set; }

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

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

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

        /// <summary>
        /// Gets or Sets CompanyBankCO
        /// </summary>
        [DataMember(Name="companyBankCO", EmitDefaultValue=false)]
        public CompanyBankCODTO CompanyBankCO { 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 CSCompanyBankCODTO {\n");
            sb.Append("  CliforCg44: ").Append(CliforCg44).Append("\n");
            sb.Append("  DittaCg18: ").Append(DittaCg18).Append("\n");
            sb.Append("  FlgPref: ").Append(FlgPref).Append("\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  ProgR: ").Append(ProgR).Append("\n");
            sb.Append("  ProgREf08: ").Append(ProgREf08).Append("\n");
            sb.Append("  Rowversion: ").Append(Rowversion).Append("\n");
            sb.Append("  TipocfCg44: ").Append(TipocfCg44).Append("\n");
            sb.Append("  CompanyBankCO: ").Append(CompanyBankCO).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 CSCompanyBankCODTO);
        }

        /// <summary>
        /// Returns true if CSCompanyBankCODTO instances are equal
        /// </summary>
        /// <param name="input">Instance of CSCompanyBankCODTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CSCompanyBankCODTO 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.FlgPref == input.FlgPref ||
                    (this.FlgPref != null &&
                    this.FlgPref.Equals(input.FlgPref))
                ) && 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.ProgR == input.ProgR ||
                    (this.ProgR != null &&
                    this.ProgR.Equals(input.ProgR))
                ) && 
                (
                    this.ProgREf08 == input.ProgREf08 ||
                    (this.ProgREf08 != null &&
                    this.ProgREf08.Equals(input.ProgREf08))
                ) && 
                (
                    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.CompanyBankCO == input.CompanyBankCO ||
                    (this.CompanyBankCO != null &&
                    this.CompanyBankCO.Equals(input.CompanyBankCO))
                ) && 
                (
                    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.FlgPref != null)
                    hashCode = hashCode * 59 + this.FlgPref.GetHashCode();
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.ProgR != null)
                    hashCode = hashCode * 59 + this.ProgR.GetHashCode();
                if (this.ProgREf08 != null)
                    hashCode = hashCode * 59 + this.ProgREf08.GetHashCode();
                if (this.Rowversion != null)
                    hashCode = hashCode * 59 + this.Rowversion.GetHashCode();
                if (this.TipocfCg44 != null)
                    hashCode = hashCode * 59 + this.TipocfCg44.GetHashCode();
                if (this.CompanyBankCO != null)
                    hashCode = hashCode * 59 + this.CompanyBankCO.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;
        }
    }
}
