/* 
 * 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>
    /// ExchangeRateDO &lt;p&gt;A exchange rate expresses the quantitative conversion factor between two kinds of currency, one which must be the store&#39;s home currency.&lt;br /&gt;&lt;/p&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO :  IEquatable<ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO>, IValidatableObject
    {
        /// <summary>
        /// &lt;p&gt;Type of origin.&lt;br /&gt; OriginCode:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt; PARENT_COPY &#x3D; &#39;00&#39;&lt;br /&gt; IMPORT &#x3D; &#39;01&#39;&lt;br /&gt; MANUAL &#x3D; &#39;02&#39;&lt;br /&gt;&lt;/pre&gt;
        /// </summary>
        /// <value>&lt;p&gt;Type of origin.&lt;br /&gt; OriginCode:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt; PARENT_COPY &#x3D; &#39;00&#39;&lt;br /&gt; IMPORT &#x3D; &#39;01&#39;&lt;br /&gt; MANUAL &#x3D; &#39;02&#39;&lt;br /&gt;&lt;/pre&gt;</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum OriginEnum
        {
            
            /// <summary>
            /// Enum PARENTCOPY for value: PARENT_COPY
            /// </summary>
            [EnumMember(Value = "PARENT_COPY")]
            PARENTCOPY = 1,
            
            /// <summary>
            /// Enum IMPORT for value: IMPORT
            /// </summary>
            [EnumMember(Value = "IMPORT")]
            IMPORT = 2,
            
            /// <summary>
            /// Enum MANUAL for value: MANUAL
            /// </summary>
            [EnumMember(Value = "MANUAL")]
            MANUAL = 3
        }

        /// <summary>
        /// &lt;p&gt;Type of origin.&lt;br /&gt; OriginCode:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt; PARENT_COPY &#x3D; &#39;00&#39;&lt;br /&gt; IMPORT &#x3D; &#39;01&#39;&lt;br /&gt; MANUAL &#x3D; &#39;02&#39;&lt;br /&gt;&lt;/pre&gt;
        /// </summary>
        /// <value>&lt;p&gt;Type of origin.&lt;br /&gt; OriginCode:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt; PARENT_COPY &#x3D; &#39;00&#39;&lt;br /&gt; IMPORT &#x3D; &#39;01&#39;&lt;br /&gt; MANUAL &#x3D; &#39;02&#39;&lt;br /&gt;&lt;/pre&gt;</value>
        [DataMember(Name="origin", EmitDefaultValue=false)]
        public OriginEnum? Origin { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="fromCurrencyID">&lt;p&gt;The unique system assigned identifier of the source currency.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="toCurrencyID">&lt;p&gt;The unique system assigned identifier of the destination currency.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="exchangeRateEffectiveDate">&lt;p&gt;The date on which a specific exchange rate becomes effective.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone) (required).</param>
        /// <param name="exchangeRateExpirationDate">&lt;p&gt;Date on which the exchange rate expires and is no longer valid.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone) (required).</param>
        /// <param name="toBuyAmount">&lt;p&gt;The buying rate of the tender type, based on the store&#39;s local currency.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="multiplyFlag">&lt;p&gt;Determines whether inside the calculation FromCurrencyCode -&amp;gt; ToCurrencyCode the amount is to be multiplied with (true) or divided by (false) the ToBuyAmount / ToSellAmount&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="origin">&lt;p&gt;Type of origin.&lt;br /&gt; OriginCode:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt; PARENT_COPY &#x3D; &#39;00&#39;&lt;br /&gt; IMPORT &#x3D; &#39;01&#39;&lt;br /&gt; MANUAL &#x3D; &#39;02&#39;&lt;br /&gt;&lt;/pre&gt;.</param>
        /// <param name="packageID">&lt;p&gt;Internal identification of the import package (e.g. IDoc file). The identification is used for monitoring purposes.&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="xxcustom05">&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="xxcustom03">&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="xxcustom02">&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="xxcustom04">&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="xxcustom01">&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;.</param>
        public ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO(ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDOKey key = default(ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDOKey), string fromCurrencyID = default(string), string toCurrencyID = default(string), string exchangeRateEffectiveDate = default(string), string exchangeRateExpirationDate = default(string), double? toBuyAmount = default(double?), bool? multiplyFlag = default(bool?), OriginEnum? origin = default(OriginEnum?), string packageID = default(string), 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 ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "fromCurrencyID" is required (not null)
            if (fromCurrencyID == null)
            {
                throw new InvalidDataException("fromCurrencyID is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.FromCurrencyID = fromCurrencyID;
            }
            // to ensure "toCurrencyID" is required (not null)
            if (toCurrencyID == null)
            {
                throw new InvalidDataException("toCurrencyID is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.ToCurrencyID = toCurrencyID;
            }
            // to ensure "exchangeRateEffectiveDate" is required (not null)
            if (exchangeRateEffectiveDate == null)
            {
                throw new InvalidDataException("exchangeRateEffectiveDate is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.ExchangeRateEffectiveDate = exchangeRateEffectiveDate;
            }
            // to ensure "exchangeRateExpirationDate" is required (not null)
            if (exchangeRateExpirationDate == null)
            {
                throw new InvalidDataException("exchangeRateExpirationDate is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.ExchangeRateExpirationDate = exchangeRateExpirationDate;
            }
            // to ensure "toBuyAmount" is required (not null)
            if (toBuyAmount == null)
            {
                throw new InvalidDataException("toBuyAmount is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.ToBuyAmount = toBuyAmount;
            }
            // to ensure "multiplyFlag" is required (not null)
            if (multiplyFlag == null)
            {
                throw new InvalidDataException("multiplyFlag is a required property for ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO and cannot be null");
            }
            else
            {
                this.MultiplyFlag = multiplyFlag;
            }
            this.Origin = origin;
            this.PackageID = packageID;
            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 ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDOKey Key { get; set; }

        /// <summary>
        /// &lt;p&gt;The unique system assigned identifier of the source currency.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The unique system assigned identifier of the source currency.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="fromCurrencyID", EmitDefaultValue=false)]
        public string FromCurrencyID { get; set; }

        /// <summary>
        /// &lt;p&gt;The unique system assigned identifier of the destination currency.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The unique system assigned identifier of the destination currency.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="toCurrencyID", EmitDefaultValue=false)]
        public string ToCurrencyID { get; set; }

        /// <summary>
        /// &lt;p&gt;The date on which a specific exchange rate becomes effective.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)
        /// </summary>
        /// <value>&lt;p&gt;The date on which a specific exchange rate becomes effective.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)</value>
        [DataMember(Name="exchangeRateEffectiveDate", EmitDefaultValue=false)]
        public string ExchangeRateEffectiveDate { get; set; }

        /// <summary>
        /// &lt;p&gt;Date on which the exchange rate expires and is no longer valid.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)
        /// </summary>
        /// <value>&lt;p&gt;Date on which the exchange rate expires and is no longer valid.&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)</value>
        [DataMember(Name="exchangeRateExpirationDate", EmitDefaultValue=false)]
        public string ExchangeRateExpirationDate { get; set; }

        /// <summary>
        /// &lt;p&gt;The buying rate of the tender type, based on the store&#39;s local currency.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The buying rate of the tender type, based on the store&#39;s local currency.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="toBuyAmount", EmitDefaultValue=false)]
        public double? ToBuyAmount { get; set; }

        /// <summary>
        /// &lt;p&gt;Determines whether inside the calculation FromCurrencyCode -&amp;gt; ToCurrencyCode the amount is to be multiplied with (true) or divided by (false) the ToBuyAmount / ToSellAmount&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Determines whether inside the calculation FromCurrencyCode -&amp;gt; ToCurrencyCode the amount is to be multiplied with (true) or divided by (false) the ToBuyAmount / ToSellAmount&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="multiplyFlag", EmitDefaultValue=false)]
        public bool? MultiplyFlag { get; set; }


        /// <summary>
        /// &lt;p&gt;Internal identification of the import package (e.g. IDoc file). The identification is used for monitoring purposes.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Internal identification of the import package (e.g. IDoc file). The identification is used for monitoring purposes.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="packageID", EmitDefaultValue=false)]
        public string PackageID { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="xxcustom05", EmitDefaultValue=false)]
        public string Xxcustom05 { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="xxcustom03", EmitDefaultValue=false)]
        public string Xxcustom03 { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="xxcustom02", EmitDefaultValue=false)]
        public string Xxcustom02 { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="xxcustom04", EmitDefaultValue=false)]
        public string Xxcustom04 { get; set; }

        /// <summary>
        /// &lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Additional field for custom development.&lt;br /&gt;&lt;/p&gt;</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 ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  FromCurrencyID: ").Append(FromCurrencyID).Append("\n");
            sb.Append("  ToCurrencyID: ").Append(ToCurrencyID).Append("\n");
            sb.Append("  ExchangeRateEffectiveDate: ").Append(ExchangeRateEffectiveDate).Append("\n");
            sb.Append("  ExchangeRateExpirationDate: ").Append(ExchangeRateExpirationDate).Append("\n");
            sb.Append("  ToBuyAmount: ").Append(ToBuyAmount).Append("\n");
            sb.Append("  MultiplyFlag: ").Append(MultiplyFlag).Append("\n");
            sb.Append("  Origin: ").Append(Origin).Append("\n");
            sb.Append("  PackageID: ").Append(PackageID).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 ComGkSoftwareGkrApiServerMdExchangeRateDtoDomExchangeRateDO);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.FromCurrencyID == input.FromCurrencyID ||
                    (this.FromCurrencyID != null &&
                    this.FromCurrencyID.Equals(input.FromCurrencyID))
                ) && 
                (
                    this.ToCurrencyID == input.ToCurrencyID ||
                    (this.ToCurrencyID != null &&
                    this.ToCurrencyID.Equals(input.ToCurrencyID))
                ) && 
                (
                    this.ExchangeRateEffectiveDate == input.ExchangeRateEffectiveDate ||
                    (this.ExchangeRateEffectiveDate != null &&
                    this.ExchangeRateEffectiveDate.Equals(input.ExchangeRateEffectiveDate))
                ) && 
                (
                    this.ExchangeRateExpirationDate == input.ExchangeRateExpirationDate ||
                    (this.ExchangeRateExpirationDate != null &&
                    this.ExchangeRateExpirationDate.Equals(input.ExchangeRateExpirationDate))
                ) && 
                (
                    this.ToBuyAmount == input.ToBuyAmount ||
                    (this.ToBuyAmount != null &&
                    this.ToBuyAmount.Equals(input.ToBuyAmount))
                ) && 
                (
                    this.MultiplyFlag == input.MultiplyFlag ||
                    (this.MultiplyFlag != null &&
                    this.MultiplyFlag.Equals(input.MultiplyFlag))
                ) && 
                (
                    this.Origin == input.Origin ||
                    (this.Origin != null &&
                    this.Origin.Equals(input.Origin))
                ) && 
                (
                    this.PackageID == input.PackageID ||
                    (this.PackageID != null &&
                    this.PackageID.Equals(input.PackageID))
                ) && 
                (
                    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.FromCurrencyID != null)
                    hashCode = hashCode * 59 + this.FromCurrencyID.GetHashCode();
                if (this.ToCurrencyID != null)
                    hashCode = hashCode * 59 + this.ToCurrencyID.GetHashCode();
                if (this.ExchangeRateEffectiveDate != null)
                    hashCode = hashCode * 59 + this.ExchangeRateEffectiveDate.GetHashCode();
                if (this.ExchangeRateExpirationDate != null)
                    hashCode = hashCode * 59 + this.ExchangeRateExpirationDate.GetHashCode();
                if (this.ToBuyAmount != null)
                    hashCode = hashCode * 59 + this.ToBuyAmount.GetHashCode();
                if (this.MultiplyFlag != null)
                    hashCode = hashCode * 59 + this.MultiplyFlag.GetHashCode();
                if (this.Origin != null)
                    hashCode = hashCode * 59 + this.Origin.GetHashCode();
                if (this.PackageID != null)
                    hashCode = hashCode * 59 + this.PackageID.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;
        }
    }

}
