/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SecurityHub { namespace Model { /** *

A rule for the network ACL. Each rule allows or denies access based on the IP * address, traffic direction, port, and protocol.

See Also:

AWS * API Reference

*/ class AwsEc2NetworkAclEntry { public: AWS_SECURITYHUB_API AwsEc2NetworkAclEntry(); AWS_SECURITYHUB_API AwsEc2NetworkAclEntry(Aws::Utils::Json::JsonView jsonValue); AWS_SECURITYHUB_API AwsEc2NetworkAclEntry& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_SECURITYHUB_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The IPV4 network range for which to deny or allow access.

*/ inline const Aws::String& GetCidrBlock() const{ return m_cidrBlock; } /** *

The IPV4 network range for which to deny or allow access.

*/ inline bool CidrBlockHasBeenSet() const { return m_cidrBlockHasBeenSet; } /** *

The IPV4 network range for which to deny or allow access.

*/ inline void SetCidrBlock(const Aws::String& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = value; } /** *

The IPV4 network range for which to deny or allow access.

*/ inline void SetCidrBlock(Aws::String&& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = std::move(value); } /** *

The IPV4 network range for which to deny or allow access.

*/ inline void SetCidrBlock(const char* value) { m_cidrBlockHasBeenSet = true; m_cidrBlock.assign(value); } /** *

The IPV4 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithCidrBlock(const Aws::String& value) { SetCidrBlock(value); return *this;} /** *

The IPV4 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithCidrBlock(Aws::String&& value) { SetCidrBlock(std::move(value)); return *this;} /** *

The IPV4 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithCidrBlock(const char* value) { SetCidrBlock(value); return *this;} /** *

Whether the rule is an egress rule. An egress rule is a rule that applies to * traffic that leaves the subnet.

*/ inline bool GetEgress() const{ return m_egress; } /** *

Whether the rule is an egress rule. An egress rule is a rule that applies to * traffic that leaves the subnet.

*/ inline bool EgressHasBeenSet() const { return m_egressHasBeenSet; } /** *

Whether the rule is an egress rule. An egress rule is a rule that applies to * traffic that leaves the subnet.

*/ inline void SetEgress(bool value) { m_egressHasBeenSet = true; m_egress = value; } /** *

Whether the rule is an egress rule. An egress rule is a rule that applies to * traffic that leaves the subnet.

*/ inline AwsEc2NetworkAclEntry& WithEgress(bool value) { SetEgress(value); return *this;} /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline const IcmpTypeCode& GetIcmpTypeCode() const{ return m_icmpTypeCode; } /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline bool IcmpTypeCodeHasBeenSet() const { return m_icmpTypeCodeHasBeenSet; } /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline void SetIcmpTypeCode(const IcmpTypeCode& value) { m_icmpTypeCodeHasBeenSet = true; m_icmpTypeCode = value; } /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline void SetIcmpTypeCode(IcmpTypeCode&& value) { m_icmpTypeCodeHasBeenSet = true; m_icmpTypeCode = std::move(value); } /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline AwsEc2NetworkAclEntry& WithIcmpTypeCode(const IcmpTypeCode& value) { SetIcmpTypeCode(value); return *this;} /** *

The Internet Control Message Protocol (ICMP) type and code for which to deny * or allow access.

*/ inline AwsEc2NetworkAclEntry& WithIcmpTypeCode(IcmpTypeCode&& value) { SetIcmpTypeCode(std::move(value)); return *this;} /** *

The IPV6 network range for which to deny or allow access.

*/ inline const Aws::String& GetIpv6CidrBlock() const{ return m_ipv6CidrBlock; } /** *

The IPV6 network range for which to deny or allow access.

*/ inline bool Ipv6CidrBlockHasBeenSet() const { return m_ipv6CidrBlockHasBeenSet; } /** *

The IPV6 network range for which to deny or allow access.

*/ inline void SetIpv6CidrBlock(const Aws::String& value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock = value; } /** *

The IPV6 network range for which to deny or allow access.

*/ inline void SetIpv6CidrBlock(Aws::String&& value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock = std::move(value); } /** *

The IPV6 network range for which to deny or allow access.

*/ inline void SetIpv6CidrBlock(const char* value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock.assign(value); } /** *

The IPV6 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(const Aws::String& value) { SetIpv6CidrBlock(value); return *this;} /** *

The IPV6 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(Aws::String&& value) { SetIpv6CidrBlock(std::move(value)); return *this;} /** *

The IPV6 network range for which to deny or allow access.

*/ inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(const char* value) { SetIpv6CidrBlock(value); return *this;} /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline const PortRangeFromTo& GetPortRange() const{ return m_portRange; } /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline bool PortRangeHasBeenSet() const { return m_portRangeHasBeenSet; } /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline void SetPortRange(const PortRangeFromTo& value) { m_portRangeHasBeenSet = true; m_portRange = value; } /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline void SetPortRange(PortRangeFromTo&& value) { m_portRangeHasBeenSet = true; m_portRange = std::move(value); } /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline AwsEc2NetworkAclEntry& WithPortRange(const PortRangeFromTo& value) { SetPortRange(value); return *this;} /** *

For TCP or UDP protocols, the range of ports that the rule applies to.

*/ inline AwsEc2NetworkAclEntry& WithPortRange(PortRangeFromTo&& value) { SetPortRange(std::move(value)); return *this;} /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline const Aws::String& GetProtocol() const{ return m_protocol; } /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; } /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline void SetProtocol(const Aws::String& value) { m_protocolHasBeenSet = true; m_protocol = value; } /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline void SetProtocol(Aws::String&& value) { m_protocolHasBeenSet = true; m_protocol = std::move(value); } /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline void SetProtocol(const char* value) { m_protocolHasBeenSet = true; m_protocol.assign(value); } /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline AwsEc2NetworkAclEntry& WithProtocol(const Aws::String& value) { SetProtocol(value); return *this;} /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline AwsEc2NetworkAclEntry& WithProtocol(Aws::String&& value) { SetProtocol(std::move(value)); return *this;} /** *

The protocol that the rule applies to. To deny or allow access to all * protocols, use the value -1.

*/ inline AwsEc2NetworkAclEntry& WithProtocol(const char* value) { SetProtocol(value); return *this;} /** *

Whether the rule is used to allow access or deny access.

*/ inline const Aws::String& GetRuleAction() const{ return m_ruleAction; } /** *

Whether the rule is used to allow access or deny access.

*/ inline bool RuleActionHasBeenSet() const { return m_ruleActionHasBeenSet; } /** *

Whether the rule is used to allow access or deny access.

*/ inline void SetRuleAction(const Aws::String& value) { m_ruleActionHasBeenSet = true; m_ruleAction = value; } /** *

Whether the rule is used to allow access or deny access.

*/ inline void SetRuleAction(Aws::String&& value) { m_ruleActionHasBeenSet = true; m_ruleAction = std::move(value); } /** *

Whether the rule is used to allow access or deny access.

*/ inline void SetRuleAction(const char* value) { m_ruleActionHasBeenSet = true; m_ruleAction.assign(value); } /** *

Whether the rule is used to allow access or deny access.

*/ inline AwsEc2NetworkAclEntry& WithRuleAction(const Aws::String& value) { SetRuleAction(value); return *this;} /** *

Whether the rule is used to allow access or deny access.

*/ inline AwsEc2NetworkAclEntry& WithRuleAction(Aws::String&& value) { SetRuleAction(std::move(value)); return *this;} /** *

Whether the rule is used to allow access or deny access.

*/ inline AwsEc2NetworkAclEntry& WithRuleAction(const char* value) { SetRuleAction(value); return *this;} /** *

The rule number. The rules are processed in order by their number.

*/ inline int GetRuleNumber() const{ return m_ruleNumber; } /** *

The rule number. The rules are processed in order by their number.

*/ inline bool RuleNumberHasBeenSet() const { return m_ruleNumberHasBeenSet; } /** *

The rule number. The rules are processed in order by their number.

*/ inline void SetRuleNumber(int value) { m_ruleNumberHasBeenSet = true; m_ruleNumber = value; } /** *

The rule number. The rules are processed in order by their number.

*/ inline AwsEc2NetworkAclEntry& WithRuleNumber(int value) { SetRuleNumber(value); return *this;} private: Aws::String m_cidrBlock; bool m_cidrBlockHasBeenSet = false; bool m_egress; bool m_egressHasBeenSet = false; IcmpTypeCode m_icmpTypeCode; bool m_icmpTypeCodeHasBeenSet = false; Aws::String m_ipv6CidrBlock; bool m_ipv6CidrBlockHasBeenSet = false; PortRangeFromTo m_portRange; bool m_portRangeHasBeenSet = false; Aws::String m_protocol; bool m_protocolHasBeenSet = false; Aws::String m_ruleAction; bool m_ruleActionHasBeenSet = false; int m_ruleNumber; bool m_ruleNumberHasBeenSet = false; }; } // namespace Model } // namespace SecurityHub } // namespace Aws