}
return toModifyInstanceAttributeResponse(engine.modifyInstanceAttribute(request));
}
private void setAccountOrGroupList(LaunchPermissionItemType[] items, EC2ModifyImageAttribute request, String operation) {
EC2ImageLaunchPermission launchPermission = new EC2ImageLaunchPermission();
if (operation.equalsIgnoreCase("add"))
launchPermission.setLaunchPermOp(EC2ImageLaunchPermission.Operation.add);
else
launchPermission.setLaunchPermOp(EC2ImageLaunchPermission.Operation.remove);
for (LaunchPermissionItemType lpItem : items) {
if (lpItem.getGroup() != null) {
launchPermission.addLaunchPermission(lpItem.getGroup());
} else if (lpItem.getUserId() != null) {
launchPermission.addLaunchPermission(lpItem.getUserId());
}
}
request.addLaunchPermission(launchPermission);
}