AWS SDK for C++

AWS SDK for C++ Version 1.11.751

Loading...
Searching...
No Matches
PortInfo.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/NetworkProtocol.h>
11
12#include <utility>
13
14namespace Aws {
15namespace Utils {
16namespace Json {
17class JsonValue;
18class JsonView;
19} // namespace Json
20} // namespace Utils
21namespace Lightsail {
22namespace Model {
23
31class PortInfo {
32 public:
33 AWS_LIGHTSAIL_API PortInfo() = default;
34 AWS_LIGHTSAIL_API PortInfo(Aws::Utils::Json::JsonView jsonValue);
35 AWS_LIGHTSAIL_API PortInfo& operator=(Aws::Utils::Json::JsonView jsonValue);
36 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
37
39
54 inline int GetFromPort() const { return m_fromPort; }
55 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
56 inline void SetFromPort(int value) {
57 m_fromPortHasBeenSet = true;
58 m_fromPort = value;
59 }
60 inline PortInfo& WithFromPort(int value) {
61 SetFromPort(value);
62 return *this;
63 }
65
67
82 inline int GetToPort() const { return m_toPort; }
83 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
84 inline void SetToPort(int value) {
85 m_toPortHasBeenSet = true;
86 m_toPort = value;
87 }
88 inline PortInfo& WithToPort(int value) {
89 SetToPort(value);
90 return *this;
91 }
93
95
123 inline NetworkProtocol GetProtocol() const { return m_protocol; }
124 inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; }
125 inline void SetProtocol(NetworkProtocol value) {
126 m_protocolHasBeenSet = true;
127 m_protocol = value;
128 }
130 SetProtocol(value);
131 return *this;
132 }
134
136
149 inline const Aws::Vector<Aws::String>& GetCidrs() const { return m_cidrs; }
150 inline bool CidrsHasBeenSet() const { return m_cidrsHasBeenSet; }
151 template <typename CidrsT = Aws::Vector<Aws::String>>
152 void SetCidrs(CidrsT&& value) {
153 m_cidrsHasBeenSet = true;
154 m_cidrs = std::forward<CidrsT>(value);
155 }
156 template <typename CidrsT = Aws::Vector<Aws::String>>
157 PortInfo& WithCidrs(CidrsT&& value) {
158 SetCidrs(std::forward<CidrsT>(value));
159 return *this;
160 }
161 template <typename CidrsT = Aws::String>
162 PortInfo& AddCidrs(CidrsT&& value) {
163 m_cidrsHasBeenSet = true;
164 m_cidrs.emplace_back(std::forward<CidrsT>(value));
165 return *this;
166 }
168
170
180 inline const Aws::Vector<Aws::String>& GetIpv6Cidrs() const { return m_ipv6Cidrs; }
181 inline bool Ipv6CidrsHasBeenSet() const { return m_ipv6CidrsHasBeenSet; }
182 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
183 void SetIpv6Cidrs(Ipv6CidrsT&& value) {
184 m_ipv6CidrsHasBeenSet = true;
185 m_ipv6Cidrs = std::forward<Ipv6CidrsT>(value);
186 }
187 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
188 PortInfo& WithIpv6Cidrs(Ipv6CidrsT&& value) {
189 SetIpv6Cidrs(std::forward<Ipv6CidrsT>(value));
190 return *this;
191 }
192 template <typename Ipv6CidrsT = Aws::String>
193 PortInfo& AddIpv6Cidrs(Ipv6CidrsT&& value) {
194 m_ipv6CidrsHasBeenSet = true;
195 m_ipv6Cidrs.emplace_back(std::forward<Ipv6CidrsT>(value));
196 return *this;
197 }
199
201
207 inline const Aws::Vector<Aws::String>& GetCidrListAliases() const { return m_cidrListAliases; }
208 inline bool CidrListAliasesHasBeenSet() const { return m_cidrListAliasesHasBeenSet; }
209 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
210 void SetCidrListAliases(CidrListAliasesT&& value) {
211 m_cidrListAliasesHasBeenSet = true;
212 m_cidrListAliases = std::forward<CidrListAliasesT>(value);
213 }
214 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
215 PortInfo& WithCidrListAliases(CidrListAliasesT&& value) {
216 SetCidrListAliases(std::forward<CidrListAliasesT>(value));
217 return *this;
218 }
219 template <typename CidrListAliasesT = Aws::String>
220 PortInfo& AddCidrListAliases(CidrListAliasesT&& value) {
221 m_cidrListAliasesHasBeenSet = true;
222 m_cidrListAliases.emplace_back(std::forward<CidrListAliasesT>(value));
223 return *this;
224 }
226 private:
227 int m_fromPort{0};
228
229 int m_toPort{0};
230
232
234
235 Aws::Vector<Aws::String> m_ipv6Cidrs;
236
237 Aws::Vector<Aws::String> m_cidrListAliases;
238 bool m_fromPortHasBeenSet = false;
239 bool m_toPortHasBeenSet = false;
240 bool m_protocolHasBeenSet = false;
241 bool m_cidrsHasBeenSet = false;
242 bool m_ipv6CidrsHasBeenSet = false;
243 bool m_cidrListAliasesHasBeenSet = false;
244};
245
246} // namespace Model
247} // namespace Lightsail
248} // namespace Aws
PortInfo & WithFromPort(int value)
Definition PortInfo.h:60
PortInfo & WithCidrs(CidrsT &&value)
Definition PortInfo.h:157
AWS_LIGHTSAIL_API PortInfo & operator=(Aws::Utils::Json::JsonView jsonValue)
PortInfo & AddCidrs(CidrsT &&value)
Definition PortInfo.h:162
PortInfo & WithToPort(int value)
Definition PortInfo.h:88
void SetCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:210
const Aws::Vector< Aws::String > & GetCidrs() const
Definition PortInfo.h:149
NetworkProtocol GetProtocol() const
Definition PortInfo.h:123
PortInfo & WithIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:188
AWS_LIGHTSAIL_API PortInfo()=default
void SetFromPort(int value)
Definition PortInfo.h:56
void SetIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:183
const Aws::Vector< Aws::String > & GetIpv6Cidrs() const
Definition PortInfo.h:180
const Aws::Vector< Aws::String > & GetCidrListAliases() const
Definition PortInfo.h:207
void SetCidrs(CidrsT &&value)
Definition PortInfo.h:152
bool CidrListAliasesHasBeenSet() const
Definition PortInfo.h:208
PortInfo & WithCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:215
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
PortInfo & AddIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:193
PortInfo & AddCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:220
PortInfo & WithProtocol(NetworkProtocol value)
Definition PortInfo.h:129
AWS_LIGHTSAIL_API PortInfo(Aws::Utils::Json::JsonView jsonValue)
void SetProtocol(NetworkProtocol value)
Definition PortInfo.h:125
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue