"Declare either versionsToKeep or daysToKeep, but not both nor none!");
DescribeApplicationVersionsRequest describeApplicationVersionsRequest = new DescribeApplicationVersionsRequest()
.withApplicationName(applicationName);
DescribeApplicationVersionsResult appVersions = getService()
.describeApplicationVersions(describeApplicationVersionsRequest);
DescribeEnvironmentsResult environments = getService()
.describeEnvironments();
List<ApplicationVersionDescription> appVersionList = new ArrayList<ApplicationVersionDescription>(
appVersions.getApplicationVersions());
deletedVersionsCount = 0;
for (EnvironmentDescription d : environments.getEnvironments()) {
boolean bActiveEnvironment = (d.getStatus().equals("Running")