/* 
 * 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>
    /// TaxLineItem &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoTaxLineItem :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoTaxLineItem>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTaxLineItem" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoTaxLineItem() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTaxLineItem" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="taxIncludedInPricesFlag">A flag denoting that all applicable taxes are included in the prices for this line item, and that therefore this SaleReturnTaxLineItem is merely a summary of those taxes, .</param>
        /// <param name="taxAtSourceFlag">A flag denoting that the goods being sold and shipped have been taxed according to the TaxAuthorityShippingRule. .</param>
        /// <param name="taxablePercent">The percentage of the taxable amount that is liable for tax. Usually this is 100% but where an aggregate item contains taxed and non-taxed goods this value may be less than 100%. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!.</param>
        /// <param name="taxableAmount">The monetary value of the transaction for which tax is being calculated.  (required).</param>
        /// <param name="taxPercent">The percentage of the taxable amount that should is tax. Derived by applying the appropriate TaxGroupRule and TaxRateRule. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!.</param>
        /// <param name="taxAmount">The monetary amount of sales Tax calculated by applying the appropriate TaxGroupRule and TaxRateRule. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="taxGroupRuleID">System assigned unique identifier for the TaxGroupRule..</param>
        /// <param name="taxAuthorityID">A specific TAX AUTHORITY that establishes the tax rate. The TAX AUTHORITY is normally a government body. .</param>
        /// <param name="taxAuthorityName">The name of the tax authority. This is to be printed on the receipt in some cases .</param>
        /// <param name="taxGroupID">A tax group which links a TAX AUTHORITY to the merchandise to which the tax applies. .</param>
        /// <param name="receiptPrintCode">A short code that is printed on a receipt to denote items that are in this TaxableGroup..</param>
        /// <param name="xxcustom05">Customizable information.</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 ComGkSoftwareGkrApiTxpoolDtoTaxLineItem(ComGkSoftwareGkrApiTxpoolDtoTaxLineItemKey key = default(ComGkSoftwareGkrApiTxpoolDtoTaxLineItemKey), bool? taxIncludedInPricesFlag = default(bool?), bool? taxAtSourceFlag = default(bool?), double? taxablePercent = default(double?), double? taxableAmount = default(double?), double? taxPercent = default(double?), double? taxAmount = default(double?), string taxGroupRuleID = default(string), string taxAuthorityID = default(string), string taxAuthorityName = default(string), string taxGroupID = default(string), string receiptPrintCode = default(string), string xxcustom05 = 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 ComGkSoftwareGkrApiTxpoolDtoTaxLineItem and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "taxableAmount" is required (not null)
            if (taxableAmount == null)
            {
                throw new InvalidDataException("taxableAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoTaxLineItem and cannot be null");
            }
            else
            {
                this.TaxableAmount = taxableAmount;
            }
            this.TaxIncludedInPricesFlag = taxIncludedInPricesFlag;
            this.TaxAtSourceFlag = taxAtSourceFlag;
            this.TaxablePercent = taxablePercent;
            this.TaxPercent = taxPercent;
            this.TaxAmount = taxAmount;
            this.TaxGroupRuleID = taxGroupRuleID;
            this.TaxAuthorityID = taxAuthorityID;
            this.TaxAuthorityName = taxAuthorityName;
            this.TaxGroupID = taxGroupID;
            this.ReceiptPrintCode = receiptPrintCode;
            this.Xxcustom05 = xxcustom05;
            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 ComGkSoftwareGkrApiTxpoolDtoTaxLineItemKey Key { get; set; }

        /// <summary>
        /// A flag denoting that all applicable taxes are included in the prices for this line item, and that therefore this SaleReturnTaxLineItem is merely a summary of those taxes, 
        /// </summary>
        /// <value>A flag denoting that all applicable taxes are included in the prices for this line item, and that therefore this SaleReturnTaxLineItem is merely a summary of those taxes, </value>
        [DataMember(Name="taxIncludedInPricesFlag", EmitDefaultValue=false)]
        public bool? TaxIncludedInPricesFlag { get; set; }

        /// <summary>
        /// A flag denoting that the goods being sold and shipped have been taxed according to the TaxAuthorityShippingRule. 
        /// </summary>
        /// <value>A flag denoting that the goods being sold and shipped have been taxed according to the TaxAuthorityShippingRule. </value>
        [DataMember(Name="taxAtSourceFlag", EmitDefaultValue=false)]
        public bool? TaxAtSourceFlag { get; set; }

        /// <summary>
        /// The percentage of the taxable amount that is liable for tax. Usually this is 100% but where an aggregate item contains taxed and non-taxed goods this value may be less than 100%. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!
        /// </summary>
        /// <value>The percentage of the taxable amount that is liable for tax. Usually this is 100% but where an aggregate item contains taxed and non-taxed goods this value may be less than 100%. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!</value>
        [DataMember(Name="taxablePercent", EmitDefaultValue=false)]
        public double? TaxablePercent { get; set; }

        /// <summary>
        /// The monetary value of the transaction for which tax is being calculated. 
        /// </summary>
        /// <value>The monetary value of the transaction for which tax is being calculated. </value>
        [DataMember(Name="taxableAmount", EmitDefaultValue=false)]
        public double? TaxableAmount { get; set; }

        /// <summary>
        /// The percentage of the taxable amount that should is tax. Derived by applying the appropriate TaxGroupRule and TaxRateRule. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!
        /// </summary>
        /// <value>The percentage of the taxable amount that should is tax. Derived by applying the appropriate TaxGroupRule and TaxRateRule. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!</value>
        [DataMember(Name="taxPercent", EmitDefaultValue=false)]
        public double? TaxPercent { get; set; }

        /// <summary>
        /// The monetary amount of sales Tax calculated by applying the appropriate TaxGroupRule and TaxRateRule. &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 amount of sales Tax calculated by applying the appropriate TaxGroupRule and TaxRateRule. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="taxAmount", EmitDefaultValue=false)]
        public double? TaxAmount { get; set; }

        /// <summary>
        /// System assigned unique identifier for the TaxGroupRule.
        /// </summary>
        /// <value>System assigned unique identifier for the TaxGroupRule.</value>
        [DataMember(Name="taxGroupRuleID", EmitDefaultValue=false)]
        public string TaxGroupRuleID { get; set; }

        /// <summary>
        /// A specific TAX AUTHORITY that establishes the tax rate. The TAX AUTHORITY is normally a government body. 
        /// </summary>
        /// <value>A specific TAX AUTHORITY that establishes the tax rate. The TAX AUTHORITY is normally a government body. </value>
        [DataMember(Name="taxAuthorityID", EmitDefaultValue=false)]
        public string TaxAuthorityID { get; set; }

        /// <summary>
        /// The name of the tax authority. This is to be printed on the receipt in some cases 
        /// </summary>
        /// <value>The name of the tax authority. This is to be printed on the receipt in some cases </value>
        [DataMember(Name="taxAuthorityName", EmitDefaultValue=false)]
        public string TaxAuthorityName { get; set; }

        /// <summary>
        /// A tax group which links a TAX AUTHORITY to the merchandise to which the tax applies. 
        /// </summary>
        /// <value>A tax group which links a TAX AUTHORITY to the merchandise to which the tax applies. </value>
        [DataMember(Name="taxGroupID", EmitDefaultValue=false)]
        public string TaxGroupID { get; set; }

        /// <summary>
        /// A short code that is printed on a receipt to denote items that are in this TaxableGroup.
        /// </summary>
        /// <value>A short code that is printed on a receipt to denote items that are in this TaxableGroup.</value>
        [DataMember(Name="receiptPrintCode", EmitDefaultValue=false)]
        public string ReceiptPrintCode { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom05", EmitDefaultValue=false)]
        public string Xxcustom05 { 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 ComGkSoftwareGkrApiTxpoolDtoTaxLineItem {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  TaxIncludedInPricesFlag: ").Append(TaxIncludedInPricesFlag).Append("\n");
            sb.Append("  TaxAtSourceFlag: ").Append(TaxAtSourceFlag).Append("\n");
            sb.Append("  TaxablePercent: ").Append(TaxablePercent).Append("\n");
            sb.Append("  TaxableAmount: ").Append(TaxableAmount).Append("\n");
            sb.Append("  TaxPercent: ").Append(TaxPercent).Append("\n");
            sb.Append("  TaxAmount: ").Append(TaxAmount).Append("\n");
            sb.Append("  TaxGroupRuleID: ").Append(TaxGroupRuleID).Append("\n");
            sb.Append("  TaxAuthorityID: ").Append(TaxAuthorityID).Append("\n");
            sb.Append("  TaxAuthorityName: ").Append(TaxAuthorityName).Append("\n");
            sb.Append("  TaxGroupID: ").Append(TaxGroupID).Append("\n");
            sb.Append("  ReceiptPrintCode: ").Append(ReceiptPrintCode).Append("\n");
            sb.Append("  Xxcustom05: ").Append(Xxcustom05).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 ComGkSoftwareGkrApiTxpoolDtoTaxLineItem);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.TaxIncludedInPricesFlag == input.TaxIncludedInPricesFlag ||
                    (this.TaxIncludedInPricesFlag != null &&
                    this.TaxIncludedInPricesFlag.Equals(input.TaxIncludedInPricesFlag))
                ) && 
                (
                    this.TaxAtSourceFlag == input.TaxAtSourceFlag ||
                    (this.TaxAtSourceFlag != null &&
                    this.TaxAtSourceFlag.Equals(input.TaxAtSourceFlag))
                ) && 
                (
                    this.TaxablePercent == input.TaxablePercent ||
                    (this.TaxablePercent != null &&
                    this.TaxablePercent.Equals(input.TaxablePercent))
                ) && 
                (
                    this.TaxableAmount == input.TaxableAmount ||
                    (this.TaxableAmount != null &&
                    this.TaxableAmount.Equals(input.TaxableAmount))
                ) && 
                (
                    this.TaxPercent == input.TaxPercent ||
                    (this.TaxPercent != null &&
                    this.TaxPercent.Equals(input.TaxPercent))
                ) && 
                (
                    this.TaxAmount == input.TaxAmount ||
                    (this.TaxAmount != null &&
                    this.TaxAmount.Equals(input.TaxAmount))
                ) && 
                (
                    this.TaxGroupRuleID == input.TaxGroupRuleID ||
                    (this.TaxGroupRuleID != null &&
                    this.TaxGroupRuleID.Equals(input.TaxGroupRuleID))
                ) && 
                (
                    this.TaxAuthorityID == input.TaxAuthorityID ||
                    (this.TaxAuthorityID != null &&
                    this.TaxAuthorityID.Equals(input.TaxAuthorityID))
                ) && 
                (
                    this.TaxAuthorityName == input.TaxAuthorityName ||
                    (this.TaxAuthorityName != null &&
                    this.TaxAuthorityName.Equals(input.TaxAuthorityName))
                ) && 
                (
                    this.TaxGroupID == input.TaxGroupID ||
                    (this.TaxGroupID != null &&
                    this.TaxGroupID.Equals(input.TaxGroupID))
                ) && 
                (
                    this.ReceiptPrintCode == input.ReceiptPrintCode ||
                    (this.ReceiptPrintCode != null &&
                    this.ReceiptPrintCode.Equals(input.ReceiptPrintCode))
                ) && 
                (
                    this.Xxcustom05 == input.Xxcustom05 ||
                    (this.Xxcustom05 != null &&
                    this.Xxcustom05.Equals(input.Xxcustom05))
                ) && 
                (
                    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.TaxIncludedInPricesFlag != null)
                    hashCode = hashCode * 59 + this.TaxIncludedInPricesFlag.GetHashCode();
                if (this.TaxAtSourceFlag != null)
                    hashCode = hashCode * 59 + this.TaxAtSourceFlag.GetHashCode();
                if (this.TaxablePercent != null)
                    hashCode = hashCode * 59 + this.TaxablePercent.GetHashCode();
                if (this.TaxableAmount != null)
                    hashCode = hashCode * 59 + this.TaxableAmount.GetHashCode();
                if (this.TaxPercent != null)
                    hashCode = hashCode * 59 + this.TaxPercent.GetHashCode();
                if (this.TaxAmount != null)
                    hashCode = hashCode * 59 + this.TaxAmount.GetHashCode();
                if (this.TaxGroupRuleID != null)
                    hashCode = hashCode * 59 + this.TaxGroupRuleID.GetHashCode();
                if (this.TaxAuthorityID != null)
                    hashCode = hashCode * 59 + this.TaxAuthorityID.GetHashCode();
                if (this.TaxAuthorityName != null)
                    hashCode = hashCode * 59 + this.TaxAuthorityName.GetHashCode();
                if (this.TaxGroupID != null)
                    hashCode = hashCode * 59 + this.TaxGroupID.GetHashCode();
                if (this.ReceiptPrintCode != null)
                    hashCode = hashCode * 59 + this.ReceiptPrintCode.GetHashCode();
                if (this.Xxcustom05 != null)
                    hashCode = hashCode * 59 + this.Xxcustom05.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;
        }
    }

}
