/* 
 * 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>
    /// PayableAmountResult &lt;p&gt;Result object of the PaymentService&lt;/p&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwarePosApiServicePaymentPayableAmountResult :  IEquatable<ComGkSoftwarePosApiServicePaymentPayableAmountResult>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiServicePaymentPayableAmountResult" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwarePosApiServicePaymentPayableAmountResult() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiServicePaymentPayableAmountResult" /> class.
        /// </summary>
        /// <param name="primaryEntry">&lt;p&gt;The primary transaction result entry.&lt;/p&gt;.</param>
        /// <param name="additionalEntries">&lt;p&gt;Additional result entries.&lt;/p&gt; (required).</param>
        /// <param name="filtered">&lt;p&gt;Indicates whether the transaction result is filtered. A filtered transaction does not contain the details of a retail transaction object in order to optimize service communication.&lt;/p&gt;.</param>
        /// <param name="failure">&lt;p&gt;Reference to a failure entity in case a failure occurs during a service execution. This field can be used when a managed exception occurs and we still want to synchronize the resulting transaction instead of throwing an exception containing no information on transaction updates.&lt;/p&gt;.</param>
        /// <param name="changeAmount">&lt;p&gt;double : change amount&lt;/p&gt; (required).</param>
        /// <param name="foreignCurrencyChangeAmount">&lt;p&gt;double : foreign currency change amount&lt;/p&gt; (required).</param>
        /// <param name="grandTotalAmount">&lt;p&gt;double : grand total amount&lt;/p&gt; (required).</param>
        /// <param name="foreignCurrencyGrandTotalAmount">&lt;p&gt;double : foreign currency grand total amount&lt;/p&gt; (required).</param>
        /// <param name="payedAmount">&lt;p&gt;double : payed amount&lt;/p&gt; (required).</param>
        /// <param name="foreignCurrencyPayedAmount">&lt;p&gt;double : foreign currency payed amount&lt;/p&gt; (required).</param>
        /// <param name="tipAmount">&lt;p&gt;Amount: tip amount&lt;/p&gt; (required).</param>
        /// <param name="baseCurrencyTenderPayableAmount">&lt;p&gt;double : base currency tender payable amount&lt;/p&gt; (required).</param>
        /// <param name="foreignCurrencyTenderPayableAmount">&lt;p&gt;double : foreign currency tender payable amount&lt;/p&gt; (required).</param>
        /// <param name="mghTenderPermissionRulesChecked">&lt;p&gt;boolean : mgh tender permission rules checked&lt;/p&gt; (required).</param>
        /// <param name="xXCustom08">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom10">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom09">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom07">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom05">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom06">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom11">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom12">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom13">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom14">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom15">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom03">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom02">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom04">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        /// <param name="xXCustom01">&lt;p&gt;Customizable information&lt;/p&gt;.</param>
        public ComGkSoftwarePosApiServicePaymentPayableAmountResult(ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry primaryEntry = default(ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry), List<ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry> additionalEntries = default(List<ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry>), bool? filtered = default(bool?), ComGkSoftwarePosApiServiceTransactionTransactionOperationFailureResult failure = default(ComGkSoftwarePosApiServiceTransactionTransactionOperationFailureResult), double? changeAmount = default(double?), double? foreignCurrencyChangeAmount = default(double?), double? grandTotalAmount = default(double?), double? foreignCurrencyGrandTotalAmount = default(double?), double? payedAmount = default(double?), double? foreignCurrencyPayedAmount = default(double?), double? tipAmount = default(double?), double? baseCurrencyTenderPayableAmount = default(double?), double? foreignCurrencyTenderPayableAmount = default(double?), bool? mghTenderPermissionRulesChecked = default(bool?), string xXCustom08 = default(string), string xXCustom10 = default(string), string xXCustom09 = default(string), string xXCustom07 = default(string), string xXCustom05 = default(string), string xXCustom06 = default(string), string xXCustom11 = default(string), string xXCustom12 = default(string), string xXCustom13 = default(string), string xXCustom14 = default(string), string xXCustom15 = default(string), string xXCustom03 = default(string), string xXCustom02 = default(string), string xXCustom04 = default(string), string xXCustom01 = default(string))
        {
            // to ensure "additionalEntries" is required (not null)
            if (additionalEntries == null)
            {
                throw new InvalidDataException("additionalEntries is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.AdditionalEntries = additionalEntries;
            }
            // to ensure "changeAmount" is required (not null)
            if (changeAmount == null)
            {
                throw new InvalidDataException("changeAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.ChangeAmount = changeAmount;
            }
            // to ensure "foreignCurrencyChangeAmount" is required (not null)
            if (foreignCurrencyChangeAmount == null)
            {
                throw new InvalidDataException("foreignCurrencyChangeAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.ForeignCurrencyChangeAmount = foreignCurrencyChangeAmount;
            }
            // to ensure "grandTotalAmount" is required (not null)
            if (grandTotalAmount == null)
            {
                throw new InvalidDataException("grandTotalAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.GrandTotalAmount = grandTotalAmount;
            }
            // to ensure "foreignCurrencyGrandTotalAmount" is required (not null)
            if (foreignCurrencyGrandTotalAmount == null)
            {
                throw new InvalidDataException("foreignCurrencyGrandTotalAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.ForeignCurrencyGrandTotalAmount = foreignCurrencyGrandTotalAmount;
            }
            // to ensure "payedAmount" is required (not null)
            if (payedAmount == null)
            {
                throw new InvalidDataException("payedAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.PayedAmount = payedAmount;
            }
            // to ensure "foreignCurrencyPayedAmount" is required (not null)
            if (foreignCurrencyPayedAmount == null)
            {
                throw new InvalidDataException("foreignCurrencyPayedAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.ForeignCurrencyPayedAmount = foreignCurrencyPayedAmount;
            }
            // to ensure "tipAmount" is required (not null)
            if (tipAmount == null)
            {
                throw new InvalidDataException("tipAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.TipAmount = tipAmount;
            }
            // to ensure "baseCurrencyTenderPayableAmount" is required (not null)
            if (baseCurrencyTenderPayableAmount == null)
            {
                throw new InvalidDataException("baseCurrencyTenderPayableAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.BaseCurrencyTenderPayableAmount = baseCurrencyTenderPayableAmount;
            }
            // to ensure "foreignCurrencyTenderPayableAmount" is required (not null)
            if (foreignCurrencyTenderPayableAmount == null)
            {
                throw new InvalidDataException("foreignCurrencyTenderPayableAmount is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.ForeignCurrencyTenderPayableAmount = foreignCurrencyTenderPayableAmount;
            }
            // to ensure "mghTenderPermissionRulesChecked" is required (not null)
            if (mghTenderPermissionRulesChecked == null)
            {
                throw new InvalidDataException("mghTenderPermissionRulesChecked is a required property for ComGkSoftwarePosApiServicePaymentPayableAmountResult and cannot be null");
            }
            else
            {
                this.MghTenderPermissionRulesChecked = mghTenderPermissionRulesChecked;
            }
            this.PrimaryEntry = primaryEntry;
            this.Filtered = filtered;
            this.Failure = failure;
            this.XXCustom08 = xXCustom08;
            this.XXCustom10 = xXCustom10;
            this.XXCustom09 = xXCustom09;
            this.XXCustom07 = xXCustom07;
            this.XXCustom05 = xXCustom05;
            this.XXCustom06 = xXCustom06;
            this.XXCustom11 = xXCustom11;
            this.XXCustom12 = xXCustom12;
            this.XXCustom13 = xXCustom13;
            this.XXCustom14 = xXCustom14;
            this.XXCustom15 = xXCustom15;
            this.XXCustom03 = xXCustom03;
            this.XXCustom02 = xXCustom02;
            this.XXCustom04 = xXCustom04;
            this.XXCustom01 = xXCustom01;
        }
        
        /// <summary>
        /// &lt;p&gt;The primary transaction result entry.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The primary transaction result entry.&lt;/p&gt;</value>
        [DataMember(Name="primaryEntry", EmitDefaultValue=false)]
        public ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry PrimaryEntry { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional result entries.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional result entries.&lt;/p&gt;</value>
        [DataMember(Name="additionalEntries", EmitDefaultValue=false)]
        public List<ComGkSoftwarePosApiServiceTransactionTransactionOperationResultEntry> AdditionalEntries { get; set; }

        /// <summary>
        /// &lt;p&gt;Indicates whether the transaction result is filtered. A filtered transaction does not contain the details of a retail transaction object in order to optimize service communication.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Indicates whether the transaction result is filtered. A filtered transaction does not contain the details of a retail transaction object in order to optimize service communication.&lt;/p&gt;</value>
        [DataMember(Name="filtered", EmitDefaultValue=false)]
        public bool? Filtered { get; set; }

        /// <summary>
        /// &lt;p&gt;Reference to a failure entity in case a failure occurs during a service execution. This field can be used when a managed exception occurs and we still want to synchronize the resulting transaction instead of throwing an exception containing no information on transaction updates.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Reference to a failure entity in case a failure occurs during a service execution. This field can be used when a managed exception occurs and we still want to synchronize the resulting transaction instead of throwing an exception containing no information on transaction updates.&lt;/p&gt;</value>
        [DataMember(Name="failure", EmitDefaultValue=false)]
        public ComGkSoftwarePosApiServiceTransactionTransactionOperationFailureResult Failure { get; set; }

        /// <summary>
        /// &lt;p&gt;double : change amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : change amount&lt;/p&gt;</value>
        [DataMember(Name="changeAmount", EmitDefaultValue=false)]
        public double? ChangeAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : foreign currency change amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : foreign currency change amount&lt;/p&gt;</value>
        [DataMember(Name="foreignCurrencyChangeAmount", EmitDefaultValue=false)]
        public double? ForeignCurrencyChangeAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : grand total amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : grand total amount&lt;/p&gt;</value>
        [DataMember(Name="grandTotalAmount", EmitDefaultValue=false)]
        public double? GrandTotalAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : foreign currency grand total amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : foreign currency grand total amount&lt;/p&gt;</value>
        [DataMember(Name="foreignCurrencyGrandTotalAmount", EmitDefaultValue=false)]
        public double? ForeignCurrencyGrandTotalAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : payed amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : payed amount&lt;/p&gt;</value>
        [DataMember(Name="payedAmount", EmitDefaultValue=false)]
        public double? PayedAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : foreign currency payed amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : foreign currency payed amount&lt;/p&gt;</value>
        [DataMember(Name="foreignCurrencyPayedAmount", EmitDefaultValue=false)]
        public double? ForeignCurrencyPayedAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;Amount: tip amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Amount: tip amount&lt;/p&gt;</value>
        [DataMember(Name="tipAmount", EmitDefaultValue=false)]
        public double? TipAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : base currency tender payable amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : base currency tender payable amount&lt;/p&gt;</value>
        [DataMember(Name="baseCurrencyTenderPayableAmount", EmitDefaultValue=false)]
        public double? BaseCurrencyTenderPayableAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;double : foreign currency tender payable amount&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;double : foreign currency tender payable amount&lt;/p&gt;</value>
        [DataMember(Name="foreignCurrencyTenderPayableAmount", EmitDefaultValue=false)]
        public double? ForeignCurrencyTenderPayableAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;boolean : mgh tender permission rules checked&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;boolean : mgh tender permission rules checked&lt;/p&gt;</value>
        [DataMember(Name="mghTenderPermissionRulesChecked", EmitDefaultValue=false)]
        public bool? MghTenderPermissionRulesChecked { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom08", EmitDefaultValue=false)]
        public string XXCustom08 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom10", EmitDefaultValue=false)]
        public string XXCustom10 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom09", EmitDefaultValue=false)]
        public string XXCustom09 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom07", EmitDefaultValue=false)]
        public string XXCustom07 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom05", EmitDefaultValue=false)]
        public string XXCustom05 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom06", EmitDefaultValue=false)]
        public string XXCustom06 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom11", EmitDefaultValue=false)]
        public string XXCustom11 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom12", EmitDefaultValue=false)]
        public string XXCustom12 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom13", EmitDefaultValue=false)]
        public string XXCustom13 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom14", EmitDefaultValue=false)]
        public string XXCustom14 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom15", EmitDefaultValue=false)]
        public string XXCustom15 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom03", EmitDefaultValue=false)]
        public string XXCustom03 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom02", EmitDefaultValue=false)]
        public string XXCustom02 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</value>
        [DataMember(Name="xXCustom04", EmitDefaultValue=false)]
        public string XXCustom04 { get; set; }

        /// <summary>
        /// &lt;p&gt;Customizable information&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Customizable information&lt;/p&gt;</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 ComGkSoftwarePosApiServicePaymentPayableAmountResult {\n");
            sb.Append("  PrimaryEntry: ").Append(PrimaryEntry).Append("\n");
            sb.Append("  AdditionalEntries: ").Append(AdditionalEntries).Append("\n");
            sb.Append("  Filtered: ").Append(Filtered).Append("\n");
            sb.Append("  Failure: ").Append(Failure).Append("\n");
            sb.Append("  ChangeAmount: ").Append(ChangeAmount).Append("\n");
            sb.Append("  ForeignCurrencyChangeAmount: ").Append(ForeignCurrencyChangeAmount).Append("\n");
            sb.Append("  GrandTotalAmount: ").Append(GrandTotalAmount).Append("\n");
            sb.Append("  ForeignCurrencyGrandTotalAmount: ").Append(ForeignCurrencyGrandTotalAmount).Append("\n");
            sb.Append("  PayedAmount: ").Append(PayedAmount).Append("\n");
            sb.Append("  ForeignCurrencyPayedAmount: ").Append(ForeignCurrencyPayedAmount).Append("\n");
            sb.Append("  TipAmount: ").Append(TipAmount).Append("\n");
            sb.Append("  BaseCurrencyTenderPayableAmount: ").Append(BaseCurrencyTenderPayableAmount).Append("\n");
            sb.Append("  ForeignCurrencyTenderPayableAmount: ").Append(ForeignCurrencyTenderPayableAmount).Append("\n");
            sb.Append("  MghTenderPermissionRulesChecked: ").Append(MghTenderPermissionRulesChecked).Append("\n");
            sb.Append("  XXCustom08: ").Append(XXCustom08).Append("\n");
            sb.Append("  XXCustom10: ").Append(XXCustom10).Append("\n");
            sb.Append("  XXCustom09: ").Append(XXCustom09).Append("\n");
            sb.Append("  XXCustom07: ").Append(XXCustom07).Append("\n");
            sb.Append("  XXCustom05: ").Append(XXCustom05).Append("\n");
            sb.Append("  XXCustom06: ").Append(XXCustom06).Append("\n");
            sb.Append("  XXCustom11: ").Append(XXCustom11).Append("\n");
            sb.Append("  XXCustom12: ").Append(XXCustom12).Append("\n");
            sb.Append("  XXCustom13: ").Append(XXCustom13).Append("\n");
            sb.Append("  XXCustom14: ").Append(XXCustom14).Append("\n");
            sb.Append("  XXCustom15: ").Append(XXCustom15).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 ComGkSoftwarePosApiServicePaymentPayableAmountResult);
        }

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

            return 
                (
                    this.PrimaryEntry == input.PrimaryEntry ||
                    (this.PrimaryEntry != null &&
                    this.PrimaryEntry.Equals(input.PrimaryEntry))
                ) && 
                (
                    this.AdditionalEntries == input.AdditionalEntries ||
                    this.AdditionalEntries != null &&
                    this.AdditionalEntries.SequenceEqual(input.AdditionalEntries)
                ) && 
                (
                    this.Filtered == input.Filtered ||
                    (this.Filtered != null &&
                    this.Filtered.Equals(input.Filtered))
                ) && 
                (
                    this.Failure == input.Failure ||
                    (this.Failure != null &&
                    this.Failure.Equals(input.Failure))
                ) && 
                (
                    this.ChangeAmount == input.ChangeAmount ||
                    (this.ChangeAmount != null &&
                    this.ChangeAmount.Equals(input.ChangeAmount))
                ) && 
                (
                    this.ForeignCurrencyChangeAmount == input.ForeignCurrencyChangeAmount ||
                    (this.ForeignCurrencyChangeAmount != null &&
                    this.ForeignCurrencyChangeAmount.Equals(input.ForeignCurrencyChangeAmount))
                ) && 
                (
                    this.GrandTotalAmount == input.GrandTotalAmount ||
                    (this.GrandTotalAmount != null &&
                    this.GrandTotalAmount.Equals(input.GrandTotalAmount))
                ) && 
                (
                    this.ForeignCurrencyGrandTotalAmount == input.ForeignCurrencyGrandTotalAmount ||
                    (this.ForeignCurrencyGrandTotalAmount != null &&
                    this.ForeignCurrencyGrandTotalAmount.Equals(input.ForeignCurrencyGrandTotalAmount))
                ) && 
                (
                    this.PayedAmount == input.PayedAmount ||
                    (this.PayedAmount != null &&
                    this.PayedAmount.Equals(input.PayedAmount))
                ) && 
                (
                    this.ForeignCurrencyPayedAmount == input.ForeignCurrencyPayedAmount ||
                    (this.ForeignCurrencyPayedAmount != null &&
                    this.ForeignCurrencyPayedAmount.Equals(input.ForeignCurrencyPayedAmount))
                ) && 
                (
                    this.TipAmount == input.TipAmount ||
                    (this.TipAmount != null &&
                    this.TipAmount.Equals(input.TipAmount))
                ) && 
                (
                    this.BaseCurrencyTenderPayableAmount == input.BaseCurrencyTenderPayableAmount ||
                    (this.BaseCurrencyTenderPayableAmount != null &&
                    this.BaseCurrencyTenderPayableAmount.Equals(input.BaseCurrencyTenderPayableAmount))
                ) && 
                (
                    this.ForeignCurrencyTenderPayableAmount == input.ForeignCurrencyTenderPayableAmount ||
                    (this.ForeignCurrencyTenderPayableAmount != null &&
                    this.ForeignCurrencyTenderPayableAmount.Equals(input.ForeignCurrencyTenderPayableAmount))
                ) && 
                (
                    this.MghTenderPermissionRulesChecked == input.MghTenderPermissionRulesChecked ||
                    (this.MghTenderPermissionRulesChecked != null &&
                    this.MghTenderPermissionRulesChecked.Equals(input.MghTenderPermissionRulesChecked))
                ) && 
                (
                    this.XXCustom08 == input.XXCustom08 ||
                    (this.XXCustom08 != null &&
                    this.XXCustom08.Equals(input.XXCustom08))
                ) && 
                (
                    this.XXCustom10 == input.XXCustom10 ||
                    (this.XXCustom10 != null &&
                    this.XXCustom10.Equals(input.XXCustom10))
                ) && 
                (
                    this.XXCustom09 == input.XXCustom09 ||
                    (this.XXCustom09 != null &&
                    this.XXCustom09.Equals(input.XXCustom09))
                ) && 
                (
                    this.XXCustom07 == input.XXCustom07 ||
                    (this.XXCustom07 != null &&
                    this.XXCustom07.Equals(input.XXCustom07))
                ) && 
                (
                    this.XXCustom05 == input.XXCustom05 ||
                    (this.XXCustom05 != null &&
                    this.XXCustom05.Equals(input.XXCustom05))
                ) && 
                (
                    this.XXCustom06 == input.XXCustom06 ||
                    (this.XXCustom06 != null &&
                    this.XXCustom06.Equals(input.XXCustom06))
                ) && 
                (
                    this.XXCustom11 == input.XXCustom11 ||
                    (this.XXCustom11 != null &&
                    this.XXCustom11.Equals(input.XXCustom11))
                ) && 
                (
                    this.XXCustom12 == input.XXCustom12 ||
                    (this.XXCustom12 != null &&
                    this.XXCustom12.Equals(input.XXCustom12))
                ) && 
                (
                    this.XXCustom13 == input.XXCustom13 ||
                    (this.XXCustom13 != null &&
                    this.XXCustom13.Equals(input.XXCustom13))
                ) && 
                (
                    this.XXCustom14 == input.XXCustom14 ||
                    (this.XXCustom14 != null &&
                    this.XXCustom14.Equals(input.XXCustom14))
                ) && 
                (
                    this.XXCustom15 == input.XXCustom15 ||
                    (this.XXCustom15 != null &&
                    this.XXCustom15.Equals(input.XXCustom15))
                ) && 
                (
                    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.PrimaryEntry != null)
                    hashCode = hashCode * 59 + this.PrimaryEntry.GetHashCode();
                if (this.AdditionalEntries != null)
                    hashCode = hashCode * 59 + this.AdditionalEntries.GetHashCode();
                if (this.Filtered != null)
                    hashCode = hashCode * 59 + this.Filtered.GetHashCode();
                if (this.Failure != null)
                    hashCode = hashCode * 59 + this.Failure.GetHashCode();
                if (this.ChangeAmount != null)
                    hashCode = hashCode * 59 + this.ChangeAmount.GetHashCode();
                if (this.ForeignCurrencyChangeAmount != null)
                    hashCode = hashCode * 59 + this.ForeignCurrencyChangeAmount.GetHashCode();
                if (this.GrandTotalAmount != null)
                    hashCode = hashCode * 59 + this.GrandTotalAmount.GetHashCode();
                if (this.ForeignCurrencyGrandTotalAmount != null)
                    hashCode = hashCode * 59 + this.ForeignCurrencyGrandTotalAmount.GetHashCode();
                if (this.PayedAmount != null)
                    hashCode = hashCode * 59 + this.PayedAmount.GetHashCode();
                if (this.ForeignCurrencyPayedAmount != null)
                    hashCode = hashCode * 59 + this.ForeignCurrencyPayedAmount.GetHashCode();
                if (this.TipAmount != null)
                    hashCode = hashCode * 59 + this.TipAmount.GetHashCode();
                if (this.BaseCurrencyTenderPayableAmount != null)
                    hashCode = hashCode * 59 + this.BaseCurrencyTenderPayableAmount.GetHashCode();
                if (this.ForeignCurrencyTenderPayableAmount != null)
                    hashCode = hashCode * 59 + this.ForeignCurrencyTenderPayableAmount.GetHashCode();
                if (this.MghTenderPermissionRulesChecked != null)
                    hashCode = hashCode * 59 + this.MghTenderPermissionRulesChecked.GetHashCode();
                if (this.XXCustom08 != null)
                    hashCode = hashCode * 59 + this.XXCustom08.GetHashCode();
                if (this.XXCustom10 != null)
                    hashCode = hashCode * 59 + this.XXCustom10.GetHashCode();
                if (this.XXCustom09 != null)
                    hashCode = hashCode * 59 + this.XXCustom09.GetHashCode();
                if (this.XXCustom07 != null)
                    hashCode = hashCode * 59 + this.XXCustom07.GetHashCode();
                if (this.XXCustom05 != null)
                    hashCode = hashCode * 59 + this.XXCustom05.GetHashCode();
                if (this.XXCustom06 != null)
                    hashCode = hashCode * 59 + this.XXCustom06.GetHashCode();
                if (this.XXCustom11 != null)
                    hashCode = hashCode * 59 + this.XXCustom11.GetHashCode();
                if (this.XXCustom12 != null)
                    hashCode = hashCode * 59 + this.XXCustom12.GetHashCode();
                if (this.XXCustom13 != null)
                    hashCode = hashCode * 59 + this.XXCustom13.GetHashCode();
                if (this.XXCustom14 != null)
                    hashCode = hashCode * 59 + this.XXCustom14.GetHashCode();
                if (this.XXCustom15 != null)
                    hashCode = hashCode * 59 + this.XXCustom15.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;
        }
    }

}
