/* 
 * 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>
    /// SaleReturnTaxOverrideModifier &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="taxGroupRuleID">System assigned unique identifier for the TaxGroupRule.  (required).</param>
        /// <param name="taxableAmount">The monetary amount for which tax is applicable at the new rate. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="originalTaxAmount">The original amount of Tax that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="newTaxAmount">The new amount of Tax that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="originalTaxPercent">The original tax rate that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!.</param>
        /// <param name="newTaxPercent">The new tax rate that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!.</param>
        /// <param name="reasonCode">A retailer assigned reason code denoting why this TaxOverride is being granted.  .</param>
        /// <param name="reasonDescription">A narrative description describing the use of the retailer assigned tax override reason code.</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 ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier(ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifierKey key = default(ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifierKey), string taxGroupRuleID = default(string), double? taxableAmount = default(double?), double? originalTaxAmount = default(double?), double? newTaxAmount = default(double?), double? originalTaxPercent = default(double?), double? newTaxPercent = default(double?), string reasonCode = default(string), string reasonDescription = 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 ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "taxGroupRuleID" is required (not null)
            if (taxGroupRuleID == null)
            {
                throw new InvalidDataException("taxGroupRuleID is a required property for ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier and cannot be null");
            }
            else
            {
                this.TaxGroupRuleID = taxGroupRuleID;
            }
            this.TaxableAmount = taxableAmount;
            this.OriginalTaxAmount = originalTaxAmount;
            this.NewTaxAmount = newTaxAmount;
            this.OriginalTaxPercent = originalTaxPercent;
            this.NewTaxPercent = newTaxPercent;
            this.ReasonCode = reasonCode;
            this.ReasonDescription = reasonDescription;
            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 ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifierKey Key { 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>
        /// The monetary amount for which tax is applicable at the new rate. &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 for which tax is applicable at the new rate. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="taxableAmount", EmitDefaultValue=false)]
        public double? TaxableAmount { get; set; }

        /// <summary>
        /// The original amount of Tax that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The original amount of Tax that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="originalTaxAmount", EmitDefaultValue=false)]
        public double? OriginalTaxAmount { get; set; }

        /// <summary>
        /// The new amount of Tax that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The new amount of Tax that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="newTaxAmount", EmitDefaultValue=false)]
        public double? NewTaxAmount { get; set; }

        /// <summary>
        /// The original tax rate that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!
        /// </summary>
        /// <value>The original tax rate that should&#39;ve been collected but wasn&#39;t because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!</value>
        [DataMember(Name="originalTaxPercent", EmitDefaultValue=false)]
        public double? OriginalTaxPercent { get; set; }

        /// <summary>
        /// The new tax rate that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!
        /// </summary>
        /// <value>The new tax rate that is being collected because of this TaxOverrideModifier. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(7, 4). Be aware of this and round value!</value>
        [DataMember(Name="newTaxPercent", EmitDefaultValue=false)]
        public double? NewTaxPercent { get; set; }

        /// <summary>
        /// A retailer assigned reason code denoting why this TaxOverride is being granted.  
        /// </summary>
        /// <value>A retailer assigned reason code denoting why this TaxOverride is being granted.  </value>
        [DataMember(Name="reasonCode", EmitDefaultValue=false)]
        public string ReasonCode { get; set; }

        /// <summary>
        /// A narrative description describing the use of the retailer assigned tax override reason code
        /// </summary>
        /// <value>A narrative description describing the use of the retailer assigned tax override reason code</value>
        [DataMember(Name="reasonDescription", EmitDefaultValue=false)]
        public string ReasonDescription { 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 ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  TaxGroupRuleID: ").Append(TaxGroupRuleID).Append("\n");
            sb.Append("  TaxableAmount: ").Append(TaxableAmount).Append("\n");
            sb.Append("  OriginalTaxAmount: ").Append(OriginalTaxAmount).Append("\n");
            sb.Append("  NewTaxAmount: ").Append(NewTaxAmount).Append("\n");
            sb.Append("  OriginalTaxPercent: ").Append(OriginalTaxPercent).Append("\n");
            sb.Append("  NewTaxPercent: ").Append(NewTaxPercent).Append("\n");
            sb.Append("  ReasonCode: ").Append(ReasonCode).Append("\n");
            sb.Append("  ReasonDescription: ").Append(ReasonDescription).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 ComGkSoftwareGkrApiTxpoolDtoSaleReturnTaxOverrideModifier);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.TaxGroupRuleID == input.TaxGroupRuleID ||
                    (this.TaxGroupRuleID != null &&
                    this.TaxGroupRuleID.Equals(input.TaxGroupRuleID))
                ) && 
                (
                    this.TaxableAmount == input.TaxableAmount ||
                    (this.TaxableAmount != null &&
                    this.TaxableAmount.Equals(input.TaxableAmount))
                ) && 
                (
                    this.OriginalTaxAmount == input.OriginalTaxAmount ||
                    (this.OriginalTaxAmount != null &&
                    this.OriginalTaxAmount.Equals(input.OriginalTaxAmount))
                ) && 
                (
                    this.NewTaxAmount == input.NewTaxAmount ||
                    (this.NewTaxAmount != null &&
                    this.NewTaxAmount.Equals(input.NewTaxAmount))
                ) && 
                (
                    this.OriginalTaxPercent == input.OriginalTaxPercent ||
                    (this.OriginalTaxPercent != null &&
                    this.OriginalTaxPercent.Equals(input.OriginalTaxPercent))
                ) && 
                (
                    this.NewTaxPercent == input.NewTaxPercent ||
                    (this.NewTaxPercent != null &&
                    this.NewTaxPercent.Equals(input.NewTaxPercent))
                ) && 
                (
                    this.ReasonCode == input.ReasonCode ||
                    (this.ReasonCode != null &&
                    this.ReasonCode.Equals(input.ReasonCode))
                ) && 
                (
                    this.ReasonDescription == input.ReasonDescription ||
                    (this.ReasonDescription != null &&
                    this.ReasonDescription.Equals(input.ReasonDescription))
                ) && 
                (
                    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.TaxGroupRuleID != null)
                    hashCode = hashCode * 59 + this.TaxGroupRuleID.GetHashCode();
                if (this.TaxableAmount != null)
                    hashCode = hashCode * 59 + this.TaxableAmount.GetHashCode();
                if (this.OriginalTaxAmount != null)
                    hashCode = hashCode * 59 + this.OriginalTaxAmount.GetHashCode();
                if (this.NewTaxAmount != null)
                    hashCode = hashCode * 59 + this.NewTaxAmount.GetHashCode();
                if (this.OriginalTaxPercent != null)
                    hashCode = hashCode * 59 + this.OriginalTaxPercent.GetHashCode();
                if (this.NewTaxPercent != null)
                    hashCode = hashCode * 59 + this.NewTaxPercent.GetHashCode();
                if (this.ReasonCode != null)
                    hashCode = hashCode * 59 + this.ReasonCode.GetHashCode();
                if (this.ReasonDescription != null)
                    hashCode = hashCode * 59 + this.ReasonDescription.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;
        }
    }

}
