Search in sources :

Example 1 with Device

use of com.amazonaws.mobile.client.results.Device in project aws-sdk-android by aws-amplify.

the class DeviceOperations method _listDevices.

private ReturningRunnable<ListDevicesResult> _listDevices(final Integer limit, final String paginationToken) {
    return new ReturningRunnable<ListDevicesResult>() {

        @Override
        public ListDevicesResult run() throws Exception {
            final ListDevicesRequest listDevicesRequest = new ListDevicesRequest();
            listDevicesRequest.setAccessToken(mobileClient.getTokens().getAccessToken().getTokenString());
            listDevicesRequest.setLimit(limit);
            listDevicesRequest.setPaginationToken(paginationToken);
            final com.amazonaws.services.cognitoidentityprovider.model.ListDevicesResult listDevicesResult = userpoolLL.listDevices(listDevicesRequest);
            final ArrayList<Device> devices = new ArrayList<Device>(limit);
            for (DeviceType deviceType : listDevicesResult.getDevices()) {
                devices.add(marshallDeviceTypeToDevice(deviceType));
            }
            return new ListDevicesResult(devices, listDevicesResult.getPaginationToken());
        }
    };
}
Also used : ListDevicesResult(com.amazonaws.mobile.client.results.ListDevicesResult) DeviceType(com.amazonaws.services.cognitoidentityprovider.model.DeviceType) ReturningRunnable(com.amazonaws.mobile.client.internal.ReturningRunnable) Device(com.amazonaws.mobile.client.results.Device) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) ArrayList(java.util.ArrayList) ListDevicesRequest(com.amazonaws.services.cognitoidentityprovider.model.ListDevicesRequest)

Aggregations

ReturningRunnable (com.amazonaws.mobile.client.internal.ReturningRunnable)1 Device (com.amazonaws.mobile.client.results.Device)1 ListDevicesResult (com.amazonaws.mobile.client.results.ListDevicesResult)1 CognitoDevice (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice)1 DeviceType (com.amazonaws.services.cognitoidentityprovider.model.DeviceType)1 ListDevicesRequest (com.amazonaws.services.cognitoidentityprovider.model.ListDevicesRequest)1 ArrayList (java.util.ArrayList)1