}
public BlackoutLoginDetails login(String username, String password) throws BlackoutException {
RequestBuilder builder = RequestBuilder.init();
builder.createLoginRequest(username, password);
BlackoutApiResponse requestEntity = sendLoginRequest(builder.build());
// check if login failed
if (requestEntity.getStatus().equalsIgnoreCase("failed"))
{
throw new BlackoutLoginException(requestEntity.getReason());
}
BlackoutLoginDetails loginDetails = new BlackoutLoginDetails();
loginDetails.setStatus(requestEntity.getStatus());
loginDetails.setKey(requestEntity.getKey());
loginDetails.setMemberId(requestEntity.getMemberId());
loginDetails.setTeamId(requestEntity.getTeamId());
return loginDetails;
}