AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
IpPermission.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/IpRange.h>
12#include <aws/ec2/model/Ipv6Range.h>
13#include <aws/ec2/model/PrefixListId.h>
14#include <aws/ec2/model/UserIdGroupPair.h>
15
16#include <utility>
17
18namespace Aws {
19namespace Utils {
20namespace Xml {
21class XmlNode;
22} // namespace Xml
23} // namespace Utils
24namespace EC2 {
25namespace Model {
26
33 public:
34 AWS_EC2_API IpPermission() = default;
35 AWS_EC2_API IpPermission(const Aws::Utils::Xml::XmlNode& xmlNode);
36 AWS_EC2_API IpPermission& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
37
38 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
39 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
40
42
54 inline const Aws::String& GetIpProtocol() const { return m_ipProtocol; }
55 inline bool IpProtocolHasBeenSet() const { return m_ipProtocolHasBeenSet; }
56 template <typename IpProtocolT = Aws::String>
57 void SetIpProtocol(IpProtocolT&& value) {
58 m_ipProtocolHasBeenSet = true;
59 m_ipProtocol = std::forward<IpProtocolT>(value);
60 }
61 template <typename IpProtocolT = Aws::String>
62 IpPermission& WithIpProtocol(IpProtocolT&& value) {
63 SetIpProtocol(std::forward<IpProtocolT>(value));
64 return *this;
65 }
67
69
73 inline int GetFromPort() const { return m_fromPort; }
74 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
75 inline void SetFromPort(int value) {
76 m_fromPortHasBeenSet = true;
77 m_fromPort = value;
78 }
79 inline IpPermission& WithFromPort(int value) {
80 SetFromPort(value);
81 return *this;
82 }
84
86
92 inline int GetToPort() const { return m_toPort; }
93 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
94 inline void SetToPort(int value) {
95 m_toPortHasBeenSet = true;
96 m_toPort = value;
97 }
98 inline IpPermission& WithToPort(int value) {
99 SetToPort(value);
100 return *this;
101 }
103
105
108 inline const Aws::Vector<UserIdGroupPair>& GetUserIdGroupPairs() const { return m_userIdGroupPairs; }
109 inline bool UserIdGroupPairsHasBeenSet() const { return m_userIdGroupPairsHasBeenSet; }
110 template <typename UserIdGroupPairsT = Aws::Vector<UserIdGroupPair>>
111 void SetUserIdGroupPairs(UserIdGroupPairsT&& value) {
112 m_userIdGroupPairsHasBeenSet = true;
113 m_userIdGroupPairs = std::forward<UserIdGroupPairsT>(value);
114 }
115 template <typename UserIdGroupPairsT = Aws::Vector<UserIdGroupPair>>
116 IpPermission& WithUserIdGroupPairs(UserIdGroupPairsT&& value) {
117 SetUserIdGroupPairs(std::forward<UserIdGroupPairsT>(value));
118 return *this;
119 }
120 template <typename UserIdGroupPairsT = UserIdGroupPair>
121 IpPermission& AddUserIdGroupPairs(UserIdGroupPairsT&& value) {
122 m_userIdGroupPairsHasBeenSet = true;
123 m_userIdGroupPairs.emplace_back(std::forward<UserIdGroupPairsT>(value));
124 return *this;
125 }
127
129
132 inline const Aws::Vector<IpRange>& GetIpRanges() const { return m_ipRanges; }
133 inline bool IpRangesHasBeenSet() const { return m_ipRangesHasBeenSet; }
134 template <typename IpRangesT = Aws::Vector<IpRange>>
135 void SetIpRanges(IpRangesT&& value) {
136 m_ipRangesHasBeenSet = true;
137 m_ipRanges = std::forward<IpRangesT>(value);
138 }
139 template <typename IpRangesT = Aws::Vector<IpRange>>
140 IpPermission& WithIpRanges(IpRangesT&& value) {
141 SetIpRanges(std::forward<IpRangesT>(value));
142 return *this;
143 }
144 template <typename IpRangesT = IpRange>
145 IpPermission& AddIpRanges(IpRangesT&& value) {
146 m_ipRangesHasBeenSet = true;
147 m_ipRanges.emplace_back(std::forward<IpRangesT>(value));
148 return *this;
149 }
151
153
156 inline const Aws::Vector<Ipv6Range>& GetIpv6Ranges() const { return m_ipv6Ranges; }
157 inline bool Ipv6RangesHasBeenSet() const { return m_ipv6RangesHasBeenSet; }
158 template <typename Ipv6RangesT = Aws::Vector<Ipv6Range>>
159 void SetIpv6Ranges(Ipv6RangesT&& value) {
160 m_ipv6RangesHasBeenSet = true;
161 m_ipv6Ranges = std::forward<Ipv6RangesT>(value);
162 }
163 template <typename Ipv6RangesT = Aws::Vector<Ipv6Range>>
164 IpPermission& WithIpv6Ranges(Ipv6RangesT&& value) {
165 SetIpv6Ranges(std::forward<Ipv6RangesT>(value));
166 return *this;
167 }
168 template <typename Ipv6RangesT = Ipv6Range>
169 IpPermission& AddIpv6Ranges(Ipv6RangesT&& value) {
170 m_ipv6RangesHasBeenSet = true;
171 m_ipv6Ranges.emplace_back(std::forward<Ipv6RangesT>(value));
172 return *this;
173 }
175
177
180 inline const Aws::Vector<PrefixListId>& GetPrefixListIds() const { return m_prefixListIds; }
181 inline bool PrefixListIdsHasBeenSet() const { return m_prefixListIdsHasBeenSet; }
182 template <typename PrefixListIdsT = Aws::Vector<PrefixListId>>
183 void SetPrefixListIds(PrefixListIdsT&& value) {
184 m_prefixListIdsHasBeenSet = true;
185 m_prefixListIds = std::forward<PrefixListIdsT>(value);
186 }
187 template <typename PrefixListIdsT = Aws::Vector<PrefixListId>>
188 IpPermission& WithPrefixListIds(PrefixListIdsT&& value) {
189 SetPrefixListIds(std::forward<PrefixListIdsT>(value));
190 return *this;
191 }
192 template <typename PrefixListIdsT = PrefixListId>
193 IpPermission& AddPrefixListIds(PrefixListIdsT&& value) {
194 m_prefixListIdsHasBeenSet = true;
195 m_prefixListIds.emplace_back(std::forward<PrefixListIdsT>(value));
196 return *this;
197 }
199 private:
200 Aws::String m_ipProtocol;
201
202 int m_fromPort{0};
203
204 int m_toPort{0};
205
206 Aws::Vector<UserIdGroupPair> m_userIdGroupPairs;
207
208 Aws::Vector<IpRange> m_ipRanges;
209
210 Aws::Vector<Ipv6Range> m_ipv6Ranges;
211
212 Aws::Vector<PrefixListId> m_prefixListIds;
213 bool m_ipProtocolHasBeenSet = false;
214 bool m_fromPortHasBeenSet = false;
215 bool m_toPortHasBeenSet = false;
216 bool m_userIdGroupPairsHasBeenSet = false;
217 bool m_ipRangesHasBeenSet = false;
218 bool m_ipv6RangesHasBeenSet = false;
219 bool m_prefixListIdsHasBeenSet = false;
220};
221
222} // namespace Model
223} // namespace EC2
224} // namespace Aws
IpPermission & AddUserIdGroupPairs(UserIdGroupPairsT &&value)
void SetIpv6Ranges(Ipv6RangesT &&value)
const Aws::Vector< IpRange > & GetIpRanges() const
IpPermission & AddIpRanges(IpRangesT &&value)
void SetIpRanges(IpRangesT &&value)
IpPermission & WithPrefixListIds(PrefixListIdsT &&value)
const Aws::Vector< Ipv6Range > & GetIpv6Ranges() const
IpPermission & WithFromPort(int value)
AWS_EC2_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
IpPermission & AddIpv6Ranges(Ipv6RangesT &&value)
const Aws::String & GetIpProtocol() const
void SetUserIdGroupPairs(UserIdGroupPairsT &&value)
IpPermission & WithIpv6Ranges(Ipv6RangesT &&value)
IpPermission & WithToPort(int value)
IpPermission & WithUserIdGroupPairs(UserIdGroupPairsT &&value)
AWS_EC2_API IpPermission & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
bool UserIdGroupPairsHasBeenSet() const
void SetIpProtocol(IpProtocolT &&value)
IpPermission & WithIpProtocol(IpProtocolT &&value)
const Aws::Vector< UserIdGroupPair > & GetUserIdGroupPairs() const
IpPermission & WithIpRanges(IpRangesT &&value)
AWS_EC2_API void OutputToStream(Aws::OStream &oStream, const char *location) const
AWS_EC2_API IpPermission()=default
void SetPrefixListIds(PrefixListIdsT &&value)
AWS_EC2_API IpPermission(const Aws::Utils::Xml::XmlNode &xmlNode)
IpPermission & AddPrefixListIds(PrefixListIdsT &&value)
const Aws::Vector< PrefixListId > & GetPrefixListIds() 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