AWS SDK for C++

AWS SDK for C++ Version 1.11.716

Loading...
Searching...
No Matches
InstancePortState.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#include <aws/lightsail/model/PortState.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Utils {
17namespace Json {
18class JsonValue;
19class JsonView;
20} // namespace Json
21} // namespace Utils
22namespace Lightsail {
23namespace Model {
24
32 public:
33 AWS_LIGHTSAIL_API InstancePortState() = default;
34 AWS_LIGHTSAIL_API InstancePortState(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 InstancePortState& 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 InstancePortState& 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
141 inline PortState GetState() const { return m_state; }
142 inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
143 inline void SetState(PortState value) {
144 m_stateHasBeenSet = true;
145 m_state = value;
146 }
148 SetState(value);
149 return *this;
150 }
152
154
163 inline const Aws::Vector<Aws::String>& GetCidrs() const { return m_cidrs; }
164 inline bool CidrsHasBeenSet() const { return m_cidrsHasBeenSet; }
165 template <typename CidrsT = Aws::Vector<Aws::String>>
166 void SetCidrs(CidrsT&& value) {
167 m_cidrsHasBeenSet = true;
168 m_cidrs = std::forward<CidrsT>(value);
169 }
170 template <typename CidrsT = Aws::Vector<Aws::String>>
171 InstancePortState& WithCidrs(CidrsT&& value) {
172 SetCidrs(std::forward<CidrsT>(value));
173 return *this;
174 }
175 template <typename CidrsT = Aws::String>
176 InstancePortState& AddCidrs(CidrsT&& value) {
177 m_cidrsHasBeenSet = true;
178 m_cidrs.emplace_back(std::forward<CidrsT>(value));
179 return *this;
180 }
182
184
194 inline const Aws::Vector<Aws::String>& GetIpv6Cidrs() const { return m_ipv6Cidrs; }
195 inline bool Ipv6CidrsHasBeenSet() const { return m_ipv6CidrsHasBeenSet; }
196 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
197 void SetIpv6Cidrs(Ipv6CidrsT&& value) {
198 m_ipv6CidrsHasBeenSet = true;
199 m_ipv6Cidrs = std::forward<Ipv6CidrsT>(value);
200 }
201 template <typename Ipv6CidrsT = Aws::Vector<Aws::String>>
202 InstancePortState& WithIpv6Cidrs(Ipv6CidrsT&& value) {
203 SetIpv6Cidrs(std::forward<Ipv6CidrsT>(value));
204 return *this;
205 }
206 template <typename Ipv6CidrsT = Aws::String>
207 InstancePortState& AddIpv6Cidrs(Ipv6CidrsT&& value) {
208 m_ipv6CidrsHasBeenSet = true;
209 m_ipv6Cidrs.emplace_back(std::forward<Ipv6CidrsT>(value));
210 return *this;
211 }
213
215
221 inline const Aws::Vector<Aws::String>& GetCidrListAliases() const { return m_cidrListAliases; }
222 inline bool CidrListAliasesHasBeenSet() const { return m_cidrListAliasesHasBeenSet; }
223 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
224 void SetCidrListAliases(CidrListAliasesT&& value) {
225 m_cidrListAliasesHasBeenSet = true;
226 m_cidrListAliases = std::forward<CidrListAliasesT>(value);
227 }
228 template <typename CidrListAliasesT = Aws::Vector<Aws::String>>
229 InstancePortState& WithCidrListAliases(CidrListAliasesT&& value) {
230 SetCidrListAliases(std::forward<CidrListAliasesT>(value));
231 return *this;
232 }
233 template <typename CidrListAliasesT = Aws::String>
234 InstancePortState& AddCidrListAliases(CidrListAliasesT&& value) {
235 m_cidrListAliasesHasBeenSet = true;
236 m_cidrListAliases.emplace_back(std::forward<CidrListAliasesT>(value));
237 return *this;
238 }
240 private:
241 int m_fromPort{0};
242
243 int m_toPort{0};
244
246
248
250
251 Aws::Vector<Aws::String> m_ipv6Cidrs;
252
253 Aws::Vector<Aws::String> m_cidrListAliases;
254 bool m_fromPortHasBeenSet = false;
255 bool m_toPortHasBeenSet = false;
256 bool m_protocolHasBeenSet = false;
257 bool m_stateHasBeenSet = false;
258 bool m_cidrsHasBeenSet = false;
259 bool m_ipv6CidrsHasBeenSet = false;
260 bool m_cidrListAliasesHasBeenSet = false;
261};
262
263} // namespace Model
264} // namespace Lightsail
265} // namespace Aws
InstancePortState & WithFromPort(int value)
const Aws::Vector< Aws::String > & GetIpv6Cidrs() const
InstancePortState & AddIpv6Cidrs(Ipv6CidrsT &&value)
InstancePortState & WithProtocol(NetworkProtocol value)
InstancePortState & WithIpv6Cidrs(Ipv6CidrsT &&value)
InstancePortState & AddCidrs(CidrsT &&value)
const Aws::Vector< Aws::String > & GetCidrs() const
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
InstancePortState & WithCidrListAliases(CidrListAliasesT &&value)
InstancePortState & WithState(PortState value)
AWS_LIGHTSAIL_API InstancePortState(Aws::Utils::Json::JsonView jsonValue)
void SetCidrListAliases(CidrListAliasesT &&value)
InstancePortState & WithCidrs(CidrsT &&value)
const Aws::Vector< Aws::String > & GetCidrListAliases() const
AWS_LIGHTSAIL_API InstancePortState()=default
InstancePortState & WithToPort(int value)
AWS_LIGHTSAIL_API InstancePortState & operator=(Aws::Utils::Json::JsonView jsonValue)
InstancePortState & AddCidrListAliases(CidrListAliasesT &&value)
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue