using System;

namespace Aitex.Core.Account
{
    [Serializable]
    public class CredentialKeepAliveCheckResult
    {
        #region Constructors

        public CredentialKeepAliveCheckResult() : this(CredentialKeepAliveStates.NotFound)
        {
           
        }

        public CredentialKeepAliveCheckResult(CredentialKeepAliveStates state) : this(state, null)
        {
            State = state;
        }

        public CredentialKeepAliveCheckResult(CredentialKeepAliveStates state, Credential credRequesting)
        {
            State = state;
            RequestingCredential = credRequesting;
        }

        #endregion

        #region Properties

        /// <summary>
        /// 返回凭据存活状态。
        /// </summary>
        public CredentialKeepAliveStates State { get; set; }

        /// <summary>
        /// 如果<see cref="State"/>等于<see cref="CredentialKeepAliveStates.RequestingLogin"/>，则返回正在发起登录请求的用户名。
        /// </summary>
        public Credential RequestingCredential { get; set; }

        #endregion
    }
}
