/* 
 * 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>
    /// GiftCertificateLineItem &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="giftCertificateHandlingTypeCode">The type code of gift certificate that defines handling rules for it.</param>
        /// <param name="giftCertificateTypeCode">Identifies a gift certificate type. Corresponds to GiftCertificateClass.GiftCertificateTypeCode .</param>
        /// <param name="bookingSuccessfulTypeCode">Determines whether the transaction amount was successfully posted to the Stored Value Server. Stays null in case that this information is not relevant for the current gift certificate line item .</param>
        /// <param name="bookingCancellationTypeCode">Determines whether a cancellation was successfully posted to the Stored Value Server.Stays null in case that this information is not relevant for the current gift certificate line item .</param>
        /// <param name="externalSystemAdapterName">The name of the adapter of the involved external system.</param>
        /// <param name="expirationDate">The expiration date of the gift certificate ; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone).</param>
        /// <param name="remainingBalance">The remaining balance of the gift certificate  (required).</param>
        /// <param name="giftCertificateSerialNumber">The serial number that uniquely identifies a GIFT CERTIFICATE..</param>
        /// <param name="xxcustom05">Customizable information.</param>
        /// <param name="xxcustom03">Customizable information.</param>
        /// <param name="gcstransactionUUID">The gift certificate server transaction ID .</param>
        /// <param name="xxcustom02">Customizable information.</param>
        /// <param name="xxcustom04">Customizable information.</param>
        /// <param name="xxcustom01">Customizable information.</param>
        public ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem(ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItemKey key = default(ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItemKey), string giftCertificateHandlingTypeCode = default(string), string giftCertificateTypeCode = default(string), string bookingSuccessfulTypeCode = default(string), string bookingCancellationTypeCode = default(string), string externalSystemAdapterName = default(string), string expirationDate = default(string), double? remainingBalance = default(double?), string giftCertificateSerialNumber = default(string), string xxcustom05 = default(string), string xxcustom03 = default(string), string gcstransactionUUID = 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 ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "remainingBalance" is required (not null)
            if (remainingBalance == null)
            {
                throw new InvalidDataException("remainingBalance is a required property for ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem and cannot be null");
            }
            else
            {
                this.RemainingBalance = remainingBalance;
            }
            this.GiftCertificateHandlingTypeCode = giftCertificateHandlingTypeCode;
            this.GiftCertificateTypeCode = giftCertificateTypeCode;
            this.BookingSuccessfulTypeCode = bookingSuccessfulTypeCode;
            this.BookingCancellationTypeCode = bookingCancellationTypeCode;
            this.ExternalSystemAdapterName = externalSystemAdapterName;
            this.ExpirationDate = expirationDate;
            this.GiftCertificateSerialNumber = giftCertificateSerialNumber;
            this.Xxcustom05 = xxcustom05;
            this.Xxcustom03 = xxcustom03;
            this.GcstransactionUUID = gcstransactionUUID;
            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 ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItemKey Key { get; set; }

        /// <summary>
        /// The type code of gift certificate that defines handling rules for it
        /// </summary>
        /// <value>The type code of gift certificate that defines handling rules for it</value>
        [DataMember(Name="giftCertificateHandlingTypeCode", EmitDefaultValue=false)]
        public string GiftCertificateHandlingTypeCode { get; set; }

        /// <summary>
        /// Identifies a gift certificate type. Corresponds to GiftCertificateClass.GiftCertificateTypeCode 
        /// </summary>
        /// <value>Identifies a gift certificate type. Corresponds to GiftCertificateClass.GiftCertificateTypeCode </value>
        [DataMember(Name="giftCertificateTypeCode", EmitDefaultValue=false)]
        public string GiftCertificateTypeCode { get; set; }

        /// <summary>
        /// Determines whether the transaction amount was successfully posted to the Stored Value Server. Stays null in case that this information is not relevant for the current gift certificate line item 
        /// </summary>
        /// <value>Determines whether the transaction amount was successfully posted to the Stored Value Server. Stays null in case that this information is not relevant for the current gift certificate line item </value>
        [DataMember(Name="bookingSuccessfulTypeCode", EmitDefaultValue=false)]
        public string BookingSuccessfulTypeCode { get; set; }

        /// <summary>
        /// Determines whether a cancellation was successfully posted to the Stored Value Server.Stays null in case that this information is not relevant for the current gift certificate line item 
        /// </summary>
        /// <value>Determines whether a cancellation was successfully posted to the Stored Value Server.Stays null in case that this information is not relevant for the current gift certificate line item </value>
        [DataMember(Name="bookingCancellationTypeCode", EmitDefaultValue=false)]
        public string BookingCancellationTypeCode { get; set; }

        /// <summary>
        /// The name of the adapter of the involved external system
        /// </summary>
        /// <value>The name of the adapter of the involved external system</value>
        [DataMember(Name="externalSystemAdapterName", EmitDefaultValue=false)]
        public string ExternalSystemAdapterName { get; set; }

        /// <summary>
        /// The expiration date of the gift certificate ; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)
        /// </summary>
        /// <value>The expiration date of the gift certificate ; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)</value>
        [DataMember(Name="expirationDate", EmitDefaultValue=false)]
        public string ExpirationDate { get; set; }

        /// <summary>
        /// The remaining balance of the gift certificate 
        /// </summary>
        /// <value>The remaining balance of the gift certificate </value>
        [DataMember(Name="remainingBalance", EmitDefaultValue=false)]
        public double? RemainingBalance { get; set; }

        /// <summary>
        /// The serial number that uniquely identifies a GIFT CERTIFICATE.
        /// </summary>
        /// <value>The serial number that uniquely identifies a GIFT CERTIFICATE.</value>
        [DataMember(Name="giftCertificateSerialNumber", EmitDefaultValue=false)]
        public string GiftCertificateSerialNumber { 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>
        /// The gift certificate server transaction ID 
        /// </summary>
        /// <value>The gift certificate server transaction ID </value>
        [DataMember(Name="gcstransactionUUID", EmitDefaultValue=false)]
        public string GcstransactionUUID { 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 ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  GiftCertificateHandlingTypeCode: ").Append(GiftCertificateHandlingTypeCode).Append("\n");
            sb.Append("  GiftCertificateTypeCode: ").Append(GiftCertificateTypeCode).Append("\n");
            sb.Append("  BookingSuccessfulTypeCode: ").Append(BookingSuccessfulTypeCode).Append("\n");
            sb.Append("  BookingCancellationTypeCode: ").Append(BookingCancellationTypeCode).Append("\n");
            sb.Append("  ExternalSystemAdapterName: ").Append(ExternalSystemAdapterName).Append("\n");
            sb.Append("  ExpirationDate: ").Append(ExpirationDate).Append("\n");
            sb.Append("  RemainingBalance: ").Append(RemainingBalance).Append("\n");
            sb.Append("  GiftCertificateSerialNumber: ").Append(GiftCertificateSerialNumber).Append("\n");
            sb.Append("  Xxcustom05: ").Append(Xxcustom05).Append("\n");
            sb.Append("  Xxcustom03: ").Append(Xxcustom03).Append("\n");
            sb.Append("  GcstransactionUUID: ").Append(GcstransactionUUID).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 ComGkSoftwareGkrApiTxpoolDtoGiftCertificateLineItem);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.GiftCertificateHandlingTypeCode == input.GiftCertificateHandlingTypeCode ||
                    (this.GiftCertificateHandlingTypeCode != null &&
                    this.GiftCertificateHandlingTypeCode.Equals(input.GiftCertificateHandlingTypeCode))
                ) && 
                (
                    this.GiftCertificateTypeCode == input.GiftCertificateTypeCode ||
                    (this.GiftCertificateTypeCode != null &&
                    this.GiftCertificateTypeCode.Equals(input.GiftCertificateTypeCode))
                ) && 
                (
                    this.BookingSuccessfulTypeCode == input.BookingSuccessfulTypeCode ||
                    (this.BookingSuccessfulTypeCode != null &&
                    this.BookingSuccessfulTypeCode.Equals(input.BookingSuccessfulTypeCode))
                ) && 
                (
                    this.BookingCancellationTypeCode == input.BookingCancellationTypeCode ||
                    (this.BookingCancellationTypeCode != null &&
                    this.BookingCancellationTypeCode.Equals(input.BookingCancellationTypeCode))
                ) && 
                (
                    this.ExternalSystemAdapterName == input.ExternalSystemAdapterName ||
                    (this.ExternalSystemAdapterName != null &&
                    this.ExternalSystemAdapterName.Equals(input.ExternalSystemAdapterName))
                ) && 
                (
                    this.ExpirationDate == input.ExpirationDate ||
                    (this.ExpirationDate != null &&
                    this.ExpirationDate.Equals(input.ExpirationDate))
                ) && 
                (
                    this.RemainingBalance == input.RemainingBalance ||
                    (this.RemainingBalance != null &&
                    this.RemainingBalance.Equals(input.RemainingBalance))
                ) && 
                (
                    this.GiftCertificateSerialNumber == input.GiftCertificateSerialNumber ||
                    (this.GiftCertificateSerialNumber != null &&
                    this.GiftCertificateSerialNumber.Equals(input.GiftCertificateSerialNumber))
                ) && 
                (
                    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.GcstransactionUUID == input.GcstransactionUUID ||
                    (this.GcstransactionUUID != null &&
                    this.GcstransactionUUID.Equals(input.GcstransactionUUID))
                ) && 
                (
                    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.GiftCertificateHandlingTypeCode != null)
                    hashCode = hashCode * 59 + this.GiftCertificateHandlingTypeCode.GetHashCode();
                if (this.GiftCertificateTypeCode != null)
                    hashCode = hashCode * 59 + this.GiftCertificateTypeCode.GetHashCode();
                if (this.BookingSuccessfulTypeCode != null)
                    hashCode = hashCode * 59 + this.BookingSuccessfulTypeCode.GetHashCode();
                if (this.BookingCancellationTypeCode != null)
                    hashCode = hashCode * 59 + this.BookingCancellationTypeCode.GetHashCode();
                if (this.ExternalSystemAdapterName != null)
                    hashCode = hashCode * 59 + this.ExternalSystemAdapterName.GetHashCode();
                if (this.ExpirationDate != null)
                    hashCode = hashCode * 59 + this.ExpirationDate.GetHashCode();
                if (this.RemainingBalance != null)
                    hashCode = hashCode * 59 + this.RemainingBalance.GetHashCode();
                if (this.GiftCertificateSerialNumber != null)
                    hashCode = hashCode * 59 + this.GiftCertificateSerialNumber.GetHashCode();
                if (this.Xxcustom05 != null)
                    hashCode = hashCode * 59 + this.Xxcustom05.GetHashCode();
                if (this.Xxcustom03 != null)
                    hashCode = hashCode * 59 + this.Xxcustom03.GetHashCode();
                if (this.GcstransactionUUID != null)
                    hashCode = hashCode * 59 + this.GcstransactionUUID.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;
        }
    }

}
