using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Events;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Library
{
///
/// Interface IUserManager
///
public interface IUserManager
{
///
/// Gets the users.
///
/// The users.
IEnumerable Users { get; }
///
/// Occurs when [user updated].
///
event EventHandler> UserUpdated;
///
/// Occurs when [user deleted].
///
event EventHandler> UserDeleted;
event EventHandler> UserCreated;
event EventHandler> UserConfigurationUpdated;
event EventHandler> UserPasswordChanged;
///
/// Updates the configuration.
///
/// The user.
/// The new configuration.
void UpdateConfiguration(User user, UserConfiguration newConfiguration);
///
/// Gets a User by Id
///
/// The id.
/// User.
///
User GetUserById(Guid id);
///
/// Gets the user by identifier.
///
/// The identifier.
/// User.
User GetUserById(string id);
///
/// Authenticates a User and returns a result indicating whether or not it succeeded
///
/// The username.
/// The password sha1.
/// The remote end point.
/// Task{System.Boolean}.
/// user
Task AuthenticateUser(string username, string passwordSha1, string remoteEndPoint);
///
/// Refreshes metadata for each user
///
/// The cancellation token.
/// Task.
Task RefreshUsersMetadata(CancellationToken cancellationToken);
///
/// Renames the user.
///
/// The user.
/// The new name.
/// Task.
/// user
///
Task RenameUser(User user, string newName);
///
/// Updates the user.
///
/// The user.
/// user
///
Task UpdateUser(User user);
///
/// Creates the user.
///
/// The name.
/// User.
/// name
///
Task CreateUser(string name);
///
/// Deletes the user.
///
/// The user.
/// Task.
/// user
///
Task DeleteUser(User user);
///
/// Resets the password.
///
/// The user.
/// Task.
Task ResetPassword(User user);
///
/// Changes the password.
///
/// The user.
/// The new password sha1.
/// Task.
Task ChangePassword(User user, string newPasswordSha1);
///
/// Gets the user dto.
///
/// The user.
/// The remote end point.
/// UserDto.
UserDto GetUserDto(User user, string remoteEndPoint = null);
///
/// Authenticates the user.
///
/// The username.
/// The password sha1.
/// The password MD5.
/// The remote end point.
/// Task<System.Boolean>.
Task AuthenticateUser(string username, string passwordSha1, string passwordMd5, string remoteEndPoint);
}
}