/* 
 * 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>
    /// TillSettlementTenderDenomination &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="typeCode">The denomination type code.</param>
        /// <param name="pieceValue">Piece value  (required).</param>
        /// <param name="rollFlag">Determines whether the DenominationCount value is expressed in coin rolls (true) or single coins/notes (false) (required).</param>
        /// <param name="rollCapacity">Count of coins in the roll  (required).</param>
        /// <param name="denominationCount">The count of the denomination (required).</param>
        /// <param name="denominationAmount">The total amount of the denomination (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 ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination(ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenominationKey key = default(ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenominationKey), string typeCode = default(string), double? pieceValue = default(double?), bool? rollFlag = default(bool?), double? rollCapacity = default(double?), double? denominationCount = default(double?), double? denominationAmount = default(double?), 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 ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "pieceValue" is required (not null)
            if (pieceValue == null)
            {
                throw new InvalidDataException("pieceValue is a required property for ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.PieceValue = pieceValue;
            }
            // to ensure "rollFlag" is required (not null)
            if (rollFlag == null)
            {
                throw new InvalidDataException("rollFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.RollFlag = rollFlag;
            }
            // to ensure "rollCapacity" is required (not null)
            if (rollCapacity == null)
            {
                throw new InvalidDataException("rollCapacity is a required property for ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.RollCapacity = rollCapacity;
            }
            // to ensure "denominationCount" is required (not null)
            if (denominationCount == null)
            {
                throw new InvalidDataException("denominationCount is a required property for ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.DenominationCount = denominationCount;
            }
            // to ensure "denominationAmount" is required (not null)
            if (denominationAmount == null)
            {
                throw new InvalidDataException("denominationAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination and cannot be null");
            }
            else
            {
                this.DenominationAmount = denominationAmount;
            }
            this.TypeCode = typeCode;
            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 ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenominationKey Key { get; set; }

        /// <summary>
        /// The denomination type code
        /// </summary>
        /// <value>The denomination type code</value>
        [DataMember(Name="typeCode", EmitDefaultValue=false)]
        public string TypeCode { get; set; }

        /// <summary>
        /// Piece value 
        /// </summary>
        /// <value>Piece value </value>
        [DataMember(Name="pieceValue", EmitDefaultValue=false)]
        public double? PieceValue { get; set; }

        /// <summary>
        /// Determines whether the DenominationCount value is expressed in coin rolls (true) or single coins/notes (false)
        /// </summary>
        /// <value>Determines whether the DenominationCount value is expressed in coin rolls (true) or single coins/notes (false)</value>
        [DataMember(Name="rollFlag", EmitDefaultValue=false)]
        public bool? RollFlag { get; set; }

        /// <summary>
        /// Count of coins in the roll 
        /// </summary>
        /// <value>Count of coins in the roll </value>
        [DataMember(Name="rollCapacity", EmitDefaultValue=false)]
        public double? RollCapacity { get; set; }

        /// <summary>
        /// The count of the denomination
        /// </summary>
        /// <value>The count of the denomination</value>
        [DataMember(Name="denominationCount", EmitDefaultValue=false)]
        public double? DenominationCount { get; set; }

        /// <summary>
        /// The total amount of the denomination
        /// </summary>
        /// <value>The total amount of the denomination</value>
        [DataMember(Name="denominationAmount", EmitDefaultValue=false)]
        public double? DenominationAmount { 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 ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  TypeCode: ").Append(TypeCode).Append("\n");
            sb.Append("  PieceValue: ").Append(PieceValue).Append("\n");
            sb.Append("  RollFlag: ").Append(RollFlag).Append("\n");
            sb.Append("  RollCapacity: ").Append(RollCapacity).Append("\n");
            sb.Append("  DenominationCount: ").Append(DenominationCount).Append("\n");
            sb.Append("  DenominationAmount: ").Append(DenominationAmount).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 ComGkSoftwareGkrApiTxpoolDtoTillSettlementTenderDenomination);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.TypeCode == input.TypeCode ||
                    (this.TypeCode != null &&
                    this.TypeCode.Equals(input.TypeCode))
                ) && 
                (
                    this.PieceValue == input.PieceValue ||
                    (this.PieceValue != null &&
                    this.PieceValue.Equals(input.PieceValue))
                ) && 
                (
                    this.RollFlag == input.RollFlag ||
                    (this.RollFlag != null &&
                    this.RollFlag.Equals(input.RollFlag))
                ) && 
                (
                    this.RollCapacity == input.RollCapacity ||
                    (this.RollCapacity != null &&
                    this.RollCapacity.Equals(input.RollCapacity))
                ) && 
                (
                    this.DenominationCount == input.DenominationCount ||
                    (this.DenominationCount != null &&
                    this.DenominationCount.Equals(input.DenominationCount))
                ) && 
                (
                    this.DenominationAmount == input.DenominationAmount ||
                    (this.DenominationAmount != null &&
                    this.DenominationAmount.Equals(input.DenominationAmount))
                ) && 
                (
                    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.TypeCode != null)
                    hashCode = hashCode * 59 + this.TypeCode.GetHashCode();
                if (this.PieceValue != null)
                    hashCode = hashCode * 59 + this.PieceValue.GetHashCode();
                if (this.RollFlag != null)
                    hashCode = hashCode * 59 + this.RollFlag.GetHashCode();
                if (this.RollCapacity != null)
                    hashCode = hashCode * 59 + this.RollCapacity.GetHashCode();
                if (this.DenominationCount != null)
                    hashCode = hashCode * 59 + this.DenominationCount.GetHashCode();
                if (this.DenominationAmount != null)
                    hashCode = hashCode * 59 + this.DenominationAmount.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;
        }
    }

}
