perm.setIcmpCode(Integer.toString(ipPerm.getToPort()));
} else {
perm.setFromPort(ipPerm.getFromPort());
perm.setToPort(ipPerm.getToPort());
}
UserIdGroupPairSetType groups = ipPerm.getGroups();
if (null != groups && groups.getItem() != null) {
UserIdGroupPairType[] groupItems = groups.getItem();
for (UserIdGroupPairType groupPair : groupItems) {
EC2SecurityGroup user = new EC2SecurityGroup();
user.setName(groupPair.getGroupName());
user.setAccount(groupPair.getUserId());
perm.addUser(user);