/* 
 * 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>
    /// AlternativeTaxInfos &lt;p&gt;This configuration entity defines the AlternativeTaxInfos.&lt;/p&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos :  IEquatable<ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos" /> class.
        /// </summary>
        /// <param name="alternativeTaxMerchandiseCategories">&lt;p&gt;List of merchandise categories for which the alternative sales tax is to be used.&lt;/p&gt;.</param>
        /// <param name="alternativeTaxMerchandiseCategoryList">&lt;p&gt;The parameter defines a list of merchandise hierarchy groups IDs separated by semicolon. The alternative tax will be applied to all line items with the merchandise hierarchy group defined in this list.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If filled then the parameter alternativeTaxMerchandiseCategories will be ignored.&lt;/p&gt;.</param>
        /// <param name="checkMerchandiseCategory">&lt;p&gt;Controls whether the merchandise category assignment is checked.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;True: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is checked.&lt;br /&gt; False: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is not checked.&lt;/p&gt; (required).</param>
        /// <param name="alternativeTaxGroupId">&lt;p&gt;Alternative tax group&lt;/p&gt;.</param>
        /// <param name="alternativeTaxMode">&lt;p&gt;false: The original tax group is used by default for each receipt. The toggle button is disabled.&lt;br /&gt; true: The alternative tax group is used by default for each receipt. The toggle button is enabled.&lt;/p&gt; (required).</param>
        /// <param name="excludedTaxGroups">&lt;p&gt;List of tax groups for which the alternative sales tax is not applied.&lt;/p&gt;.</param>
        public ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos(List<string> alternativeTaxMerchandiseCategories = default(List<string>), string alternativeTaxMerchandiseCategoryList = default(string), bool? checkMerchandiseCategory = default(bool?), string alternativeTaxGroupId = default(string), bool? alternativeTaxMode = default(bool?), List<string> excludedTaxGroups = default(List<string>))
        {
            // to ensure "checkMerchandiseCategory" is required (not null)
            if (checkMerchandiseCategory == null)
            {
                throw new InvalidDataException("checkMerchandiseCategory is a required property for ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos and cannot be null");
            }
            else
            {
                this.CheckMerchandiseCategory = checkMerchandiseCategory;
            }
            // to ensure "alternativeTaxMode" is required (not null)
            if (alternativeTaxMode == null)
            {
                throw new InvalidDataException("alternativeTaxMode is a required property for ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos and cannot be null");
            }
            else
            {
                this.AlternativeTaxMode = alternativeTaxMode;
            }
            this.AlternativeTaxMerchandiseCategories = alternativeTaxMerchandiseCategories;
            this.AlternativeTaxMerchandiseCategoryList = alternativeTaxMerchandiseCategoryList;
            this.AlternativeTaxGroupId = alternativeTaxGroupId;
            this.ExcludedTaxGroups = excludedTaxGroups;
        }
        
        /// <summary>
        /// &lt;p&gt;List of merchandise categories for which the alternative sales tax is to be used.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;List of merchandise categories for which the alternative sales tax is to be used.&lt;/p&gt;</value>
        [DataMember(Name="alternativeTaxMerchandiseCategories", EmitDefaultValue=false)]
        public List<string> AlternativeTaxMerchandiseCategories { get; set; }

        /// <summary>
        /// &lt;p&gt;The parameter defines a list of merchandise hierarchy groups IDs separated by semicolon. The alternative tax will be applied to all line items with the merchandise hierarchy group defined in this list.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If filled then the parameter alternativeTaxMerchandiseCategories will be ignored.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The parameter defines a list of merchandise hierarchy groups IDs separated by semicolon. The alternative tax will be applied to all line items with the merchandise hierarchy group defined in this list.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If filled then the parameter alternativeTaxMerchandiseCategories will be ignored.&lt;/p&gt;</value>
        [DataMember(Name="alternativeTaxMerchandiseCategoryList", EmitDefaultValue=false)]
        public string AlternativeTaxMerchandiseCategoryList { get; set; }

        /// <summary>
        /// &lt;p&gt;Controls whether the merchandise category assignment is checked.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;True: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is checked.&lt;br /&gt; False: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is not checked.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Controls whether the merchandise category assignment is checked.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;True: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is checked.&lt;br /&gt; False: Assignment to merchandise category defined in alternativeTaxMerchandiseCategoryList/alternativeTaxMerchandiseCategories is not checked.&lt;/p&gt;</value>
        [DataMember(Name="checkMerchandiseCategory", EmitDefaultValue=false)]
        public bool? CheckMerchandiseCategory { get; set; }

        /// <summary>
        /// &lt;p&gt;Alternative tax group&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Alternative tax group&lt;/p&gt;</value>
        [DataMember(Name="alternativeTaxGroupId", EmitDefaultValue=false)]
        public string AlternativeTaxGroupId { get; set; }

        /// <summary>
        /// &lt;p&gt;false: The original tax group is used by default for each receipt. The toggle button is disabled.&lt;br /&gt; true: The alternative tax group is used by default for each receipt. The toggle button is enabled.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;false: The original tax group is used by default for each receipt. The toggle button is disabled.&lt;br /&gt; true: The alternative tax group is used by default for each receipt. The toggle button is enabled.&lt;/p&gt;</value>
        [DataMember(Name="alternativeTaxMode", EmitDefaultValue=false)]
        public bool? AlternativeTaxMode { get; set; }

        /// <summary>
        /// &lt;p&gt;List of tax groups for which the alternative sales tax is not applied.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;List of tax groups for which the alternative sales tax is not applied.&lt;/p&gt;</value>
        [DataMember(Name="excludedTaxGroups", EmitDefaultValue=false)]
        public List<string> ExcludedTaxGroups { 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 ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos {\n");
            sb.Append("  AlternativeTaxMerchandiseCategories: ").Append(AlternativeTaxMerchandiseCategories).Append("\n");
            sb.Append("  AlternativeTaxMerchandiseCategoryList: ").Append(AlternativeTaxMerchandiseCategoryList).Append("\n");
            sb.Append("  CheckMerchandiseCategory: ").Append(CheckMerchandiseCategory).Append("\n");
            sb.Append("  AlternativeTaxGroupId: ").Append(AlternativeTaxGroupId).Append("\n");
            sb.Append("  AlternativeTaxMode: ").Append(AlternativeTaxMode).Append("\n");
            sb.Append("  ExcludedTaxGroups: ").Append(ExcludedTaxGroups).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 ComGkSoftwarePosApiModelConfigProcessFlowsAlternativeTaxInfos);
        }

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

            return 
                (
                    this.AlternativeTaxMerchandiseCategories == input.AlternativeTaxMerchandiseCategories ||
                    this.AlternativeTaxMerchandiseCategories != null &&
                    this.AlternativeTaxMerchandiseCategories.SequenceEqual(input.AlternativeTaxMerchandiseCategories)
                ) && 
                (
                    this.AlternativeTaxMerchandiseCategoryList == input.AlternativeTaxMerchandiseCategoryList ||
                    (this.AlternativeTaxMerchandiseCategoryList != null &&
                    this.AlternativeTaxMerchandiseCategoryList.Equals(input.AlternativeTaxMerchandiseCategoryList))
                ) && 
                (
                    this.CheckMerchandiseCategory == input.CheckMerchandiseCategory ||
                    (this.CheckMerchandiseCategory != null &&
                    this.CheckMerchandiseCategory.Equals(input.CheckMerchandiseCategory))
                ) && 
                (
                    this.AlternativeTaxGroupId == input.AlternativeTaxGroupId ||
                    (this.AlternativeTaxGroupId != null &&
                    this.AlternativeTaxGroupId.Equals(input.AlternativeTaxGroupId))
                ) && 
                (
                    this.AlternativeTaxMode == input.AlternativeTaxMode ||
                    (this.AlternativeTaxMode != null &&
                    this.AlternativeTaxMode.Equals(input.AlternativeTaxMode))
                ) && 
                (
                    this.ExcludedTaxGroups == input.ExcludedTaxGroups ||
                    this.ExcludedTaxGroups != null &&
                    this.ExcludedTaxGroups.SequenceEqual(input.ExcludedTaxGroups)
                );
        }

        /// <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.AlternativeTaxMerchandiseCategories != null)
                    hashCode = hashCode * 59 + this.AlternativeTaxMerchandiseCategories.GetHashCode();
                if (this.AlternativeTaxMerchandiseCategoryList != null)
                    hashCode = hashCode * 59 + this.AlternativeTaxMerchandiseCategoryList.GetHashCode();
                if (this.CheckMerchandiseCategory != null)
                    hashCode = hashCode * 59 + this.CheckMerchandiseCategory.GetHashCode();
                if (this.AlternativeTaxGroupId != null)
                    hashCode = hashCode * 59 + this.AlternativeTaxGroupId.GetHashCode();
                if (this.AlternativeTaxMode != null)
                    hashCode = hashCode * 59 + this.AlternativeTaxMode.GetHashCode();
                if (this.ExcludedTaxGroups != null)
                    hashCode = hashCode * 59 + this.ExcludedTaxGroups.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;
        }
    }

}
