use of com.arm.mbed.cloud.sdk.accountmanagement.model.ApiKeyListOptions in project mbed-cloud-sdk-java by ARMmbed.
the class AccountManagementExamples method listApiKeys.
/**
* Lists the first 5 API Keys.
*/
@SuppressWarnings("boxing")
@Example
public void listApiKeys() {
ConnectionOptions config = Configuration.get();
AccountManagement api = new AccountManagement(config);
try {
// Defining query options
ApiKeyListOptions options = new ApiKeyListOptions();
options.setLimit(5);
// Listing API keys.
Paginator<ApiKey> apikeys = api.listAllApiKeys(options);
for (ApiKey apiKey : apikeys) {
log("API key", apiKey);
}
} catch (Exception e) {
logError("last API Metadata", api.getLastApiMetadata());
fail(e.getMessage());
}
}
use of com.arm.mbed.cloud.sdk.accountmanagement.model.ApiKeyListOptions in project mbed-cloud-sdk-java by ARMmbed.
the class TestAllListOptions method testApiKeyListOptionsClone.
@Test
public void testApiKeyListOptionsClone() {
ApiKeyListOptions opt1 = new ApiKeyListOptions();
opt1.addEqualFilter("field1", Integer.valueOf(3));
opt1.includeTotalCount();
opt1.setLimit(Integer.valueOf(2));
ApiKeyListOptions opt2 = new ApiKeyListOptions();
assertNotEquals(opt2, opt1);
assertNotSame(opt2, opt1);
opt2 = opt1.clone();
assertEquals(opt2, opt1);
assertNotSame(opt2, opt1);
}
Aggregations