/* 
 * 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>
    /// WorkstationStatus &lt;p&gt;This DB table contains information about&lt;/p&gt;&lt;ul&gt;&lt;li&gt;online/offline workstations&lt;/li&gt;&lt;li&gt;sign-on (also paused) / sign-off operators on workstations&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus :  IEquatable<ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="workstationLastConnectedAddress">last workstation client address (IP + DNS name) (required).</param>
        /// <param name="workstationLastConnectedTimestamp">the time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone).</param>
        /// <param name="loginType">POS, ACCOUNTING, TECHNICAL - this info is used for concurrency check when the operator tries to login on more workstations (required).</param>
        /// <param name="operatorID">signed operator id. EMPTY if operator does sign off.the information is not guaranteed if workstation is considered as offline.</param>
        /// <param name="workstationLastConnectedTimestampUTC0">the UTC0 time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; UTC0 date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ&#39; (with timezone).</param>
        /// <param name="token">token to be used in successive calls, otherwise the data will be rejected. This provides control if calls are done in correct order.If background process is about to notify server that client is still alive and operator is login in, request from the background process can get delayed and can be processed after login request, effectively login out the user, so correct order is important..</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 ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus(ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatusKey key = default(ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatusKey), string workstationLastConnectedAddress = default(string), string workstationLastConnectedTimestamp = default(string), string loginType = default(string), string operatorID = default(string), DateTime? workstationLastConnectedTimestampUTC0 = default(DateTime?), string token = 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 ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "workstationLastConnectedAddress" is required (not null)
            if (workstationLastConnectedAddress == null)
            {
                throw new InvalidDataException("workstationLastConnectedAddress is a required property for ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus and cannot be null");
            }
            else
            {
                this.WorkstationLastConnectedAddress = workstationLastConnectedAddress;
            }
            // to ensure "loginType" is required (not null)
            if (loginType == null)
            {
                throw new InvalidDataException("loginType is a required property for ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus and cannot be null");
            }
            else
            {
                this.LoginType = loginType;
            }
            this.WorkstationLastConnectedTimestamp = workstationLastConnectedTimestamp;
            this.OperatorID = operatorID;
            this.WorkstationLastConnectedTimestampUTC0 = workstationLastConnectedTimestampUTC0;
            this.Token = token;
            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 ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatusKey Key { get; set; }

        /// <summary>
        /// last workstation client address (IP + DNS name)
        /// </summary>
        /// <value>last workstation client address (IP + DNS name)</value>
        [DataMember(Name="workstationLastConnectedAddress", EmitDefaultValue=false)]
        public string WorkstationLastConnectedAddress { get; set; }

        /// <summary>
        /// the time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)
        /// </summary>
        /// <value>the time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; Date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSS&#39; (no timezone)</value>
        [DataMember(Name="workstationLastConnectedTimestamp", EmitDefaultValue=false)]
        public string WorkstationLastConnectedTimestamp { get; set; }

        /// <summary>
        /// POS, ACCOUNTING, TECHNICAL - this info is used for concurrency check when the operator tries to login on more workstations
        /// </summary>
        /// <value>POS, ACCOUNTING, TECHNICAL - this info is used for concurrency check when the operator tries to login on more workstations</value>
        [DataMember(Name="loginType", EmitDefaultValue=false)]
        public string LoginType { get; set; }

        /// <summary>
        /// signed operator id. EMPTY if operator does sign off.the information is not guaranteed if workstation is considered as offline
        /// </summary>
        /// <value>signed operator id. EMPTY if operator does sign off.the information is not guaranteed if workstation is considered as offline</value>
        [DataMember(Name="operatorID", EmitDefaultValue=false)]
        public string OperatorID { get; set; }

        /// <summary>
        /// the UTC0 time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; UTC0 date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ&#39; (with timezone)
        /// </summary>
        /// <value>the UTC0 time of last workstation ping.if current time - WorkstationLastConnectedTimestamp &gt; TIMEOUT (property pos_server.login_manager.timeout)then workstation is considered as offline; UTC0 date format &#39;yyyy-MM-dd&#39;T&#39;HH:mm:ss.SSSZ&#39; (with timezone)</value>
        [DataMember(Name="workstationLastConnectedTimestampUTC0", EmitDefaultValue=false)]
        public DateTime? WorkstationLastConnectedTimestampUTC0 { get; set; }

        /// <summary>
        /// token to be used in successive calls, otherwise the data will be rejected. This provides control if calls are done in correct order.If background process is about to notify server that client is still alive and operator is login in, request from the background process can get delayed and can be processed after login request, effectively login out the user, so correct order is important.
        /// </summary>
        /// <value>token to be used in successive calls, otherwise the data will be rejected. This provides control if calls are done in correct order.If background process is about to notify server that client is still alive and operator is login in, request from the background process can get delayed and can be processed after login request, effectively login out the user, so correct order is important.</value>
        [DataMember(Name="token", EmitDefaultValue=false)]
        public string Token { 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 ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  WorkstationLastConnectedAddress: ").Append(WorkstationLastConnectedAddress).Append("\n");
            sb.Append("  WorkstationLastConnectedTimestamp: ").Append(WorkstationLastConnectedTimestamp).Append("\n");
            sb.Append("  LoginType: ").Append(LoginType).Append("\n");
            sb.Append("  OperatorID: ").Append(OperatorID).Append("\n");
            sb.Append("  WorkstationLastConnectedTimestampUTC0: ").Append(WorkstationLastConnectedTimestampUTC0).Append("\n");
            sb.Append("  Token: ").Append(Token).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 ComGkSoftwareGkrApiLoginManagerDtoWorkstationStatus);
        }

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

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.WorkstationLastConnectedAddress == input.WorkstationLastConnectedAddress ||
                    (this.WorkstationLastConnectedAddress != null &&
                    this.WorkstationLastConnectedAddress.Equals(input.WorkstationLastConnectedAddress))
                ) && 
                (
                    this.WorkstationLastConnectedTimestamp == input.WorkstationLastConnectedTimestamp ||
                    (this.WorkstationLastConnectedTimestamp != null &&
                    this.WorkstationLastConnectedTimestamp.Equals(input.WorkstationLastConnectedTimestamp))
                ) && 
                (
                    this.LoginType == input.LoginType ||
                    (this.LoginType != null &&
                    this.LoginType.Equals(input.LoginType))
                ) && 
                (
                    this.OperatorID == input.OperatorID ||
                    (this.OperatorID != null &&
                    this.OperatorID.Equals(input.OperatorID))
                ) && 
                (
                    this.WorkstationLastConnectedTimestampUTC0 == input.WorkstationLastConnectedTimestampUTC0 ||
                    (this.WorkstationLastConnectedTimestampUTC0 != null &&
                    this.WorkstationLastConnectedTimestampUTC0.Equals(input.WorkstationLastConnectedTimestampUTC0))
                ) && 
                (
                    this.Token == input.Token ||
                    (this.Token != null &&
                    this.Token.Equals(input.Token))
                ) && 
                (
                    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.WorkstationLastConnectedAddress != null)
                    hashCode = hashCode * 59 + this.WorkstationLastConnectedAddress.GetHashCode();
                if (this.WorkstationLastConnectedTimestamp != null)
                    hashCode = hashCode * 59 + this.WorkstationLastConnectedTimestamp.GetHashCode();
                if (this.LoginType != null)
                    hashCode = hashCode * 59 + this.LoginType.GetHashCode();
                if (this.OperatorID != null)
                    hashCode = hashCode * 59 + this.OperatorID.GetHashCode();
                if (this.WorkstationLastConnectedTimestampUTC0 != null)
                    hashCode = hashCode * 59 + this.WorkstationLastConnectedTimestampUTC0.GetHashCode();
                if (this.Token != null)
                    hashCode = hashCode * 59 + this.Token.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;
        }
    }

}
