jellyfin/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs

49 lines
1.8 KiB
C#
Raw Normal View History

2020-04-15 19:28:42 +00:00
using System;
using System.Threading.Tasks;
using MediaBrowser.Controller.Authentication;
using MediaBrowser.Controller.Net;
2020-04-15 19:28:42 +00:00
using MediaBrowser.Model.QuickConnect;
namespace MediaBrowser.Controller.QuickConnect
{
/// <summary>
/// Quick connect standard interface.
/// </summary>
public interface IQuickConnect
{
/// <summary>
2021-06-18 17:31:47 +00:00
/// Gets a value indicating whether quick connect is enabled or not.
/// </summary>
2021-06-18 17:31:47 +00:00
bool IsEnabled { get; }
2020-04-15 19:28:42 +00:00
/// <summary>
/// Initiates a new quick connect request.
/// </summary>
/// <param name="authorizationInfo">The initiator authorization info.</param>
2020-07-27 04:13:14 +00:00
/// <returns>A quick connect result with tokens to proceed or throws an exception if not active.</returns>
QuickConnectResult TryConnect(AuthorizationInfo authorizationInfo);
2020-04-15 19:28:42 +00:00
/// <summary>
/// Checks the status of an individual request.
/// </summary>
/// <param name="secret">Unique secret identifier of the request.</param>
/// <returns>Quick connect result.</returns>
QuickConnectResult CheckRequestStatus(string secret);
/// <summary>
/// Authorizes a quick connect request to connect as the calling user.
/// </summary>
2020-08-17 21:36:45 +00:00
/// <param name="userId">User id.</param>
2020-06-18 06:58:58 +00:00
/// <param name="code">Identifying code for the request.</param>
2020-04-15 19:28:42 +00:00
/// <returns>A boolean indicating if the authorization completed successfully.</returns>
Task<bool> AuthorizeRequest(Guid userId, string code);
/// <summary>
/// Gets the authorized request for the secret.
/// </summary>
/// <param name="secret">The secret.</param>
/// <returns>The authentication result.</returns>
AuthenticationResult GetAuthorizedRequest(string secret);
2020-04-15 19:28:42 +00:00
}
}