/* 
 * 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>
    /// RetailTransactionCouponSummary &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="inputCount">Count of registered coupons  (required).</param>
        /// <param name="appliedCount">Number of used coupons &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(10, 0). Be aware of this and round value!.</param>
        /// <param name="privilegeType">Determines how the new price is to be calculated in case that rebate information is given by PrivilegeValue .</param>
        /// <param name="privilegeValue">Reduction amount, reduction percent or new price amount – depending on the chosen PrivilegeType&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="customerID">A unique system assigned identifier for the Customer..</param>
        /// <param name="customerAddressTypeCode">The customer type code.</param>
        /// <param name="retailTransactionCouponSerialSummaryList">list of coupon serials.</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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummaryKey key = default(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummaryKey), double? inputCount = default(double?), double? appliedCount = default(double?), string privilegeType = default(string), double? privilegeValue = default(double?), string customerID = default(string), string customerAddressTypeCode = default(string), List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSerialSummary> retailTransactionCouponSerialSummaryList = default(List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSerialSummary>), 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "inputCount" is required (not null)
            if (inputCount == null)
            {
                throw new InvalidDataException("inputCount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary and cannot be null");
            }
            else
            {
                this.InputCount = inputCount;
            }
            this.AppliedCount = appliedCount;
            this.PrivilegeType = privilegeType;
            this.PrivilegeValue = privilegeValue;
            this.CustomerID = customerID;
            this.CustomerAddressTypeCode = customerAddressTypeCode;
            this.RetailTransactionCouponSerialSummaryList = retailTransactionCouponSerialSummaryList;
            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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummaryKey Key { get; set; }

        /// <summary>
        /// Count of registered coupons 
        /// </summary>
        /// <value>Count of registered coupons </value>
        [DataMember(Name="inputCount", EmitDefaultValue=false)]
        public double? InputCount { get; set; }

        /// <summary>
        /// Number of used coupons &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(10, 0). Be aware of this and round value!
        /// </summary>
        /// <value>Number of used coupons &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(10, 0). Be aware of this and round value!</value>
        [DataMember(Name="appliedCount", EmitDefaultValue=false)]
        public double? AppliedCount { get; set; }

        /// <summary>
        /// Determines how the new price is to be calculated in case that rebate information is given by PrivilegeValue 
        /// </summary>
        /// <value>Determines how the new price is to be calculated in case that rebate information is given by PrivilegeValue </value>
        [DataMember(Name="privilegeType", EmitDefaultValue=false)]
        public string PrivilegeType { get; set; }

        /// <summary>
        /// Reduction amount, reduction percent or new price amount – depending on the chosen PrivilegeType&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>Reduction amount, reduction percent or new price amount – depending on the chosen PrivilegeType&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="privilegeValue", EmitDefaultValue=false)]
        public double? PrivilegeValue { 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="customerAddressTypeCode", EmitDefaultValue=false)]
        public string CustomerAddressTypeCode { get; set; }

        /// <summary>
        /// list of coupon serials
        /// </summary>
        /// <value>list of coupon serials</value>
        [DataMember(Name="retailTransactionCouponSerialSummaryList", EmitDefaultValue=false)]
        public List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSerialSummary> RetailTransactionCouponSerialSummaryList { 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  InputCount: ").Append(InputCount).Append("\n");
            sb.Append("  AppliedCount: ").Append(AppliedCount).Append("\n");
            sb.Append("  PrivilegeType: ").Append(PrivilegeType).Append("\n");
            sb.Append("  PrivilegeValue: ").Append(PrivilegeValue).Append("\n");
            sb.Append("  CustomerID: ").Append(CustomerID).Append("\n");
            sb.Append("  CustomerAddressTypeCode: ").Append(CustomerAddressTypeCode).Append("\n");
            sb.Append("  RetailTransactionCouponSerialSummaryList: ").Append(RetailTransactionCouponSerialSummaryList).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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionCouponSummary);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.InputCount == input.InputCount ||
                    (this.InputCount != null &&
                    this.InputCount.Equals(input.InputCount))
                ) && 
                (
                    this.AppliedCount == input.AppliedCount ||
                    (this.AppliedCount != null &&
                    this.AppliedCount.Equals(input.AppliedCount))
                ) && 
                (
                    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.CustomerID == input.CustomerID ||
                    (this.CustomerID != null &&
                    this.CustomerID.Equals(input.CustomerID))
                ) && 
                (
                    this.CustomerAddressTypeCode == input.CustomerAddressTypeCode ||
                    (this.CustomerAddressTypeCode != null &&
                    this.CustomerAddressTypeCode.Equals(input.CustomerAddressTypeCode))
                ) && 
                (
                    this.RetailTransactionCouponSerialSummaryList == input.RetailTransactionCouponSerialSummaryList ||
                    this.RetailTransactionCouponSerialSummaryList != null &&
                    this.RetailTransactionCouponSerialSummaryList.SequenceEqual(input.RetailTransactionCouponSerialSummaryList)
                ) && 
                (
                    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.InputCount != null)
                    hashCode = hashCode * 59 + this.InputCount.GetHashCode();
                if (this.AppliedCount != null)
                    hashCode = hashCode * 59 + this.AppliedCount.GetHashCode();
                if (this.PrivilegeType != null)
                    hashCode = hashCode * 59 + this.PrivilegeType.GetHashCode();
                if (this.PrivilegeValue != null)
                    hashCode = hashCode * 59 + this.PrivilegeValue.GetHashCode();
                if (this.CustomerID != null)
                    hashCode = hashCode * 59 + this.CustomerID.GetHashCode();
                if (this.CustomerAddressTypeCode != null)
                    hashCode = hashCode * 59 + this.CustomerAddressTypeCode.GetHashCode();
                if (this.RetailTransactionCouponSerialSummaryList != null)
                    hashCode = hashCode * 59 + this.RetailTransactionCouponSerialSummaryList.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;
        }
    }

}
