File size: 1,443 Bytes
18a519f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using Unity.Plastic.Newtonsoft.Json;

using PlasticGui.WebApi.Responses;

namespace Unity.PlasticSCM.Editor.WebApi
{
    /// <summary>
    /// Response to credentials request.
    /// </summary>
    public class CredentialsResponse
    {
        /// <summary>
        /// Error caused by the request.
        /// </summary>
        [JsonProperty("error")]
        public ErrorResponse.ErrorFields Error { get; set; }

        /// <summary>
        /// Type of the token.
        /// </summary>
        public enum TokenType : int
        {
            /// <summary>
            /// Password token.
            /// </summary>
            Password = 0,

            /// <summary>
            /// Bearer token.
            /// </summary>
            Bearer = 1,
        }

        /// <summary>
        /// Get the type of the token.
        /// </summary>
        [JsonIgnore]
        public TokenType Type
        {
            get { return (TokenType)TokenTypeValue; }
        }

        /// <summary>
        /// The user's email.
        /// </summary>
        [JsonProperty("email")]
        public string Email;

        /// <summary>
        /// The credential's token.
        /// </summary>
        [JsonProperty("token")]
        public string Token;

        /// <summary>
        /// The token type represented as an integer.
        /// </summary>
        [JsonProperty("tokenTypeValue")]
        public int TokenTypeValue;
    }
}