using MediaBrowser.Model.Dto; using MediaBrowser.Model.Events; using MediaBrowser.Model.Users; using System; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Model.ApiClient { public interface IConnectionManager { /// /// Occurs when [connected]. /// event EventHandler> Connected; /// /// Gets the API client. /// /// The item. /// MediaBrowser.Model.ApiClient.IApiClient. IApiClient GetApiClient(BaseItemDto item); /// /// Connects the specified cancellation token. /// /// The cancellation token. /// Task<ConnectionResult>. Task Connect(CancellationToken cancellationToken); /// /// Connects the specified server. /// /// The server. /// The cancellation token. /// Task<ConnectionResult>. Task Connect(ServerInfo server, CancellationToken cancellationToken); /// /// Connects the specified server. /// /// The address. /// The cancellation token. /// Task<ConnectionResult>. Task Connect(string address, CancellationToken cancellationToken); /// /// Logouts this instance. /// /// Task<ConnectionResult>. Task Logout(); /// /// Authenticates with a specific server /// /// The server. /// The username. /// The hash. /// if set to true [remember login]. /// Task. Task Authenticate(ServerInfo server, string username, byte[] hash, bool rememberLogin); /// /// Authenticates with a specific server /// /// The API client. /// The username. /// The hash. /// if set to true [remember login]. /// Task. Task Authenticate(IApiClient apiClient, string username, byte[] hash, bool rememberLogin); } }