class InventoryUtil {

	public static Map<String,List<NetworkInterface>> fetchNetworkIntefaces(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName){

		Map<String,List<NetworkInterface>> niMap = new LinkedHashMap<>();
		AmazonEC2 ec2Client ;
		String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource in specific region\" ,\"type\": \"Network Interface\" , \"region\":\"" ;
		for(Region region : RegionUtils.getRegions()) {
			try{
				if(!skipRegions.contains(region.getName())){
					ec2Client = AmazonEC2ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();
					DescribeNetworkInterfacesResult  descNIRslt =  ec2Client.describeNetworkInterfaces();
					List<NetworkInterface> niList = descNIRslt.getNetworkInterfaces();
					if(!niList.isEmpty() ) {
						log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Network Interface " +region.getName()+" >> " + niList.size());
						niMap.put(accountId+delimiter+accountName+delimiter+region.getName(),niList);
					}

				}
			}catch(Exception e){
				log.error("Exception fetching Network Interfaces for "+region.getName() + e);
				log.warn(expPrefix+ region.getName()+InventoryConstants.ERROR_CAUSE +e.getMessage()+"\"}");
				ErrorManageUtil.uploadError(accountId,region.getName(),"eni",e.getMessage());
			}
		}
		return niMap;
	}

	private  InventoryUtil();

}