using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Jellyfin.Data.Entities;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Controller.Library
{
///
/// Interface IUserManager.
///
public interface IUserManager
{
///
/// Occurs when a user is updated.
///
event EventHandler> OnUserUpdated;
///
/// Occurs when a user is created.
///
event EventHandler> OnUserCreated;
///
/// Occurs when a user is deleted.
///
event EventHandler> OnUserDeleted;
///
/// Occurs when a user's password is changed.
///
event EventHandler> OnUserPasswordChanged;
///
/// Occurs when a user is locked out.
///
event EventHandler> OnUserLockedOut;
///
/// Gets the users.
///
/// The users.
IEnumerable Users { get; }
///
/// Gets the user ids.
///
/// The users ids.
IEnumerable UsersIds { get; }
///
/// Initializes the user manager and ensures that a user exists.
///
Task InitializeAsync();
///
/// Gets a user by Id.
///
/// The id.
/// The user with the specified Id, or null if the user doesn't exist.
/// id is an empty Guid.
User GetUserById(Guid id);
///
/// Gets the name of the user by.
///
/// The name.
/// User.
User GetUserByName(string name);
///
/// Renames the user.
///
/// The user.
/// The new name.
/// Task.
/// user
///
Task RenameUser(User user, string newName);
///
/// Updates the user.
///
/// The user.
/// user
///
void UpdateUser(User user);
///
/// Updates the user.
///
/// The user.
/// If user is null.
/// If the provided user doesn't exist.
/// A task representing the update of the user.
Task UpdateUserAsync(User user);
///
/// Creates a user with the specified name.
///
/// The name of the new user.
/// The created user.
/// name
///
Task CreateUserAsync(string name);
///
/// Deletes the specified user.
///
/// The id of the user to be deleted.
void DeleteUser(Guid userId);
///
/// Resets the password.
///
/// The user.
/// Task.
Task ResetPassword(User user);
///
/// Resets the easy password.
///
/// The user.
/// Task.
void ResetEasyPassword(User user);
///
/// Changes the password.
///
Task ChangePassword(User user, string newPassword);
///
/// Changes the easy password.
///
void ChangeEasyPassword(User user, string newPassword, string newPasswordSha1);
///
/// Gets the user dto.
///
/// The user.
/// The remote end point.
/// UserDto.
UserDto GetUserDto(User user, string remoteEndPoint = null);
///
/// Authenticates the user.
///
Task AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession);
///
/// Starts the forgot password process.
///
/// The entered username.
/// if set to true [is in network].
/// ForgotPasswordResult.
Task StartForgotPasswordProcess(string enteredUsername, bool isInNetwork);
///
/// Redeems the password reset pin.
///
/// The pin.
/// true if XXXX, false otherwise.
Task RedeemPasswordResetPin(string pin);
NameIdPair[] GetAuthenticationProviders();
NameIdPair[] GetPasswordResetProviders();
///
/// This method updates the user's configuration.
/// This is only included as a stopgap until the new API, using this internally is not recommended.
/// Instead, modify the user object directly, then call .
///
/// The user's Id.
/// The request containing the new user configuration.
void UpdateConfiguration(Guid userId, UserConfiguration config);
///
/// This method updates the user's policy.
/// This is only included as a stopgap until the new API, using this internally is not recommended.
/// Instead, modify the user object directly, then call .
///
/// The user's Id.
/// The request containing the new user policy.
void UpdatePolicy(Guid userId, UserPolicy policy);
///
/// Clears the user's profile image.
///
/// The user.
void ClearProfileImage(User user);
}
}