AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
SecurityGroupRule.h
1
6#pragma once
7#include <aws/ec2/EC2_EXPORTS.h>
8#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/ec2/model/ReferencedSecurityGroup.h>
11#include <aws/core/utils/memory/stl/AWSVector.h>
12#include <aws/ec2/model/Tag.h>
13#include <utility>
14
15namespace Aws
16{
17namespace Utils
18{
19namespace Xml
20{
21 class XmlNode;
22} // namespace Xml
23} // namespace Utils
24namespace EC2
25{
26namespace Model
27{
28
35 {
36 public:
37 AWS_EC2_API SecurityGroupRule() = default;
38 AWS_EC2_API SecurityGroupRule(const Aws::Utils::Xml::XmlNode& xmlNode);
40
41 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
42 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
43
44
46
49 inline const Aws::String& GetSecurityGroupRuleId() const { return m_securityGroupRuleId; }
50 inline bool SecurityGroupRuleIdHasBeenSet() const { return m_securityGroupRuleIdHasBeenSet; }
51 template<typename SecurityGroupRuleIdT = Aws::String>
52 void SetSecurityGroupRuleId(SecurityGroupRuleIdT&& value) { m_securityGroupRuleIdHasBeenSet = true; m_securityGroupRuleId = std::forward<SecurityGroupRuleIdT>(value); }
53 template<typename SecurityGroupRuleIdT = Aws::String>
54 SecurityGroupRule& WithSecurityGroupRuleId(SecurityGroupRuleIdT&& value) { SetSecurityGroupRuleId(std::forward<SecurityGroupRuleIdT>(value)); return *this;}
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) { m_groupIdHasBeenSet = true; m_groupId = std::forward<GroupIdT>(value); }
65 template<typename GroupIdT = Aws::String>
66 SecurityGroupRule& WithGroupId(GroupIdT&& value) { SetGroupId(std::forward<GroupIdT>(value)); return *this;}
68
70
73 inline const Aws::String& GetGroupOwnerId() const { return m_groupOwnerId; }
74 inline bool GroupOwnerIdHasBeenSet() const { return m_groupOwnerIdHasBeenSet; }
75 template<typename GroupOwnerIdT = Aws::String>
76 void SetGroupOwnerId(GroupOwnerIdT&& value) { m_groupOwnerIdHasBeenSet = true; m_groupOwnerId = std::forward<GroupOwnerIdT>(value); }
77 template<typename GroupOwnerIdT = Aws::String>
78 SecurityGroupRule& WithGroupOwnerId(GroupOwnerIdT&& value) { SetGroupOwnerId(std::forward<GroupOwnerIdT>(value)); return *this;}
80
82
85 inline bool GetIsEgress() const { return m_isEgress; }
86 inline bool IsEgressHasBeenSet() const { return m_isEgressHasBeenSet; }
87 inline void SetIsEgress(bool value) { m_isEgressHasBeenSet = true; m_isEgress = value; }
88 inline SecurityGroupRule& WithIsEgress(bool value) { SetIsEgress(value); return *this;}
90
92
98 inline const Aws::String& GetIpProtocol() const { return m_ipProtocol; }
99 inline bool IpProtocolHasBeenSet() const { return m_ipProtocolHasBeenSet; }
100 template<typename IpProtocolT = Aws::String>
101 void SetIpProtocol(IpProtocolT&& value) { m_ipProtocolHasBeenSet = true; m_ipProtocol = std::forward<IpProtocolT>(value); }
102 template<typename IpProtocolT = Aws::String>
103 SecurityGroupRule& WithIpProtocol(IpProtocolT&& value) { SetIpProtocol(std::forward<IpProtocolT>(value)); return *this;}
105
107
111 inline int GetFromPort() const { return m_fromPort; }
112 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
113 inline void SetFromPort(int value) { m_fromPortHasBeenSet = true; m_fromPort = value; }
114 inline SecurityGroupRule& WithFromPort(int value) { SetFromPort(value); return *this;}
116
118
124 inline int GetToPort() const { return m_toPort; }
125 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
126 inline void SetToPort(int value) { m_toPortHasBeenSet = true; m_toPort = value; }
127 inline SecurityGroupRule& WithToPort(int value) { SetToPort(value); return *this;}
129
131
134 inline const Aws::String& GetCidrIpv4() const { return m_cidrIpv4; }
135 inline bool CidrIpv4HasBeenSet() const { return m_cidrIpv4HasBeenSet; }
136 template<typename CidrIpv4T = Aws::String>
137 void SetCidrIpv4(CidrIpv4T&& value) { m_cidrIpv4HasBeenSet = true; m_cidrIpv4 = std::forward<CidrIpv4T>(value); }
138 template<typename CidrIpv4T = Aws::String>
139 SecurityGroupRule& WithCidrIpv4(CidrIpv4T&& value) { SetCidrIpv4(std::forward<CidrIpv4T>(value)); return *this;}
141
143
146 inline const Aws::String& GetCidrIpv6() const { return m_cidrIpv6; }
147 inline bool CidrIpv6HasBeenSet() const { return m_cidrIpv6HasBeenSet; }
148 template<typename CidrIpv6T = Aws::String>
149 void SetCidrIpv6(CidrIpv6T&& value) { m_cidrIpv6HasBeenSet = true; m_cidrIpv6 = std::forward<CidrIpv6T>(value); }
150 template<typename CidrIpv6T = Aws::String>
151 SecurityGroupRule& WithCidrIpv6(CidrIpv6T&& value) { SetCidrIpv6(std::forward<CidrIpv6T>(value)); return *this;}
153
155
158 inline const Aws::String& GetPrefixListId() const { return m_prefixListId; }
159 inline bool PrefixListIdHasBeenSet() const { return m_prefixListIdHasBeenSet; }
160 template<typename PrefixListIdT = Aws::String>
161 void SetPrefixListId(PrefixListIdT&& value) { m_prefixListIdHasBeenSet = true; m_prefixListId = std::forward<PrefixListIdT>(value); }
162 template<typename PrefixListIdT = Aws::String>
163 SecurityGroupRule& WithPrefixListId(PrefixListIdT&& value) { SetPrefixListId(std::forward<PrefixListIdT>(value)); return *this;}
165
167
170 inline const ReferencedSecurityGroup& GetReferencedGroupInfo() const { return m_referencedGroupInfo; }
171 inline bool ReferencedGroupInfoHasBeenSet() const { return m_referencedGroupInfoHasBeenSet; }
172 template<typename ReferencedGroupInfoT = ReferencedSecurityGroup>
173 void SetReferencedGroupInfo(ReferencedGroupInfoT&& value) { m_referencedGroupInfoHasBeenSet = true; m_referencedGroupInfo = std::forward<ReferencedGroupInfoT>(value); }
174 template<typename ReferencedGroupInfoT = ReferencedSecurityGroup>
175 SecurityGroupRule& WithReferencedGroupInfo(ReferencedGroupInfoT&& value) { SetReferencedGroupInfo(std::forward<ReferencedGroupInfoT>(value)); return *this;}
177
179
182 inline const Aws::String& GetDescription() const { return m_description; }
183 inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }
184 template<typename DescriptionT = Aws::String>
185 void SetDescription(DescriptionT&& value) { m_descriptionHasBeenSet = true; m_description = std::forward<DescriptionT>(value); }
186 template<typename DescriptionT = Aws::String>
187 SecurityGroupRule& WithDescription(DescriptionT&& value) { SetDescription(std::forward<DescriptionT>(value)); return *this;}
189
191
194 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
195 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
196 template<typename TagsT = Aws::Vector<Tag>>
197 void SetTags(TagsT&& value) { m_tagsHasBeenSet = true; m_tags = std::forward<TagsT>(value); }
198 template<typename TagsT = Aws::Vector<Tag>>
199 SecurityGroupRule& WithTags(TagsT&& value) { SetTags(std::forward<TagsT>(value)); return *this;}
200 template<typename TagsT = Tag>
201 SecurityGroupRule& AddTags(TagsT&& value) { m_tagsHasBeenSet = true; m_tags.emplace_back(std::forward<TagsT>(value)); return *this; }
203
205
208 inline const Aws::String& GetSecurityGroupRuleArn() const { return m_securityGroupRuleArn; }
209 inline bool SecurityGroupRuleArnHasBeenSet() const { return m_securityGroupRuleArnHasBeenSet; }
210 template<typename SecurityGroupRuleArnT = Aws::String>
211 void SetSecurityGroupRuleArn(SecurityGroupRuleArnT&& value) { m_securityGroupRuleArnHasBeenSet = true; m_securityGroupRuleArn = std::forward<SecurityGroupRuleArnT>(value); }
212 template<typename SecurityGroupRuleArnT = Aws::String>
213 SecurityGroupRule& WithSecurityGroupRuleArn(SecurityGroupRuleArnT&& value) { SetSecurityGroupRuleArn(std::forward<SecurityGroupRuleArnT>(value)); return *this;}
215 private:
216
217 Aws::String m_securityGroupRuleId;
218 bool m_securityGroupRuleIdHasBeenSet = false;
219
220 Aws::String m_groupId;
221 bool m_groupIdHasBeenSet = false;
222
223 Aws::String m_groupOwnerId;
224 bool m_groupOwnerIdHasBeenSet = false;
225
226 bool m_isEgress{false};
227 bool m_isEgressHasBeenSet = false;
228
229 Aws::String m_ipProtocol;
230 bool m_ipProtocolHasBeenSet = false;
231
232 int m_fromPort{0};
233 bool m_fromPortHasBeenSet = false;
234
235 int m_toPort{0};
236 bool m_toPortHasBeenSet = false;
237
238 Aws::String m_cidrIpv4;
239 bool m_cidrIpv4HasBeenSet = false;
240
241 Aws::String m_cidrIpv6;
242 bool m_cidrIpv6HasBeenSet = false;
243
244 Aws::String m_prefixListId;
245 bool m_prefixListIdHasBeenSet = false;
246
247 ReferencedSecurityGroup m_referencedGroupInfo;
248 bool m_referencedGroupInfoHasBeenSet = false;
249
250 Aws::String m_description;
251 bool m_descriptionHasBeenSet = false;
252
253 Aws::Vector<Tag> m_tags;
254 bool m_tagsHasBeenSet = false;
255
256 Aws::String m_securityGroupRuleArn;
257 bool m_securityGroupRuleArnHasBeenSet = false;
258 };
259
260} // namespace Model
261} // namespace EC2
262} // 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