in src/main/java/org/jenkinsci/plugins/awsdevicefarm/AWSDeviceFarmRecorder.java [1752:1775]
public FormValidation doCheckIsRunUnmetered(@QueryParameter Boolean isRunUnmetered,
@QueryParameter String appArtifact, @QueryParameter Boolean ifWebApp) {
if (isRunUnmetered != null && isRunUnmetered) {
AWSDeviceFarm adf = getAWSDeviceFarm();
if (ifWebApp != null && !ifWebApp) {
String os = null;
try {
os = adf.getOs(appArtifact);
} catch (AWSDeviceFarmException e) {
return FormValidation.error(e.getMessage());
}
if (adf.getUnmeteredDevices(os) <= 0) {
return FormValidation
.error(String.format("Your account does not have unmetered %s device slots.", os));
}
} else {
if (adf.getUnmeteredDevicesForWeb() <= 0) {
return FormValidation.error(
String.format("Your account does not have unmetered Android or IOS device slots."));
}
}
}
return FormValidation.ok();
}