/* 
 * 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>
    /// RetailTransactionCustomerIdentification.Key Inner class for composite key attributes
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey" /> class.
        /// </summary>
        /// <param name="businessUnitGroupID">A unique system assigned identifier for a group of BusinessUnits. (required).</param>
        /// <param name="transactionID">A universally unique identifier (UUID) for the Transaction. This may be assembled from alternate key members.  (required).</param>
        /// <param name="customerID">A unique system assigned identifier for the Customer.  (required).</param>
        /// <param name="addressTypeCode">The customer type code (required).</param>
        /// <param name="partyIdentificationTypeCode">A code denoting a form of identification that the customer uses to identify themselves.  (required).</param>
        public ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey(string businessUnitGroupID = default(string), string transactionID = default(string), string customerID = default(string), string addressTypeCode = default(string), string partyIdentificationTypeCode = default(string))
        {
            // to ensure "businessUnitGroupID" is required (not null)
            if (businessUnitGroupID == null)
            {
                throw new InvalidDataException("businessUnitGroupID is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey and cannot be null");
            }
            else
            {
                this.BusinessUnitGroupID = businessUnitGroupID;
            }
            // to ensure "transactionID" is required (not null)
            if (transactionID == null)
            {
                throw new InvalidDataException("transactionID is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey and cannot be null");
            }
            else
            {
                this.TransactionID = transactionID;
            }
            // to ensure "customerID" is required (not null)
            if (customerID == null)
            {
                throw new InvalidDataException("customerID is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey and cannot be null");
            }
            else
            {
                this.CustomerID = customerID;
            }
            // to ensure "addressTypeCode" is required (not null)
            if (addressTypeCode == null)
            {
                throw new InvalidDataException("addressTypeCode is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey and cannot be null");
            }
            else
            {
                this.AddressTypeCode = addressTypeCode;
            }
            // to ensure "partyIdentificationTypeCode" is required (not null)
            if (partyIdentificationTypeCode == null)
            {
                throw new InvalidDataException("partyIdentificationTypeCode is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey and cannot be null");
            }
            else
            {
                this.PartyIdentificationTypeCode = partyIdentificationTypeCode;
            }
        }
        
        /// <summary>
        /// A unique system assigned identifier for a group of BusinessUnits.
        /// </summary>
        /// <value>A unique system assigned identifier for a group of BusinessUnits.</value>
        [DataMember(Name="businessUnitGroupID", EmitDefaultValue=false)]
        public string BusinessUnitGroupID { get; set; }

        /// <summary>
        /// A universally unique identifier (UUID) for the Transaction. This may be assembled from alternate key members. 
        /// </summary>
        /// <value>A universally unique identifier (UUID) for the Transaction. This may be assembled from alternate key members. </value>
        [DataMember(Name="transactionID", EmitDefaultValue=false)]
        public string TransactionID { get; set; }

        /// <summary>
        /// A unique system assigned identifier for the Customer. 
        /// </summary>
        /// <value>A unique system assigned identifier for the Customer. </value>
        [DataMember(Name="customerID", EmitDefaultValue=false)]
        public string CustomerID { get; set; }

        /// <summary>
        /// The customer type code
        /// </summary>
        /// <value>The customer type code</value>
        [DataMember(Name="addressTypeCode", EmitDefaultValue=false)]
        public string AddressTypeCode { get; set; }

        /// <summary>
        /// A code denoting a form of identification that the customer uses to identify themselves. 
        /// </summary>
        /// <value>A code denoting a form of identification that the customer uses to identify themselves. </value>
        [DataMember(Name="partyIdentificationTypeCode", EmitDefaultValue=false)]
        public string PartyIdentificationTypeCode { 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey {\n");
            sb.Append("  BusinessUnitGroupID: ").Append(BusinessUnitGroupID).Append("\n");
            sb.Append("  TransactionID: ").Append(TransactionID).Append("\n");
            sb.Append("  CustomerID: ").Append(CustomerID).Append("\n");
            sb.Append("  AddressTypeCode: ").Append(AddressTypeCode).Append("\n");
            sb.Append("  PartyIdentificationTypeCode: ").Append(PartyIdentificationTypeCode).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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCustomerIdentificationKey);
        }

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

            return 
                (
                    this.BusinessUnitGroupID == input.BusinessUnitGroupID ||
                    (this.BusinessUnitGroupID != null &&
                    this.BusinessUnitGroupID.Equals(input.BusinessUnitGroupID))
                ) && 
                (
                    this.TransactionID == input.TransactionID ||
                    (this.TransactionID != null &&
                    this.TransactionID.Equals(input.TransactionID))
                ) && 
                (
                    this.CustomerID == input.CustomerID ||
                    (this.CustomerID != null &&
                    this.CustomerID.Equals(input.CustomerID))
                ) && 
                (
                    this.AddressTypeCode == input.AddressTypeCode ||
                    (this.AddressTypeCode != null &&
                    this.AddressTypeCode.Equals(input.AddressTypeCode))
                ) && 
                (
                    this.PartyIdentificationTypeCode == input.PartyIdentificationTypeCode ||
                    (this.PartyIdentificationTypeCode != null &&
                    this.PartyIdentificationTypeCode.Equals(input.PartyIdentificationTypeCode))
                );
        }

        /// <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.BusinessUnitGroupID != null)
                    hashCode = hashCode * 59 + this.BusinessUnitGroupID.GetHashCode();
                if (this.TransactionID != null)
                    hashCode = hashCode * 59 + this.TransactionID.GetHashCode();
                if (this.CustomerID != null)
                    hashCode = hashCode * 59 + this.CustomerID.GetHashCode();
                if (this.AddressTypeCode != null)
                    hashCode = hashCode * 59 + this.AddressTypeCode.GetHashCode();
                if (this.PartyIdentificationTypeCode != null)
                    hashCode = hashCode * 59 + this.PartyIdentificationTypeCode.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;
        }
    }

}
