using System.ComponentModel;
using Unity.Plastic.Newtonsoft.Json;
using PlasticGui.WebApi.Responses;
namespace Unity.PlasticSCM.Editor.WebApi
{
    /// 
    /// Response to credentials request.
    /// Internal usage. This isn't a public API.
    /// 
    [EditorBrowsable(EditorBrowsableState.Never)]
    public class CredentialsResponse
    {
        /// 
        /// Error caused by the request.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        [JsonProperty("error")]
        public ErrorResponse.ErrorFields Error { get; set; }
        /// 
        /// Type of the token.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        public enum TokenType : int
        {
            /// 
            /// Password token.
            /// 
            Password = 0,
            /// 
            /// Bearer token.
            /// 
            Bearer = 1,
        }
        /// 
        /// Get the type of the token.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        [JsonIgnore]
        public TokenType Type
        {
            get { return (TokenType)TokenTypeValue; }
        }
        /// 
        /// The user's email.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        [JsonProperty("email")]
        public string Email;
        /// 
        /// The credential's token.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        [JsonProperty("token")]
        public string Token;
        /// 
        /// The token type represented as an integer.
        /// 
        [EditorBrowsable(EditorBrowsableState.Never)]
        [JsonProperty("tokenTypeValue")]
        public int TokenTypeValue;
    }
}