/* 
 * 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>
    /// RetailTransactionCustomerAccount &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="customerAccountID">The customer account number .</param>
        /// <param name="customerAccountTypeCode">Determines what kind of customer account this is. (required).</param>
        /// <param name="customerAccountBalance">The current balance of the customer account  (required).</param>
        /// <param name="customerAccountQuerySuccessfulFlag">Determines whether the request of customer account data was completed successfully  (required).</param>
        /// <param name="customerAccountTransactionID">The external ident of the accounting transaction of the the customer account.</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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccountKey key = default(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccountKey), string customerAccountID = default(string), string customerAccountTypeCode = default(string), double? customerAccountBalance = default(double?), bool? customerAccountQuerySuccessfulFlag = default(bool?), string customerAccountTransactionID = 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "customerAccountTypeCode" is required (not null)
            if (customerAccountTypeCode == null)
            {
                throw new InvalidDataException("customerAccountTypeCode is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount and cannot be null");
            }
            else
            {
                this.CustomerAccountTypeCode = customerAccountTypeCode;
            }
            // to ensure "customerAccountBalance" is required (not null)
            if (customerAccountBalance == null)
            {
                throw new InvalidDataException("customerAccountBalance is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount and cannot be null");
            }
            else
            {
                this.CustomerAccountBalance = customerAccountBalance;
            }
            // to ensure "customerAccountQuerySuccessfulFlag" is required (not null)
            if (customerAccountQuerySuccessfulFlag == null)
            {
                throw new InvalidDataException("customerAccountQuerySuccessfulFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount and cannot be null");
            }
            else
            {
                this.CustomerAccountQuerySuccessfulFlag = customerAccountQuerySuccessfulFlag;
            }
            this.CustomerAccountID = customerAccountID;
            this.CustomerAccountTransactionID = customerAccountTransactionID;
            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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccountKey Key { get; set; }

        /// <summary>
        /// The customer account number 
        /// </summary>
        /// <value>The customer account number </value>
        [DataMember(Name="customerAccountID", EmitDefaultValue=false)]
        public string CustomerAccountID { get; set; }

        /// <summary>
        /// Determines what kind of customer account this is.
        /// </summary>
        /// <value>Determines what kind of customer account this is.</value>
        [DataMember(Name="customerAccountTypeCode", EmitDefaultValue=false)]
        public string CustomerAccountTypeCode { get; set; }

        /// <summary>
        /// The current balance of the customer account 
        /// </summary>
        /// <value>The current balance of the customer account </value>
        [DataMember(Name="customerAccountBalance", EmitDefaultValue=false)]
        public double? CustomerAccountBalance { get; set; }

        /// <summary>
        /// Determines whether the request of customer account data was completed successfully 
        /// </summary>
        /// <value>Determines whether the request of customer account data was completed successfully </value>
        [DataMember(Name="customerAccountQuerySuccessfulFlag", EmitDefaultValue=false)]
        public bool? CustomerAccountQuerySuccessfulFlag { get; set; }

        /// <summary>
        /// The external ident of the accounting transaction of the the customer account
        /// </summary>
        /// <value>The external ident of the accounting transaction of the the customer account</value>
        [DataMember(Name="customerAccountTransactionID", EmitDefaultValue=false)]
        public string CustomerAccountTransactionID { 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  CustomerAccountID: ").Append(CustomerAccountID).Append("\n");
            sb.Append("  CustomerAccountTypeCode: ").Append(CustomerAccountTypeCode).Append("\n");
            sb.Append("  CustomerAccountBalance: ").Append(CustomerAccountBalance).Append("\n");
            sb.Append("  CustomerAccountQuerySuccessfulFlag: ").Append(CustomerAccountQuerySuccessfulFlag).Append("\n");
            sb.Append("  CustomerAccountTransactionID: ").Append(CustomerAccountTransactionID).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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerAccount);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.CustomerAccountID == input.CustomerAccountID ||
                    (this.CustomerAccountID != null &&
                    this.CustomerAccountID.Equals(input.CustomerAccountID))
                ) && 
                (
                    this.CustomerAccountTypeCode == input.CustomerAccountTypeCode ||
                    (this.CustomerAccountTypeCode != null &&
                    this.CustomerAccountTypeCode.Equals(input.CustomerAccountTypeCode))
                ) && 
                (
                    this.CustomerAccountBalance == input.CustomerAccountBalance ||
                    (this.CustomerAccountBalance != null &&
                    this.CustomerAccountBalance.Equals(input.CustomerAccountBalance))
                ) && 
                (
                    this.CustomerAccountQuerySuccessfulFlag == input.CustomerAccountQuerySuccessfulFlag ||
                    (this.CustomerAccountQuerySuccessfulFlag != null &&
                    this.CustomerAccountQuerySuccessfulFlag.Equals(input.CustomerAccountQuerySuccessfulFlag))
                ) && 
                (
                    this.CustomerAccountTransactionID == input.CustomerAccountTransactionID ||
                    (this.CustomerAccountTransactionID != null &&
                    this.CustomerAccountTransactionID.Equals(input.CustomerAccountTransactionID))
                ) && 
                (
                    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.CustomerAccountID != null)
                    hashCode = hashCode * 59 + this.CustomerAccountID.GetHashCode();
                if (this.CustomerAccountTypeCode != null)
                    hashCode = hashCode * 59 + this.CustomerAccountTypeCode.GetHashCode();
                if (this.CustomerAccountBalance != null)
                    hashCode = hashCode * 59 + this.CustomerAccountBalance.GetHashCode();
                if (this.CustomerAccountQuerySuccessfulFlag != null)
                    hashCode = hashCode * 59 + this.CustomerAccountQuerySuccessfulFlag.GetHashCode();
                if (this.CustomerAccountTransactionID != null)
                    hashCode = hashCode * 59 + this.CustomerAccountTransactionID.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;
        }
    }

}
