Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CredentialsResponse.cs 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Unity.Plastic.Newtonsoft.Json;
  2. using PlasticGui.WebApi.Responses;
  3. namespace Unity.PlasticSCM.Editor.WebApi
  4. {
  5. /// <summary>
  6. /// Response to credentials request.
  7. /// </summary>
  8. public class CredentialsResponse
  9. {
  10. /// <summary>
  11. /// Error caused by the request.
  12. /// </summary>
  13. [JsonProperty("error")]
  14. public ErrorResponse.ErrorFields Error { get; set; }
  15. /// <summary>
  16. /// Type of the token.
  17. /// </summary>
  18. public enum TokenType : int
  19. {
  20. /// <summary>
  21. /// Password token.
  22. /// </summary>
  23. Password = 0,
  24. /// <summary>
  25. /// Bearer token.
  26. /// </summary>
  27. Bearer = 1,
  28. }
  29. /// <summary>
  30. /// Get the type of the token.
  31. /// </summary>
  32. [JsonIgnore]
  33. public TokenType Type
  34. {
  35. get { return (TokenType)TokenTypeValue; }
  36. }
  37. /// <summary>
  38. /// The user's email.
  39. /// </summary>
  40. [JsonProperty("email")]
  41. public string Email;
  42. /// <summary>
  43. /// The credential's token.
  44. /// </summary>
  45. [JsonProperty("token")]
  46. public string Token;
  47. /// <summary>
  48. /// The token type represented as an integer.
  49. /// </summary>
  50. [JsonProperty("tokenTypeValue")]
  51. public int TokenTypeValue;
  52. }
  53. }