/*
* Copyright 2018-2023 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 javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.ReplaceNetworkAclEntryRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReplaceNetworkAclEntryRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest
* The IPv4 network range to allow or deny, in CIDR notation (for example
* Indicates whether to replace the egress rule.
*
* Default: If no value is specified, we replace the ingress rule.
*
* ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6)
* with an IPv6 CIDR block.
*
* The IPv6 network range to allow or deny, in CIDR notation (for example
* The ID of the ACL.
*
* TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17
* (UDP).
*
* The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6"
* (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes
* that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP
* types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an
* IPv6 CIDR block, you must specify an ICMP type and code.
*
* Indicates whether to allow or deny the traffic that matches the rule.
*
* The rule number of the entry to replace.
*
* The IPv4 network range to allow or deny, in CIDR notation (for example
* The IPv4 network range to allow or deny, in CIDR notation (for example
* The IPv4 network range to allow or deny, in CIDR notation (for example
* Indicates whether to replace the egress rule.
*
* Default: If no value is specified, we replace the ingress rule.
* 172.16.0.0/24
).
* 2001:bd8:1234:1a00::/64
).
* 172.16.0.0/24
).
* 172.16.0.0/24
).
*/
public void setCidrBlock(String cidrBlock) {
this.cidrBlock = cidrBlock;
}
/**
* 172.16.0.0/24
).
* 172.16.0.0/24
).
*/
public String getCidrBlock() {
return this.cidrBlock;
}
/**
* 172.16.0.0/24
).
* 172.16.0.0/24
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplaceNetworkAclEntryRequest withCidrBlock(String cidrBlock) {
setCidrBlock(cidrBlock);
return this;
}
/**
*
* Default: If no value is specified, we replace the ingress rule. */ public void setEgress(Boolean egress) { this.egress = egress; } /** *
* Indicates whether to replace the egress rule. *
** Default: If no value is specified, we replace the ingress rule. *
* * @return Indicates whether to replace the egress rule. ** Default: If no value is specified, we replace the ingress rule. */ public Boolean getEgress() { return this.egress; } /** *
* Indicates whether to replace the egress rule. *
** Default: If no value is specified, we replace the ingress rule. *
* * @param egress * Indicates whether to replace the egress rule. ** Default: If no value is specified, we replace the ingress rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withEgress(Boolean egress) { setEgress(egress); return this; } /** *
* Indicates whether to replace the egress rule. *
** Default: If no value is specified, we replace the ingress rule. *
* * @return Indicates whether to replace the egress rule. ** Default: If no value is specified, we replace the ingress rule. */ public Boolean isEgress() { return this.egress; } /** *
* ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) * with an IPv6 CIDR block. *
* * @param icmpTypeCode * ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 * (ICMPv6) with an IPv6 CIDR block. */ public void setIcmpTypeCode(IcmpTypeCode icmpTypeCode) { this.icmpTypeCode = icmpTypeCode; } /** ** ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) * with an IPv6 CIDR block. *
* * @return ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 * (ICMPv6) with an IPv6 CIDR block. */ public IcmpTypeCode getIcmpTypeCode() { return this.icmpTypeCode; } /** ** ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) * with an IPv6 CIDR block. *
* * @param icmpTypeCode * ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 * (ICMPv6) with an IPv6 CIDR block. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withIcmpTypeCode(IcmpTypeCode icmpTypeCode) { setIcmpTypeCode(icmpTypeCode); return this; } /** *
* The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64
).
*
2001:bd8:1234:1a00::/64
).
*/
public void setIpv6CidrBlock(String ipv6CidrBlock) {
this.ipv6CidrBlock = ipv6CidrBlock;
}
/**
*
* The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64
).
*
2001:bd8:1234:1a00::/64
).
*/
public String getIpv6CidrBlock() {
return this.ipv6CidrBlock;
}
/**
*
* The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64
).
*
2001:bd8:1234:1a00::/64
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReplaceNetworkAclEntryRequest withIpv6CidrBlock(String ipv6CidrBlock) {
setIpv6CidrBlock(ipv6CidrBlock);
return this;
}
/**
* * The ID of the ACL. *
* * @param networkAclId * The ID of the ACL. */ public void setNetworkAclId(String networkAclId) { this.networkAclId = networkAclId; } /** ** The ID of the ACL. *
* * @return The ID of the ACL. */ public String getNetworkAclId() { return this.networkAclId; } /** ** The ID of the ACL. *
* * @param networkAclId * The ID of the ACL. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withNetworkAclId(String networkAclId) { setNetworkAclId(networkAclId); return this; } /** ** TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 * (UDP). *
* * @param portRange * TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or * 17 (UDP). */ public void setPortRange(PortRange portRange) { this.portRange = portRange; } /** ** TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 * (UDP). *
* * @return TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or * 17 (UDP). */ public PortRange getPortRange() { return this.portRange; } /** ** TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 * (UDP). *
* * @param portRange * TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or * 17 (UDP). * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withPortRange(PortRange portRange) { setPortRange(portRange); return this; } /** ** The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" * (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes * that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP * types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an * IPv6 CIDR block, you must specify an ICMP type and code. *
* * @param protocol * The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other * than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or * ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR * block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify * protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code. */ public void setProtocol(String protocol) { this.protocol = protocol; } /** ** The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" * (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes * that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP * types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an * IPv6 CIDR block, you must specify an ICMP type and code. *
* * @return The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other * than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or * ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR * block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify * protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code. */ public String getProtocol() { return this.protocol; } /** ** The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" * (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes * that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP * types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an * IPv6 CIDR block, you must specify an ICMP type and code. *
* * @param protocol * The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other * than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or * ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR * block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify * protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withProtocol(String protocol) { setProtocol(protocol); return this; } /** ** Indicates whether to allow or deny the traffic that matches the rule. *
* * @param ruleAction * Indicates whether to allow or deny the traffic that matches the rule. * @see RuleAction */ public void setRuleAction(String ruleAction) { this.ruleAction = ruleAction; } /** ** Indicates whether to allow or deny the traffic that matches the rule. *
* * @return Indicates whether to allow or deny the traffic that matches the rule. * @see RuleAction */ public String getRuleAction() { return this.ruleAction; } /** ** Indicates whether to allow or deny the traffic that matches the rule. *
* * @param ruleAction * Indicates whether to allow or deny the traffic that matches the rule. * @return Returns a reference to this object so that method calls can be chained together. * @see RuleAction */ public ReplaceNetworkAclEntryRequest withRuleAction(String ruleAction) { setRuleAction(ruleAction); return this; } /** ** Indicates whether to allow or deny the traffic that matches the rule. *
* * @param ruleAction * Indicates whether to allow or deny the traffic that matches the rule. * @see RuleAction */ public void setRuleAction(RuleAction ruleAction) { withRuleAction(ruleAction); } /** ** Indicates whether to allow or deny the traffic that matches the rule. *
* * @param ruleAction * Indicates whether to allow or deny the traffic that matches the rule. * @return Returns a reference to this object so that method calls can be chained together. * @see RuleAction */ public ReplaceNetworkAclEntryRequest withRuleAction(RuleAction ruleAction) { this.ruleAction = ruleAction.toString(); return this; } /** ** The rule number of the entry to replace. *
* * @param ruleNumber * The rule number of the entry to replace. */ public void setRuleNumber(Integer ruleNumber) { this.ruleNumber = ruleNumber; } /** ** The rule number of the entry to replace. *
* * @return The rule number of the entry to replace. */ public Integer getRuleNumber() { return this.ruleNumber; } /** ** The rule number of the entry to replace. *
* * @param ruleNumber * The rule number of the entry to replace. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceNetworkAclEntryRequest withRuleNumber(Integer ruleNumber) { setRuleNumber(ruleNumber); return this; } /** * This method is intended for internal use only. Returns the marshaled request configured with additional * parameters to enable operation dry-run. */ @Override public Request