List of usage examples for com.amazonaws.services.cognitoidp.model GetDeviceRequest GetDeviceRequest
GetDeviceRequest
From source file:io.fineo.client.auth.cognito.CognitoDevice.java
License:Open Source License
/** * Internal method to fetch device details. * * @param session REQUIRED: A valid {@link CognitoUserSession}. * @return//from ww w.jav a2 s . c o m */ private GetDeviceResult getDeviceInternal(CognitoUserSession session) { if (session != null && session.isValid()) { if (this.deviceKey != null) { GetDeviceRequest getDeviceRequest = new GetDeviceRequest(); getDeviceRequest.setAccessToken(session.getAccessToken().getJWTToken()); getDeviceRequest.setDeviceKey(this.deviceKey); return user.getCognitoIdentityProviderClient().getDevice(getDeviceRequest); } else { throw new CognitoParameterInvalidException("Device key is null"); } } else { throw new CognitoNotAuthorizedException("User is not authorized"); } }