1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/securityhub/SecurityHub_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/securityhub/model/IcmpTypeCode.h>
10 #include <aws/securityhub/model/PortRangeFromTo.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace SecurityHub
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>A rule for the network ACL. Each rule allows or denies access based on the IP
30    * address, traffic direction, port, and protocol.</p><p><h3>See Also:</h3>   <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/AwsEc2NetworkAclEntry">AWS
32    * API Reference</a></p>
33    */
34   class AWS_SECURITYHUB_API AwsEc2NetworkAclEntry
35   {
36   public:
37     AwsEc2NetworkAclEntry();
38     AwsEc2NetworkAclEntry(Aws::Utils::Json::JsonView jsonValue);
39     AwsEc2NetworkAclEntry& operator=(Aws::Utils::Json::JsonView jsonValue);
40     Aws::Utils::Json::JsonValue Jsonize() const;
41 
42 
43     /**
44      * <p>The IPV4 network range for which to deny or allow access.</p>
45      */
GetCidrBlock()46     inline const Aws::String& GetCidrBlock() const{ return m_cidrBlock; }
47 
48     /**
49      * <p>The IPV4 network range for which to deny or allow access.</p>
50      */
CidrBlockHasBeenSet()51     inline bool CidrBlockHasBeenSet() const { return m_cidrBlockHasBeenSet; }
52 
53     /**
54      * <p>The IPV4 network range for which to deny or allow access.</p>
55      */
SetCidrBlock(const Aws::String & value)56     inline void SetCidrBlock(const Aws::String& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = value; }
57 
58     /**
59      * <p>The IPV4 network range for which to deny or allow access.</p>
60      */
SetCidrBlock(Aws::String && value)61     inline void SetCidrBlock(Aws::String&& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = std::move(value); }
62 
63     /**
64      * <p>The IPV4 network range for which to deny or allow access.</p>
65      */
SetCidrBlock(const char * value)66     inline void SetCidrBlock(const char* value) { m_cidrBlockHasBeenSet = true; m_cidrBlock.assign(value); }
67 
68     /**
69      * <p>The IPV4 network range for which to deny or allow access.</p>
70      */
WithCidrBlock(const Aws::String & value)71     inline AwsEc2NetworkAclEntry& WithCidrBlock(const Aws::String& value) { SetCidrBlock(value); return *this;}
72 
73     /**
74      * <p>The IPV4 network range for which to deny or allow access.</p>
75      */
WithCidrBlock(Aws::String && value)76     inline AwsEc2NetworkAclEntry& WithCidrBlock(Aws::String&& value) { SetCidrBlock(std::move(value)); return *this;}
77 
78     /**
79      * <p>The IPV4 network range for which to deny or allow access.</p>
80      */
WithCidrBlock(const char * value)81     inline AwsEc2NetworkAclEntry& WithCidrBlock(const char* value) { SetCidrBlock(value); return *this;}
82 
83 
84     /**
85      * <p>Whether the rule is an egress rule. An egress rule is a rule that applies to
86      * traffic that leaves the subnet.</p>
87      */
GetEgress()88     inline bool GetEgress() const{ return m_egress; }
89 
90     /**
91      * <p>Whether the rule is an egress rule. An egress rule is a rule that applies to
92      * traffic that leaves the subnet.</p>
93      */
EgressHasBeenSet()94     inline bool EgressHasBeenSet() const { return m_egressHasBeenSet; }
95 
96     /**
97      * <p>Whether the rule is an egress rule. An egress rule is a rule that applies to
98      * traffic that leaves the subnet.</p>
99      */
SetEgress(bool value)100     inline void SetEgress(bool value) { m_egressHasBeenSet = true; m_egress = value; }
101 
102     /**
103      * <p>Whether the rule is an egress rule. An egress rule is a rule that applies to
104      * traffic that leaves the subnet.</p>
105      */
WithEgress(bool value)106     inline AwsEc2NetworkAclEntry& WithEgress(bool value) { SetEgress(value); return *this;}
107 
108 
109     /**
110      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
111      * or allow access.</p>
112      */
GetIcmpTypeCode()113     inline const IcmpTypeCode& GetIcmpTypeCode() const{ return m_icmpTypeCode; }
114 
115     /**
116      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
117      * or allow access.</p>
118      */
IcmpTypeCodeHasBeenSet()119     inline bool IcmpTypeCodeHasBeenSet() const { return m_icmpTypeCodeHasBeenSet; }
120 
121     /**
122      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
123      * or allow access.</p>
124      */
SetIcmpTypeCode(const IcmpTypeCode & value)125     inline void SetIcmpTypeCode(const IcmpTypeCode& value) { m_icmpTypeCodeHasBeenSet = true; m_icmpTypeCode = value; }
126 
127     /**
128      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
129      * or allow access.</p>
130      */
SetIcmpTypeCode(IcmpTypeCode && value)131     inline void SetIcmpTypeCode(IcmpTypeCode&& value) { m_icmpTypeCodeHasBeenSet = true; m_icmpTypeCode = std::move(value); }
132 
133     /**
134      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
135      * or allow access.</p>
136      */
WithIcmpTypeCode(const IcmpTypeCode & value)137     inline AwsEc2NetworkAclEntry& WithIcmpTypeCode(const IcmpTypeCode& value) { SetIcmpTypeCode(value); return *this;}
138 
139     /**
140      * <p>The Internet Control Message Protocol (ICMP) type and code for which to deny
141      * or allow access.</p>
142      */
WithIcmpTypeCode(IcmpTypeCode && value)143     inline AwsEc2NetworkAclEntry& WithIcmpTypeCode(IcmpTypeCode&& value) { SetIcmpTypeCode(std::move(value)); return *this;}
144 
145 
146     /**
147      * <p>The IPV6 network range for which to deny or allow access.</p>
148      */
GetIpv6CidrBlock()149     inline const Aws::String& GetIpv6CidrBlock() const{ return m_ipv6CidrBlock; }
150 
151     /**
152      * <p>The IPV6 network range for which to deny or allow access.</p>
153      */
Ipv6CidrBlockHasBeenSet()154     inline bool Ipv6CidrBlockHasBeenSet() const { return m_ipv6CidrBlockHasBeenSet; }
155 
156     /**
157      * <p>The IPV6 network range for which to deny or allow access.</p>
158      */
SetIpv6CidrBlock(const Aws::String & value)159     inline void SetIpv6CidrBlock(const Aws::String& value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock = value; }
160 
161     /**
162      * <p>The IPV6 network range for which to deny or allow access.</p>
163      */
SetIpv6CidrBlock(Aws::String && value)164     inline void SetIpv6CidrBlock(Aws::String&& value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock = std::move(value); }
165 
166     /**
167      * <p>The IPV6 network range for which to deny or allow access.</p>
168      */
SetIpv6CidrBlock(const char * value)169     inline void SetIpv6CidrBlock(const char* value) { m_ipv6CidrBlockHasBeenSet = true; m_ipv6CidrBlock.assign(value); }
170 
171     /**
172      * <p>The IPV6 network range for which to deny or allow access.</p>
173      */
WithIpv6CidrBlock(const Aws::String & value)174     inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(const Aws::String& value) { SetIpv6CidrBlock(value); return *this;}
175 
176     /**
177      * <p>The IPV6 network range for which to deny or allow access.</p>
178      */
WithIpv6CidrBlock(Aws::String && value)179     inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(Aws::String&& value) { SetIpv6CidrBlock(std::move(value)); return *this;}
180 
181     /**
182      * <p>The IPV6 network range for which to deny or allow access.</p>
183      */
WithIpv6CidrBlock(const char * value)184     inline AwsEc2NetworkAclEntry& WithIpv6CidrBlock(const char* value) { SetIpv6CidrBlock(value); return *this;}
185 
186 
187     /**
188      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
189      */
GetPortRange()190     inline const PortRangeFromTo& GetPortRange() const{ return m_portRange; }
191 
192     /**
193      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
194      */
PortRangeHasBeenSet()195     inline bool PortRangeHasBeenSet() const { return m_portRangeHasBeenSet; }
196 
197     /**
198      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
199      */
SetPortRange(const PortRangeFromTo & value)200     inline void SetPortRange(const PortRangeFromTo& value) { m_portRangeHasBeenSet = true; m_portRange = value; }
201 
202     /**
203      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
204      */
SetPortRange(PortRangeFromTo && value)205     inline void SetPortRange(PortRangeFromTo&& value) { m_portRangeHasBeenSet = true; m_portRange = std::move(value); }
206 
207     /**
208      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
209      */
WithPortRange(const PortRangeFromTo & value)210     inline AwsEc2NetworkAclEntry& WithPortRange(const PortRangeFromTo& value) { SetPortRange(value); return *this;}
211 
212     /**
213      * <p>For TCP or UDP protocols, the range of ports that the rule applies to.</p>
214      */
WithPortRange(PortRangeFromTo && value)215     inline AwsEc2NetworkAclEntry& WithPortRange(PortRangeFromTo&& value) { SetPortRange(std::move(value)); return *this;}
216 
217 
218     /**
219      * <p>The protocol that the rule applies to. To deny or allow access to all
220      * protocols, use the value -1.</p>
221      */
GetProtocol()222     inline const Aws::String& GetProtocol() const{ return m_protocol; }
223 
224     /**
225      * <p>The protocol that the rule applies to. To deny or allow access to all
226      * protocols, use the value -1.</p>
227      */
ProtocolHasBeenSet()228     inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; }
229 
230     /**
231      * <p>The protocol that the rule applies to. To deny or allow access to all
232      * protocols, use the value -1.</p>
233      */
SetProtocol(const Aws::String & value)234     inline void SetProtocol(const Aws::String& value) { m_protocolHasBeenSet = true; m_protocol = value; }
235 
236     /**
237      * <p>The protocol that the rule applies to. To deny or allow access to all
238      * protocols, use the value -1.</p>
239      */
SetProtocol(Aws::String && value)240     inline void SetProtocol(Aws::String&& value) { m_protocolHasBeenSet = true; m_protocol = std::move(value); }
241 
242     /**
243      * <p>The protocol that the rule applies to. To deny or allow access to all
244      * protocols, use the value -1.</p>
245      */
SetProtocol(const char * value)246     inline void SetProtocol(const char* value) { m_protocolHasBeenSet = true; m_protocol.assign(value); }
247 
248     /**
249      * <p>The protocol that the rule applies to. To deny or allow access to all
250      * protocols, use the value -1.</p>
251      */
WithProtocol(const Aws::String & value)252     inline AwsEc2NetworkAclEntry& WithProtocol(const Aws::String& value) { SetProtocol(value); return *this;}
253 
254     /**
255      * <p>The protocol that the rule applies to. To deny or allow access to all
256      * protocols, use the value -1.</p>
257      */
WithProtocol(Aws::String && value)258     inline AwsEc2NetworkAclEntry& WithProtocol(Aws::String&& value) { SetProtocol(std::move(value)); return *this;}
259 
260     /**
261      * <p>The protocol that the rule applies to. To deny or allow access to all
262      * protocols, use the value -1.</p>
263      */
WithProtocol(const char * value)264     inline AwsEc2NetworkAclEntry& WithProtocol(const char* value) { SetProtocol(value); return *this;}
265 
266 
267     /**
268      * <p>Whether the rule is used to allow access or deny access.</p>
269      */
GetRuleAction()270     inline const Aws::String& GetRuleAction() const{ return m_ruleAction; }
271 
272     /**
273      * <p>Whether the rule is used to allow access or deny access.</p>
274      */
RuleActionHasBeenSet()275     inline bool RuleActionHasBeenSet() const { return m_ruleActionHasBeenSet; }
276 
277     /**
278      * <p>Whether the rule is used to allow access or deny access.</p>
279      */
SetRuleAction(const Aws::String & value)280     inline void SetRuleAction(const Aws::String& value) { m_ruleActionHasBeenSet = true; m_ruleAction = value; }
281 
282     /**
283      * <p>Whether the rule is used to allow access or deny access.</p>
284      */
SetRuleAction(Aws::String && value)285     inline void SetRuleAction(Aws::String&& value) { m_ruleActionHasBeenSet = true; m_ruleAction = std::move(value); }
286 
287     /**
288      * <p>Whether the rule is used to allow access or deny access.</p>
289      */
SetRuleAction(const char * value)290     inline void SetRuleAction(const char* value) { m_ruleActionHasBeenSet = true; m_ruleAction.assign(value); }
291 
292     /**
293      * <p>Whether the rule is used to allow access or deny access.</p>
294      */
WithRuleAction(const Aws::String & value)295     inline AwsEc2NetworkAclEntry& WithRuleAction(const Aws::String& value) { SetRuleAction(value); return *this;}
296 
297     /**
298      * <p>Whether the rule is used to allow access or deny access.</p>
299      */
WithRuleAction(Aws::String && value)300     inline AwsEc2NetworkAclEntry& WithRuleAction(Aws::String&& value) { SetRuleAction(std::move(value)); return *this;}
301 
302     /**
303      * <p>Whether the rule is used to allow access or deny access.</p>
304      */
WithRuleAction(const char * value)305     inline AwsEc2NetworkAclEntry& WithRuleAction(const char* value) { SetRuleAction(value); return *this;}
306 
307 
308     /**
309      * <p>The rule number. The rules are processed in order by their number.</p>
310      */
GetRuleNumber()311     inline int GetRuleNumber() const{ return m_ruleNumber; }
312 
313     /**
314      * <p>The rule number. The rules are processed in order by their number.</p>
315      */
RuleNumberHasBeenSet()316     inline bool RuleNumberHasBeenSet() const { return m_ruleNumberHasBeenSet; }
317 
318     /**
319      * <p>The rule number. The rules are processed in order by their number.</p>
320      */
SetRuleNumber(int value)321     inline void SetRuleNumber(int value) { m_ruleNumberHasBeenSet = true; m_ruleNumber = value; }
322 
323     /**
324      * <p>The rule number. The rules are processed in order by their number.</p>
325      */
WithRuleNumber(int value)326     inline AwsEc2NetworkAclEntry& WithRuleNumber(int value) { SetRuleNumber(value); return *this;}
327 
328   private:
329 
330     Aws::String m_cidrBlock;
331     bool m_cidrBlockHasBeenSet;
332 
333     bool m_egress;
334     bool m_egressHasBeenSet;
335 
336     IcmpTypeCode m_icmpTypeCode;
337     bool m_icmpTypeCodeHasBeenSet;
338 
339     Aws::String m_ipv6CidrBlock;
340     bool m_ipv6CidrBlockHasBeenSet;
341 
342     PortRangeFromTo m_portRange;
343     bool m_portRangeHasBeenSet;
344 
345     Aws::String m_protocol;
346     bool m_protocolHasBeenSet;
347 
348     Aws::String m_ruleAction;
349     bool m_ruleActionHasBeenSet;
350 
351     int m_ruleNumber;
352     bool m_ruleNumberHasBeenSet;
353   };
354 
355 } // namespace Model
356 } // namespace SecurityHub
357 } // namespace Aws
358