/* 
 * 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>
    /// CG08_TABVALUTE - Valuta&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Codice&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class CurrencyCODTO :  IEquatable<CurrencyCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CurrencyCODTO" /> class.
        /// </summary>
        /// <param name="cambiofisso">CG08_CAMBIOFISSO - Cambio fisso.</param>
        /// <param name="codice">CG08_CODICE - Codice (required).</param>
        /// <param name="dataattuem">CG08_DATAATTUEM - Data attuazione valuta UEM.</param>
        /// <param name="descr">CG08_DESCR - Descrizione.</param>
        /// <param name="flgValuem">CG08_FLGVALUEM - Flag valuta UEM.</param>
        /// <param name="idmediaCg99">CG08_IDMEDIA_CG99 - ID HyperMedia.</param>
        /// <param name="indCertoincerto">CG08_INDCERTOINCERTO - Cambio incerto per certo (default to 0).</param>
        /// <param name="indSepmigl">CG08_INDSEPMIGL - Separatore migliaia&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - .&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - ,&lt;/li&gt;&lt;/ul&gt;.</param>
        /// <param name="indValuem">CG08_INDVALUEM - Tipo valuta UEM&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No valuta UEM&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Franco belga&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Marco tedesco&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Peseta spagnola&lt;/li&gt;&lt;li&gt;&lt;i&gt;4&lt;/i&gt; - Franco francese&lt;/li&gt;&lt;li&gt;&lt;i&gt;5&lt;/i&gt; - Sterlina irlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;6&lt;/i&gt; - Lira italiana&lt;/li&gt;&lt;li&gt;&lt;i&gt;7&lt;/i&gt; - Fiorino olandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;8&lt;/i&gt; - Scellino austriaco&lt;/li&gt;&lt;li&gt;&lt;i&gt;9&lt;/i&gt; - Escudo portoghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;10&lt;/i&gt; - Marco finlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;11&lt;/i&gt; - Franco lussemburghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;12&lt;/i&gt; - Dracma greca&lt;/li&gt;&lt;li&gt;&lt;i&gt;13&lt;/i&gt; - Tallero sloveno&lt;/li&gt;&lt;li&gt;&lt;i&gt;14&lt;/i&gt; - Lira cipriota&lt;/li&gt;&lt;li&gt;&lt;i&gt;15&lt;/i&gt; - Lira maltese&lt;/li&gt;&lt;li&gt;&lt;i&gt;16&lt;/i&gt; - Corona slovacca&lt;/li&gt;&lt;li&gt;&lt;i&gt;17&lt;/i&gt; - Corona estone&lt;/li&gt;&lt;li&gt;&lt;i&gt;18&lt;/i&gt; - Lats lettone&lt;/li&gt;&lt;li&gt;&lt;i&gt;19&lt;/i&gt; - Litas lituano&lt;/li&gt;&lt;/ul&gt;.</param>
        /// <param name="numdec">CG08_NUMDEC - Numeri Decimali.</param>
        /// <param name="sigla">CG08_SIGLA - Sigla.</param>
        /// <param name="exchangeRateCO">exchangeRateCO.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public CurrencyCODTO(double? cambiofisso = default(double?), string codice = default(string), DateTime? dataattuem = default(DateTime?), string descr = default(string), double? flgValuem = default(double?), double? idmediaCg99 = default(double?), int? indCertoincerto = 0, double? indSepmigl = default(double?), double? indValuem = default(double?), double? numdec = default(double?), string sigla = default(string), List<ExchangeRateCODTO> exchangeRateCO = default(List<ExchangeRateCODTO>), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "codice" is required (not null)
            if (codice == null)
            {
                throw new InvalidDataException("codice is a required property for CurrencyCODTO and cannot be null");
            }
            else
            {
                this.Codice = codice;
            }
            this.Cambiofisso = cambiofisso;
            this.Dataattuem = dataattuem;
            this.Descr = descr;
            this.FlgValuem = flgValuem;
            this.IdmediaCg99 = idmediaCg99;
            // use default value if no "indCertoincerto" provided
            if (indCertoincerto == null)
            {
                this.IndCertoincerto = 0;
            }
            else
            {
                this.IndCertoincerto = indCertoincerto;
            }
            this.IndSepmigl = indSepmigl;
            this.IndValuem = indValuem;
            this.Numdec = numdec;
            this.Sigla = sigla;
            this.ExchangeRateCO = exchangeRateCO;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CG08_CAMBIOFISSO - Cambio fisso
        /// </summary>
        /// <value>CG08_CAMBIOFISSO - Cambio fisso</value>
        [DataMember(Name="cambiofisso", EmitDefaultValue=false)]
        public double? Cambiofisso { get; set; }

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

        /// <summary>
        /// CG08_DATAATTUEM - Data attuazione valuta UEM
        /// </summary>
        /// <value>CG08_DATAATTUEM - Data attuazione valuta UEM</value>
        [DataMember(Name="dataattuem", EmitDefaultValue=false)]
        public DateTime? Dataattuem { get; set; }

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

        /// <summary>
        /// CG08_FLGVALUEM - Flag valuta UEM
        /// </summary>
        /// <value>CG08_FLGVALUEM - Flag valuta UEM</value>
        [DataMember(Name="flgValuem", EmitDefaultValue=false)]
        public double? FlgValuem { get; set; }

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

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

        /// <summary>
        /// CG08_INDSEPMIGL - Separatore migliaia&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - .&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - ,&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>CG08_INDSEPMIGL - Separatore migliaia&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - .&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - ,&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="indSepmigl", EmitDefaultValue=false)]
        public double? IndSepmigl { get; set; }

        /// <summary>
        /// CG08_INDVALUEM - Tipo valuta UEM&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No valuta UEM&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Franco belga&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Marco tedesco&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Peseta spagnola&lt;/li&gt;&lt;li&gt;&lt;i&gt;4&lt;/i&gt; - Franco francese&lt;/li&gt;&lt;li&gt;&lt;i&gt;5&lt;/i&gt; - Sterlina irlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;6&lt;/i&gt; - Lira italiana&lt;/li&gt;&lt;li&gt;&lt;i&gt;7&lt;/i&gt; - Fiorino olandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;8&lt;/i&gt; - Scellino austriaco&lt;/li&gt;&lt;li&gt;&lt;i&gt;9&lt;/i&gt; - Escudo portoghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;10&lt;/i&gt; - Marco finlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;11&lt;/i&gt; - Franco lussemburghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;12&lt;/i&gt; - Dracma greca&lt;/li&gt;&lt;li&gt;&lt;i&gt;13&lt;/i&gt; - Tallero sloveno&lt;/li&gt;&lt;li&gt;&lt;i&gt;14&lt;/i&gt; - Lira cipriota&lt;/li&gt;&lt;li&gt;&lt;i&gt;15&lt;/i&gt; - Lira maltese&lt;/li&gt;&lt;li&gt;&lt;i&gt;16&lt;/i&gt; - Corona slovacca&lt;/li&gt;&lt;li&gt;&lt;i&gt;17&lt;/i&gt; - Corona estone&lt;/li&gt;&lt;li&gt;&lt;i&gt;18&lt;/i&gt; - Lats lettone&lt;/li&gt;&lt;li&gt;&lt;i&gt;19&lt;/i&gt; - Litas lituano&lt;/li&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>CG08_INDVALUEM - Tipo valuta UEM&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;0&lt;/i&gt; - No valuta UEM&lt;/li&gt;&lt;li&gt;&lt;i&gt;1&lt;/i&gt; - Franco belga&lt;/li&gt;&lt;li&gt;&lt;i&gt;2&lt;/i&gt; - Marco tedesco&lt;/li&gt;&lt;li&gt;&lt;i&gt;3&lt;/i&gt; - Peseta spagnola&lt;/li&gt;&lt;li&gt;&lt;i&gt;4&lt;/i&gt; - Franco francese&lt;/li&gt;&lt;li&gt;&lt;i&gt;5&lt;/i&gt; - Sterlina irlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;6&lt;/i&gt; - Lira italiana&lt;/li&gt;&lt;li&gt;&lt;i&gt;7&lt;/i&gt; - Fiorino olandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;8&lt;/i&gt; - Scellino austriaco&lt;/li&gt;&lt;li&gt;&lt;i&gt;9&lt;/i&gt; - Escudo portoghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;10&lt;/i&gt; - Marco finlandese&lt;/li&gt;&lt;li&gt;&lt;i&gt;11&lt;/i&gt; - Franco lussemburghese&lt;/li&gt;&lt;li&gt;&lt;i&gt;12&lt;/i&gt; - Dracma greca&lt;/li&gt;&lt;li&gt;&lt;i&gt;13&lt;/i&gt; - Tallero sloveno&lt;/li&gt;&lt;li&gt;&lt;i&gt;14&lt;/i&gt; - Lira cipriota&lt;/li&gt;&lt;li&gt;&lt;i&gt;15&lt;/i&gt; - Lira maltese&lt;/li&gt;&lt;li&gt;&lt;i&gt;16&lt;/i&gt; - Corona slovacca&lt;/li&gt;&lt;li&gt;&lt;i&gt;17&lt;/i&gt; - Corona estone&lt;/li&gt;&lt;li&gt;&lt;i&gt;18&lt;/i&gt; - Lats lettone&lt;/li&gt;&lt;li&gt;&lt;i&gt;19&lt;/i&gt; - Litas lituano&lt;/li&gt;&lt;/ul&gt;</value>
        [DataMember(Name="indValuem", EmitDefaultValue=false)]
        public double? IndValuem { get; set; }

        /// <summary>
        /// CG08_NUMDEC - Numeri Decimali
        /// </summary>
        /// <value>CG08_NUMDEC - Numeri Decimali</value>
        [DataMember(Name="numdec", EmitDefaultValue=false)]
        public double? Numdec { get; set; }

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

        /// <summary>
        /// Gets or Sets ExchangeRateCO
        /// </summary>
        [DataMember(Name="exchangeRateCO", EmitDefaultValue=false)]
        public List<ExchangeRateCODTO> ExchangeRateCO { 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 CurrencyCODTO {\n");
            sb.Append("  Cambiofisso: ").Append(Cambiofisso).Append("\n");
            sb.Append("  Codice: ").Append(Codice).Append("\n");
            sb.Append("  Dataattuem: ").Append(Dataattuem).Append("\n");
            sb.Append("  Descr: ").Append(Descr).Append("\n");
            sb.Append("  FlgValuem: ").Append(FlgValuem).Append("\n");
            sb.Append("  IdmediaCg99: ").Append(IdmediaCg99).Append("\n");
            sb.Append("  IndCertoincerto: ").Append(IndCertoincerto).Append("\n");
            sb.Append("  IndSepmigl: ").Append(IndSepmigl).Append("\n");
            sb.Append("  IndValuem: ").Append(IndValuem).Append("\n");
            sb.Append("  Numdec: ").Append(Numdec).Append("\n");
            sb.Append("  Sigla: ").Append(Sigla).Append("\n");
            sb.Append("  ExchangeRateCO: ").Append(ExchangeRateCO).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 CurrencyCODTO);
        }

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

            return 
                (
                    this.Cambiofisso == input.Cambiofisso ||
                    (this.Cambiofisso != null &&
                    this.Cambiofisso.Equals(input.Cambiofisso))
                ) && 
                (
                    this.Codice == input.Codice ||
                    (this.Codice != null &&
                    this.Codice.Equals(input.Codice))
                ) && 
                (
                    this.Dataattuem == input.Dataattuem ||
                    (this.Dataattuem != null &&
                    this.Dataattuem.Equals(input.Dataattuem))
                ) && 
                (
                    this.Descr == input.Descr ||
                    (this.Descr != null &&
                    this.Descr.Equals(input.Descr))
                ) && 
                (
                    this.FlgValuem == input.FlgValuem ||
                    (this.FlgValuem != null &&
                    this.FlgValuem.Equals(input.FlgValuem))
                ) && 
                (
                    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.IndSepmigl == input.IndSepmigl ||
                    (this.IndSepmigl != null &&
                    this.IndSepmigl.Equals(input.IndSepmigl))
                ) && 
                (
                    this.IndValuem == input.IndValuem ||
                    (this.IndValuem != null &&
                    this.IndValuem.Equals(input.IndValuem))
                ) && 
                (
                    this.Numdec == input.Numdec ||
                    (this.Numdec != null &&
                    this.Numdec.Equals(input.Numdec))
                ) && 
                (
                    this.Sigla == input.Sigla ||
                    (this.Sigla != null &&
                    this.Sigla.Equals(input.Sigla))
                ) && 
                (
                    this.ExchangeRateCO == input.ExchangeRateCO ||
                    this.ExchangeRateCO != null &&
                    input.ExchangeRateCO != null &&
                    this.ExchangeRateCO.SequenceEqual(input.ExchangeRateCO)
                ) && 
                (
                    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.Cambiofisso != null)
                    hashCode = hashCode * 59 + this.Cambiofisso.GetHashCode();
                if (this.Codice != null)
                    hashCode = hashCode * 59 + this.Codice.GetHashCode();
                if (this.Dataattuem != null)
                    hashCode = hashCode * 59 + this.Dataattuem.GetHashCode();
                if (this.Descr != null)
                    hashCode = hashCode * 59 + this.Descr.GetHashCode();
                if (this.FlgValuem != null)
                    hashCode = hashCode * 59 + this.FlgValuem.GetHashCode();
                if (this.IdmediaCg99 != null)
                    hashCode = hashCode * 59 + this.IdmediaCg99.GetHashCode();
                if (this.IndCertoincerto != null)
                    hashCode = hashCode * 59 + this.IndCertoincerto.GetHashCode();
                if (this.IndSepmigl != null)
                    hashCode = hashCode * 59 + this.IndSepmigl.GetHashCode();
                if (this.IndValuem != null)
                    hashCode = hashCode * 59 + this.IndValuem.GetHashCode();
                if (this.Numdec != null)
                    hashCode = hashCode * 59 + this.Numdec.GetHashCode();
                if (this.Sigla != null)
                    hashCode = hashCode * 59 + this.Sigla.GetHashCode();
                if (this.ExchangeRateCO != null)
                    hashCode = hashCode * 59 + this.ExchangeRateCO.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;
        }
    }
}
