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

Describes a stateful rule.

See Also:

AWS * API Reference

*/ class FirewallStatefulRule { public: AWS_EC2_API FirewallStatefulRule(); AWS_EC2_API FirewallStatefulRule(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API FirewallStatefulRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The ARN of the stateful rule group.

*/ inline const Aws::String& GetRuleGroupArn() const{ return m_ruleGroupArn; } /** *

The ARN of the stateful rule group.

*/ inline bool RuleGroupArnHasBeenSet() const { return m_ruleGroupArnHasBeenSet; } /** *

The ARN of the stateful rule group.

*/ inline void SetRuleGroupArn(const Aws::String& value) { m_ruleGroupArnHasBeenSet = true; m_ruleGroupArn = value; } /** *

The ARN of the stateful rule group.

*/ inline void SetRuleGroupArn(Aws::String&& value) { m_ruleGroupArnHasBeenSet = true; m_ruleGroupArn = std::move(value); } /** *

The ARN of the stateful rule group.

*/ inline void SetRuleGroupArn(const char* value) { m_ruleGroupArnHasBeenSet = true; m_ruleGroupArn.assign(value); } /** *

The ARN of the stateful rule group.

*/ inline FirewallStatefulRule& WithRuleGroupArn(const Aws::String& value) { SetRuleGroupArn(value); return *this;} /** *

The ARN of the stateful rule group.

*/ inline FirewallStatefulRule& WithRuleGroupArn(Aws::String&& value) { SetRuleGroupArn(std::move(value)); return *this;} /** *

The ARN of the stateful rule group.

*/ inline FirewallStatefulRule& WithRuleGroupArn(const char* value) { SetRuleGroupArn(value); return *this;} /** *

The source IP addresses, in CIDR notation.

*/ inline const Aws::Vector& GetSources() const{ return m_sources; } /** *

The source IP addresses, in CIDR notation.

*/ inline bool SourcesHasBeenSet() const { return m_sourcesHasBeenSet; } /** *

The source IP addresses, in CIDR notation.

*/ inline void SetSources(const Aws::Vector& value) { m_sourcesHasBeenSet = true; m_sources = value; } /** *

The source IP addresses, in CIDR notation.

*/ inline void SetSources(Aws::Vector&& value) { m_sourcesHasBeenSet = true; m_sources = std::move(value); } /** *

The source IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& WithSources(const Aws::Vector& value) { SetSources(value); return *this;} /** *

The source IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& WithSources(Aws::Vector&& value) { SetSources(std::move(value)); return *this;} /** *

The source IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddSources(const Aws::String& value) { m_sourcesHasBeenSet = true; m_sources.push_back(value); return *this; } /** *

The source IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddSources(Aws::String&& value) { m_sourcesHasBeenSet = true; m_sources.push_back(std::move(value)); return *this; } /** *

The source IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddSources(const char* value) { m_sourcesHasBeenSet = true; m_sources.push_back(value); return *this; } /** *

The destination IP addresses, in CIDR notation.

*/ inline const Aws::Vector& GetDestinations() const{ return m_destinations; } /** *

The destination IP addresses, in CIDR notation.

*/ inline bool DestinationsHasBeenSet() const { return m_destinationsHasBeenSet; } /** *

The destination IP addresses, in CIDR notation.

*/ inline void SetDestinations(const Aws::Vector& value) { m_destinationsHasBeenSet = true; m_destinations = value; } /** *

The destination IP addresses, in CIDR notation.

*/ inline void SetDestinations(Aws::Vector&& value) { m_destinationsHasBeenSet = true; m_destinations = std::move(value); } /** *

The destination IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& WithDestinations(const Aws::Vector& value) { SetDestinations(value); return *this;} /** *

The destination IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& WithDestinations(Aws::Vector&& value) { SetDestinations(std::move(value)); return *this;} /** *

The destination IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddDestinations(const Aws::String& value) { m_destinationsHasBeenSet = true; m_destinations.push_back(value); return *this; } /** *

The destination IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddDestinations(Aws::String&& value) { m_destinationsHasBeenSet = true; m_destinations.push_back(std::move(value)); return *this; } /** *

The destination IP addresses, in CIDR notation.

*/ inline FirewallStatefulRule& AddDestinations(const char* value) { m_destinationsHasBeenSet = true; m_destinations.push_back(value); return *this; } /** *

The source ports.

*/ inline const Aws::Vector& GetSourcePorts() const{ return m_sourcePorts; } /** *

The source ports.

*/ inline bool SourcePortsHasBeenSet() const { return m_sourcePortsHasBeenSet; } /** *

The source ports.

*/ inline void SetSourcePorts(const Aws::Vector& value) { m_sourcePortsHasBeenSet = true; m_sourcePorts = value; } /** *

The source ports.

*/ inline void SetSourcePorts(Aws::Vector&& value) { m_sourcePortsHasBeenSet = true; m_sourcePorts = std::move(value); } /** *

The source ports.

*/ inline FirewallStatefulRule& WithSourcePorts(const Aws::Vector& value) { SetSourcePorts(value); return *this;} /** *

The source ports.

*/ inline FirewallStatefulRule& WithSourcePorts(Aws::Vector&& value) { SetSourcePorts(std::move(value)); return *this;} /** *

The source ports.

*/ inline FirewallStatefulRule& AddSourcePorts(const PortRange& value) { m_sourcePortsHasBeenSet = true; m_sourcePorts.push_back(value); return *this; } /** *

The source ports.

*/ inline FirewallStatefulRule& AddSourcePorts(PortRange&& value) { m_sourcePortsHasBeenSet = true; m_sourcePorts.push_back(std::move(value)); return *this; } /** *

The destination ports.

*/ inline const Aws::Vector& GetDestinationPorts() const{ return m_destinationPorts; } /** *

The destination ports.

*/ inline bool DestinationPortsHasBeenSet() const { return m_destinationPortsHasBeenSet; } /** *

The destination ports.

*/ inline void SetDestinationPorts(const Aws::Vector& value) { m_destinationPortsHasBeenSet = true; m_destinationPorts = value; } /** *

The destination ports.

*/ inline void SetDestinationPorts(Aws::Vector&& value) { m_destinationPortsHasBeenSet = true; m_destinationPorts = std::move(value); } /** *

The destination ports.

*/ inline FirewallStatefulRule& WithDestinationPorts(const Aws::Vector& value) { SetDestinationPorts(value); return *this;} /** *

The destination ports.

*/ inline FirewallStatefulRule& WithDestinationPorts(Aws::Vector&& value) { SetDestinationPorts(std::move(value)); return *this;} /** *

The destination ports.

*/ inline FirewallStatefulRule& AddDestinationPorts(const PortRange& value) { m_destinationPortsHasBeenSet = true; m_destinationPorts.push_back(value); return *this; } /** *

The destination ports.

*/ inline FirewallStatefulRule& AddDestinationPorts(PortRange&& value) { m_destinationPortsHasBeenSet = true; m_destinationPorts.push_back(std::move(value)); return *this; } /** *

The protocol.

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

The protocol.

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

The protocol.

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

The protocol.

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

The protocol.

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

The protocol.

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

The protocol.

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

The protocol.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The rule action. The possible values are pass, * drop, and alert.

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

The direction. The possible values are FORWARD and * ANY.

*/ inline const Aws::String& GetDirection() const{ return m_direction; } /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline bool DirectionHasBeenSet() const { return m_directionHasBeenSet; } /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline void SetDirection(const Aws::String& value) { m_directionHasBeenSet = true; m_direction = value; } /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline void SetDirection(Aws::String&& value) { m_directionHasBeenSet = true; m_direction = std::move(value); } /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline void SetDirection(const char* value) { m_directionHasBeenSet = true; m_direction.assign(value); } /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline FirewallStatefulRule& WithDirection(const Aws::String& value) { SetDirection(value); return *this;} /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline FirewallStatefulRule& WithDirection(Aws::String&& value) { SetDirection(std::move(value)); return *this;} /** *

The direction. The possible values are FORWARD and * ANY.

*/ inline FirewallStatefulRule& WithDirection(const char* value) { SetDirection(value); return *this;} private: Aws::String m_ruleGroupArn; bool m_ruleGroupArnHasBeenSet = false; Aws::Vector m_sources; bool m_sourcesHasBeenSet = false; Aws::Vector m_destinations; bool m_destinationsHasBeenSet = false; Aws::Vector m_sourcePorts; bool m_sourcePortsHasBeenSet = false; Aws::Vector m_destinationPorts; bool m_destinationPortsHasBeenSet = false; Aws::String m_protocol; bool m_protocolHasBeenSet = false; Aws::String m_ruleAction; bool m_ruleActionHasBeenSet = false; Aws::String m_direction; bool m_directionHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws