public async Task DeleteUser()

in src/YouTrackSharp/Management/UserManagementService.cs [158:180]


        public async Task DeleteUser(string username, string successor)
        {
            var userToDelete = await GetUser(username);
            var userToInherit = await GetUser(successor);
            
            if (userToDelete == null)
            {
                throw new YouTrackErrorException(Strings.Exception_BadRequest, (int)HttpStatusCode.BadRequest,
                    "Could not find user with login " + username,
                    null, null);
            }
            
            if (userToInherit == null)
            {
                throw new YouTrackErrorException(Strings.Exception_BadRequest, (int)HttpStatusCode.BadRequest,
                    "Could not find user with login " + successor,
                    null, null);
            }
            
            var client = await _connection.GetAuthenticatedApiClient();

            await client.HubUsersDeleteAsync(userToDelete.RingId, userToInherit.RingId);
        }