/* 
 * 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>
    /// MG20_CLIFORSCPAG - Scaglioni di pagamento&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 CSPaymentRangeCODTO :  IEquatable<CSPaymentRangeCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CSPaymentRangeCODTO" /> class.
        /// </summary>
        /// <param name="aimpdoc">MG20_AIMPDOC - Limite superiore.</param>
        /// <param name="cliforCg44">MG20_CLIFOR_CG44 - Codice Cliente / Fornitore (required).</param>
        /// <param name="codPagCg62">MG20_CODPAG_CG62 - Condizione pagamento.</param>
        /// <param name="codScagl">MG20_CODSCAGL - Scaglione (required).</param>
        /// <param name="dittaCg18">MG20_DITTA_CG18 - Ditta (required).</param>
        /// <param name="id">MG20_ID - ID (Required only in PUT/PATCH).</param>
        /// <param name="idCg62">MG20_ID_CG62 - IdCg62.</param>
        /// <param name="idmediaCg99">MG20_IDMEDIA_CG99 - ID HyperMedia.</param>
        /// <param name="indPagpart">MG20_INDPAGPART - Applica condizione di pagamento&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - del documento&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - dello scaglione&lt;/li&gt;&lt;/ul&gt;.</param>
        /// <param name="tipocfCg44">MG20_TIPOCF_CG44 - Tipo Cliente / Fornitore (required).</param>
        /// <param name="valutaCg08">MG20_VALUTA_CG08 - Valuta (required).</param>
        /// <param name="currencyCO">currencyCO (required).</param>
        /// <param name="paymentTermCO">paymentTermCO.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CSPaymentRangeCODTO(double? aimpdoc = default(double?), double? cliforCg44 = default(double?), string codPagCg62 = default(string), double? codScagl = default(double?), double? dittaCg18 = default(double?), long? id = default(long?), long? idCg62 = default(long?), double? idmediaCg99 = default(double?), double? indPagpart = default(double?), double? tipocfCg44 = default(double?), string valutaCg08 = default(string), CurrencyCODTO currencyCO = default(CurrencyCODTO), PaymentTermCODTO paymentTermCO = default(PaymentTermCODTO), 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 CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.CliforCg44 = cliforCg44;
            }
            // to ensure "codScagl" is required (not null)
            if (codScagl == null)
            {
                throw new InvalidDataException("codScagl is a required property for CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.CodScagl = codScagl;
            }
            // to ensure "dittaCg18" is required (not null)
            if (dittaCg18 == null)
            {
                throw new InvalidDataException("dittaCg18 is a required property for CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.DittaCg18 = dittaCg18;
            }
            // to ensure "tipocfCg44" is required (not null)
            if (tipocfCg44 == null)
            {
                throw new InvalidDataException("tipocfCg44 is a required property for CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.TipocfCg44 = tipocfCg44;
            }
            // to ensure "valutaCg08" is required (not null)
            if (valutaCg08 == null)
            {
                throw new InvalidDataException("valutaCg08 is a required property for CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.ValutaCg08 = valutaCg08;
            }
            // to ensure "currencyCO" is required (not null)
            if (currencyCO == null)
            {
                throw new InvalidDataException("currencyCO is a required property for CSPaymentRangeCODTO and cannot be null");
            }
            else
            {
                this.CurrencyCO = currencyCO;
            }
            this.Aimpdoc = aimpdoc;
            this.CodPagCg62 = codPagCg62;
            this.Id = id;
            this.IdCg62 = idCg62;
            this.IdmediaCg99 = idmediaCg99;
            this.IndPagpart = indPagpart;
            this.PaymentTermCO = paymentTermCO;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// MG20_AIMPDOC - Limite superiore
        /// </summary>
        /// <value>MG20_AIMPDOC - Limite superiore</value>
        [DataMember(Name="aimpdoc", EmitDefaultValue=false)]
        public double? Aimpdoc { get; set; }

        /// <summary>
        /// MG20_CLIFOR_CG44 - Codice Cliente / Fornitore
        /// </summary>
        /// <value>MG20_CLIFOR_CG44 - Codice Cliente / Fornitore</value>
        [DataMember(Name="cliforCg44", EmitDefaultValue=false)]
        public double? CliforCg44 { get; set; }

        /// <summary>
        /// MG20_CODPAG_CG62 - Condizione pagamento
        /// </summary>
        /// <value>MG20_CODPAG_CG62 - Condizione pagamento</value>
        [DataMember(Name="codPagCg62", EmitDefaultValue=false)]
        public string CodPagCg62 { get; set; }

        /// <summary>
        /// MG20_CODSCAGL - Scaglione
        /// </summary>
        /// <value>MG20_CODSCAGL - Scaglione</value>
        [DataMember(Name="codScagl", EmitDefaultValue=false)]
        public double? CodScagl { get; set; }

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

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

        /// <summary>
        /// MG20_ID_CG62 - IdCg62
        /// </summary>
        /// <value>MG20_ID_CG62 - IdCg62</value>
        [DataMember(Name="idCg62", EmitDefaultValue=false)]
        public long? IdCg62 { get; set; }

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

        /// <summary>
        /// MG20_INDPAGPART - Applica condizione di pagamento&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - del documento&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - dello scaglione&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>MG20_INDPAGPART - Applica condizione di pagamento&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - del documento&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - dello scaglione&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="indPagpart", EmitDefaultValue=false)]
        public double? IndPagpart { get; set; }

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

        /// <summary>
        /// MG20_VALUTA_CG08 - Valuta
        /// </summary>
        /// <value>MG20_VALUTA_CG08 - Valuta</value>
        [DataMember(Name="valutaCg08", EmitDefaultValue=false)]
        public string ValutaCg08 { get; set; }

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

        /// <summary>
        /// Gets or Sets PaymentTermCO
        /// </summary>
        [DataMember(Name="paymentTermCO", EmitDefaultValue=false)]
        public PaymentTermCODTO PaymentTermCO { 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 CSPaymentRangeCODTO {\n");
            sb.Append("  Aimpdoc: ").Append(Aimpdoc).Append("\n");
            sb.Append("  CliforCg44: ").Append(CliforCg44).Append("\n");
            sb.Append("  CodPagCg62: ").Append(CodPagCg62).Append("\n");
            sb.Append("  CodScagl: ").Append(CodScagl).Append("\n");
            sb.Append("  DittaCg18: ").Append(DittaCg18).Append("\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  IdCg62: ").Append(IdCg62).Append("\n");
            sb.Append("  IdmediaCg99: ").Append(IdmediaCg99).Append("\n");
            sb.Append("  IndPagpart: ").Append(IndPagpart).Append("\n");
            sb.Append("  TipocfCg44: ").Append(TipocfCg44).Append("\n");
            sb.Append("  ValutaCg08: ").Append(ValutaCg08).Append("\n");
            sb.Append("  CurrencyCO: ").Append(CurrencyCO).Append("\n");
            sb.Append("  PaymentTermCO: ").Append(PaymentTermCO).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 CSPaymentRangeCODTO);
        }

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

            return 
                (
                    this.Aimpdoc == input.Aimpdoc ||
                    (this.Aimpdoc != null &&
                    this.Aimpdoc.Equals(input.Aimpdoc))
                ) && 
                (
                    this.CliforCg44 == input.CliforCg44 ||
                    (this.CliforCg44 != null &&
                    this.CliforCg44.Equals(input.CliforCg44))
                ) && 
                (
                    this.CodPagCg62 == input.CodPagCg62 ||
                    (this.CodPagCg62 != null &&
                    this.CodPagCg62.Equals(input.CodPagCg62))
                ) && 
                (
                    this.CodScagl == input.CodScagl ||
                    (this.CodScagl != null &&
                    this.CodScagl.Equals(input.CodScagl))
                ) && 
                (
                    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.IdCg62 == input.IdCg62 ||
                    (this.IdCg62 != null &&
                    this.IdCg62.Equals(input.IdCg62))
                ) && 
                (
                    this.IdmediaCg99 == input.IdmediaCg99 ||
                    (this.IdmediaCg99 != null &&
                    this.IdmediaCg99.Equals(input.IdmediaCg99))
                ) && 
                (
                    this.IndPagpart == input.IndPagpart ||
                    (this.IndPagpart != null &&
                    this.IndPagpart.Equals(input.IndPagpart))
                ) && 
                (
                    this.TipocfCg44 == input.TipocfCg44 ||
                    (this.TipocfCg44 != null &&
                    this.TipocfCg44.Equals(input.TipocfCg44))
                ) && 
                (
                    this.ValutaCg08 == input.ValutaCg08 ||
                    (this.ValutaCg08 != null &&
                    this.ValutaCg08.Equals(input.ValutaCg08))
                ) && 
                (
                    this.CurrencyCO == input.CurrencyCO ||
                    (this.CurrencyCO != null &&
                    this.CurrencyCO.Equals(input.CurrencyCO))
                ) && 
                (
                    this.PaymentTermCO == input.PaymentTermCO ||
                    (this.PaymentTermCO != null &&
                    this.PaymentTermCO.Equals(input.PaymentTermCO))
                ) && 
                (
                    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.Aimpdoc != null)
                    hashCode = hashCode * 59 + this.Aimpdoc.GetHashCode();
                if (this.CliforCg44 != null)
                    hashCode = hashCode * 59 + this.CliforCg44.GetHashCode();
                if (this.CodPagCg62 != null)
                    hashCode = hashCode * 59 + this.CodPagCg62.GetHashCode();
                if (this.CodScagl != null)
                    hashCode = hashCode * 59 + this.CodScagl.GetHashCode();
                if (this.DittaCg18 != null)
                    hashCode = hashCode * 59 + this.DittaCg18.GetHashCode();
                if (this.Id != null)
                    hashCode = hashCode * 59 + this.Id.GetHashCode();
                if (this.IdCg62 != null)
                    hashCode = hashCode * 59 + this.IdCg62.GetHashCode();
                if (this.IdmediaCg99 != null)
                    hashCode = hashCode * 59 + this.IdmediaCg99.GetHashCode();
                if (this.IndPagpart != null)
                    hashCode = hashCode * 59 + this.IndPagpart.GetHashCode();
                if (this.TipocfCg44 != null)
                    hashCode = hashCode * 59 + this.TipocfCg44.GetHashCode();
                if (this.ValutaCg08 != null)
                    hashCode = hashCode * 59 + this.ValutaCg08.GetHashCode();
                if (this.CurrencyCO != null)
                    hashCode = hashCode * 59 + this.CurrencyCO.GetHashCode();
                if (this.PaymentTermCO != null)
                    hashCode = hashCode * 59 + this.PaymentTermCO.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;
        }
    }
}
