@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class SecurityGroupRuleRequest extends Object implements Serializable, Cloneable
Describes a security group rule.
You must specify exactly one of the following parameters, based on the rule type:
CidrIpv4
CidrIpv6
PrefixListId
ReferencedGroupId
When you modify a rule, you cannot change the rule type. For example, if the rule uses an IPv4 address range, you
must use CidrIpv4
to specify a new IPv4 address range.
Constructor and Description |
---|
SecurityGroupRuleRequest() |
Modifier and Type | Method and Description |
---|---|
SecurityGroupRuleRequest |
clone() |
boolean |
equals(Object obj) |
String |
getCidrIpv4()
The IPv4 CIDR range.
|
String |
getCidrIpv6()
The IPv6 CIDR range.
|
String |
getDescription()
The description of the security group rule.
|
Integer |
getFromPort()
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
|
String |
getIpProtocol()
|
String |
getPrefixListId()
The ID of the prefix list.
|
String |
getReferencedGroupId()
The ID of the security group that is referenced in the security group rule.
|
Integer |
getToPort()
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
|
int |
hashCode() |
void |
setCidrIpv4(String cidrIpv4)
The IPv4 CIDR range.
|
void |
setCidrIpv6(String cidrIpv6)
The IPv6 CIDR range.
|
void |
setDescription(String description)
The description of the security group rule.
|
void |
setFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
|
void |
setIpProtocol(String ipProtocol)
|
void |
setPrefixListId(String prefixListId)
The ID of the prefix list.
|
void |
setReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
|
void |
setToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
|
String |
toString()
Returns a string representation of this object.
|
SecurityGroupRuleRequest |
withCidrIpv4(String cidrIpv4)
The IPv4 CIDR range.
|
SecurityGroupRuleRequest |
withCidrIpv6(String cidrIpv6)
The IPv6 CIDR range.
|
SecurityGroupRuleRequest |
withDescription(String description)
The description of the security group rule.
|
SecurityGroupRuleRequest |
withFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
|
SecurityGroupRuleRequest |
withIpProtocol(String ipProtocol)
|
SecurityGroupRuleRequest |
withPrefixListId(String prefixListId)
The ID of the prefix list.
|
SecurityGroupRuleRequest |
withReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
|
SecurityGroupRuleRequest |
withToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
|
public void setIpProtocol(String ipProtocol)
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
ipProtocol
- The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public String getIpProtocol()
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public SecurityGroupRuleRequest withIpProtocol(String ipProtocol)
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number (see
Protocol Numbers).
Use -1
to specify all protocols.
ipProtocol
- The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or
number (see Protocol
Numbers).
Use -1
to specify all protocols.
public void setFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
fromPort
- The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. A value of -1 indicates all
ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.public Integer getFromPort()
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
public SecurityGroupRuleRequest withFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
fromPort
- The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. A value of -1 indicates all
ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.public void setToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1
indicates
all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
toPort
- The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1
indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.public Integer getToPort()
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1
indicates
all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
-1
indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.public SecurityGroupRuleRequest withToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1
indicates
all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
toPort
- The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1
indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.public void setCidrIpv4(String cidrIpv4)
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
cidrIpv4
- The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.public String getCidrIpv4()
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
public SecurityGroupRuleRequest withCidrIpv4(String cidrIpv4)
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
cidrIpv4
- The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.public void setCidrIpv6(String cidrIpv6)
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
cidrIpv6
- The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.public String getCidrIpv6()
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
public SecurityGroupRuleRequest withCidrIpv6(String cidrIpv6)
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
cidrIpv6
- The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.public void setPrefixListId(String prefixListId)
The ID of the prefix list.
prefixListId
- The ID of the prefix list.public String getPrefixListId()
The ID of the prefix list.
public SecurityGroupRuleRequest withPrefixListId(String prefixListId)
The ID of the prefix list.
prefixListId
- The ID of the prefix list.public void setReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
referencedGroupId
- The ID of the security group that is referenced in the security group rule.public String getReferencedGroupId()
The ID of the security group that is referenced in the security group rule.
public SecurityGroupRuleRequest withReferencedGroupId(String referencedGroupId)
The ID of the security group that is referenced in the security group rule.
referencedGroupId
- The ID of the security group that is referenced in the security group rule.public void setDescription(String description)
The description of the security group rule.
description
- The description of the security group rule.public String getDescription()
The description of the security group rule.
public SecurityGroupRuleRequest withDescription(String description)
The description of the security group rule.
description
- The description of the security group rule.public String toString()
toString
in class Object
Object.toString()
public SecurityGroupRuleRequest clone()