/* 
 * 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>
    /// SaleReturnLineItemPromotionTrigger &lt;p&gt;Promotion trigger for a sale return line item.&lt;/p&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger :  IEquatable<ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger" /> class.
        /// </summary>
        /// <param name="triggerSequenceNumber">&lt;p&gt;The identification of the manual trigger (because one line item can have more than one trigger).&lt;/p&gt; (required).</param>
        /// <param name="triggerType">&lt;p&gt;The type of the trigger (referencing to POS configuration).&lt;/p&gt; (required).</param>
        /// <param name="triggerValue">&lt;p&gt;The value of the trigger (referencing to POS configuration).&lt;/p&gt; (required).</param>
        /// <param name="privilegeType">&lt;p&gt;Defines the method for price modification.&lt;/p&gt; (required).</param>
        /// <param name="privilegeValue">&lt;p&gt;Reduction amount, reduction percent or new price amount.&lt;/p&gt; (required).</param>
        /// <param name="reasonCode">&lt;p&gt;Reason code for the manual discount.&lt;/p&gt;.</param>
        /// <param name="reasonDescription">&lt;p&gt;A narrative description describing the manual discount reason.&lt;/p&gt;.</param>
        /// <param name="triggerSequenceAddend">&lt;p&gt;A value which is to be added to the sequence of the condition (which comes from the master data).&lt;/p&gt;.</param>
        public ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger(int? triggerSequenceNumber = default(int?), 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 triggerSequenceAddend = default(string))
        {
            // to ensure "triggerSequenceNumber" is required (not null)
            if (triggerSequenceNumber == null)
            {
                throw new InvalidDataException("triggerSequenceNumber is a required property for ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger and cannot be null");
            }
            else
            {
                this.TriggerSequenceNumber = triggerSequenceNumber;
            }
            // to ensure "triggerType" is required (not null)
            if (triggerType == null)
            {
                throw new InvalidDataException("triggerType is a required property for ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger 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 ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger 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 ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger 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 ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger and cannot be null");
            }
            else
            {
                this.PrivilegeValue = privilegeValue;
            }
            this.ReasonCode = reasonCode;
            this.ReasonDescription = reasonDescription;
            this.TriggerSequenceAddend = triggerSequenceAddend;
        }
        
        /// <summary>
        /// &lt;p&gt;The identification of the manual trigger (because one line item can have more than one trigger).&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The identification of the manual trigger (because one line item can have more than one trigger).&lt;/p&gt;</value>
        [DataMember(Name="triggerSequenceNumber", EmitDefaultValue=false)]
        public int? TriggerSequenceNumber { get; set; }

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

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

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

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

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

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

        /// <summary>
        /// &lt;p&gt;A value which is to be added to the sequence of the condition (which comes from the master data).&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;A value which is to be added to the sequence of the condition (which comes from the master data).&lt;/p&gt;</value>
        [DataMember(Name="TriggerSequenceAddend", EmitDefaultValue=false)]
        public string TriggerSequenceAddend { 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 ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger {\n");
            sb.Append("  TriggerSequenceNumber: ").Append(TriggerSequenceNumber).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("  TriggerSequenceAddend: ").Append(TriggerSequenceAddend).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 ComGkSoftwarePosApiModelDomAppServicesTransactionSaleReturnLineItemPromotionTrigger);
        }

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

            return 
                (
                    this.TriggerSequenceNumber == input.TriggerSequenceNumber ||
                    (this.TriggerSequenceNumber != null &&
                    this.TriggerSequenceNumber.Equals(input.TriggerSequenceNumber))
                ) && 
                (
                    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.TriggerSequenceAddend == input.TriggerSequenceAddend ||
                    (this.TriggerSequenceAddend != null &&
                    this.TriggerSequenceAddend.Equals(input.TriggerSequenceAddend))
                );
        }

        /// <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.TriggerSequenceNumber != null)
                    hashCode = hashCode * 59 + this.TriggerSequenceNumber.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.TriggerSequenceAddend != null)
                    hashCode = hashCode * 59 + this.TriggerSequenceAddend.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;
        }
    }

}
