AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
FirewallStatelessRule.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/ec2/EC2_EXPORTS.h>
11#include <aws/ec2/model/PortRange.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Utils {
17namespace Xml {
18class XmlNode;
19} // namespace Xml
20} // namespace Utils
21namespace EC2 {
22namespace Model {
23
30 public:
31 AWS_EC2_API FirewallStatelessRule() = default;
34
35 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
36 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
37
39
42 inline const Aws::String& GetRuleGroupArn() const { return m_ruleGroupArn; }
43 inline bool RuleGroupArnHasBeenSet() const { return m_ruleGroupArnHasBeenSet; }
44 template <typename RuleGroupArnT = Aws::String>
45 void SetRuleGroupArn(RuleGroupArnT&& value) {
46 m_ruleGroupArnHasBeenSet = true;
47 m_ruleGroupArn = std::forward<RuleGroupArnT>(value);
48 }
49 template <typename RuleGroupArnT = Aws::String>
50 FirewallStatelessRule& WithRuleGroupArn(RuleGroupArnT&& value) {
51 SetRuleGroupArn(std::forward<RuleGroupArnT>(value));
52 return *this;
53 }
55
57
60 inline const Aws::Vector<Aws::String>& GetSources() const { return m_sources; }
61 inline bool SourcesHasBeenSet() const { return m_sourcesHasBeenSet; }
62 template <typename SourcesT = Aws::Vector<Aws::String>>
63 void SetSources(SourcesT&& value) {
64 m_sourcesHasBeenSet = true;
65 m_sources = std::forward<SourcesT>(value);
66 }
67 template <typename SourcesT = Aws::Vector<Aws::String>>
69 SetSources(std::forward<SourcesT>(value));
70 return *this;
71 }
72 template <typename SourcesT = Aws::String>
73 FirewallStatelessRule& AddSources(SourcesT&& value) {
74 m_sourcesHasBeenSet = true;
75 m_sources.emplace_back(std::forward<SourcesT>(value));
76 return *this;
77 }
79
81
84 inline const Aws::Vector<Aws::String>& GetDestinations() const { return m_destinations; }
85 inline bool DestinationsHasBeenSet() const { return m_destinationsHasBeenSet; }
86 template <typename DestinationsT = Aws::Vector<Aws::String>>
87 void SetDestinations(DestinationsT&& value) {
88 m_destinationsHasBeenSet = true;
89 m_destinations = std::forward<DestinationsT>(value);
90 }
91 template <typename DestinationsT = Aws::Vector<Aws::String>>
92 FirewallStatelessRule& WithDestinations(DestinationsT&& value) {
93 SetDestinations(std::forward<DestinationsT>(value));
94 return *this;
95 }
96 template <typename DestinationsT = Aws::String>
97 FirewallStatelessRule& AddDestinations(DestinationsT&& value) {
98 m_destinationsHasBeenSet = true;
99 m_destinations.emplace_back(std::forward<DestinationsT>(value));
100 return *this;
101 }
103
105
108 inline const Aws::Vector<PortRange>& GetSourcePorts() const { return m_sourcePorts; }
109 inline bool SourcePortsHasBeenSet() const { return m_sourcePortsHasBeenSet; }
110 template <typename SourcePortsT = Aws::Vector<PortRange>>
111 void SetSourcePorts(SourcePortsT&& value) {
112 m_sourcePortsHasBeenSet = true;
113 m_sourcePorts = std::forward<SourcePortsT>(value);
114 }
115 template <typename SourcePortsT = Aws::Vector<PortRange>>
116 FirewallStatelessRule& WithSourcePorts(SourcePortsT&& value) {
117 SetSourcePorts(std::forward<SourcePortsT>(value));
118 return *this;
119 }
120 template <typename SourcePortsT = PortRange>
121 FirewallStatelessRule& AddSourcePorts(SourcePortsT&& value) {
122 m_sourcePortsHasBeenSet = true;
123 m_sourcePorts.emplace_back(std::forward<SourcePortsT>(value));
124 return *this;
125 }
127
129
132 inline const Aws::Vector<PortRange>& GetDestinationPorts() const { return m_destinationPorts; }
133 inline bool DestinationPortsHasBeenSet() const { return m_destinationPortsHasBeenSet; }
134 template <typename DestinationPortsT = Aws::Vector<PortRange>>
135 void SetDestinationPorts(DestinationPortsT&& value) {
136 m_destinationPortsHasBeenSet = true;
137 m_destinationPorts = std::forward<DestinationPortsT>(value);
138 }
139 template <typename DestinationPortsT = Aws::Vector<PortRange>>
140 FirewallStatelessRule& WithDestinationPorts(DestinationPortsT&& value) {
141 SetDestinationPorts(std::forward<DestinationPortsT>(value));
142 return *this;
143 }
144 template <typename DestinationPortsT = PortRange>
145 FirewallStatelessRule& AddDestinationPorts(DestinationPortsT&& value) {
146 m_destinationPortsHasBeenSet = true;
147 m_destinationPorts.emplace_back(std::forward<DestinationPortsT>(value));
148 return *this;
149 }
151
153
156 inline const Aws::Vector<int>& GetProtocols() const { return m_protocols; }
157 inline bool ProtocolsHasBeenSet() const { return m_protocolsHasBeenSet; }
158 template <typename ProtocolsT = Aws::Vector<int>>
159 void SetProtocols(ProtocolsT&& value) {
160 m_protocolsHasBeenSet = true;
161 m_protocols = std::forward<ProtocolsT>(value);
162 }
163 template <typename ProtocolsT = Aws::Vector<int>>
165 SetProtocols(std::forward<ProtocolsT>(value));
166 return *this;
167 }
169 m_protocolsHasBeenSet = true;
170 m_protocols.push_back(value);
171 return *this;
172 }
174
176
180 inline const Aws::String& GetRuleAction() const { return m_ruleAction; }
181 inline bool RuleActionHasBeenSet() const { return m_ruleActionHasBeenSet; }
182 template <typename RuleActionT = Aws::String>
183 void SetRuleAction(RuleActionT&& value) {
184 m_ruleActionHasBeenSet = true;
185 m_ruleAction = std::forward<RuleActionT>(value);
186 }
187 template <typename RuleActionT = Aws::String>
188 FirewallStatelessRule& WithRuleAction(RuleActionT&& value) {
189 SetRuleAction(std::forward<RuleActionT>(value));
190 return *this;
191 }
193
195
198 inline int GetPriority() const { return m_priority; }
199 inline bool PriorityHasBeenSet() const { return m_priorityHasBeenSet; }
200 inline void SetPriority(int value) {
201 m_priorityHasBeenSet = true;
202 m_priority = value;
203 }
205 SetPriority(value);
206 return *this;
207 }
209 private:
210 Aws::String m_ruleGroupArn;
211
212 Aws::Vector<Aws::String> m_sources;
213
214 Aws::Vector<Aws::String> m_destinations;
215
216 Aws::Vector<PortRange> m_sourcePorts;
217
218 Aws::Vector<PortRange> m_destinationPorts;
219
220 Aws::Vector<int> m_protocols;
221
222 Aws::String m_ruleAction;
223
224 int m_priority{0};
225 bool m_ruleGroupArnHasBeenSet = false;
226 bool m_sourcesHasBeenSet = false;
227 bool m_destinationsHasBeenSet = false;
228 bool m_sourcePortsHasBeenSet = false;
229 bool m_destinationPortsHasBeenSet = false;
230 bool m_protocolsHasBeenSet = false;
231 bool m_ruleActionHasBeenSet = false;
232 bool m_priorityHasBeenSet = false;
233};
234
235} // namespace Model
236} // namespace EC2
237} // namespace Aws
FirewallStatelessRule & WithSourcePorts(SourcePortsT &&value)
FirewallStatelessRule & AddDestinationPorts(DestinationPortsT &&value)
FirewallStatelessRule & WithSources(SourcesT &&value)
FirewallStatelessRule & WithPriority(int value)
FirewallStatelessRule & AddSources(SourcesT &&value)
FirewallStatelessRule & AddProtocols(int value)
void SetDestinations(DestinationsT &&value)
FirewallStatelessRule & AddSourcePorts(SourcePortsT &&value)
const Aws::Vector< Aws::String > & GetDestinations() const
AWS_EC2_API FirewallStatelessRule(const Aws::Utils::Xml::XmlNode &xmlNode)
const Aws::String & GetRuleGroupArn() const
FirewallStatelessRule & AddDestinations(DestinationsT &&value)
const Aws::Vector< int > & GetProtocols() const
FirewallStatelessRule & WithDestinations(DestinationsT &&value)
void SetDestinationPorts(DestinationPortsT &&value)
void SetRuleGroupArn(RuleGroupArnT &&value)
AWS_EC2_API FirewallStatelessRule()=default
FirewallStatelessRule & WithRuleAction(RuleActionT &&value)
const Aws::Vector< Aws::String > & GetSources() const
AWS_EC2_API FirewallStatelessRule & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
const Aws::Vector< PortRange > & GetDestinationPorts() const
FirewallStatelessRule & WithRuleGroupArn(RuleGroupArnT &&value)
FirewallStatelessRule & WithDestinationPorts(DestinationPortsT &&value)
FirewallStatelessRule & WithProtocols(ProtocolsT &&value)
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
const Aws::Vector< PortRange > & GetSourcePorts() const
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::basic_ostream< char, std::char_traits< char > > OStream