/* * 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; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.RevokeSecurityGroupEgressRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#revokeSecurityGroupEgress(RevokeSecurityGroupEgressRequest) RevokeSecurityGroupEgress operation}. *
* [EC2-VPC only] Removes one or more egress rules from a security group * for EC2-VPC. This action doesn't apply to security groups for use in * EC2-Classic. The values that you specify in the revoke request (for * example, ports) must match the existing rule's values for the rule to * be revoked. *
** Each rule consists of the protocol and the CIDR range or source * security group. For the TCP and UDP protocols, you must also specify * the destination port or range of ports. For the ICMP protocol, you * must also specify the ICMP type and code. *
** Rule changes are propagated to instances within the security group as * quickly as possible. However, a small delay might occur. *
* * @see com.amazonaws.services.ec2.AmazonEC2#revokeSecurityGroupEgress(RevokeSecurityGroupEgressRequest) */ public class RevokeSecurityGroupEgressRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest* 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 RevokeSecurityGroupEgressRequest withGroupId(String groupId) { this.groupId = groupId; return this; } /** * The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. * * @return The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. */ public String getSourceSecurityGroupName() { return sourceSecurityGroupName; } /** * The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. * * @param sourceSecurityGroupName The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. */ public void setSourceSecurityGroupName(String sourceSecurityGroupName) { this.sourceSecurityGroupName = sourceSecurityGroupName; } /** * The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. *
* Returns a reference to this object so that method calls can be chained together. * * @param sourceSecurityGroupName The name of a destination security group. To revoke outbound access to * a destination security group, we recommend that you use a set of IP * permissions instead. * * @return A reference to this updated object so that method calls can be chained * together. */ public RevokeSecurityGroupEgressRequest withSourceSecurityGroupName(String sourceSecurityGroupName) { this.sourceSecurityGroupName = sourceSecurityGroupName; return this; } /** * The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. * * @return The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. */ public String getSourceSecurityGroupOwnerId() { return sourceSecurityGroupOwnerId; } /** * The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. * * @param sourceSecurityGroupOwnerId The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. */ public void setSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) { this.sourceSecurityGroupOwnerId = sourceSecurityGroupOwnerId; } /** * The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. *
* Returns a reference to this object so that method calls can be chained together. * * @param sourceSecurityGroupOwnerId The AWS account number for a destination security group. To revoke * outbound access to a destination security group, we recommend that you * use a set of IP permissions instead. * * @return A reference to this updated object so that method calls can be chained * together. */ public RevokeSecurityGroupEgressRequest withSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) { this.sourceSecurityGroupOwnerId = sourceSecurityGroupOwnerId; return this; } /** * The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. * * @return The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. */ public String getIpProtocol() { return ipProtocol; } /** * The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. * * @param ipProtocol The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. */ public void setIpProtocol(String ipProtocol) { this.ipProtocol = ipProtocol; } /** * The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. *
* Returns a reference to this object so that method calls can be chained together. * * @param ipProtocol The IP protocol name or number. We recommend that you specify the * protocol in a set of IP permissions instead. * * @return A reference to this updated object so that method calls can be chained * together. */ public RevokeSecurityGroupEgressRequest withIpProtocol(String ipProtocol) { this.ipProtocol = ipProtocol; return this; } /** * The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @return The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. */ public Integer getFromPort() { return fromPort; } /** * The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @param fromPort The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. */ public void setFromPort(Integer fromPort) { this.fromPort = fromPort; } /** * The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. *
* Returns a reference to this object so that method calls can be chained together. * * @param fromPort The start of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @return A reference to this updated object so that method calls can be chained * together. */ public RevokeSecurityGroupEgressRequest withFromPort(Integer fromPort) { this.fromPort = fromPort; return this; } /** * The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @return The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. */ public Integer getToPort() { return toPort; } /** * The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @param toPort The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. */ public void setToPort(Integer toPort) { this.toPort = toPort; } /** * The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. *
* Returns a reference to this object so that method calls can be chained together. * * @param toPort The end of port range for the TCP and UDP protocols, or an ICMP type * number. We recommend that you specify the port range in a set of IP * permissions instead. * * @return A reference to this updated object so that method calls can be chained * together. */ public RevokeSecurityGroupEgressRequest withToPort(Integer toPort) { this.toPort = toPort; return this; } /** * The CIDR IP address range. We recommend that you specify the CIDR * range in a set of IP permissions instead. * * @return The CIDR IP address range. We recommend that you specify the CIDR * range in a set of IP permissions instead. */ public String getCidrIp() { return cidrIp; } /** * The CIDR IP address range. We recommend that you specify the CIDR * range in a set of IP permissions instead. * * @param cidrIp The CIDR IP address range. We recommend that you specify the CIDR * range in a set of IP permissions instead. */ public void setCidrIp(String cidrIp) { this.cidrIp = cidrIp; } /** * The CIDR IP address range. We recommend that you specify the CIDR * range in a set of IP permissions instead. *
* Returns a reference to this object so that method calls can be chained together.
*
* @param cidrIp The CIDR IP address range. We recommend that you specify the CIDR
* range in a set of IP permissions instead.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RevokeSecurityGroupEgressRequest withCidrIp(String cidrIp) {
this.cidrIp = cidrIp;
return this;
}
/**
* A set of IP permissions. You can't specify a destination security
* group and a CIDR IP address range.
*
* @return A set of IP permissions. You can't specify a destination security
* group and a CIDR IP address range.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param ipPermissions A set of IP permissions. You can't specify a destination security
* group and a CIDR IP address range.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RevokeSecurityGroupEgressRequest 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 A set of IP permissions. You can't specify a destination security
* group and a CIDR IP address range.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RevokeSecurityGroupEgressRequest withIpPermissions(java.util.Collection