2014-11-03 04:38:43 +01:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Model.Connect;
|
2014-10-13 22:14:53 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2014-09-14 17:10:51 +02:00
|
|
|
|
|
2014-08-25 05:54:45 +02:00
|
|
|
|
namespace MediaBrowser.Controller.Connect
|
|
|
|
|
{
|
|
|
|
|
public interface IConnectManager
|
|
|
|
|
{
|
2014-09-14 17:10:51 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the wan API address.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The wan API address.</value>
|
2014-08-25 05:54:45 +02:00
|
|
|
|
string WanApiAddress { get; }
|
2014-09-14 17:10:51 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Links the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
|
/// <param name="connectUsername">The connect username.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-09-15 01:39:06 +02:00
|
|
|
|
Task<UserLinkResult> LinkUser(string userId, string connectUsername);
|
2014-09-14 17:10:51 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removes the link.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-10-14 06:22:17 +02:00
|
|
|
|
Task RemoveConnect(string userId);
|
2014-10-13 22:14:53 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Invites the user.
|
|
|
|
|
/// </summary>
|
2014-10-31 05:57:24 +01:00
|
|
|
|
/// <param name="request">The request.</param>
|
2014-10-13 22:14:53 +02:00
|
|
|
|
/// <returns>Task<UserLinkResult>.</returns>
|
2014-10-31 05:57:24 +01:00
|
|
|
|
Task<UserLinkResult> InviteUser(ConnectAuthorizationRequest request);
|
2014-10-13 22:14:53 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the pending guests.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task<List<ConnectAuthorization>>.</returns>
|
|
|
|
|
Task<List<ConnectAuthorization>> GetPendingGuests();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cancels the authorization.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CancelAuthorization(string id);
|
2014-10-17 06:52:41 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Authenticates the specified username.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="username">The username.</param>
|
|
|
|
|
/// <param name="passwordMd5">The password MD5.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task Authenticate(string username, string passwordMd5);
|
2014-11-03 04:38:43 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the local user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="connectUserId">The connect user identifier.</param>
|
|
|
|
|
/// <returns>Task<User>.</returns>
|
|
|
|
|
Task<User> GetLocalUser(string connectUserId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines whether [is authorization token valid] [the specified token].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="token">The token.</param>
|
|
|
|
|
/// <returns><c>true</c> if [is authorization token valid] [the specified token]; otherwise, <c>false</c>.</returns>
|
|
|
|
|
bool IsAuthorizationTokenValid(string token);
|
2014-08-25 05:54:45 +02:00
|
|
|
|
}
|
|
|
|
|
}
|