1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/elasticloadbalancingv2/ElasticLoadBalancingv2_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <aws/elasticloadbalancingv2/model/ProtocolEnum.h> 11 #include <aws/core/utils/memory/stl/AWSVector.h> 12 #include <aws/elasticloadbalancingv2/model/Certificate.h> 13 #include <aws/elasticloadbalancingv2/model/Action.h> 14 #include <utility> 15 16 namespace Aws 17 { 18 namespace Utils 19 { 20 namespace Xml 21 { 22 class XmlNode; 23 } // namespace Xml 24 } // namespace Utils 25 namespace ElasticLoadBalancingv2 26 { 27 namespace Model 28 { 29 30 /** 31 * <p>Information about a listener.</p><p><h3>See Also:</h3> <a 32 * href="http://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/Listener">AWS 33 * API Reference</a></p> 34 */ 35 class AWS_ELASTICLOADBALANCINGV2_API Listener 36 { 37 public: 38 Listener(); 39 Listener(const Aws::Utils::Xml::XmlNode& xmlNode); 40 Listener& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 41 42 void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; 43 void OutputToStream(Aws::OStream& oStream, const char* location) const; 44 45 46 /** 47 * <p>The Amazon Resource Name (ARN) of the listener.</p> 48 */ GetListenerArn()49 inline const Aws::String& GetListenerArn() const{ return m_listenerArn; } 50 51 /** 52 * <p>The Amazon Resource Name (ARN) of the listener.</p> 53 */ ListenerArnHasBeenSet()54 inline bool ListenerArnHasBeenSet() const { return m_listenerArnHasBeenSet; } 55 56 /** 57 * <p>The Amazon Resource Name (ARN) of the listener.</p> 58 */ SetListenerArn(const Aws::String & value)59 inline void SetListenerArn(const Aws::String& value) { m_listenerArnHasBeenSet = true; m_listenerArn = value; } 60 61 /** 62 * <p>The Amazon Resource Name (ARN) of the listener.</p> 63 */ SetListenerArn(Aws::String && value)64 inline void SetListenerArn(Aws::String&& value) { m_listenerArnHasBeenSet = true; m_listenerArn = std::move(value); } 65 66 /** 67 * <p>The Amazon Resource Name (ARN) of the listener.</p> 68 */ SetListenerArn(const char * value)69 inline void SetListenerArn(const char* value) { m_listenerArnHasBeenSet = true; m_listenerArn.assign(value); } 70 71 /** 72 * <p>The Amazon Resource Name (ARN) of the listener.</p> 73 */ WithListenerArn(const Aws::String & value)74 inline Listener& WithListenerArn(const Aws::String& value) { SetListenerArn(value); return *this;} 75 76 /** 77 * <p>The Amazon Resource Name (ARN) of the listener.</p> 78 */ WithListenerArn(Aws::String && value)79 inline Listener& WithListenerArn(Aws::String&& value) { SetListenerArn(std::move(value)); return *this;} 80 81 /** 82 * <p>The Amazon Resource Name (ARN) of the listener.</p> 83 */ WithListenerArn(const char * value)84 inline Listener& WithListenerArn(const char* value) { SetListenerArn(value); return *this;} 85 86 87 /** 88 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 89 */ GetLoadBalancerArn()90 inline const Aws::String& GetLoadBalancerArn() const{ return m_loadBalancerArn; } 91 92 /** 93 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 94 */ LoadBalancerArnHasBeenSet()95 inline bool LoadBalancerArnHasBeenSet() const { return m_loadBalancerArnHasBeenSet; } 96 97 /** 98 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 99 */ SetLoadBalancerArn(const Aws::String & value)100 inline void SetLoadBalancerArn(const Aws::String& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = value; } 101 102 /** 103 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 104 */ SetLoadBalancerArn(Aws::String && value)105 inline void SetLoadBalancerArn(Aws::String&& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = std::move(value); } 106 107 /** 108 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 109 */ SetLoadBalancerArn(const char * value)110 inline void SetLoadBalancerArn(const char* value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn.assign(value); } 111 112 /** 113 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 114 */ WithLoadBalancerArn(const Aws::String & value)115 inline Listener& WithLoadBalancerArn(const Aws::String& value) { SetLoadBalancerArn(value); return *this;} 116 117 /** 118 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 119 */ WithLoadBalancerArn(Aws::String && value)120 inline Listener& WithLoadBalancerArn(Aws::String&& value) { SetLoadBalancerArn(std::move(value)); return *this;} 121 122 /** 123 * <p>The Amazon Resource Name (ARN) of the load balancer.</p> 124 */ WithLoadBalancerArn(const char * value)125 inline Listener& WithLoadBalancerArn(const char* value) { SetLoadBalancerArn(value); return *this;} 126 127 128 /** 129 * <p>The port on which the load balancer is listening.</p> 130 */ GetPort()131 inline int GetPort() const{ return m_port; } 132 133 /** 134 * <p>The port on which the load balancer is listening.</p> 135 */ PortHasBeenSet()136 inline bool PortHasBeenSet() const { return m_portHasBeenSet; } 137 138 /** 139 * <p>The port on which the load balancer is listening.</p> 140 */ SetPort(int value)141 inline void SetPort(int value) { m_portHasBeenSet = true; m_port = value; } 142 143 /** 144 * <p>The port on which the load balancer is listening.</p> 145 */ WithPort(int value)146 inline Listener& WithPort(int value) { SetPort(value); return *this;} 147 148 149 /** 150 * <p>The protocol for connections from clients to the load balancer.</p> 151 */ GetProtocol()152 inline const ProtocolEnum& GetProtocol() const{ return m_protocol; } 153 154 /** 155 * <p>The protocol for connections from clients to the load balancer.</p> 156 */ ProtocolHasBeenSet()157 inline bool ProtocolHasBeenSet() const { return m_protocolHasBeenSet; } 158 159 /** 160 * <p>The protocol for connections from clients to the load balancer.</p> 161 */ SetProtocol(const ProtocolEnum & value)162 inline void SetProtocol(const ProtocolEnum& value) { m_protocolHasBeenSet = true; m_protocol = value; } 163 164 /** 165 * <p>The protocol for connections from clients to the load balancer.</p> 166 */ SetProtocol(ProtocolEnum && value)167 inline void SetProtocol(ProtocolEnum&& value) { m_protocolHasBeenSet = true; m_protocol = std::move(value); } 168 169 /** 170 * <p>The protocol for connections from clients to the load balancer.</p> 171 */ WithProtocol(const ProtocolEnum & value)172 inline Listener& WithProtocol(const ProtocolEnum& value) { SetProtocol(value); return *this;} 173 174 /** 175 * <p>The protocol for connections from clients to the load balancer.</p> 176 */ WithProtocol(ProtocolEnum && value)177 inline Listener& WithProtocol(ProtocolEnum&& value) { SetProtocol(std::move(value)); return *this;} 178 179 180 /** 181 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 182 */ GetCertificates()183 inline const Aws::Vector<Certificate>& GetCertificates() const{ return m_certificates; } 184 185 /** 186 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 187 */ CertificatesHasBeenSet()188 inline bool CertificatesHasBeenSet() const { return m_certificatesHasBeenSet; } 189 190 /** 191 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 192 */ SetCertificates(const Aws::Vector<Certificate> & value)193 inline void SetCertificates(const Aws::Vector<Certificate>& value) { m_certificatesHasBeenSet = true; m_certificates = value; } 194 195 /** 196 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 197 */ SetCertificates(Aws::Vector<Certificate> && value)198 inline void SetCertificates(Aws::Vector<Certificate>&& value) { m_certificatesHasBeenSet = true; m_certificates = std::move(value); } 199 200 /** 201 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 202 */ WithCertificates(const Aws::Vector<Certificate> & value)203 inline Listener& WithCertificates(const Aws::Vector<Certificate>& value) { SetCertificates(value); return *this;} 204 205 /** 206 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 207 */ WithCertificates(Aws::Vector<Certificate> && value)208 inline Listener& WithCertificates(Aws::Vector<Certificate>&& value) { SetCertificates(std::move(value)); return *this;} 209 210 /** 211 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 212 */ AddCertificates(const Certificate & value)213 inline Listener& AddCertificates(const Certificate& value) { m_certificatesHasBeenSet = true; m_certificates.push_back(value); return *this; } 214 215 /** 216 * <p>[HTTPS or TLS listener] The default certificate for the listener.</p> 217 */ AddCertificates(Certificate && value)218 inline Listener& AddCertificates(Certificate&& value) { m_certificatesHasBeenSet = true; m_certificates.push_back(std::move(value)); return *this; } 219 220 221 /** 222 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 223 * ciphers are supported.</p> 224 */ GetSslPolicy()225 inline const Aws::String& GetSslPolicy() const{ return m_sslPolicy; } 226 227 /** 228 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 229 * ciphers are supported.</p> 230 */ SslPolicyHasBeenSet()231 inline bool SslPolicyHasBeenSet() const { return m_sslPolicyHasBeenSet; } 232 233 /** 234 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 235 * ciphers are supported.</p> 236 */ SetSslPolicy(const Aws::String & value)237 inline void SetSslPolicy(const Aws::String& value) { m_sslPolicyHasBeenSet = true; m_sslPolicy = value; } 238 239 /** 240 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 241 * ciphers are supported.</p> 242 */ SetSslPolicy(Aws::String && value)243 inline void SetSslPolicy(Aws::String&& value) { m_sslPolicyHasBeenSet = true; m_sslPolicy = std::move(value); } 244 245 /** 246 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 247 * ciphers are supported.</p> 248 */ SetSslPolicy(const char * value)249 inline void SetSslPolicy(const char* value) { m_sslPolicyHasBeenSet = true; m_sslPolicy.assign(value); } 250 251 /** 252 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 253 * ciphers are supported.</p> 254 */ WithSslPolicy(const Aws::String & value)255 inline Listener& WithSslPolicy(const Aws::String& value) { SetSslPolicy(value); return *this;} 256 257 /** 258 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 259 * ciphers are supported.</p> 260 */ WithSslPolicy(Aws::String && value)261 inline Listener& WithSslPolicy(Aws::String&& value) { SetSslPolicy(std::move(value)); return *this;} 262 263 /** 264 * <p>[HTTPS or TLS listener] The security policy that defines which protocols and 265 * ciphers are supported.</p> 266 */ WithSslPolicy(const char * value)267 inline Listener& WithSslPolicy(const char* value) { SetSslPolicy(value); return *this;} 268 269 270 /** 271 * <p>The default actions for the listener.</p> 272 */ GetDefaultActions()273 inline const Aws::Vector<Action>& GetDefaultActions() const{ return m_defaultActions; } 274 275 /** 276 * <p>The default actions for the listener.</p> 277 */ DefaultActionsHasBeenSet()278 inline bool DefaultActionsHasBeenSet() const { return m_defaultActionsHasBeenSet; } 279 280 /** 281 * <p>The default actions for the listener.</p> 282 */ SetDefaultActions(const Aws::Vector<Action> & value)283 inline void SetDefaultActions(const Aws::Vector<Action>& value) { m_defaultActionsHasBeenSet = true; m_defaultActions = value; } 284 285 /** 286 * <p>The default actions for the listener.</p> 287 */ SetDefaultActions(Aws::Vector<Action> && value)288 inline void SetDefaultActions(Aws::Vector<Action>&& value) { m_defaultActionsHasBeenSet = true; m_defaultActions = std::move(value); } 289 290 /** 291 * <p>The default actions for the listener.</p> 292 */ WithDefaultActions(const Aws::Vector<Action> & value)293 inline Listener& WithDefaultActions(const Aws::Vector<Action>& value) { SetDefaultActions(value); return *this;} 294 295 /** 296 * <p>The default actions for the listener.</p> 297 */ WithDefaultActions(Aws::Vector<Action> && value)298 inline Listener& WithDefaultActions(Aws::Vector<Action>&& value) { SetDefaultActions(std::move(value)); return *this;} 299 300 /** 301 * <p>The default actions for the listener.</p> 302 */ AddDefaultActions(const Action & value)303 inline Listener& AddDefaultActions(const Action& value) { m_defaultActionsHasBeenSet = true; m_defaultActions.push_back(value); return *this; } 304 305 /** 306 * <p>The default actions for the listener.</p> 307 */ AddDefaultActions(Action && value)308 inline Listener& AddDefaultActions(Action&& value) { m_defaultActionsHasBeenSet = true; m_defaultActions.push_back(std::move(value)); return *this; } 309 310 311 /** 312 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 313 * policy.</p> 314 */ GetAlpnPolicy()315 inline const Aws::Vector<Aws::String>& GetAlpnPolicy() const{ return m_alpnPolicy; } 316 317 /** 318 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 319 * policy.</p> 320 */ AlpnPolicyHasBeenSet()321 inline bool AlpnPolicyHasBeenSet() const { return m_alpnPolicyHasBeenSet; } 322 323 /** 324 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 325 * policy.</p> 326 */ SetAlpnPolicy(const Aws::Vector<Aws::String> & value)327 inline void SetAlpnPolicy(const Aws::Vector<Aws::String>& value) { m_alpnPolicyHasBeenSet = true; m_alpnPolicy = value; } 328 329 /** 330 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 331 * policy.</p> 332 */ SetAlpnPolicy(Aws::Vector<Aws::String> && value)333 inline void SetAlpnPolicy(Aws::Vector<Aws::String>&& value) { m_alpnPolicyHasBeenSet = true; m_alpnPolicy = std::move(value); } 334 335 /** 336 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 337 * policy.</p> 338 */ WithAlpnPolicy(const Aws::Vector<Aws::String> & value)339 inline Listener& WithAlpnPolicy(const Aws::Vector<Aws::String>& value) { SetAlpnPolicy(value); return *this;} 340 341 /** 342 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 343 * policy.</p> 344 */ WithAlpnPolicy(Aws::Vector<Aws::String> && value)345 inline Listener& WithAlpnPolicy(Aws::Vector<Aws::String>&& value) { SetAlpnPolicy(std::move(value)); return *this;} 346 347 /** 348 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 349 * policy.</p> 350 */ AddAlpnPolicy(const Aws::String & value)351 inline Listener& AddAlpnPolicy(const Aws::String& value) { m_alpnPolicyHasBeenSet = true; m_alpnPolicy.push_back(value); return *this; } 352 353 /** 354 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 355 * policy.</p> 356 */ AddAlpnPolicy(Aws::String && value)357 inline Listener& AddAlpnPolicy(Aws::String&& value) { m_alpnPolicyHasBeenSet = true; m_alpnPolicy.push_back(std::move(value)); return *this; } 358 359 /** 360 * <p>[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) 361 * policy.</p> 362 */ AddAlpnPolicy(const char * value)363 inline Listener& AddAlpnPolicy(const char* value) { m_alpnPolicyHasBeenSet = true; m_alpnPolicy.push_back(value); return *this; } 364 365 private: 366 367 Aws::String m_listenerArn; 368 bool m_listenerArnHasBeenSet; 369 370 Aws::String m_loadBalancerArn; 371 bool m_loadBalancerArnHasBeenSet; 372 373 int m_port; 374 bool m_portHasBeenSet; 375 376 ProtocolEnum m_protocol; 377 bool m_protocolHasBeenSet; 378 379 Aws::Vector<Certificate> m_certificates; 380 bool m_certificatesHasBeenSet; 381 382 Aws::String m_sslPolicy; 383 bool m_sslPolicyHasBeenSet; 384 385 Aws::Vector<Action> m_defaultActions; 386 bool m_defaultActionsHasBeenSet; 387 388 Aws::Vector<Aws::String> m_alpnPolicy; 389 bool m_alpnPolicyHasBeenSet; 390 }; 391 392 } // namespace Model 393 } // namespace ElasticLoadBalancingv2 394 } // namespace Aws 395