/* 
 * 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>
    /// RetailTransactionPromotionTrigger &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="triggerType">The type of the trigger (referencing to POS configuration) (required).</param>
        /// <param name="triggerValue">The value of the trigger (referencing to POS configuration) (required).</param>
        /// <param name="privilegeType">Defines the method for price modification. (required).</param>
        /// <param name="privilegeValue">Reduction amount, reduction percent or new price amount (required).</param>
        /// <param name="reasonCode">Reason code for the manual discount.</param>
        /// <param name="reasonDescription">A narrative description describing the manual discount reason..</param>
        /// <param name="reference_">An additional information concerning the trigger .</param>
        /// <param name="triggerSequenceAddend">A value which is to be added to the sequence of the condition (which comes from the master data) (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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTriggerKey key = default(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTriggerKey), string triggerType = default(string), string triggerValue = default(string), string privilegeType = default(string), double? privilegeValue = default(double?), string reasonCode = default(string), string reasonDescription = default(string), string reference_ = default(string), string triggerSequenceAddend = 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "triggerType" is required (not null)
            if (triggerType == null)
            {
                throw new InvalidDataException("triggerType is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.TriggerType = triggerType;
            }
            // to ensure "triggerValue" is required (not null)
            if (triggerValue == null)
            {
                throw new InvalidDataException("triggerValue is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.TriggerValue = triggerValue;
            }
            // to ensure "privilegeType" is required (not null)
            if (privilegeType == null)
            {
                throw new InvalidDataException("privilegeType is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.PrivilegeType = privilegeType;
            }
            // to ensure "privilegeValue" is required (not null)
            if (privilegeValue == null)
            {
                throw new InvalidDataException("privilegeValue is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.PrivilegeValue = privilegeValue;
            }
            // to ensure "triggerSequenceAddend" is required (not null)
            if (triggerSequenceAddend == null)
            {
                throw new InvalidDataException("triggerSequenceAddend is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger and cannot be null");
            }
            else
            {
                this.TriggerSequenceAddend = triggerSequenceAddend;
            }
            this.ReasonCode = reasonCode;
            this.ReasonDescription = reasonDescription;
            this.Reference_ = reference_;
            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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTriggerKey Key { get; set; }

        /// <summary>
        /// The type of the trigger (referencing to POS configuration)
        /// </summary>
        /// <value>The type of the trigger (referencing to POS configuration)</value>
        [DataMember(Name="triggerType", EmitDefaultValue=false)]
        public string TriggerType { get; set; }

        /// <summary>
        /// The value of the trigger (referencing to POS configuration)
        /// </summary>
        /// <value>The value of the trigger (referencing to POS configuration)</value>
        [DataMember(Name="triggerValue", EmitDefaultValue=false)]
        public string TriggerValue { get; set; }

        /// <summary>
        /// Defines the method for price modification.
        /// </summary>
        /// <value>Defines the method for price modification.</value>
        [DataMember(Name="privilegeType", EmitDefaultValue=false)]
        public string PrivilegeType { get; set; }

        /// <summary>
        /// Reduction amount, reduction percent or new price amount
        /// </summary>
        /// <value>Reduction amount, reduction percent or new price amount</value>
        [DataMember(Name="privilegeValue", EmitDefaultValue=false)]
        public double? PrivilegeValue { get; set; }

        /// <summary>
        /// Reason code for the manual discount
        /// </summary>
        /// <value>Reason code for the manual discount</value>
        [DataMember(Name="reasonCode", EmitDefaultValue=false)]
        public string ReasonCode { get; set; }

        /// <summary>
        /// A narrative description describing the manual discount reason.
        /// </summary>
        /// <value>A narrative description describing the manual discount reason.</value>
        [DataMember(Name="reasonDescription", EmitDefaultValue=false)]
        public string ReasonDescription { get; set; }

        /// <summary>
        /// An additional information concerning the trigger 
        /// </summary>
        /// <value>An additional information concerning the trigger </value>
        [DataMember(Name="reference_", EmitDefaultValue=false)]
        public string Reference_ { get; set; }

        /// <summary>
        /// A value which is to be added to the sequence of the condition (which comes from the master data)
        /// </summary>
        /// <value>A value which is to be added to the sequence of the condition (which comes from the master data)</value>
        [DataMember(Name="triggerSequenceAddend", EmitDefaultValue=false)]
        public string TriggerSequenceAddend { 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  TriggerType: ").Append(TriggerType).Append("\n");
            sb.Append("  TriggerValue: ").Append(TriggerValue).Append("\n");
            sb.Append("  PrivilegeType: ").Append(PrivilegeType).Append("\n");
            sb.Append("  PrivilegeValue: ").Append(PrivilegeValue).Append("\n");
            sb.Append("  ReasonCode: ").Append(ReasonCode).Append("\n");
            sb.Append("  ReasonDescription: ").Append(ReasonDescription).Append("\n");
            sb.Append("  Reference_: ").Append(Reference_).Append("\n");
            sb.Append("  TriggerSequenceAddend: ").Append(TriggerSequenceAddend).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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionPromotionTrigger);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.TriggerType == input.TriggerType ||
                    (this.TriggerType != null &&
                    this.TriggerType.Equals(input.TriggerType))
                ) && 
                (
                    this.TriggerValue == input.TriggerValue ||
                    (this.TriggerValue != null &&
                    this.TriggerValue.Equals(input.TriggerValue))
                ) && 
                (
                    this.PrivilegeType == input.PrivilegeType ||
                    (this.PrivilegeType != null &&
                    this.PrivilegeType.Equals(input.PrivilegeType))
                ) && 
                (
                    this.PrivilegeValue == input.PrivilegeValue ||
                    (this.PrivilegeValue != null &&
                    this.PrivilegeValue.Equals(input.PrivilegeValue))
                ) && 
                (
                    this.ReasonCode == input.ReasonCode ||
                    (this.ReasonCode != null &&
                    this.ReasonCode.Equals(input.ReasonCode))
                ) && 
                (
                    this.ReasonDescription == input.ReasonDescription ||
                    (this.ReasonDescription != null &&
                    this.ReasonDescription.Equals(input.ReasonDescription))
                ) && 
                (
                    this.Reference_ == input.Reference_ ||
                    (this.Reference_ != null &&
                    this.Reference_.Equals(input.Reference_))
                ) && 
                (
                    this.TriggerSequenceAddend == input.TriggerSequenceAddend ||
                    (this.TriggerSequenceAddend != null &&
                    this.TriggerSequenceAddend.Equals(input.TriggerSequenceAddend))
                ) && 
                (
                    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.TriggerType != null)
                    hashCode = hashCode * 59 + this.TriggerType.GetHashCode();
                if (this.TriggerValue != null)
                    hashCode = hashCode * 59 + this.TriggerValue.GetHashCode();
                if (this.PrivilegeType != null)
                    hashCode = hashCode * 59 + this.PrivilegeType.GetHashCode();
                if (this.PrivilegeValue != null)
                    hashCode = hashCode * 59 + this.PrivilegeValue.GetHashCode();
                if (this.ReasonCode != null)
                    hashCode = hashCode * 59 + this.ReasonCode.GetHashCode();
                if (this.ReasonDescription != null)
                    hashCode = hashCode * 59 + this.ReasonDescription.GetHashCode();
                if (this.Reference_ != null)
                    hashCode = hashCode * 59 + this.Reference_.GetHashCode();
                if (this.TriggerSequenceAddend != null)
                    hashCode = hashCode * 59 + this.TriggerSequenceAddend.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;
        }
    }

}
