/* 
 * 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>
    /// Oggetto contenente i parametri necessari per il calcolo. Se non viene passato il cambio verrà preso da CG09_TABCAMBI
    /// </summary>
    [DataContract]
        public partial class CalculateAmountParametersDTO :  IEquatable<CalculateAmountParametersDTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CalculateAmountParametersDTO" /> class.
        /// </summary>
        /// <param name="fromCurrencyCode">fromCurrencyCode.</param>
        /// <param name="toCurrencyCode">toCurrencyCode.</param>
        /// <param name="date">date.</param>
        /// <param name="amount">amount.</param>
        /// <param name="currencyExchange">currencyExchange.</param>
        /// <param name="toCurrencyIsCompanyCurrency">toCurrencyIsCompanyCurrency.</param>
        public CalculateAmountParametersDTO(string fromCurrencyCode = default(string), string toCurrencyCode = default(string), DateTime? date = default(DateTime?), double? amount = default(double?), double? currencyExchange = default(double?), bool? toCurrencyIsCompanyCurrency = default(bool?))
        {
            this.FromCurrencyCode = fromCurrencyCode;
            this.ToCurrencyCode = toCurrencyCode;
            this.Date = date;
            this.Amount = amount;
            this.CurrencyExchange = currencyExchange;
            this.ToCurrencyIsCompanyCurrency = toCurrencyIsCompanyCurrency;
        }
        
        /// <summary>
        /// Gets or Sets FromCurrencyCode
        /// </summary>
        [DataMember(Name="fromCurrencyCode", EmitDefaultValue=false)]
        public string FromCurrencyCode { get; set; }

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

        /// <summary>
        /// Gets or Sets Date
        /// </summary>
        [DataMember(Name="date", EmitDefaultValue=false)]
        public DateTime? Date { get; set; }

        /// <summary>
        /// Gets or Sets Amount
        /// </summary>
        [DataMember(Name="amount", EmitDefaultValue=false)]
        public double? Amount { get; set; }

        /// <summary>
        /// Gets or Sets CurrencyExchange
        /// </summary>
        [DataMember(Name="currencyExchange", EmitDefaultValue=false)]
        public double? CurrencyExchange { get; set; }

        /// <summary>
        /// Gets or Sets ToCurrencyIsCompanyCurrency
        /// </summary>
        [DataMember(Name="toCurrencyIsCompanyCurrency", EmitDefaultValue=false)]
        public bool? ToCurrencyIsCompanyCurrency { 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 CalculateAmountParametersDTO {\n");
            sb.Append("  FromCurrencyCode: ").Append(FromCurrencyCode).Append("\n");
            sb.Append("  ToCurrencyCode: ").Append(ToCurrencyCode).Append("\n");
            sb.Append("  Date: ").Append(Date).Append("\n");
            sb.Append("  Amount: ").Append(Amount).Append("\n");
            sb.Append("  CurrencyExchange: ").Append(CurrencyExchange).Append("\n");
            sb.Append("  ToCurrencyIsCompanyCurrency: ").Append(ToCurrencyIsCompanyCurrency).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 CalculateAmountParametersDTO);
        }

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

            return 
                (
                    this.FromCurrencyCode == input.FromCurrencyCode ||
                    (this.FromCurrencyCode != null &&
                    this.FromCurrencyCode.Equals(input.FromCurrencyCode))
                ) && 
                (
                    this.ToCurrencyCode == input.ToCurrencyCode ||
                    (this.ToCurrencyCode != null &&
                    this.ToCurrencyCode.Equals(input.ToCurrencyCode))
                ) && 
                (
                    this.Date == input.Date ||
                    (this.Date != null &&
                    this.Date.Equals(input.Date))
                ) && 
                (
                    this.Amount == input.Amount ||
                    (this.Amount != null &&
                    this.Amount.Equals(input.Amount))
                ) && 
                (
                    this.CurrencyExchange == input.CurrencyExchange ||
                    (this.CurrencyExchange != null &&
                    this.CurrencyExchange.Equals(input.CurrencyExchange))
                ) && 
                (
                    this.ToCurrencyIsCompanyCurrency == input.ToCurrencyIsCompanyCurrency ||
                    (this.ToCurrencyIsCompanyCurrency != null &&
                    this.ToCurrencyIsCompanyCurrency.Equals(input.ToCurrencyIsCompanyCurrency))
                );
        }

        /// <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.FromCurrencyCode != null)
                    hashCode = hashCode * 59 + this.FromCurrencyCode.GetHashCode();
                if (this.ToCurrencyCode != null)
                    hashCode = hashCode * 59 + this.ToCurrencyCode.GetHashCode();
                if (this.Date != null)
                    hashCode = hashCode * 59 + this.Date.GetHashCode();
                if (this.Amount != null)
                    hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.CurrencyExchange != null)
                    hashCode = hashCode * 59 + this.CurrencyExchange.GetHashCode();
                if (this.ToCurrencyIsCompanyCurrency != null)
                    hashCode = hashCode * 59 + this.ToCurrencyIsCompanyCurrency.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;
        }
    }
}
