using System; using System.Collections.Generic; using MediaBrowser.Model.QuickConnect; using MediaBrowser.Model.Services; namespace MediaBrowser.Controller.QuickConnect { /// /// Quick connect standard interface. /// public interface IQuickConnect { /// /// Gets or sets the length of user facing codes. /// public int CodeLength { get; set; } /// /// Gets or sets the string to prefix internal access tokens with. /// public string TokenNamePrefix { get; set; } /// /// Gets the current state of quick connect. /// public QuickConnectState State { get; } /// /// Gets or sets the time (in minutes) before quick connect will automatically deactivate. /// public int Timeout { get; set; } /// /// Assert that quick connect is currently active and throws an exception if it is not. /// void AssertActive(); /// /// Temporarily activates quick connect for a short amount of time. /// /// A quick connect result object indicating success. QuickConnectResult Activate(); /// /// Changes the status of quick connect. /// /// New state to change to. void SetEnabled(QuickConnectState newState); /// /// Initiates a new quick connect request. /// /// Friendly device name to display in the request UI. /// A quick connect result with tokens to proceed or a descriptive error message otherwise. QuickConnectResult TryConnect(string friendlyName); /// /// Checks the status of an individual request. /// /// Unique secret identifier of the request. /// Quick connect result. QuickConnectResult CheckRequestStatus(string secret); /// /// Returns all current quick connect requests as DTOs. Does not include sensitive information. /// /// List of all quick connect results. List GetCurrentRequests(); /// /// Returns all current quick connect requests (including sensitive information). /// /// List of all quick connect results. List GetCurrentRequestsInternal(); /// /// Authorizes a quick connect request to connect as the calling user. /// /// HTTP request object. /// Identifying code for the request.. /// A boolean indicating if the authorization completed successfully. bool AuthorizeRequest(IRequest request, string code); /// /// Deletes all quick connect access tokens for the provided user. /// /// Guid of the user to delete tokens for. /// A count of the deleted tokens. int DeleteAllDevices(Guid user); /// /// Generates a short code to display to the user to uniquely identify this request. /// /// A short, unique alphanumeric string. string GenerateCode(); } }