AWS SDK for C++

AWS SDK for C++ Version 1.11.748

Loading...
Searching...
No Matches
PortMapping.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/ecs/ECS_EXPORTS.h>
9#include <aws/ecs/model/ApplicationProtocol.h>
10#include <aws/ecs/model/TransportProtocol.h>
11
12#include <utility>
13
14namespace Aws {
15namespace Utils {
16namespace Json {
17class JsonValue;
18class JsonView;
19} // namespace Json
20} // namespace Utils
21namespace ECS {
22namespace Model {
23
46 public:
47 AWS_ECS_API PortMapping() = default;
51
53
64 inline int GetContainerPort() const { return m_containerPort; }
65 inline bool ContainerPortHasBeenSet() const { return m_containerPortHasBeenSet; }
66 inline void SetContainerPort(int value) {
67 m_containerPortHasBeenSet = true;
68 m_containerPort = value;
69 }
70 inline PortMapping& WithContainerPort(int value) {
71 SetContainerPort(value);
72 return *this;
73 }
75
77
112 inline int GetHostPort() const { return m_hostPort; }
113 inline bool HostPortHasBeenSet() const { return m_hostPortHasBeenSet; }
114 inline void SetHostPort(int value) {
115 m_hostPortHasBeenSet = true;
116 m_hostPort = value;
117 }
118 inline PortMapping& WithHostPort(int value) {
119 SetHostPort(value);
120 return *this;
121 }
123
125
131 inline TransportProtocol GetProtocol() const { return m_protocol; }
132 inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; }
133 inline void SetProtocol(TransportProtocol value) {
134 m_protocolHasBeenSet = true;
135 m_protocol = value;
136 }
138 SetProtocol(value);
139 return *this;
140 }
142
144
151 inline const Aws::String& GetName() const { return m_name; }
152 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
153 template <typename NameT = Aws::String>
154 void SetName(NameT&& value) {
155 m_nameHasBeenSet = true;
156 m_name = std::forward<NameT>(value);
157 }
158 template <typename NameT = Aws::String>
159 PortMapping& WithName(NameT&& value) {
160 SetName(std::forward<NameT>(value));
161 return *this;
162 }
164
166
185 inline ApplicationProtocol GetAppProtocol() const { return m_appProtocol; }
186 inline bool AppProtocolHasBeenSet() const { return m_appProtocolHasBeenSet; }
188 m_appProtocolHasBeenSet = true;
189 m_appProtocol = value;
190 }
192 SetAppProtocol(value);
193 return *this;
194 }
196
198
233 inline const Aws::String& GetContainerPortRange() const { return m_containerPortRange; }
234 inline bool ContainerPortRangeHasBeenSet() const { return m_containerPortRangeHasBeenSet; }
235 template <typename ContainerPortRangeT = Aws::String>
236 void SetContainerPortRange(ContainerPortRangeT&& value) {
237 m_containerPortRangeHasBeenSet = true;
238 m_containerPortRange = std::forward<ContainerPortRangeT>(value);
239 }
240 template <typename ContainerPortRangeT = Aws::String>
241 PortMapping& WithContainerPortRange(ContainerPortRangeT&& value) {
242 SetContainerPortRange(std::forward<ContainerPortRangeT>(value));
243 return *this;
244 }
246 private:
247 int m_containerPort{0};
248
249 int m_hostPort{0};
250
252
253 Aws::String m_name;
254
256
257 Aws::String m_containerPortRange;
258 bool m_containerPortHasBeenSet = false;
259 bool m_hostPortHasBeenSet = false;
260 bool m_protocolHasBeenSet = false;
261 bool m_nameHasBeenSet = false;
262 bool m_appProtocolHasBeenSet = false;
263 bool m_containerPortRangeHasBeenSet = false;
264};
265
266} // namespace Model
267} // namespace ECS
268} // namespace Aws
AWS_ECS_API Aws::Utils::Json::JsonValue Jsonize() const
TransportProtocol GetProtocol() const
PortMapping & WithName(NameT &&value)
AWS_ECS_API PortMapping & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetProtocol(TransportProtocol value)
void SetContainerPort(int value)
Definition PortMapping.h:66
PortMapping & WithContainerPort(int value)
Definition PortMapping.h:70
AWS_ECS_API PortMapping(Aws::Utils::Json::JsonView jsonValue)
PortMapping & WithHostPort(int value)
const Aws::String & GetName() const
PortMapping & WithAppProtocol(ApplicationProtocol value)
PortMapping & WithContainerPortRange(ContainerPortRangeT &&value)
void SetContainerPortRange(ContainerPortRangeT &&value)
bool ContainerPortRangeHasBeenSet() const
bool ContainerPortHasBeenSet() const
Definition PortMapping.h:65
void SetName(NameT &&value)
PortMapping & WithProtocol(TransportProtocol value)
const Aws::String & GetContainerPortRange() const
void SetAppProtocol(ApplicationProtocol value)
AWS_ECS_API PortMapping()=default
ApplicationProtocol GetAppProtocol() const
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Aws::Utils::Json::JsonValue JsonValue