/* 
 * 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>
    /// CG09_TABCAMBI - ExchangeRateCO&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Anno&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;CodiceCg08&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;CodicerifCg08&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Giorno&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Mese&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class ExchangeRateCODTO :  IEquatable<ExchangeRateCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ExchangeRateCODTO" /> class.
        /// </summary>
        /// <param name="adegcambio">CG09_ADEGCAMBIO -  Cambio UIC Annuale.</param>
        /// <param name="anno">CG09_ANNO - Anno (required).</param>
        /// <param name="cambio">CG09_CAMBIO - Cambio.</param>
        /// <param name="codiceCg08">CG09_CODICE_CG08 - Codice valuta (required).</param>
        /// <param name="codicerifCg08">CG09_CODICERIF_CG08 - CodicerifCg08 (required).</param>
        /// <param name="giorno">CG09_GIORNO - Giorno (required).</param>
        /// <param name="idmediaCg99">CG09_IDMEDIA_CG99 - Hypermedia.</param>
        /// <param name="indCertoincerto">CG09_INDCERTOINCERTO - Cambio incerto per certo (required).</param>
        /// <param name="mese">CG09_MESE - Mese (required).</param>
        /// <param name="rowversion">CG09_ROWVERSION - RowVersion.</param>
        /// <param name="currencyCO">currencyCO (required).</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public ExchangeRateCODTO(double? adegcambio = default(double?), double? anno = default(double?), double? cambio = default(double?), string codiceCg08 = default(string), string codicerifCg08 = default(string), double? giorno = default(double?), double? idmediaCg99 = default(double?), int? indCertoincerto = default(int?), double? mese = default(double?), byte[] rowversion = default(byte[]), CurrencyCODTO currencyCO = default(CurrencyCODTO), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "anno" is required (not null)
            if (anno == null)
            {
                throw new InvalidDataException("anno is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.Anno = anno;
            }
            // to ensure "codiceCg08" is required (not null)
            if (codiceCg08 == null)
            {
                throw new InvalidDataException("codiceCg08 is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.CodiceCg08 = codiceCg08;
            }
            // to ensure "codicerifCg08" is required (not null)
            if (codicerifCg08 == null)
            {
                throw new InvalidDataException("codicerifCg08 is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.CodicerifCg08 = codicerifCg08;
            }
            // to ensure "giorno" is required (not null)
            if (giorno == null)
            {
                throw new InvalidDataException("giorno is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.Giorno = giorno;
            }
            // to ensure "indCertoincerto" is required (not null)
            if (indCertoincerto == null)
            {
                throw new InvalidDataException("indCertoincerto is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.IndCertoincerto = indCertoincerto;
            }
            // to ensure "mese" is required (not null)
            if (mese == null)
            {
                throw new InvalidDataException("mese is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.Mese = mese;
            }
            // to ensure "currencyCO" is required (not null)
            if (currencyCO == null)
            {
                throw new InvalidDataException("currencyCO is a required property for ExchangeRateCODTO and cannot be null");
            }
            else
            {
                this.CurrencyCO = currencyCO;
            }
            this.Adegcambio = adegcambio;
            this.Cambio = cambio;
            this.IdmediaCg99 = idmediaCg99;
            this.Rowversion = rowversion;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CG09_ADEGCAMBIO -  Cambio UIC Annuale
        /// </summary>
        /// <value>CG09_ADEGCAMBIO -  Cambio UIC Annuale</value>
        [DataMember(Name="adegcambio", EmitDefaultValue=false)]
        public double? Adegcambio { get; set; }

        /// <summary>
        /// CG09_ANNO - Anno
        /// </summary>
        /// <value>CG09_ANNO - Anno</value>
        [DataMember(Name="anno", EmitDefaultValue=false)]
        public double? Anno { get; set; }

        /// <summary>
        /// CG09_CAMBIO - Cambio
        /// </summary>
        /// <value>CG09_CAMBIO - Cambio</value>
        [DataMember(Name="cambio", EmitDefaultValue=false)]
        public double? Cambio { get; set; }

        /// <summary>
        /// CG09_CODICE_CG08 - Codice valuta
        /// </summary>
        /// <value>CG09_CODICE_CG08 - Codice valuta</value>
        [DataMember(Name="codiceCg08", EmitDefaultValue=false)]
        public string CodiceCg08 { get; set; }

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

        /// <summary>
        /// CG09_GIORNO - Giorno
        /// </summary>
        /// <value>CG09_GIORNO - Giorno</value>
        [DataMember(Name="giorno", EmitDefaultValue=false)]
        public double? Giorno { get; set; }

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

        /// <summary>
        /// CG09_INDCERTOINCERTO - Cambio incerto per certo
        /// </summary>
        /// <value>CG09_INDCERTOINCERTO - Cambio incerto per certo</value>
        [DataMember(Name="indCertoincerto", EmitDefaultValue=false)]
        public int? IndCertoincerto { get; set; }

        /// <summary>
        /// CG09_MESE - Mese
        /// </summary>
        /// <value>CG09_MESE - Mese</value>
        [DataMember(Name="mese", EmitDefaultValue=false)]
        public double? Mese { get; set; }

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

        /// <summary>
        /// Gets or Sets CurrencyCO
        /// </summary>
        [DataMember(Name="currencyCO", EmitDefaultValue=false)]
        public CurrencyCODTO CurrencyCO { 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 ExchangeRateCODTO {\n");
            sb.Append("  Adegcambio: ").Append(Adegcambio).Append("\n");
            sb.Append("  Anno: ").Append(Anno).Append("\n");
            sb.Append("  Cambio: ").Append(Cambio).Append("\n");
            sb.Append("  CodiceCg08: ").Append(CodiceCg08).Append("\n");
            sb.Append("  CodicerifCg08: ").Append(CodicerifCg08).Append("\n");
            sb.Append("  Giorno: ").Append(Giorno).Append("\n");
            sb.Append("  IdmediaCg99: ").Append(IdmediaCg99).Append("\n");
            sb.Append("  IndCertoincerto: ").Append(IndCertoincerto).Append("\n");
            sb.Append("  Mese: ").Append(Mese).Append("\n");
            sb.Append("  Rowversion: ").Append(Rowversion).Append("\n");
            sb.Append("  CurrencyCO: ").Append(CurrencyCO).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 ExchangeRateCODTO);
        }

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

            return 
                (
                    this.Adegcambio == input.Adegcambio ||
                    (this.Adegcambio != null &&
                    this.Adegcambio.Equals(input.Adegcambio))
                ) && 
                (
                    this.Anno == input.Anno ||
                    (this.Anno != null &&
                    this.Anno.Equals(input.Anno))
                ) && 
                (
                    this.Cambio == input.Cambio ||
                    (this.Cambio != null &&
                    this.Cambio.Equals(input.Cambio))
                ) && 
                (
                    this.CodiceCg08 == input.CodiceCg08 ||
                    (this.CodiceCg08 != null &&
                    this.CodiceCg08.Equals(input.CodiceCg08))
                ) && 
                (
                    this.CodicerifCg08 == input.CodicerifCg08 ||
                    (this.CodicerifCg08 != null &&
                    this.CodicerifCg08.Equals(input.CodicerifCg08))
                ) && 
                (
                    this.Giorno == input.Giorno ||
                    (this.Giorno != null &&
                    this.Giorno.Equals(input.Giorno))
                ) && 
                (
                    this.IdmediaCg99 == input.IdmediaCg99 ||
                    (this.IdmediaCg99 != null &&
                    this.IdmediaCg99.Equals(input.IdmediaCg99))
                ) && 
                (
                    this.IndCertoincerto == input.IndCertoincerto ||
                    (this.IndCertoincerto != null &&
                    this.IndCertoincerto.Equals(input.IndCertoincerto))
                ) && 
                (
                    this.Mese == input.Mese ||
                    (this.Mese != null &&
                    this.Mese.Equals(input.Mese))
                ) && 
                (
                    this.Rowversion == input.Rowversion ||
                    (this.Rowversion != null &&
                    this.Rowversion.Equals(input.Rowversion))
                ) && 
                (
                    this.CurrencyCO == input.CurrencyCO ||
                    (this.CurrencyCO != null &&
                    this.CurrencyCO.Equals(input.CurrencyCO))
                ) && 
                (
                    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.Adegcambio != null)
                    hashCode = hashCode * 59 + this.Adegcambio.GetHashCode();
                if (this.Anno != null)
                    hashCode = hashCode * 59 + this.Anno.GetHashCode();
                if (this.Cambio != null)
                    hashCode = hashCode * 59 + this.Cambio.GetHashCode();
                if (this.CodiceCg08 != null)
                    hashCode = hashCode * 59 + this.CodiceCg08.GetHashCode();
                if (this.CodicerifCg08 != null)
                    hashCode = hashCode * 59 + this.CodicerifCg08.GetHashCode();
                if (this.Giorno != null)
                    hashCode = hashCode * 59 + this.Giorno.GetHashCode();
                if (this.IdmediaCg99 != null)
                    hashCode = hashCode * 59 + this.IdmediaCg99.GetHashCode();
                if (this.IndCertoincerto != null)
                    hashCode = hashCode * 59 + this.IndCertoincerto.GetHashCode();
                if (this.Mese != null)
                    hashCode = hashCode * 59 + this.Mese.GetHashCode();
                if (this.Rowversion != null)
                    hashCode = hashCode * 59 + this.Rowversion.GetHashCode();
                if (this.CurrencyCO != null)
                    hashCode = hashCode * 59 + this.CurrencyCO.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;
        }
    }
}
