/* * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.ec2.model; import java.io.Serializable; /** *
* Describes a security group *
*/ public class SecurityGroup implements Serializable { /** * The AWS account ID of the owner of the security group. */ private String ownerId; /** * The name of the security group. */ private String groupName; /** * The ID of the security group. */ private String groupId; /** * A description of the security group. */ private String description; /** * One or more inbound rules associated with the security group. */ private com.amazonaws.internal.ListWithAutoConstructFlag* Returns a reference to this object so that method calls can be chained together. * * @param ownerId The AWS account ID of the owner of the security group. * * @return A reference to this updated object so that method calls can be chained * together. */ public SecurityGroup withOwnerId(String ownerId) { this.ownerId = ownerId; return this; } /** * The name of the security group. * * @return The name of the security group. */ public String getGroupName() { return groupName; } /** * The name of the security group. * * @param groupName The name of the security group. */ public void setGroupName(String groupName) { this.groupName = groupName; } /** * The name of the security group. *
* Returns a reference to this object so that method calls can be chained together. * * @param groupName The name of the security group. * * @return A reference to this updated object so that method calls can be chained * together. */ public SecurityGroup withGroupName(String groupName) { this.groupName = groupName; return this; } /** * The ID of the security group. * * @return The ID of the security group. */ public String getGroupId() { return groupId; } /** * The ID of the security group. * * @param groupId The ID of the security group. */ public void setGroupId(String groupId) { this.groupId = groupId; } /** * The ID of the security group. *
* Returns a reference to this object so that method calls can be chained together. * * @param groupId The ID of the security group. * * @return A reference to this updated object so that method calls can be chained * together. */ public SecurityGroup withGroupId(String groupId) { this.groupId = groupId; return this; } /** * A description of the security group. * * @return A description of the security group. */ public String getDescription() { return description; } /** * A description of the security group. * * @param description A description of the security group. */ public void setDescription(String description) { this.description = description; } /** * A description of the security group. *
* Returns a reference to this object so that method calls can be chained together.
*
* @param description A description of the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withDescription(String description) {
this.description = description;
return this;
}
/**
* One or more inbound rules associated with the security group.
*
* @return One or more inbound rules associated with the security group.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param ipPermissions One or more inbound rules associated with the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withIpPermissions(IpPermission... ipPermissions) {
if (getIpPermissions() == null) setIpPermissions(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param ipPermissions One or more inbound rules associated with the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withIpPermissions(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param ipPermissionsEgress [EC2-VPC] One or more outbound rules associated with the security
* group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress) {
if (getIpPermissionsEgress() == null) setIpPermissionsEgress(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param ipPermissionsEgress [EC2-VPC] One or more outbound rules associated with the security
* group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withIpPermissionsEgress(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param vpcId [EC2-VPC] The ID of the VPC for the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withVpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
/**
* Any tags assigned to the security group.
*
* @return Any tags assigned to the security group.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param tags Any tags assigned to the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withTags(Tag... tags) {
if (getTags() == null) setTags(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param tags Any tags assigned to the security group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public SecurityGroup withTags(java.util.Collection