AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
SecurityGroupRule.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/ReferencedSecurityGroup.h>
12#include <aws/ec2/model/Tag.h>
13
14#include <utility>
15
16namespace Aws {
17namespace Utils {
18namespace Xml {
19class XmlNode;
20} // namespace Xml
21} // namespace Utils
22namespace EC2 {
23namespace Model {
24
31 public:
32 AWS_EC2_API SecurityGroupRule() = default;
33 AWS_EC2_API SecurityGroupRule(const Aws::Utils::Xml::XmlNode& xmlNode);
35
36 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
37 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
38
40
43 inline const Aws::String& GetSecurityGroupRuleId() const { return m_securityGroupRuleId; }
44 inline bool SecurityGroupRuleIdHasBeenSet() const { return m_securityGroupRuleIdHasBeenSet; }
45 template <typename SecurityGroupRuleIdT = Aws::String>
46 void SetSecurityGroupRuleId(SecurityGroupRuleIdT&& value) {
47 m_securityGroupRuleIdHasBeenSet = true;
48 m_securityGroupRuleId = std::forward<SecurityGroupRuleIdT>(value);
49 }
50 template <typename SecurityGroupRuleIdT = Aws::String>
51 SecurityGroupRule& WithSecurityGroupRuleId(SecurityGroupRuleIdT&& value) {
52 SetSecurityGroupRuleId(std::forward<SecurityGroupRuleIdT>(value));
53 return *this;
54 }
56
58
61 inline const Aws::String& GetGroupId() const { return m_groupId; }
62 inline bool GroupIdHasBeenSet() const { return m_groupIdHasBeenSet; }
63 template <typename GroupIdT = Aws::String>
64 void SetGroupId(GroupIdT&& value) {
65 m_groupIdHasBeenSet = true;
66 m_groupId = std::forward<GroupIdT>(value);
67 }
68 template <typename GroupIdT = Aws::String>
69 SecurityGroupRule& WithGroupId(GroupIdT&& value) {
70 SetGroupId(std::forward<GroupIdT>(value));
71 return *this;
72 }
74
76
79 inline const Aws::String& GetGroupOwnerId() const { return m_groupOwnerId; }
80 inline bool GroupOwnerIdHasBeenSet() const { return m_groupOwnerIdHasBeenSet; }
81 template <typename GroupOwnerIdT = Aws::String>
82 void SetGroupOwnerId(GroupOwnerIdT&& value) {
83 m_groupOwnerIdHasBeenSet = true;
84 m_groupOwnerId = std::forward<GroupOwnerIdT>(value);
85 }
86 template <typename GroupOwnerIdT = Aws::String>
87 SecurityGroupRule& WithGroupOwnerId(GroupOwnerIdT&& value) {
88 SetGroupOwnerId(std::forward<GroupOwnerIdT>(value));
89 return *this;
90 }
92
94
97 inline bool GetIsEgress() const { return m_isEgress; }
98 inline bool IsEgressHasBeenSet() const { return m_isEgressHasBeenSet; }
99 inline void SetIsEgress(bool value) {
100 m_isEgressHasBeenSet = true;
101 m_isEgress = value;
102 }
103 inline SecurityGroupRule& WithIsEgress(bool value) {
104 SetIsEgress(value);
105 return *this;
106 }
108
110
116 inline const Aws::String& GetIpProtocol() const { return m_ipProtocol; }
117 inline bool IpProtocolHasBeenSet() const { return m_ipProtocolHasBeenSet; }
118 template <typename IpProtocolT = Aws::String>
119 void SetIpProtocol(IpProtocolT&& value) {
120 m_ipProtocolHasBeenSet = true;
121 m_ipProtocol = std::forward<IpProtocolT>(value);
122 }
123 template <typename IpProtocolT = Aws::String>
124 SecurityGroupRule& WithIpProtocol(IpProtocolT&& value) {
125 SetIpProtocol(std::forward<IpProtocolT>(value));
126 return *this;
127 }
129
131
135 inline int GetFromPort() const { return m_fromPort; }
136 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
137 inline void SetFromPort(int value) {
138 m_fromPortHasBeenSet = true;
139 m_fromPort = value;
140 }
141 inline SecurityGroupRule& WithFromPort(int value) {
142 SetFromPort(value);
143 return *this;
144 }
146
148
154 inline int GetToPort() const { return m_toPort; }
155 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
156 inline void SetToPort(int value) {
157 m_toPortHasBeenSet = true;
158 m_toPort = value;
159 }
160 inline SecurityGroupRule& WithToPort(int value) {
161 SetToPort(value);
162 return *this;
163 }
165
167
170 inline const Aws::String& GetCidrIpv4() const { return m_cidrIpv4; }
171 inline bool CidrIpv4HasBeenSet() const { return m_cidrIpv4HasBeenSet; }
172 template <typename CidrIpv4T = Aws::String>
173 void SetCidrIpv4(CidrIpv4T&& value) {
174 m_cidrIpv4HasBeenSet = true;
175 m_cidrIpv4 = std::forward<CidrIpv4T>(value);
176 }
177 template <typename CidrIpv4T = Aws::String>
178 SecurityGroupRule& WithCidrIpv4(CidrIpv4T&& value) {
179 SetCidrIpv4(std::forward<CidrIpv4T>(value));
180 return *this;
181 }
183
185
188 inline const Aws::String& GetCidrIpv6() const { return m_cidrIpv6; }
189 inline bool CidrIpv6HasBeenSet() const { return m_cidrIpv6HasBeenSet; }
190 template <typename CidrIpv6T = Aws::String>
191 void SetCidrIpv6(CidrIpv6T&& value) {
192 m_cidrIpv6HasBeenSet = true;
193 m_cidrIpv6 = std::forward<CidrIpv6T>(value);
194 }
195 template <typename CidrIpv6T = Aws::String>
196 SecurityGroupRule& WithCidrIpv6(CidrIpv6T&& value) {
197 SetCidrIpv6(std::forward<CidrIpv6T>(value));
198 return *this;
199 }
201
203
206 inline const Aws::String& GetPrefixListId() const { return m_prefixListId; }
207 inline bool PrefixListIdHasBeenSet() const { return m_prefixListIdHasBeenSet; }
208 template <typename PrefixListIdT = Aws::String>
209 void SetPrefixListId(PrefixListIdT&& value) {
210 m_prefixListIdHasBeenSet = true;
211 m_prefixListId = std::forward<PrefixListIdT>(value);
212 }
213 template <typename PrefixListIdT = Aws::String>
214 SecurityGroupRule& WithPrefixListId(PrefixListIdT&& value) {
215 SetPrefixListId(std::forward<PrefixListIdT>(value));
216 return *this;
217 }
219
221
224 inline const ReferencedSecurityGroup& GetReferencedGroupInfo() const { return m_referencedGroupInfo; }
225 inline bool ReferencedGroupInfoHasBeenSet() const { return m_referencedGroupInfoHasBeenSet; }
226 template <typename ReferencedGroupInfoT = ReferencedSecurityGroup>
227 void SetReferencedGroupInfo(ReferencedGroupInfoT&& value) {
228 m_referencedGroupInfoHasBeenSet = true;
229 m_referencedGroupInfo = std::forward<ReferencedGroupInfoT>(value);
230 }
231 template <typename ReferencedGroupInfoT = ReferencedSecurityGroup>
232 SecurityGroupRule& WithReferencedGroupInfo(ReferencedGroupInfoT&& value) {
233 SetReferencedGroupInfo(std::forward<ReferencedGroupInfoT>(value));
234 return *this;
235 }
237
239
242 inline const Aws::String& GetDescription() const { return m_description; }
243 inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }
244 template <typename DescriptionT = Aws::String>
245 void SetDescription(DescriptionT&& value) {
246 m_descriptionHasBeenSet = true;
247 m_description = std::forward<DescriptionT>(value);
248 }
249 template <typename DescriptionT = Aws::String>
250 SecurityGroupRule& WithDescription(DescriptionT&& value) {
251 SetDescription(std::forward<DescriptionT>(value));
252 return *this;
253 }
255
257
260 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
261 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
262 template <typename TagsT = Aws::Vector<Tag>>
263 void SetTags(TagsT&& value) {
264 m_tagsHasBeenSet = true;
265 m_tags = std::forward<TagsT>(value);
266 }
267 template <typename TagsT = Aws::Vector<Tag>>
268 SecurityGroupRule& WithTags(TagsT&& value) {
269 SetTags(std::forward<TagsT>(value));
270 return *this;
271 }
272 template <typename TagsT = Tag>
273 SecurityGroupRule& AddTags(TagsT&& value) {
274 m_tagsHasBeenSet = true;
275 m_tags.emplace_back(std::forward<TagsT>(value));
276 return *this;
277 }
279
281
284 inline const Aws::String& GetSecurityGroupRuleArn() const { return m_securityGroupRuleArn; }
285 inline bool SecurityGroupRuleArnHasBeenSet() const { return m_securityGroupRuleArnHasBeenSet; }
286 template <typename SecurityGroupRuleArnT = Aws::String>
287 void SetSecurityGroupRuleArn(SecurityGroupRuleArnT&& value) {
288 m_securityGroupRuleArnHasBeenSet = true;
289 m_securityGroupRuleArn = std::forward<SecurityGroupRuleArnT>(value);
290 }
291 template <typename SecurityGroupRuleArnT = Aws::String>
292 SecurityGroupRule& WithSecurityGroupRuleArn(SecurityGroupRuleArnT&& value) {
293 SetSecurityGroupRuleArn(std::forward<SecurityGroupRuleArnT>(value));
294 return *this;
295 }
297 private:
298 Aws::String m_securityGroupRuleId;
299
300 Aws::String m_groupId;
301
302 Aws::String m_groupOwnerId;
303
304 bool m_isEgress{false};
305
306 Aws::String m_ipProtocol;
307
308 int m_fromPort{0};
309
310 int m_toPort{0};
311
312 Aws::String m_cidrIpv4;
313
314 Aws::String m_cidrIpv6;
315
316 Aws::String m_prefixListId;
317
318 ReferencedSecurityGroup m_referencedGroupInfo;
319
320 Aws::String m_description;
321
322 Aws::Vector<Tag> m_tags;
323
324 Aws::String m_securityGroupRuleArn;
325 bool m_securityGroupRuleIdHasBeenSet = false;
326 bool m_groupIdHasBeenSet = false;
327 bool m_groupOwnerIdHasBeenSet = false;
328 bool m_isEgressHasBeenSet = false;
329 bool m_ipProtocolHasBeenSet = false;
330 bool m_fromPortHasBeenSet = false;
331 bool m_toPortHasBeenSet = false;
332 bool m_cidrIpv4HasBeenSet = false;
333 bool m_cidrIpv6HasBeenSet = false;
334 bool m_prefixListIdHasBeenSet = false;
335 bool m_referencedGroupInfoHasBeenSet = false;
336 bool m_descriptionHasBeenSet = false;
337 bool m_tagsHasBeenSet = false;
338 bool m_securityGroupRuleArnHasBeenSet = false;
339};
340
341} // namespace Model
342} // namespace EC2
343} // namespace Aws
void SetReferencedGroupInfo(ReferencedGroupInfoT &&value)
const Aws::String & GetGroupOwnerId() const
SecurityGroupRule & WithFromPort(int value)
SecurityGroupRule & WithPrefixListId(PrefixListIdT &&value)
void SetDescription(DescriptionT &&value)
const Aws::Vector< Tag > & GetTags() const
const Aws::String & GetDescription() const
SecurityGroupRule & WithToPort(int value)
SecurityGroupRule & WithGroupId(GroupIdT &&value)
const Aws::String & GetCidrIpv6() const
const Aws::String & GetPrefixListId() const
SecurityGroupRule & WithCidrIpv6(CidrIpv6T &&value)
SecurityGroupRule & AddTags(TagsT &&value)
const ReferencedSecurityGroup & GetReferencedGroupInfo() const
SecurityGroupRule & WithTags(TagsT &&value)
AWS_EC2_API SecurityGroupRule(const Aws::Utils::Xml::XmlNode &xmlNode)
AWS_EC2_API SecurityGroupRule & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
SecurityGroupRule & WithSecurityGroupRuleId(SecurityGroupRuleIdT &&value)
const Aws::String & GetSecurityGroupRuleId() const
void SetSecurityGroupRuleArn(SecurityGroupRuleArnT &&value)
AWS_EC2_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
const Aws::String & GetCidrIpv4() const
void SetGroupOwnerId(GroupOwnerIdT &&value)
SecurityGroupRule & WithReferencedGroupInfo(ReferencedGroupInfoT &&value)
AWS_EC2_API SecurityGroupRule()=default
SecurityGroupRule & WithIsEgress(bool value)
void SetIpProtocol(IpProtocolT &&value)
void SetSecurityGroupRuleId(SecurityGroupRuleIdT &&value)
SecurityGroupRule & WithSecurityGroupRuleArn(SecurityGroupRuleArnT &&value)
const Aws::String & GetGroupId() const
const Aws::String & GetSecurityGroupRuleArn() const
SecurityGroupRule & WithGroupOwnerId(GroupOwnerIdT &&value)
SecurityGroupRule & WithDescription(DescriptionT &&value)
void SetPrefixListId(PrefixListIdT &&value)
SecurityGroupRule & WithIpProtocol(IpProtocolT &&value)
AWS_EC2_API void OutputToStream(Aws::OStream &oStream, const char *location) const
SecurityGroupRule & WithCidrIpv4(CidrIpv4T &&value)
const Aws::String & GetIpProtocol() 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