public async Task <IActionResult> AllocateSingleUser(AllocateUserRequest request) { _logger.LogDebug("AllocateSingleUser {userType} {application}", request.UserType, request.Application); try { var response = await _testApiClient.AllocateSingleUserAsync(request); _logger.LogDebug("User '{username}' successfully allocated", response.Username); return(Ok(response)); } catch (TestApiException e) { _logger.LogError(e, "Unable to allocate user: {userType}", request.UserType); return(StatusCode(e.StatusCode, e.Response)); } }