UserDto.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #nullable disable
  2. using System;
  3. using System.ComponentModel;
  4. using MediaBrowser.Model.Configuration;
  5. using MediaBrowser.Model.Users;
  6. namespace MediaBrowser.Model.Dto
  7. {
  8. /// <summary>
  9. /// Class UserDto.
  10. /// </summary>
  11. public class UserDto : IItemDto, IHasServerId
  12. {
  13. /// <summary>
  14. /// Initializes a new instance of the <see cref="UserDto"/> class.
  15. /// </summary>
  16. public UserDto()
  17. {
  18. Configuration = new UserConfiguration();
  19. Policy = new UserPolicy();
  20. }
  21. /// <summary>
  22. /// Gets or sets the name.
  23. /// </summary>
  24. /// <value>The name.</value>
  25. public string Name { get; set; }
  26. /// <summary>
  27. /// Gets or sets the server identifier.
  28. /// </summary>
  29. /// <value>The server identifier.</value>
  30. public string ServerId { get; set; }
  31. /// <summary>
  32. /// Gets or sets the name of the server.
  33. /// This is not used by the server and is for client-side usage only.
  34. /// </summary>
  35. /// <value>The name of the server.</value>
  36. public string ServerName { get; set; }
  37. /// <summary>
  38. /// Gets or sets the id.
  39. /// </summary>
  40. /// <value>The id.</value>
  41. public Guid Id { get; set; }
  42. /// <summary>
  43. /// Gets or sets the primary image tag.
  44. /// </summary>
  45. /// <value>The primary image tag.</value>
  46. public string PrimaryImageTag { get; set; }
  47. /// <summary>
  48. /// Gets or sets a value indicating whether this instance has password.
  49. /// </summary>
  50. /// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
  51. [Obsolete("This information is no longer provided")]
  52. public bool? HasPassword { get; set; } = true;
  53. /// <summary>
  54. /// Gets or sets a value indicating whether this instance has configured password.
  55. /// </summary>
  56. /// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
  57. [Obsolete("This is always true")]
  58. public bool? HasConfiguredPassword { get; set; } = true;
  59. /// <summary>
  60. /// Gets or sets a value indicating whether this instance has configured easy password.
  61. /// </summary>
  62. /// <value><c>true</c> if this instance has configured easy password; otherwise, <c>false</c>.</value>
  63. [Obsolete("Easy Password has been replaced with Quick Connect")]
  64. public bool? HasConfiguredEasyPassword { get; set; } = false;
  65. /// <summary>
  66. /// Gets or sets whether async login is enabled or not.
  67. /// </summary>
  68. public bool? EnableAutoLogin { get; set; }
  69. /// <summary>
  70. /// Gets or sets the last login date.
  71. /// </summary>
  72. /// <value>The last login date.</value>
  73. public DateTime? LastLoginDate { get; set; }
  74. /// <summary>
  75. /// Gets or sets the last activity date.
  76. /// </summary>
  77. /// <value>The last activity date.</value>
  78. public DateTime? LastActivityDate { get; set; }
  79. /// <summary>
  80. /// Gets or sets the configuration.
  81. /// </summary>
  82. /// <value>The configuration.</value>
  83. public UserConfiguration Configuration { get; set; }
  84. /// <summary>
  85. /// Gets or sets the policy.
  86. /// </summary>
  87. /// <value>The policy.</value>
  88. public UserPolicy Policy { get; set; }
  89. /// <summary>
  90. /// Gets or sets the primary image aspect ratio.
  91. /// </summary>
  92. /// <value>The primary image aspect ratio.</value>
  93. public double? PrimaryImageAspectRatio { get; set; }
  94. /// <inheritdoc />
  95. public override string ToString()
  96. {
  97. return Name ?? base.ToString();
  98. }
  99. }
  100. }