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());
}
};
}
Aggregations