tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/IAMServiceAccountsService.java
private boolean deleteIAMServiceAccountPolicies(String token, String iamSvcAccName) {
		int succssCount = 0;
		boolean allPoliciesDeleted = false;
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies")
				.put(LogMessage.MESSAGE,
						String.format("Trying to remove policies for IAM service account [%s]", iamSvcAccName))
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		
		for (String policyPrefix : TVaultConstants.getSvcAccPolicies().keySet()) {
			String accessId = new StringBuffer().append(policyPrefix).append(IAMServiceAccountConstants.IAMSVCACC_POLICY_PREFIX).append(iamSvcAccName).toString();
			ResponseEntity<String> policyDeleteStatus = accessService.deletePolicyInfo(token, accessId);
			if (HttpStatus.OK.equals(policyDeleteStatus.getStatusCode())) {
				succssCount++;
			}
		}
		if (succssCount == TVaultConstants.getSvcAccPolicies().size()) {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
					put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies").
					put(LogMessage.MESSAGE, "Successfully removed policies for IAM service account.").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
			allPoliciesDeleted = true;
		}
		else {
			log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
					put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies").
					put(LogMessage.MESSAGE, "Failed to delete some of the policies for IAM service account.").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
		}
		return allPoliciesDeleted;
	}
/**
	 * Deletes IAM Service Account policies
	 * @param token
	 * @param svcAccName
	 * @return
	 */
Deletes IAM Service Account policies
@param token
@param svcAccName
@return
Deletes IAM Service Account policies @param token @param svcAccName @return
private boolean deleteIAMServiceAccountPolicies(String token, String iamSvcAccName) {
		int succssCount = 0;
		boolean allPoliciesDeleted = false;
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies")
				.put(LogMessage.MESSAGE,
						String.format("Trying to remove policies for IAM service account [%s]", iamSvcAccName))
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		for (String policyPrefix : TVaultConstants.getSvcAccPolicies().keySet()) {
			String accessId = new StringBuffer().append(policyPrefix).append(IAMServiceAccountConstants.IAMSVCACC_POLICY_PREFIX).append(iamSvcAccName).toString();
			ResponseEntity<String> policyDeleteStatus = accessService.deletePolicyInfo(token, accessId);
			if (HttpStatus.OK.equals(policyDeleteStatus.getStatusCode())) {
				succssCount++;
			}
		}
		if (succssCount == TVaultConstants.getSvcAccPolicies().size()) {
			log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
					put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies").
					put(LogMessage.MESSAGE, "Successfully removed policies for IAM service account.").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
			allPoliciesDeleted = true;
		}
		else {
			log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
					put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
					put(LogMessage.ACTION, "deleteIAMServiceAccountPolicies").
					put(LogMessage.MESSAGE, "Failed to delete some of the policies for IAM service account.").
					put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
					build()));
		}
		return allPoliciesDeleted;
	}
private boolean deleteIAMServiceAccountPolicies ( String token , String iamSvcAccName ) { int succssCount = 0 ; boolean allPoliciesDeleted = false ; log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteIAMServiceAccountPolicies" ) . put ( LogMessage . MESSAGE , String . format ( "Trying to remove policies for IAM service account [%s]" , iamSvcAccName ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; for ( String policyPrefix : TVaultConstants . getSvcAccPolicies ( ) . keySet ( ) ) { String accessId = new StringBuffer ( ) . append ( policyPrefix ) . append ( IAMServiceAccountConstants . IAMSVCACC_POLICY_PREFIX ) . append ( iamSvcAccName ) . toString ( ) ; ResponseEntity < String > policyDeleteStatus = accessService . deletePolicyInfo ( token , accessId ) ; if ( HttpStatus . OK . equals ( policyDeleteStatus . getStatusCode ( ) ) ) { succssCount ++ ; } } if ( succssCount == TVaultConstants . getSvcAccPolicies ( ) . size ( ) ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteIAMServiceAccountPolicies" ) . put ( LogMessage . MESSAGE , "Successfully removed policies for IAM service account." ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; allPoliciesDeleted = true ; } else { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteIAMServiceAccountPolicies" ) . put ( LogMessage . MESSAGE , "Failed to delete some of the policies for IAM service account." ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } return allPoliciesDeleted ; }
Deletes IAM Service Account policies
 @param token
 @param svcAccName
 @return
Deletes IAM Service Account policies @param token @param svcAccName @return