/* 
 * GK application - OmniPOS Service API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 5.21.1-b03
 * 
 * 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>
    /// TenderControlTransactionTenderLineItem &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="foreignCurrencyAmount">The monetary value (in currency being moved) of the Tender being moved by the transaction. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="amount">The monetary value (in the default system currency) of the Tender being moved by the transaction.  (required).</param>
        /// <param name="count">The number of tender units being moved. (required).</param>
        /// <param name="tenderControlTransactionTenderLineItemDenominationList">list of denominations.</param>
        /// <param name="currencySymbol">Currency symbol.</param>
        /// <param name="tenderDescription">Description of the tender.</param>
        /// <param name="unitCountRequiredFlag">A flag to signify that specific tender type units need to be counted and recorded by the operator prior to a pickup.  (required).</param>
        /// <param name="amountCountRequiredFlag">A flag to signify that a specific tender type amount needs to be counted and recorded by the operator prior to a pickup.  (required).</param>
        /// <param name="tenderClassCode">The tender class code from master data.</param>
        /// <param name="exchangeRate">The quantitative conversion factor between foreign currency and local currency. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(14, 9). Be aware of this and round value!.</param>
        /// <param name="exchangeRateMultiplyFlag">Determines whether inside the calculation foreign currency -&gt; local currency the amount is to be multiplied with (true) or divided by (false) the ExchangeRate factor (required).</param>
        /// <param name="xxcustom05">Customizable information.</param>
        /// <param name="isocurrencyCode">Currency code of the tender.</param>
        /// <param name="xxcustom03">Customizable information.</param>
        /// <param name="xxcustom02">Customizable information.</param>
        /// <param name="xxcustom04">Customizable information.</param>
        /// <param name="xxcustom01">Customizable information.</param>
        public ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem(ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemKey key = default(ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemKey), double? foreignCurrencyAmount = default(double?), double? amount = default(double?), int? count = default(int?), List<ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemDenomination> tenderControlTransactionTenderLineItemDenominationList = default(List<ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemDenomination>), string currencySymbol = default(string), string tenderDescription = default(string), bool? unitCountRequiredFlag = default(bool?), bool? amountCountRequiredFlag = default(bool?), string tenderClassCode = default(string), double? exchangeRate = default(double?), bool? exchangeRateMultiplyFlag = default(bool?), string xxcustom05 = default(string), string isocurrencyCode = default(string), string xxcustom03 = default(string), string xxcustom02 = default(string), string xxcustom04 = default(string), string xxcustom01 = default(string))
        {
            // to ensure "key" is required (not null)
            if (key == null)
            {
                throw new InvalidDataException("key is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "amount" is required (not null)
            if (amount == null)
            {
                throw new InvalidDataException("amount is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.Amount = amount;
            }
            // to ensure "count" is required (not null)
            if (count == null)
            {
                throw new InvalidDataException("count is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.Count = count;
            }
            // to ensure "unitCountRequiredFlag" is required (not null)
            if (unitCountRequiredFlag == null)
            {
                throw new InvalidDataException("unitCountRequiredFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.UnitCountRequiredFlag = unitCountRequiredFlag;
            }
            // to ensure "amountCountRequiredFlag" is required (not null)
            if (amountCountRequiredFlag == null)
            {
                throw new InvalidDataException("amountCountRequiredFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.AmountCountRequiredFlag = amountCountRequiredFlag;
            }
            // to ensure "exchangeRateMultiplyFlag" is required (not null)
            if (exchangeRateMultiplyFlag == null)
            {
                throw new InvalidDataException("exchangeRateMultiplyFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem and cannot be null");
            }
            else
            {
                this.ExchangeRateMultiplyFlag = exchangeRateMultiplyFlag;
            }
            this.ForeignCurrencyAmount = foreignCurrencyAmount;
            this.TenderControlTransactionTenderLineItemDenominationList = tenderControlTransactionTenderLineItemDenominationList;
            this.CurrencySymbol = currencySymbol;
            this.TenderDescription = tenderDescription;
            this.TenderClassCode = tenderClassCode;
            this.ExchangeRate = exchangeRate;
            this.Xxcustom05 = xxcustom05;
            this.IsocurrencyCode = isocurrencyCode;
            this.Xxcustom03 = xxcustom03;
            this.Xxcustom02 = xxcustom02;
            this.Xxcustom04 = xxcustom04;
            this.Xxcustom01 = xxcustom01;
        }
        
        /// <summary>
        /// &lt;p&gt;Getter for inner key class.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Getter for inner key class.&lt;/p&gt;</value>
        [DataMember(Name="key", EmitDefaultValue=false)]
        public ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemKey Key { get; set; }

        /// <summary>
        /// The monetary value (in currency being moved) of the Tender being moved by the transaction. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The monetary value (in currency being moved) of the Tender being moved by the transaction. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="foreignCurrencyAmount", EmitDefaultValue=false)]
        public double? ForeignCurrencyAmount { get; set; }

        /// <summary>
        /// The monetary value (in the default system currency) of the Tender being moved by the transaction. 
        /// </summary>
        /// <value>The monetary value (in the default system currency) of the Tender being moved by the transaction. </value>
        [DataMember(Name="amount", EmitDefaultValue=false)]
        public double? Amount { get; set; }

        /// <summary>
        /// The number of tender units being moved.
        /// </summary>
        /// <value>The number of tender units being moved.</value>
        [DataMember(Name="count", EmitDefaultValue=false)]
        public int? Count { get; set; }

        /// <summary>
        /// list of denominations
        /// </summary>
        /// <value>list of denominations</value>
        [DataMember(Name="tenderControlTransactionTenderLineItemDenominationList", EmitDefaultValue=false)]
        public List<ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItemDenomination> TenderControlTransactionTenderLineItemDenominationList { get; set; }

        /// <summary>
        /// Currency symbol
        /// </summary>
        /// <value>Currency symbol</value>
        [DataMember(Name="currencySymbol", EmitDefaultValue=false)]
        public string CurrencySymbol { get; set; }

        /// <summary>
        /// Description of the tender
        /// </summary>
        /// <value>Description of the tender</value>
        [DataMember(Name="tenderDescription", EmitDefaultValue=false)]
        public string TenderDescription { get; set; }

        /// <summary>
        /// A flag to signify that specific tender type units need to be counted and recorded by the operator prior to a pickup. 
        /// </summary>
        /// <value>A flag to signify that specific tender type units need to be counted and recorded by the operator prior to a pickup. </value>
        [DataMember(Name="unitCountRequiredFlag", EmitDefaultValue=false)]
        public bool? UnitCountRequiredFlag { get; set; }

        /// <summary>
        /// A flag to signify that a specific tender type amount needs to be counted and recorded by the operator prior to a pickup. 
        /// </summary>
        /// <value>A flag to signify that a specific tender type amount needs to be counted and recorded by the operator prior to a pickup. </value>
        [DataMember(Name="amountCountRequiredFlag", EmitDefaultValue=false)]
        public bool? AmountCountRequiredFlag { get; set; }

        /// <summary>
        /// The tender class code from master data
        /// </summary>
        /// <value>The tender class code from master data</value>
        [DataMember(Name="tenderClassCode", EmitDefaultValue=false)]
        public string TenderClassCode { get; set; }

        /// <summary>
        /// The quantitative conversion factor between foreign currency and local currency. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(14, 9). Be aware of this and round value!
        /// </summary>
        /// <value>The quantitative conversion factor between foreign currency and local currency. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(14, 9). Be aware of this and round value!</value>
        [DataMember(Name="exchangeRate", EmitDefaultValue=false)]
        public double? ExchangeRate { get; set; }

        /// <summary>
        /// Determines whether inside the calculation foreign currency -&gt; local currency the amount is to be multiplied with (true) or divided by (false) the ExchangeRate factor
        /// </summary>
        /// <value>Determines whether inside the calculation foreign currency -&gt; local currency the amount is to be multiplied with (true) or divided by (false) the ExchangeRate factor</value>
        [DataMember(Name="exchangeRateMultiplyFlag", EmitDefaultValue=false)]
        public bool? ExchangeRateMultiplyFlag { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom05", EmitDefaultValue=false)]
        public string Xxcustom05 { get; set; }

        /// <summary>
        /// Currency code of the tender
        /// </summary>
        /// <value>Currency code of the tender</value>
        [DataMember(Name="isocurrencyCode", EmitDefaultValue=false)]
        public string IsocurrencyCode { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom03", EmitDefaultValue=false)]
        public string Xxcustom03 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom02", EmitDefaultValue=false)]
        public string Xxcustom02 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom04", EmitDefaultValue=false)]
        public string Xxcustom04 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom01", EmitDefaultValue=false)]
        public string Xxcustom01 { 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 ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  ForeignCurrencyAmount: ").Append(ForeignCurrencyAmount).Append("\n");
            sb.Append("  Amount: ").Append(Amount).Append("\n");
            sb.Append("  Count: ").Append(Count).Append("\n");
            sb.Append("  TenderControlTransactionTenderLineItemDenominationList: ").Append(TenderControlTransactionTenderLineItemDenominationList).Append("\n");
            sb.Append("  CurrencySymbol: ").Append(CurrencySymbol).Append("\n");
            sb.Append("  TenderDescription: ").Append(TenderDescription).Append("\n");
            sb.Append("  UnitCountRequiredFlag: ").Append(UnitCountRequiredFlag).Append("\n");
            sb.Append("  AmountCountRequiredFlag: ").Append(AmountCountRequiredFlag).Append("\n");
            sb.Append("  TenderClassCode: ").Append(TenderClassCode).Append("\n");
            sb.Append("  ExchangeRate: ").Append(ExchangeRate).Append("\n");
            sb.Append("  ExchangeRateMultiplyFlag: ").Append(ExchangeRateMultiplyFlag).Append("\n");
            sb.Append("  Xxcustom05: ").Append(Xxcustom05).Append("\n");
            sb.Append("  IsocurrencyCode: ").Append(IsocurrencyCode).Append("\n");
            sb.Append("  Xxcustom03: ").Append(Xxcustom03).Append("\n");
            sb.Append("  Xxcustom02: ").Append(Xxcustom02).Append("\n");
            sb.Append("  Xxcustom04: ").Append(Xxcustom04).Append("\n");
            sb.Append("  Xxcustom01: ").Append(Xxcustom01).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 ComGkSoftwareGkrApiTxpoolDtoTenderControlTransactionTenderLineItem);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.ForeignCurrencyAmount == input.ForeignCurrencyAmount ||
                    (this.ForeignCurrencyAmount != null &&
                    this.ForeignCurrencyAmount.Equals(input.ForeignCurrencyAmount))
                ) && 
                (
                    this.Amount == input.Amount ||
                    (this.Amount != null &&
                    this.Amount.Equals(input.Amount))
                ) && 
                (
                    this.Count == input.Count ||
                    (this.Count != null &&
                    this.Count.Equals(input.Count))
                ) && 
                (
                    this.TenderControlTransactionTenderLineItemDenominationList == input.TenderControlTransactionTenderLineItemDenominationList ||
                    this.TenderControlTransactionTenderLineItemDenominationList != null &&
                    this.TenderControlTransactionTenderLineItemDenominationList.SequenceEqual(input.TenderControlTransactionTenderLineItemDenominationList)
                ) && 
                (
                    this.CurrencySymbol == input.CurrencySymbol ||
                    (this.CurrencySymbol != null &&
                    this.CurrencySymbol.Equals(input.CurrencySymbol))
                ) && 
                (
                    this.TenderDescription == input.TenderDescription ||
                    (this.TenderDescription != null &&
                    this.TenderDescription.Equals(input.TenderDescription))
                ) && 
                (
                    this.UnitCountRequiredFlag == input.UnitCountRequiredFlag ||
                    (this.UnitCountRequiredFlag != null &&
                    this.UnitCountRequiredFlag.Equals(input.UnitCountRequiredFlag))
                ) && 
                (
                    this.AmountCountRequiredFlag == input.AmountCountRequiredFlag ||
                    (this.AmountCountRequiredFlag != null &&
                    this.AmountCountRequiredFlag.Equals(input.AmountCountRequiredFlag))
                ) && 
                (
                    this.TenderClassCode == input.TenderClassCode ||
                    (this.TenderClassCode != null &&
                    this.TenderClassCode.Equals(input.TenderClassCode))
                ) && 
                (
                    this.ExchangeRate == input.ExchangeRate ||
                    (this.ExchangeRate != null &&
                    this.ExchangeRate.Equals(input.ExchangeRate))
                ) && 
                (
                    this.ExchangeRateMultiplyFlag == input.ExchangeRateMultiplyFlag ||
                    (this.ExchangeRateMultiplyFlag != null &&
                    this.ExchangeRateMultiplyFlag.Equals(input.ExchangeRateMultiplyFlag))
                ) && 
                (
                    this.Xxcustom05 == input.Xxcustom05 ||
                    (this.Xxcustom05 != null &&
                    this.Xxcustom05.Equals(input.Xxcustom05))
                ) && 
                (
                    this.IsocurrencyCode == input.IsocurrencyCode ||
                    (this.IsocurrencyCode != null &&
                    this.IsocurrencyCode.Equals(input.IsocurrencyCode))
                ) && 
                (
                    this.Xxcustom03 == input.Xxcustom03 ||
                    (this.Xxcustom03 != null &&
                    this.Xxcustom03.Equals(input.Xxcustom03))
                ) && 
                (
                    this.Xxcustom02 == input.Xxcustom02 ||
                    (this.Xxcustom02 != null &&
                    this.Xxcustom02.Equals(input.Xxcustom02))
                ) && 
                (
                    this.Xxcustom04 == input.Xxcustom04 ||
                    (this.Xxcustom04 != null &&
                    this.Xxcustom04.Equals(input.Xxcustom04))
                ) && 
                (
                    this.Xxcustom01 == input.Xxcustom01 ||
                    (this.Xxcustom01 != null &&
                    this.Xxcustom01.Equals(input.Xxcustom01))
                );
        }

        /// <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.Key != null)
                    hashCode = hashCode * 59 + this.Key.GetHashCode();
                if (this.ForeignCurrencyAmount != null)
                    hashCode = hashCode * 59 + this.ForeignCurrencyAmount.GetHashCode();
                if (this.Amount != null)
                    hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.Count != null)
                    hashCode = hashCode * 59 + this.Count.GetHashCode();
                if (this.TenderControlTransactionTenderLineItemDenominationList != null)
                    hashCode = hashCode * 59 + this.TenderControlTransactionTenderLineItemDenominationList.GetHashCode();
                if (this.CurrencySymbol != null)
                    hashCode = hashCode * 59 + this.CurrencySymbol.GetHashCode();
                if (this.TenderDescription != null)
                    hashCode = hashCode * 59 + this.TenderDescription.GetHashCode();
                if (this.UnitCountRequiredFlag != null)
                    hashCode = hashCode * 59 + this.UnitCountRequiredFlag.GetHashCode();
                if (this.AmountCountRequiredFlag != null)
                    hashCode = hashCode * 59 + this.AmountCountRequiredFlag.GetHashCode();
                if (this.TenderClassCode != null)
                    hashCode = hashCode * 59 + this.TenderClassCode.GetHashCode();
                if (this.ExchangeRate != null)
                    hashCode = hashCode * 59 + this.ExchangeRate.GetHashCode();
                if (this.ExchangeRateMultiplyFlag != null)
                    hashCode = hashCode * 59 + this.ExchangeRateMultiplyFlag.GetHashCode();
                if (this.Xxcustom05 != null)
                    hashCode = hashCode * 59 + this.Xxcustom05.GetHashCode();
                if (this.IsocurrencyCode != null)
                    hashCode = hashCode * 59 + this.IsocurrencyCode.GetHashCode();
                if (this.Xxcustom03 != null)
                    hashCode = hashCode * 59 + this.Xxcustom03.GetHashCode();
                if (this.Xxcustom02 != null)
                    hashCode = hashCode * 59 + this.Xxcustom02.GetHashCode();
                if (this.Xxcustom04 != null)
                    hashCode = hashCode * 59 + this.Xxcustom04.GetHashCode();
                if (this.Xxcustom01 != null)
                    hashCode = hashCode * 59 + this.Xxcustom01.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;
        }
    }

}
