AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
PortInfo.h
1
6#pragma once
7#include <aws/lightsail/Lightsail_EXPORTS.h>
8#include <aws/lightsail/model/NetworkProtocol.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/core/utils/memory/stl/AWSString.h>
11#include <utility>
12
13namespace Aws
14{
15namespace Utils
16{
17namespace Json
18{
19 class JsonValue;
20 class JsonView;
21} // namespace Json
22} // namespace Utils
23namespace Lightsail
24{
25namespace Model
26{
27
36 {
37 public:
38 AWS_LIGHTSAIL_API PortInfo() = default;
39 AWS_LIGHTSAIL_API PortInfo(Aws::Utils::Json::JsonView jsonValue);
40 AWS_LIGHTSAIL_API PortInfo& operator=(Aws::Utils::Json::JsonView jsonValue);
41 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
42
43
45
60 inline int GetFromPort() const { return m_fromPort; }
61 inline bool FromPortHasBeenSet() const { return m_fromPortHasBeenSet; }
62 inline void SetFromPort(int value) { m_fromPortHasBeenSet = true; m_fromPort = value; }
63 inline PortInfo& WithFromPort(int value) { SetFromPort(value); return *this;}
65
67
82 inline int GetToPort() const { return m_toPort; }
83 inline bool ToPortHasBeenSet() const { return m_toPortHasBeenSet; }
84 inline void SetToPort(int value) { m_toPortHasBeenSet = true; m_toPort = value; }
85 inline PortInfo& WithToPort(int value) { SetToPort(value); return *this;}
87
89
117 inline NetworkProtocol GetProtocol() const { return m_protocol; }
118 inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; }
119 inline void SetProtocol(NetworkProtocol value) { m_protocolHasBeenSet = true; m_protocol = value; }
120 inline PortInfo& WithProtocol(NetworkProtocol value) { SetProtocol(value); return *this;}
122
124
137 inline const Aws::Vector<Aws::String>& GetCidrs() const { return m_cidrs; }
138 inline bool CidrsHasBeenSet() const { return m_cidrsHasBeenSet; }
139 template<typename CidrsT = Aws::Vector<Aws::String>>
140 void SetCidrs(CidrsT&& value) { m_cidrsHasBeenSet = true; m_cidrs = std::forward<CidrsT>(value); }
141 template<typename CidrsT = Aws::Vector<Aws::String>>
142 PortInfo& WithCidrs(CidrsT&& value) { SetCidrs(std::forward<CidrsT>(value)); return *this;}
143 template<typename CidrsT = Aws::String>
144 PortInfo& AddCidrs(CidrsT&& value) { m_cidrsHasBeenSet = true; m_cidrs.emplace_back(std::forward<CidrsT>(value)); return *this; }
146
148
158 inline const Aws::Vector<Aws::String>& GetIpv6Cidrs() const { return m_ipv6Cidrs; }
159 inline bool Ipv6CidrsHasBeenSet() const { return m_ipv6CidrsHasBeenSet; }
160 template<typename Ipv6CidrsT = Aws::Vector<Aws::String>>
161 void SetIpv6Cidrs(Ipv6CidrsT&& value) { m_ipv6CidrsHasBeenSet = true; m_ipv6Cidrs = std::forward<Ipv6CidrsT>(value); }
162 template<typename Ipv6CidrsT = Aws::Vector<Aws::String>>
163 PortInfo& WithIpv6Cidrs(Ipv6CidrsT&& value) { SetIpv6Cidrs(std::forward<Ipv6CidrsT>(value)); return *this;}
164 template<typename Ipv6CidrsT = Aws::String>
165 PortInfo& AddIpv6Cidrs(Ipv6CidrsT&& value) { m_ipv6CidrsHasBeenSet = true; m_ipv6Cidrs.emplace_back(std::forward<Ipv6CidrsT>(value)); return *this; }
167
169
175 inline const Aws::Vector<Aws::String>& GetCidrListAliases() const { return m_cidrListAliases; }
176 inline bool CidrListAliasesHasBeenSet() const { return m_cidrListAliasesHasBeenSet; }
177 template<typename CidrListAliasesT = Aws::Vector<Aws::String>>
178 void SetCidrListAliases(CidrListAliasesT&& value) { m_cidrListAliasesHasBeenSet = true; m_cidrListAliases = std::forward<CidrListAliasesT>(value); }
179 template<typename CidrListAliasesT = Aws::Vector<Aws::String>>
180 PortInfo& WithCidrListAliases(CidrListAliasesT&& value) { SetCidrListAliases(std::forward<CidrListAliasesT>(value)); return *this;}
181 template<typename CidrListAliasesT = Aws::String>
182 PortInfo& AddCidrListAliases(CidrListAliasesT&& value) { m_cidrListAliasesHasBeenSet = true; m_cidrListAliases.emplace_back(std::forward<CidrListAliasesT>(value)); return *this; }
184 private:
185
186 int m_fromPort{0};
187 bool m_fromPortHasBeenSet = false;
188
189 int m_toPort{0};
190 bool m_toPortHasBeenSet = false;
191
193 bool m_protocolHasBeenSet = false;
194
196 bool m_cidrsHasBeenSet = false;
197
198 Aws::Vector<Aws::String> m_ipv6Cidrs;
199 bool m_ipv6CidrsHasBeenSet = false;
200
201 Aws::Vector<Aws::String> m_cidrListAliases;
202 bool m_cidrListAliasesHasBeenSet = false;
203 };
204
205} // namespace Model
206} // namespace Lightsail
207} // namespace Aws
PortInfo & WithFromPort(int value)
Definition PortInfo.h:63
PortInfo & WithCidrs(CidrsT &&value)
Definition PortInfo.h:142
AWS_LIGHTSAIL_API PortInfo & operator=(Aws::Utils::Json::JsonView jsonValue)
PortInfo & AddCidrs(CidrsT &&value)
Definition PortInfo.h:144
PortInfo & WithToPort(int value)
Definition PortInfo.h:85
void SetCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:178
const Aws::Vector< Aws::String > & GetCidrs() const
Definition PortInfo.h:137
NetworkProtocol GetProtocol() const
Definition PortInfo.h:117
PortInfo & WithIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:163
AWS_LIGHTSAIL_API PortInfo()=default
void SetFromPort(int value)
Definition PortInfo.h:62
void SetIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:161
const Aws::Vector< Aws::String > & GetIpv6Cidrs() const
Definition PortInfo.h:158
const Aws::Vector< Aws::String > & GetCidrListAliases() const
Definition PortInfo.h:175
void SetCidrs(CidrsT &&value)
Definition PortInfo.h:140
bool CidrListAliasesHasBeenSet() const
Definition PortInfo.h:176
PortInfo & WithCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:180
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
PortInfo & AddIpv6Cidrs(Ipv6CidrsT &&value)
Definition PortInfo.h:165
PortInfo & AddCidrListAliases(CidrListAliasesT &&value)
Definition PortInfo.h:182
PortInfo & WithProtocol(NetworkProtocol value)
Definition PortInfo.h:120
AWS_LIGHTSAIL_API PortInfo(Aws::Utils::Json::JsonView jsonValue)
void SetProtocol(NetworkProtocol value)
Definition PortInfo.h:119
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue