jellyfin/MediaBrowser.Model/QuickConnect/QuickConnectResult.cs

49 lines
1.6 KiB
C#
Raw Normal View History

2020-04-15 15:28:42 -04:00
using System;
namespace MediaBrowser.Model.QuickConnect
{
/// <summary>
2021-06-18 13:31:47 -04:00
/// Stores the state of an quick connect request.
2020-04-15 15:28:42 -04:00
/// </summary>
public class QuickConnectResult
{
/// <summary>
2021-06-18 13:31:47 -04:00
/// Initializes a new instance of the <see cref="QuickConnectResult"/> class.
2020-04-15 15:28:42 -04:00
/// </summary>
2021-06-18 13:31:47 -04:00
/// <param name="secret">The secret used to query the request state.</param>
/// <param name="code">The code used to allow the request.</param>
/// <param name="dateAdded">The time when the request was created.</param>
public QuickConnectResult(string secret, string code, DateTime dateAdded)
{
Secret = secret;
Code = code;
DateAdded = dateAdded;
}
2020-04-15 15:28:42 -04:00
/// <summary>
2021-06-18 13:31:47 -04:00
/// Gets a value indicating whether this request is authorized.
2020-04-15 15:28:42 -04:00
/// </summary>
2021-06-18 13:31:47 -04:00
public bool Authenticated => Authentication != null;
2020-04-15 15:28:42 -04:00
/// <summary>
2021-06-18 13:31:47 -04:00
/// Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information.
2020-04-15 15:28:42 -04:00
/// </summary>
2021-06-18 13:31:47 -04:00
public string Secret { get; }
2020-04-15 15:28:42 -04:00
/// <summary>
2021-06-18 13:31:47 -04:00
/// Gets the user facing code used so the user can quickly differentiate this request from others.
2020-04-15 15:28:42 -04:00
/// </summary>
2021-06-18 13:31:47 -04:00
public string Code { get; }
2020-04-15 15:28:42 -04:00
/// <summary>
2021-06-18 13:31:47 -04:00
/// Gets or sets the private access token.
2020-04-15 15:28:42 -04:00
/// </summary>
2021-06-18 13:31:47 -04:00
public Guid? Authentication { get; set; }
2020-04-15 15:28:42 -04:00
/// <summary>
/// Gets or sets the DateTime that this request was created.
/// </summary>
2021-06-18 13:31:47 -04:00
public DateTime DateAdded { get; set; }
2020-04-15 15:28:42 -04:00
}
}