src/main/java/org/jenkinsci/plugins/awsdevicefarm/AWSDeviceFarmRecorder.java
@SuppressWarnings("unused")
        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();
        }
/**
         * Validate if user account has unmetered devices
         *
         * @param isRunUnmetered
         * @param appArtifact
         * @return Returns whether form validation passed
         */
Validate if user account has unmetered devices
@param isRunUnmetered
@param appArtifact
@return Returns whether form validation passed
Validate if user account has unmetered devices @param isRunUnmetered @param appArtifact @return Returns whether form validation passed
@SuppressWarnings("unused")
        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();
        }
@ SuppressWarnings ( "unused" ) 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 ( ) ; }
Validate if user account has unmetered devices
 @param isRunUnmetered
 @param appArtifact
 @return Returns whether form validation passed
Validate if user account has unmetered devices @param isRunUnmetered @param appArtifact @return Returns whether form validation passed