/* 
 * 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>
    /// RetailTransactionManufacturerCouponSummary &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="manufacturerCompanyCode">The 6 to 12 digit GS1 Company Prefix of the manufacturer that is funding this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise. (required).</param>
        /// <param name="manufacturerOfferCode">A 6-digit number (assigned by the holder of the ManufacturerCompanyCode) that identifies this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise. (required).</param>
        /// <param name="keyEnteredFlag">A flag to denote whether the manufacturer coupon was key entered or scanned (required).</param>
        /// <param name="inputCount">The number how often the manufacturer coupon was registered (required).</param>
        /// <param name="appliedCount">The number how often the manufacturer coupon was applied (required).</param>
        /// <param name="appliedIntervalCount">The number of intervals for which the manufacturer coupon was applied (required).</param>
        /// <param name="totalAmount">The total discount amount that is granted by applying the manufacturer coupon according to its AppliedCount (required).</param>
        /// <param name="tenderLineItemSequenceNumber">The reference to the corresponding tender line item.</param>
        /// <param name="saleLineItemValidationList">list of validating sale line items.</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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummaryKey key = default(ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummaryKey), string manufacturerCompanyCode = default(string), string manufacturerOfferCode = default(string), bool? keyEnteredFlag = default(bool?), double? inputCount = default(double?), double? appliedCount = default(double?), double? appliedIntervalCount = default(double?), double? totalAmount = default(double?), int? tenderLineItemSequenceNumber = default(int?), List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponValidation> saleLineItemValidationList = default(List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponValidation>), 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "manufacturerCompanyCode" is required (not null)
            if (manufacturerCompanyCode == null)
            {
                throw new InvalidDataException("manufacturerCompanyCode is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.ManufacturerCompanyCode = manufacturerCompanyCode;
            }
            // to ensure "manufacturerOfferCode" is required (not null)
            if (manufacturerOfferCode == null)
            {
                throw new InvalidDataException("manufacturerOfferCode is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.ManufacturerOfferCode = manufacturerOfferCode;
            }
            // to ensure "keyEnteredFlag" is required (not null)
            if (keyEnteredFlag == null)
            {
                throw new InvalidDataException("keyEnteredFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.KeyEnteredFlag = keyEnteredFlag;
            }
            // to ensure "inputCount" is required (not null)
            if (inputCount == null)
            {
                throw new InvalidDataException("inputCount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.InputCount = inputCount;
            }
            // to ensure "appliedCount" is required (not null)
            if (appliedCount == null)
            {
                throw new InvalidDataException("appliedCount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.AppliedCount = appliedCount;
            }
            // to ensure "appliedIntervalCount" is required (not null)
            if (appliedIntervalCount == null)
            {
                throw new InvalidDataException("appliedIntervalCount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.AppliedIntervalCount = appliedIntervalCount;
            }
            // to ensure "totalAmount" is required (not null)
            if (totalAmount == null)
            {
                throw new InvalidDataException("totalAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary and cannot be null");
            }
            else
            {
                this.TotalAmount = totalAmount;
            }
            this.TenderLineItemSequenceNumber = tenderLineItemSequenceNumber;
            this.SaleLineItemValidationList = saleLineItemValidationList;
            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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummaryKey Key { get; set; }

        /// <summary>
        /// The 6 to 12 digit GS1 Company Prefix of the manufacturer that is funding this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise.
        /// </summary>
        /// <value>The 6 to 12 digit GS1 Company Prefix of the manufacturer that is funding this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise.</value>
        [DataMember(Name="manufacturerCompanyCode", EmitDefaultValue=false)]
        public string ManufacturerCompanyCode { get; set; }

        /// <summary>
        /// A 6-digit number (assigned by the holder of the ManufacturerCompanyCode) that identifies this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise.
        /// </summary>
        /// <value>A 6-digit number (assigned by the holder of the ManufacturerCompanyCode) that identifies this offer. This information is derived from the ManufacturerCouponScanCode in case that the manufacturer coupon was scanned, or manually entered otherwise.</value>
        [DataMember(Name="manufacturerOfferCode", EmitDefaultValue=false)]
        public string ManufacturerOfferCode { get; set; }

        /// <summary>
        /// A flag to denote whether the manufacturer coupon was key entered or scanned
        /// </summary>
        /// <value>A flag to denote whether the manufacturer coupon was key entered or scanned</value>
        [DataMember(Name="keyEnteredFlag", EmitDefaultValue=false)]
        public bool? KeyEnteredFlag { get; set; }

        /// <summary>
        /// The number how often the manufacturer coupon was registered
        /// </summary>
        /// <value>The number how often the manufacturer coupon was registered</value>
        [DataMember(Name="inputCount", EmitDefaultValue=false)]
        public double? InputCount { get; set; }

        /// <summary>
        /// The number how often the manufacturer coupon was applied
        /// </summary>
        /// <value>The number how often the manufacturer coupon was applied</value>
        [DataMember(Name="appliedCount", EmitDefaultValue=false)]
        public double? AppliedCount { get; set; }

        /// <summary>
        /// The number of intervals for which the manufacturer coupon was applied
        /// </summary>
        /// <value>The number of intervals for which the manufacturer coupon was applied</value>
        [DataMember(Name="appliedIntervalCount", EmitDefaultValue=false)]
        public double? AppliedIntervalCount { get; set; }

        /// <summary>
        /// The total discount amount that is granted by applying the manufacturer coupon according to its AppliedCount
        /// </summary>
        /// <value>The total discount amount that is granted by applying the manufacturer coupon according to its AppliedCount</value>
        [DataMember(Name="totalAmount", EmitDefaultValue=false)]
        public double? TotalAmount { get; set; }

        /// <summary>
        /// The reference to the corresponding tender line item
        /// </summary>
        /// <value>The reference to the corresponding tender line item</value>
        [DataMember(Name="tenderLineItemSequenceNumber", EmitDefaultValue=false)]
        public int? TenderLineItemSequenceNumber { get; set; }

        /// <summary>
        /// list of validating sale line items
        /// </summary>
        /// <value>list of validating sale line items</value>
        [DataMember(Name="saleLineItemValidationList", EmitDefaultValue=false)]
        public List<ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponValidation> SaleLineItemValidationList { 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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  ManufacturerCompanyCode: ").Append(ManufacturerCompanyCode).Append("\n");
            sb.Append("  ManufacturerOfferCode: ").Append(ManufacturerOfferCode).Append("\n");
            sb.Append("  KeyEnteredFlag: ").Append(KeyEnteredFlag).Append("\n");
            sb.Append("  InputCount: ").Append(InputCount).Append("\n");
            sb.Append("  AppliedCount: ").Append(AppliedCount).Append("\n");
            sb.Append("  AppliedIntervalCount: ").Append(AppliedIntervalCount).Append("\n");
            sb.Append("  TotalAmount: ").Append(TotalAmount).Append("\n");
            sb.Append("  TenderLineItemSequenceNumber: ").Append(TenderLineItemSequenceNumber).Append("\n");
            sb.Append("  SaleLineItemValidationList: ").Append(SaleLineItemValidationList).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 ComGkSoftwareGkrApiTxpoolDtoRetailTransactionManufacturerCouponSummary);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.ManufacturerCompanyCode == input.ManufacturerCompanyCode ||
                    (this.ManufacturerCompanyCode != null &&
                    this.ManufacturerCompanyCode.Equals(input.ManufacturerCompanyCode))
                ) && 
                (
                    this.ManufacturerOfferCode == input.ManufacturerOfferCode ||
                    (this.ManufacturerOfferCode != null &&
                    this.ManufacturerOfferCode.Equals(input.ManufacturerOfferCode))
                ) && 
                (
                    this.KeyEnteredFlag == input.KeyEnteredFlag ||
                    (this.KeyEnteredFlag != null &&
                    this.KeyEnteredFlag.Equals(input.KeyEnteredFlag))
                ) && 
                (
                    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.AppliedIntervalCount == input.AppliedIntervalCount ||
                    (this.AppliedIntervalCount != null &&
                    this.AppliedIntervalCount.Equals(input.AppliedIntervalCount))
                ) && 
                (
                    this.TotalAmount == input.TotalAmount ||
                    (this.TotalAmount != null &&
                    this.TotalAmount.Equals(input.TotalAmount))
                ) && 
                (
                    this.TenderLineItemSequenceNumber == input.TenderLineItemSequenceNumber ||
                    (this.TenderLineItemSequenceNumber != null &&
                    this.TenderLineItemSequenceNumber.Equals(input.TenderLineItemSequenceNumber))
                ) && 
                (
                    this.SaleLineItemValidationList == input.SaleLineItemValidationList ||
                    this.SaleLineItemValidationList != null &&
                    this.SaleLineItemValidationList.SequenceEqual(input.SaleLineItemValidationList)
                ) && 
                (
                    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.ManufacturerCompanyCode != null)
                    hashCode = hashCode * 59 + this.ManufacturerCompanyCode.GetHashCode();
                if (this.ManufacturerOfferCode != null)
                    hashCode = hashCode * 59 + this.ManufacturerOfferCode.GetHashCode();
                if (this.KeyEnteredFlag != null)
                    hashCode = hashCode * 59 + this.KeyEnteredFlag.GetHashCode();
                if (this.InputCount != null)
                    hashCode = hashCode * 59 + this.InputCount.GetHashCode();
                if (this.AppliedCount != null)
                    hashCode = hashCode * 59 + this.AppliedCount.GetHashCode();
                if (this.AppliedIntervalCount != null)
                    hashCode = hashCode * 59 + this.AppliedIntervalCount.GetHashCode();
                if (this.TotalAmount != null)
                    hashCode = hashCode * 59 + this.TotalAmount.GetHashCode();
                if (this.TenderLineItemSequenceNumber != null)
                    hashCode = hashCode * 59 + this.TenderLineItemSequenceNumber.GetHashCode();
                if (this.SaleLineItemValidationList != null)
                    hashCode = hashCode * 59 + this.SaleLineItemValidationList.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;
        }
    }

}
