tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static boolean areAWSIAMRoleInputsValid(AWSIAMRole awsiamRole) throws TVaultValidationException{
		if (awsiamRole == null) {
			return false;
		}
		String[] policyvalue= {DEFAULT_ROLE_POLICY};
		if(StringUtils.isEmpty(awsiamRole.getPolicies())) {
			awsiamRole.setPolicies(policyvalue);
		}
		if (StringUtils.isEmpty(awsiamRole.getRole())) {
			throw new TVaultValidationException(ROLESTR);
		}
		else if (StringUtils.isEmpty(awsiamRole.getAuth_type()) || !awsiamRole.getAuth_type().equalsIgnoreCase("iam")) {
			throw new TVaultValidationException("auth_type is required and it should be iam.");
		}
		else if (ArrayUtils.isNotEmpty(awsiamRole.getBound_iam_principal_arn())
			) {
			boolean containsEmptyString = Stream.of(awsiamRole.getBound_iam_principal_arn())
		            .anyMatch(string -> string == null || string.isEmpty());
			if(containsEmptyString) {
				throw new TVaultValidationException("Invalid value specified for bound_iam_principal_arn.");
			}
			else {
				return true;
			}
		}
		throw new TVaultValidationException("Bound parameter should be specified.");
	}
/**
	 * Validate IAM role inputs
	 * @param awsiamRole
	 * @return
	 */
Validate IAM role inputs
@param awsiamRole
@return
Validate IAM role inputs @param awsiamRole @return
public static boolean areAWSIAMRoleInputsValid(AWSIAMRole awsiamRole) throws TVaultValidationException{
		if (awsiamRole == null) {
			return false;
		}
		String[] policyvalue= {DEFAULT_ROLE_POLICY};
		if(StringUtils.isEmpty(awsiamRole.getPolicies())) {
			awsiamRole.setPolicies(policyvalue);
		}
		if (StringUtils.isEmpty(awsiamRole.getRole())) {
			throw new TVaultValidationException(ROLESTR);
		}
		else if (StringUtils.isEmpty(awsiamRole.getAuth_type()) || !awsiamRole.getAuth_type().equalsIgnoreCase("iam")) {
			throw new TVaultValidationException("auth_type is required and it should be iam.");
		}
		else if (ArrayUtils.isNotEmpty(awsiamRole.getBound_iam_principal_arn())
			) {
			boolean containsEmptyString = Stream.of(awsiamRole.getBound_iam_principal_arn())
		            .anyMatch(string -> string == null || string.isEmpty());
			if(containsEmptyString) {
				throw new TVaultValidationException("Invalid value specified for bound_iam_principal_arn.");
			}
			else {
				return true;
			}
		}
		throw new TVaultValidationException("Bound parameter should be specified.");
	}
public static boolean areAWSIAMRoleInputsValid ( AWSIAMRole awsiamRole ) throws TVaultValidationException { if ( awsiamRole == null ) { return false ; } String [ ] policyvalue = { DEFAULT_ROLE_POLICY } ; if ( StringUtils . isEmpty ( awsiamRole . getPolicies ( ) ) ) { awsiamRole . setPolicies ( policyvalue ) ; } if ( StringUtils . isEmpty ( awsiamRole . getRole ( ) ) ) { throw new TVaultValidationException ( ROLESTR ) ; } else if ( StringUtils . isEmpty ( awsiamRole . getAuth_type ( ) ) || ! awsiamRole . getAuth_type ( ) . equalsIgnoreCase ( "iam" ) ) { throw new TVaultValidationException ( "auth_type is required and it should be iam." ) ; } else if ( ArrayUtils . isNotEmpty ( awsiamRole . getBound_iam_principal_arn ( ) ) ) { boolean containsEmptyString = Stream . of ( awsiamRole . getBound_iam_principal_arn ( ) ) . anyMatch ( string -> string == null || string . isEmpty ( ) ) ; if ( containsEmptyString ) { throw new TVaultValidationException ( "Invalid value specified for bound_iam_principal_arn." ) ; } else { return true ; } } throw new TVaultValidationException ( "Bound parameter should be specified." ) ; }
Validate IAM role inputs
 @param awsiamRole
 @return
Validate IAM role inputs @param awsiamRole @return