/* 
 * 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>
    /// TimePeriodSO &lt;p&gt;Time period&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO :  IEquatable<ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO>, IValidatableObject
    {
        /// <summary>
        /// &lt;p&gt;A 2 character code denoting the day of the week that the time period falls on&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>&lt;p&gt;A 2 character code denoting the day of the week that the time period falls on&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum DayOfWeekEnum
        {
            
            /// <summary>
            /// Enum MO for value: MO
            /// </summary>
            [EnumMember(Value = "MO")]
            MO = 1,
            
            /// <summary>
            /// Enum TU for value: TU
            /// </summary>
            [EnumMember(Value = "TU")]
            TU = 2,
            
            /// <summary>
            /// Enum WE for value: WE
            /// </summary>
            [EnumMember(Value = "WE")]
            WE = 3,
            
            /// <summary>
            /// Enum TH for value: TH
            /// </summary>
            [EnumMember(Value = "TH")]
            TH = 4,
            
            /// <summary>
            /// Enum FR for value: FR
            /// </summary>
            [EnumMember(Value = "FR")]
            FR = 5,
            
            /// <summary>
            /// Enum SA for value: SA
            /// </summary>
            [EnumMember(Value = "SA")]
            SA = 6,
            
            /// <summary>
            /// Enum SU for value: SU
            /// </summary>
            [EnumMember(Value = "SU")]
            SU = 7
        }

        /// <summary>
        /// &lt;p&gt;A 2 character code denoting the day of the week that the time period falls on&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;
        /// </summary>
        /// <value>&lt;p&gt;A 2 character code denoting the day of the week that the time period falls on&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</value>
        [DataMember(Name="dayOfWeek", EmitDefaultValue=false)]
        public DayOfWeekEnum? DayOfWeek { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO" /> class.
        /// </summary>
        /// <param name="dayOfWeek">&lt;p&gt;A 2 character code denoting the day of the week that the time period falls on&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Import:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;masterdata_Promotion_SE.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt; &lt;li&gt;PromotionCPD.xml: Promotion.Condition.GlobalData.TimePeriod.Weekday&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;.</param>
        /// <param name="startTime">&lt;p&gt;The time of day that the time period commences&lt;br /&gt;&lt;/p&gt; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone).</param>
        /// <param name="duration">&lt;p&gt;The duration included in the time period from the start time&lt;br /&gt;&lt;/p&gt;.</param>
        /// <param name="internalTimePeriodID">&lt;p&gt;ID of the time period&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Generated, not imported.&lt;br /&gt;&lt;/p&gt; (required).</param>
        /// <param name="timeRestriction">&lt;p&gt;The time restriction in cron format.&lt;br /&gt;&lt;/p&gt;.</param>
        public ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO(DayOfWeekEnum? dayOfWeek = default(DayOfWeekEnum?), string startTime = default(string), int? duration = default(int?), string internalTimePeriodID = default(string), string timeRestriction = default(string))
        {
            // to ensure "internalTimePeriodID" is required (not null)
            if (internalTimePeriodID == null)
            {
                throw new InvalidDataException("internalTimePeriodID is a required property for ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO and cannot be null");
            }
            else
            {
                this.InternalTimePeriodID = internalTimePeriodID;
            }
            this.DayOfWeek = dayOfWeek;
            this.StartTime = startTime;
            this.Duration = duration;
            this.TimeRestriction = timeRestriction;
        }
        

        /// <summary>
        /// &lt;p&gt;The time of day that the time period commences&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 time of day that the time period commences&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="startTime", EmitDefaultValue=false)]
        public string StartTime { get; set; }

        /// <summary>
        /// &lt;p&gt;The duration included in the time period from the start time&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The duration included in the time period from the start time&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="duration", EmitDefaultValue=false)]
        public int? Duration { get; set; }

        /// <summary>
        /// &lt;p&gt;ID of the time period&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Generated, not imported.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;ID of the time period&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Generated, not imported.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="internalTimePeriodID", EmitDefaultValue=false)]
        public string InternalTimePeriodID { get; set; }

        /// <summary>
        /// &lt;p&gt;The time restriction in cron format.&lt;br /&gt;&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;The time restriction in cron format.&lt;br /&gt;&lt;/p&gt;</value>
        [DataMember(Name="timeRestriction", EmitDefaultValue=false)]
        public string TimeRestriction { 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 ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO {\n");
            sb.Append("  DayOfWeek: ").Append(DayOfWeek).Append("\n");
            sb.Append("  StartTime: ").Append(StartTime).Append("\n");
            sb.Append("  Duration: ").Append(Duration).Append("\n");
            sb.Append("  InternalTimePeriodID: ").Append(InternalTimePeriodID).Append("\n");
            sb.Append("  TimeRestriction: ").Append(TimeRestriction).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 ComGkSoftwareSweeSesApiServerMdPromotionDtoSoTimePeriodSO);
        }

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

            return 
                (
                    this.DayOfWeek == input.DayOfWeek ||
                    (this.DayOfWeek != null &&
                    this.DayOfWeek.Equals(input.DayOfWeek))
                ) && 
                (
                    this.StartTime == input.StartTime ||
                    (this.StartTime != null &&
                    this.StartTime.Equals(input.StartTime))
                ) && 
                (
                    this.Duration == input.Duration ||
                    (this.Duration != null &&
                    this.Duration.Equals(input.Duration))
                ) && 
                (
                    this.InternalTimePeriodID == input.InternalTimePeriodID ||
                    (this.InternalTimePeriodID != null &&
                    this.InternalTimePeriodID.Equals(input.InternalTimePeriodID))
                ) && 
                (
                    this.TimeRestriction == input.TimeRestriction ||
                    (this.TimeRestriction != null &&
                    this.TimeRestriction.Equals(input.TimeRestriction))
                );
        }

        /// <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.DayOfWeek != null)
                    hashCode = hashCode * 59 + this.DayOfWeek.GetHashCode();
                if (this.StartTime != null)
                    hashCode = hashCode * 59 + this.StartTime.GetHashCode();
                if (this.Duration != null)
                    hashCode = hashCode * 59 + this.Duration.GetHashCode();
                if (this.InternalTimePeriodID != null)
                    hashCode = hashCode * 59 + this.InternalTimePeriodID.GetHashCode();
                if (this.TimeRestriction != null)
                    hashCode = hashCode * 59 + this.TimeRestriction.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;
        }
    }

}
