AWS SDK for C++

AWS SDK for C++ Version 1.11.716

Loading...
Searching...
No Matches
InstancePortInfo.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/lightsail/Lightsail_EXPORTS.h>
10#include <aws/lightsail/model/AccessDirection.h>
11#include <aws/lightsail/model/NetworkProtocol.h>
12#include <aws/lightsail/model/PortAccessType.h>
13
14#include <utility>
15
16namespace Aws {
17namespace Utils {
18namespace Json {
19class JsonValue;
20class JsonView;
21} // namespace Json
22} // namespace Utils
23namespace Lightsail {
24namespace Model {
25
33 public:
34 AWS_LIGHTSAIL_API InstancePortInfo() = default;
35 AWS_LIGHTSAIL_API InstancePortInfo(Aws::Utils::Json::JsonView jsonValue);
37 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
38
40
55 inline int GetFromPort() const { return m_fromPort; }
56 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
57 inline void SetFromPort(int value) {
58 m_fromPortHasBeenSet = true;
59 m_fromPort = value;
60 }
61 inline InstancePortInfo& WithFromPort(int value) {
62 SetFromPort(value);
63 return *this;
64 }
66
68
83 inline int GetToPort() const { return m_toPort; }
84 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
85 inline void SetToPort(int value) {
86 m_toPortHasBeenSet = true;
87 m_toPort = value;
88 }
89 inline InstancePortInfo& WithToPort(int value) {
90 SetToPort(value);
91 return *this;
92 }
94
96
124 inline NetworkProtocol GetProtocol() const { return m_protocol; }
125 inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; }
126 inline void SetProtocol(NetworkProtocol value) {
127 m_protocolHasBeenSet = true;
128 m_protocol = value;
129 }
131 SetProtocol(value);
132 return *this;
133 }
135
137
142 inline const Aws::String& GetAccessFrom() const { return m_accessFrom; }
143 inline bool AccessFromHasBeenSet() const { return m_accessFromHasBeenSet; }
144 template <typename AccessFromT = Aws::String>
145 void SetAccessFrom(AccessFromT&& value) {
146 m_accessFromHasBeenSet = true;
147 m_accessFrom = std::forward<AccessFromT>(value);
148 }
149 template <typename AccessFromT = Aws::String>
150 InstancePortInfo& WithAccessFrom(AccessFromT&& value) {
151 SetAccessFrom(std::forward<AccessFromT>(value));
152 return *this;
153 }
155
157
160 inline PortAccessType GetAccessType() const { return m_accessType; }
161 inline bool AccessTypeHasBeenSet() const { return m_accessTypeHasBeenSet; }
162 inline void SetAccessType(PortAccessType value) {
163 m_accessTypeHasBeenSet = true;
164 m_accessType = value;
165 }
167 SetAccessType(value);
168 return *this;
169 }
171
173
176 inline const Aws::String& GetCommonName() const { return m_commonName; }
177 inline bool CommonNameHasBeenSet() const { return m_commonNameHasBeenSet; }
178 template <typename CommonNameT = Aws::String>
179 void SetCommonName(CommonNameT&& value) {
180 m_commonNameHasBeenSet = true;
181 m_commonName = std::forward<CommonNameT>(value);
182 }
183 template <typename CommonNameT = Aws::String>
184 InstancePortInfo& WithCommonName(CommonNameT&& value) {
185 SetCommonName(std::forward<CommonNameT>(value));
186 return *this;
187 }
189
191
196 inline AccessDirection GetAccessDirection() const { return m_accessDirection; }
197 inline bool AccessDirectionHasBeenSet() const { return m_accessDirectionHasBeenSet; }
199 m_accessDirectionHasBeenSet = true;
200 m_accessDirection = value;
201 }
203 SetAccessDirection(value);
204 return *this;
205 }
207
209
218 inline const Aws::Vector<Aws::String>& GetCidrs() const { return m_cidrs; }
219 inline bool CidrsHasBeenSet() const { return m_cidrsHasBeenSet; }
220 template <typename CidrsT = Aws::Vector<Aws::String>>
221 void SetCidrs(CidrsT&& value) {
222 m_cidrsHasBeenSet = true;
223 m_cidrs = std::forward<CidrsT>(value);
224 }
225 template <typename CidrsT = Aws::Vector<Aws::String>>
226 InstancePortInfo& WithCidrs(CidrsT&& value) {
227 SetCidrs(std::forward<CidrsT>(value));
228 return *this;
229 }
230 template <typename CidrsT = Aws::String>
231 InstancePortInfo& AddCidrs(CidrsT&& value) {
232 m_cidrsHasBeenSet = true;
233 m_cidrs.emplace_back(std::forward<CidrsT>(value));
234 return *this;
235 }
237
239
249 inline const Aws::Vector<Aws::String>& GetIpv6Cidrs() const { return m_ipv6Cidrs; }
250 inline bool Ipv6CidrsHasBeenSet() const { return m_ipv6CidrsHasBeenSet; }
251 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
252 void SetIpv6Cidrs(Ipv6CidrsT&& value) {
253 m_ipv6CidrsHasBeenSet = true;
254 m_ipv6Cidrs = std::forward<Ipv6CidrsT>(value);
255 }
256 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
257 InstancePortInfo& WithIpv6Cidrs(Ipv6CidrsT&& value) {
258 SetIpv6Cidrs(std::forward<Ipv6CidrsT>(value));
259 return *this;
260 }
261 template <typename Ipv6CidrsT = Aws::String>
262 InstancePortInfo& AddIpv6Cidrs(Ipv6CidrsT&& value) {
263 m_ipv6CidrsHasBeenSet = true;
264 m_ipv6Cidrs.emplace_back(std::forward<Ipv6CidrsT>(value));
265 return *this;
266 }
268
270
276 inline const Aws::Vector<Aws::String>& GetCidrListAliases() const { return m_cidrListAliases; }
277 inline bool CidrListAliasesHasBeenSet() const { return m_cidrListAliasesHasBeenSet; }
278 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
279 void SetCidrListAliases(CidrListAliasesT&& value) {
280 m_cidrListAliasesHasBeenSet = true;
281 m_cidrListAliases = std::forward<CidrListAliasesT>(value);
282 }
283 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
284 InstancePortInfo& WithCidrListAliases(CidrListAliasesT&& value) {
285 SetCidrListAliases(std::forward<CidrListAliasesT>(value));
286 return *this;
287 }
288 template <typename CidrListAliasesT = Aws::String>
289 InstancePortInfo& AddCidrListAliases(CidrListAliasesT&& value) {
290 m_cidrListAliasesHasBeenSet = true;
291 m_cidrListAliases.emplace_back(std::forward<CidrListAliasesT>(value));
292 return *this;
293 }
295 private:
296 int m_fromPort{0};
297
298 int m_toPort{0};
299
301
302 Aws::String m_accessFrom;
303
305
306 Aws::String m_commonName;
307
308 AccessDirection m_accessDirection{AccessDirection::NOT_SET};
309
311
312 Aws::Vector<Aws::String> m_ipv6Cidrs;
313
314 Aws::Vector<Aws::String> m_cidrListAliases;
315 bool m_fromPortHasBeenSet = false;
316 bool m_toPortHasBeenSet = false;
317 bool m_protocolHasBeenSet = false;
318 bool m_accessFromHasBeenSet = false;
319 bool m_accessTypeHasBeenSet = false;
320 bool m_commonNameHasBeenSet = false;
321 bool m_accessDirectionHasBeenSet = false;
322 bool m_cidrsHasBeenSet = false;
323 bool m_ipv6CidrsHasBeenSet = false;
324 bool m_cidrListAliasesHasBeenSet = false;
325};
326
327} // namespace Model
328} // namespace Lightsail
329} // namespace Aws
void SetAccessDirection(AccessDirection value)
const Aws::Vector< Aws::String > & GetCidrListAliases() const
InstancePortInfo & AddCidrListAliases(CidrListAliasesT &&value)
AWS_LIGHTSAIL_API InstancePortInfo(Aws::Utils::Json::JsonView jsonValue)
InstancePortInfo & WithCidrListAliases(CidrListAliasesT &&value)
InstancePortInfo & WithAccessDirection(AccessDirection value)
InstancePortInfo & AddCidrs(CidrsT &&value)
const Aws::String & GetAccessFrom() const
const Aws::Vector< Aws::String > & GetIpv6Cidrs() const
InstancePortInfo & WithAccessType(PortAccessType value)
InstancePortInfo & WithProtocol(NetworkProtocol value)
const Aws::Vector< Aws::String > & GetCidrs() const
void SetAccessType(PortAccessType value)
const Aws::String & GetCommonName() const
InstancePortInfo & WithCommonName(CommonNameT &&value)
InstancePortInfo & WithCidrs(CidrsT &&value)
AWS_LIGHTSAIL_API InstancePortInfo & operator=(Aws::Utils::Json::JsonView jsonValue)
InstancePortInfo & WithAccessFrom(AccessFromT &&value)
void SetCidrListAliases(CidrListAliasesT &&value)
AWS_LIGHTSAIL_API InstancePortInfo()=default
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
InstancePortInfo & WithFromPort(int value)
InstancePortInfo & WithIpv6Cidrs(Ipv6CidrsT &&value)
InstancePortInfo & AddIpv6Cidrs(Ipv6CidrsT &&value)
void SetProtocol(NetworkProtocol value)
InstancePortInfo & WithToPort(int value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue