using MediaBrowser.Model.Connect; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Events; using System; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Model.ApiClient { public interface IConnectionManager { /// /// Occurs when [connected]. /// event EventHandler> Connected; /// /// Occurs when [remote logged out]. /// event EventHandler RemoteLoggedOut; /// /// 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(); /// /// Logins to connect. /// /// Task. Task LoginToConnect(string username, string password); /// /// Gets the active api client instance /// [Obsolete] IApiClient CurrentApiClient { get; } /// /// Creates the pin. /// /// Task<PinCreationResult>. Task CreatePin(); /// /// Gets the pin status. /// /// The pin. /// Task<PinStatusResult>. Task GetPinStatus(PinCreationResult pin); /// /// Exchanges the pin. /// /// The pin. /// Task. Task ExchangePin(PinCreationResult pin); } }