use of com.arm.mbed.cloud.sdk.update.model.FirmwareImageListOptions in project mbed-cloud-sdk-java by ARMmbed.
the class UpdateExamples method listFirmwareImages.
/**
* Lists the first 5 firmware images.
*/
@SuppressWarnings("boxing")
@Example
public void listFirmwareImages() {
ConnectionOptions config = Configuration.get();
Update api = new Update(config);
try {
// Defining query options.
FirmwareImageListOptions options = new FirmwareImageListOptions();
options.setLimit(5);
// Listing firmware images.
Paginator<FirmwareImage> images = api.listAllFirmwareImages(options);
String imageId = null;
for (FirmwareImage image : images) {
log("Firmware image", image);
imageId = image.getId();
}
// Getting a specific image
FirmwareImage image = api.getFirmwareImage(imageId);
log("Specific firmware image", image);
} catch (Exception e) {
logError("last API Metadata", api.getLastApiMetadata());
fail(e.getMessage());
}
}
use of com.arm.mbed.cloud.sdk.update.model.FirmwareImageListOptions in project mbed-cloud-sdk-java by ARMmbed.
the class TestAllListOptions method testFirmwareImageListOptionsClone.
@Test
public void testFirmwareImageListOptionsClone() {
FirmwareImageListOptions opt1 = new FirmwareImageListOptions();
opt1.addEqualFilter("field1", Integer.valueOf(3));
opt1.includeTotalCount();
opt1.setLimit(Integer.valueOf(2));
FirmwareImageListOptions opt2 = new FirmwareImageListOptions();
assertNotEquals(opt2, opt1);
assertNotSame(opt2, opt1);
opt2 = opt1.clone();
assertEquals(opt2, opt1);
assertNotSame(opt2, opt1);
}
Aggregations