jellyfin/MediaBrowser.Controller/QuickConnect/IQuickConnect.cs

40 lines
1.4 KiB
C#
Raw Normal View History

2020-04-15 21:28:42 +02:00
using System;
using System.Threading.Tasks;
2021-04-14 02:01:21 +02:00
using MediaBrowser.Controller.Session;
2020-04-15 21:28:42 +02:00
using MediaBrowser.Model.QuickConnect;
namespace MediaBrowser.Controller.QuickConnect
{
/// <summary>
/// Quick connect standard interface.
/// </summary>
public interface IQuickConnect
{
/// <summary>
2021-06-18 19:31:47 +02:00
/// Gets a value indicating whether quick connect is enabled or not.
/// </summary>
2021-06-18 19:31:47 +02:00
bool IsEnabled { get; }
2020-04-15 21:28:42 +02:00
/// <summary>
/// Initiates a new quick connect request.
/// </summary>
2020-07-27 06:13:14 +02:00
/// <returns>A quick connect result with tokens to proceed or throws an exception if not active.</returns>
2020-08-17 23:36:45 +02:00
QuickConnectResult TryConnect();
2020-04-15 21:28:42 +02: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 23:36:45 +02:00
/// <param name="userId">User id.</param>
2020-06-18 08:58:58 +02:00
/// <param name="code">Identifying code for the request.</param>
2020-04-15 21:28:42 +02:00
/// <returns>A boolean indicating if the authorization completed successfully.</returns>
Task<bool> AuthorizeRequest(Guid userId, string code);
2020-04-15 21:28:42 +02:00
}
}