/* 
 * 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>
    /// TaxRefundTransaction &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="taxRefundDocumentID">The unique identifier of the tax refund document. This is returned from tax refund service. (required).</param>
        /// <param name="externalTransactionID">A universally unique identifier (UUID) for the transaction in the external system. Provided by the service provider..</param>
        /// <param name="storeInvoiceID">Fiscal invoice number for countries, where this is required..</param>
        /// <param name="totalGrossAmount">The summarized gross amout for all sale transactions of this tax refund (required).</param>
        /// <param name="totalTaxAmount">The summarized gross amout for all sale transactions of this tax refund&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="totalRefundAmount">The resulting tax refund amount (required).</param>
        /// <param name="taxRefundServiceProviderName">The used tax refund service provider (required).</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 ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction(ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransactionKey key = default(ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransactionKey), string taxRefundDocumentID = default(string), string externalTransactionID = default(string), string storeInvoiceID = default(string), double? totalGrossAmount = default(double?), double? totalTaxAmount = default(double?), double? totalRefundAmount = default(double?), string taxRefundServiceProviderName = 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 ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "taxRefundDocumentID" is required (not null)
            if (taxRefundDocumentID == null)
            {
                throw new InvalidDataException("taxRefundDocumentID is a required property for ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction and cannot be null");
            }
            else
            {
                this.TaxRefundDocumentID = taxRefundDocumentID;
            }
            // to ensure "totalGrossAmount" is required (not null)
            if (totalGrossAmount == null)
            {
                throw new InvalidDataException("totalGrossAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction and cannot be null");
            }
            else
            {
                this.TotalGrossAmount = totalGrossAmount;
            }
            // to ensure "totalRefundAmount" is required (not null)
            if (totalRefundAmount == null)
            {
                throw new InvalidDataException("totalRefundAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction and cannot be null");
            }
            else
            {
                this.TotalRefundAmount = totalRefundAmount;
            }
            // to ensure "taxRefundServiceProviderName" is required (not null)
            if (taxRefundServiceProviderName == null)
            {
                throw new InvalidDataException("taxRefundServiceProviderName is a required property for ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction and cannot be null");
            }
            else
            {
                this.TaxRefundServiceProviderName = taxRefundServiceProviderName;
            }
            this.ExternalTransactionID = externalTransactionID;
            this.StoreInvoiceID = storeInvoiceID;
            this.TotalTaxAmount = totalTaxAmount;
            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 ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransactionKey Key { get; set; }

        /// <summary>
        /// The unique identifier of the tax refund document. This is returned from tax refund service.
        /// </summary>
        /// <value>The unique identifier of the tax refund document. This is returned from tax refund service.</value>
        [DataMember(Name="taxRefundDocumentID", EmitDefaultValue=false)]
        public string TaxRefundDocumentID { get; set; }

        /// <summary>
        /// A universally unique identifier (UUID) for the transaction in the external system. Provided by the service provider.
        /// </summary>
        /// <value>A universally unique identifier (UUID) for the transaction in the external system. Provided by the service provider.</value>
        [DataMember(Name="externalTransactionID", EmitDefaultValue=false)]
        public string ExternalTransactionID { get; set; }

        /// <summary>
        /// Fiscal invoice number for countries, where this is required.
        /// </summary>
        /// <value>Fiscal invoice number for countries, where this is required.</value>
        [DataMember(Name="storeInvoiceID", EmitDefaultValue=false)]
        public string StoreInvoiceID { get; set; }

        /// <summary>
        /// The summarized gross amout for all sale transactions of this tax refund
        /// </summary>
        /// <value>The summarized gross amout for all sale transactions of this tax refund</value>
        [DataMember(Name="totalGrossAmount", EmitDefaultValue=false)]
        public double? TotalGrossAmount { get; set; }

        /// <summary>
        /// The summarized gross amout for all sale transactions of this tax refund&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The summarized gross amout for all sale transactions of this tax refund&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="totalTaxAmount", EmitDefaultValue=false)]
        public double? TotalTaxAmount { get; set; }

        /// <summary>
        /// The resulting tax refund amount
        /// </summary>
        /// <value>The resulting tax refund amount</value>
        [DataMember(Name="totalRefundAmount", EmitDefaultValue=false)]
        public double? TotalRefundAmount { get; set; }

        /// <summary>
        /// The used tax refund service provider
        /// </summary>
        /// <value>The used tax refund service provider</value>
        [DataMember(Name="taxRefundServiceProviderName", EmitDefaultValue=false)]
        public string TaxRefundServiceProviderName { 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 ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  TaxRefundDocumentID: ").Append(TaxRefundDocumentID).Append("\n");
            sb.Append("  ExternalTransactionID: ").Append(ExternalTransactionID).Append("\n");
            sb.Append("  StoreInvoiceID: ").Append(StoreInvoiceID).Append("\n");
            sb.Append("  TotalGrossAmount: ").Append(TotalGrossAmount).Append("\n");
            sb.Append("  TotalTaxAmount: ").Append(TotalTaxAmount).Append("\n");
            sb.Append("  TotalRefundAmount: ").Append(TotalRefundAmount).Append("\n");
            sb.Append("  TaxRefundServiceProviderName: ").Append(TaxRefundServiceProviderName).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 ComGkSoftwareGkrApiTxpoolDtoTaxRefundTransaction);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.TaxRefundDocumentID == input.TaxRefundDocumentID ||
                    (this.TaxRefundDocumentID != null &&
                    this.TaxRefundDocumentID.Equals(input.TaxRefundDocumentID))
                ) && 
                (
                    this.ExternalTransactionID == input.ExternalTransactionID ||
                    (this.ExternalTransactionID != null &&
                    this.ExternalTransactionID.Equals(input.ExternalTransactionID))
                ) && 
                (
                    this.StoreInvoiceID == input.StoreInvoiceID ||
                    (this.StoreInvoiceID != null &&
                    this.StoreInvoiceID.Equals(input.StoreInvoiceID))
                ) && 
                (
                    this.TotalGrossAmount == input.TotalGrossAmount ||
                    (this.TotalGrossAmount != null &&
                    this.TotalGrossAmount.Equals(input.TotalGrossAmount))
                ) && 
                (
                    this.TotalTaxAmount == input.TotalTaxAmount ||
                    (this.TotalTaxAmount != null &&
                    this.TotalTaxAmount.Equals(input.TotalTaxAmount))
                ) && 
                (
                    this.TotalRefundAmount == input.TotalRefundAmount ||
                    (this.TotalRefundAmount != null &&
                    this.TotalRefundAmount.Equals(input.TotalRefundAmount))
                ) && 
                (
                    this.TaxRefundServiceProviderName == input.TaxRefundServiceProviderName ||
                    (this.TaxRefundServiceProviderName != null &&
                    this.TaxRefundServiceProviderName.Equals(input.TaxRefundServiceProviderName))
                ) && 
                (
                    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.TaxRefundDocumentID != null)
                    hashCode = hashCode * 59 + this.TaxRefundDocumentID.GetHashCode();
                if (this.ExternalTransactionID != null)
                    hashCode = hashCode * 59 + this.ExternalTransactionID.GetHashCode();
                if (this.StoreInvoiceID != null)
                    hashCode = hashCode * 59 + this.StoreInvoiceID.GetHashCode();
                if (this.TotalGrossAmount != null)
                    hashCode = hashCode * 59 + this.TotalGrossAmount.GetHashCode();
                if (this.TotalTaxAmount != null)
                    hashCode = hashCode * 59 + this.TotalTaxAmount.GetHashCode();
                if (this.TotalRefundAmount != null)
                    hashCode = hashCode * 59 + this.TotalRefundAmount.GetHashCode();
                if (this.TaxRefundServiceProviderName != null)
                    hashCode = hashCode * 59 + this.TaxRefundServiceProviderName.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;
        }
    }

}
