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/elasticloadbalancingv2/ElasticLoadBalancingv2Request.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/core/utils/memory/stl/AWSVector.h>
11 #include <aws/elasticloadbalancingv2/model/IpAddressType.h>
12 #include <aws/elasticloadbalancingv2/model/SubnetMapping.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace ElasticLoadBalancingv2
18 {
19 namespace Model
20 {
21 
22   /**
23    */
24   class AWS_ELASTICLOADBALANCINGV2_API SetSubnetsRequest : public ElasticLoadBalancingv2Request
25   {
26   public:
27     SetSubnetsRequest();
28 
29     // Service request name is the Operation name which will send this request out,
30     // each operation should has unique request name, so that we can get operation's name from this request.
31     // Note: this is not true for response, multiple operations may have the same response name,
32     // so we can not get operation's name from response.
GetServiceRequestName()33     inline virtual const char* GetServiceRequestName() const override { return "SetSubnets"; }
34 
35     Aws::String SerializePayload() const override;
36 
37   protected:
38     void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
39 
40   public:
41 
42     /**
43      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
44      */
GetLoadBalancerArn()45     inline const Aws::String& GetLoadBalancerArn() const{ return m_loadBalancerArn; }
46 
47     /**
48      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
49      */
LoadBalancerArnHasBeenSet()50     inline bool LoadBalancerArnHasBeenSet() const { return m_loadBalancerArnHasBeenSet; }
51 
52     /**
53      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
54      */
SetLoadBalancerArn(const Aws::String & value)55     inline void SetLoadBalancerArn(const Aws::String& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = value; }
56 
57     /**
58      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
59      */
SetLoadBalancerArn(Aws::String && value)60     inline void SetLoadBalancerArn(Aws::String&& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = std::move(value); }
61 
62     /**
63      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
64      */
SetLoadBalancerArn(const char * value)65     inline void SetLoadBalancerArn(const char* value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn.assign(value); }
66 
67     /**
68      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
69      */
WithLoadBalancerArn(const Aws::String & value)70     inline SetSubnetsRequest& WithLoadBalancerArn(const Aws::String& value) { SetLoadBalancerArn(value); return *this;}
71 
72     /**
73      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
74      */
WithLoadBalancerArn(Aws::String && value)75     inline SetSubnetsRequest& WithLoadBalancerArn(Aws::String&& value) { SetLoadBalancerArn(std::move(value)); return *this;}
76 
77     /**
78      * <p>The Amazon Resource Name (ARN) of the load balancer.</p>
79      */
WithLoadBalancerArn(const char * value)80     inline SetSubnetsRequest& WithLoadBalancerArn(const char* value) { SetLoadBalancerArn(value); return *this;}
81 
82 
83     /**
84      * <p>The IDs of the public subnets. You can specify only one subnet per
85      * Availability Zone. You must specify either subnets or subnet mappings.</p>
86      * <p>[Application Load Balancers] You must specify subnets from at least two
87      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
88      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
89      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
90      * Balancers] You can specify subnets from one or more Availability Zones.</p>
91      */
GetSubnets()92     inline const Aws::Vector<Aws::String>& GetSubnets() const{ return m_subnets; }
93 
94     /**
95      * <p>The IDs of the public subnets. You can specify only one subnet per
96      * Availability Zone. You must specify either subnets or subnet mappings.</p>
97      * <p>[Application Load Balancers] You must specify subnets from at least two
98      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
99      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
100      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
101      * Balancers] You can specify subnets from one or more Availability Zones.</p>
102      */
SubnetsHasBeenSet()103     inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
104 
105     /**
106      * <p>The IDs of the public subnets. You can specify only one subnet per
107      * Availability Zone. You must specify either subnets or subnet mappings.</p>
108      * <p>[Application Load Balancers] You must specify subnets from at least two
109      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
110      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
111      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
112      * Balancers] You can specify subnets from one or more Availability Zones.</p>
113      */
SetSubnets(const Aws::Vector<Aws::String> & value)114     inline void SetSubnets(const Aws::Vector<Aws::String>& value) { m_subnetsHasBeenSet = true; m_subnets = value; }
115 
116     /**
117      * <p>The IDs of the public subnets. You can specify only one subnet per
118      * Availability Zone. You must specify either subnets or subnet mappings.</p>
119      * <p>[Application Load Balancers] You must specify subnets from at least two
120      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
121      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
122      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
123      * Balancers] You can specify subnets from one or more Availability Zones.</p>
124      */
SetSubnets(Aws::Vector<Aws::String> && value)125     inline void SetSubnets(Aws::Vector<Aws::String>&& value) { m_subnetsHasBeenSet = true; m_subnets = std::move(value); }
126 
127     /**
128      * <p>The IDs of the public subnets. You can specify only one subnet per
129      * Availability Zone. You must specify either subnets or subnet mappings.</p>
130      * <p>[Application Load Balancers] You must specify subnets from at least two
131      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
132      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
133      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
134      * Balancers] You can specify subnets from one or more Availability Zones.</p>
135      */
WithSubnets(const Aws::Vector<Aws::String> & value)136     inline SetSubnetsRequest& WithSubnets(const Aws::Vector<Aws::String>& value) { SetSubnets(value); return *this;}
137 
138     /**
139      * <p>The IDs of the public subnets. You can specify only one subnet per
140      * Availability Zone. You must specify either subnets or subnet mappings.</p>
141      * <p>[Application Load Balancers] You must specify subnets from at least two
142      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
143      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
144      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
145      * Balancers] You can specify subnets from one or more Availability Zones.</p>
146      */
WithSubnets(Aws::Vector<Aws::String> && value)147     inline SetSubnetsRequest& WithSubnets(Aws::Vector<Aws::String>&& value) { SetSubnets(std::move(value)); return *this;}
148 
149     /**
150      * <p>The IDs of the public subnets. You can specify only one subnet per
151      * Availability Zone. You must specify either subnets or subnet mappings.</p>
152      * <p>[Application Load Balancers] You must specify subnets from at least two
153      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
154      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
155      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
156      * Balancers] You can specify subnets from one or more Availability Zones.</p>
157      */
AddSubnets(const Aws::String & value)158     inline SetSubnetsRequest& AddSubnets(const Aws::String& value) { m_subnetsHasBeenSet = true; m_subnets.push_back(value); return *this; }
159 
160     /**
161      * <p>The IDs of the public subnets. You can specify only one subnet per
162      * Availability Zone. You must specify either subnets or subnet mappings.</p>
163      * <p>[Application Load Balancers] You must specify subnets from at least two
164      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
165      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
166      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
167      * Balancers] You can specify subnets from one or more Availability Zones.</p>
168      */
AddSubnets(Aws::String && value)169     inline SetSubnetsRequest& AddSubnets(Aws::String&& value) { m_subnetsHasBeenSet = true; m_subnets.push_back(std::move(value)); return *this; }
170 
171     /**
172      * <p>The IDs of the public subnets. You can specify only one subnet per
173      * Availability Zone. You must specify either subnets or subnet mappings.</p>
174      * <p>[Application Load Balancers] You must specify subnets from at least two
175      * Availability Zones.</p> <p>[Application Load Balancers on Outposts] You must
176      * specify one Outpost subnet.</p> <p>[Application Load Balancers on Local Zones]
177      * You can specify subnets from one or more Local Zones.</p> <p>[Network Load
178      * Balancers] You can specify subnets from one or more Availability Zones.</p>
179      */
AddSubnets(const char * value)180     inline SetSubnetsRequest& AddSubnets(const char* value) { m_subnetsHasBeenSet = true; m_subnets.push_back(value); return *this; }
181 
182 
183     /**
184      * <p>The IDs of the public subnets. You can specify only one subnet per
185      * Availability Zone. You must specify either subnets or subnet mappings.</p>
186      * <p>[Application Load Balancers] You must specify subnets from at least two
187      * Availability Zones. You cannot specify Elastic IP addresses for your
188      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
189      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
190      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
191      * You can specify subnets from one or more Availability Zones. You can specify one
192      * Elastic IP address per subnet if you need static IP addresses for your
193      * internet-facing load balancer. For internal load balancers, you can specify one
194      * private IP address per subnet from the IPv4 range of the subnet. For
195      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
196      */
GetSubnetMappings()197     inline const Aws::Vector<SubnetMapping>& GetSubnetMappings() const{ return m_subnetMappings; }
198 
199     /**
200      * <p>The IDs of the public subnets. You can specify only one subnet per
201      * Availability Zone. You must specify either subnets or subnet mappings.</p>
202      * <p>[Application Load Balancers] You must specify subnets from at least two
203      * Availability Zones. You cannot specify Elastic IP addresses for your
204      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
205      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
206      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
207      * You can specify subnets from one or more Availability Zones. You can specify one
208      * Elastic IP address per subnet if you need static IP addresses for your
209      * internet-facing load balancer. For internal load balancers, you can specify one
210      * private IP address per subnet from the IPv4 range of the subnet. For
211      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
212      */
SubnetMappingsHasBeenSet()213     inline bool SubnetMappingsHasBeenSet() const { return m_subnetMappingsHasBeenSet; }
214 
215     /**
216      * <p>The IDs of the public subnets. You can specify only one subnet per
217      * Availability Zone. You must specify either subnets or subnet mappings.</p>
218      * <p>[Application Load Balancers] You must specify subnets from at least two
219      * Availability Zones. You cannot specify Elastic IP addresses for your
220      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
221      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
222      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
223      * You can specify subnets from one or more Availability Zones. You can specify one
224      * Elastic IP address per subnet if you need static IP addresses for your
225      * internet-facing load balancer. For internal load balancers, you can specify one
226      * private IP address per subnet from the IPv4 range of the subnet. For
227      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
228      */
SetSubnetMappings(const Aws::Vector<SubnetMapping> & value)229     inline void SetSubnetMappings(const Aws::Vector<SubnetMapping>& value) { m_subnetMappingsHasBeenSet = true; m_subnetMappings = value; }
230 
231     /**
232      * <p>The IDs of the public subnets. You can specify only one subnet per
233      * Availability Zone. You must specify either subnets or subnet mappings.</p>
234      * <p>[Application Load Balancers] You must specify subnets from at least two
235      * Availability Zones. You cannot specify Elastic IP addresses for your
236      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
237      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
238      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
239      * You can specify subnets from one or more Availability Zones. You can specify one
240      * Elastic IP address per subnet if you need static IP addresses for your
241      * internet-facing load balancer. For internal load balancers, you can specify one
242      * private IP address per subnet from the IPv4 range of the subnet. For
243      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
244      */
SetSubnetMappings(Aws::Vector<SubnetMapping> && value)245     inline void SetSubnetMappings(Aws::Vector<SubnetMapping>&& value) { m_subnetMappingsHasBeenSet = true; m_subnetMappings = std::move(value); }
246 
247     /**
248      * <p>The IDs of the public subnets. You can specify only one subnet per
249      * Availability Zone. You must specify either subnets or subnet mappings.</p>
250      * <p>[Application Load Balancers] You must specify subnets from at least two
251      * Availability Zones. You cannot specify Elastic IP addresses for your
252      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
253      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
254      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
255      * You can specify subnets from one or more Availability Zones. You can specify one
256      * Elastic IP address per subnet if you need static IP addresses for your
257      * internet-facing load balancer. For internal load balancers, you can specify one
258      * private IP address per subnet from the IPv4 range of the subnet. For
259      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
260      */
WithSubnetMappings(const Aws::Vector<SubnetMapping> & value)261     inline SetSubnetsRequest& WithSubnetMappings(const Aws::Vector<SubnetMapping>& value) { SetSubnetMappings(value); return *this;}
262 
263     /**
264      * <p>The IDs of the public subnets. You can specify only one subnet per
265      * Availability Zone. You must specify either subnets or subnet mappings.</p>
266      * <p>[Application Load Balancers] You must specify subnets from at least two
267      * Availability Zones. You cannot specify Elastic IP addresses for your
268      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
269      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
270      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
271      * You can specify subnets from one or more Availability Zones. You can specify one
272      * Elastic IP address per subnet if you need static IP addresses for your
273      * internet-facing load balancer. For internal load balancers, you can specify one
274      * private IP address per subnet from the IPv4 range of the subnet. For
275      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
276      */
WithSubnetMappings(Aws::Vector<SubnetMapping> && value)277     inline SetSubnetsRequest& WithSubnetMappings(Aws::Vector<SubnetMapping>&& value) { SetSubnetMappings(std::move(value)); return *this;}
278 
279     /**
280      * <p>The IDs of the public subnets. You can specify only one subnet per
281      * Availability Zone. You must specify either subnets or subnet mappings.</p>
282      * <p>[Application Load Balancers] You must specify subnets from at least two
283      * Availability Zones. You cannot specify Elastic IP addresses for your
284      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
285      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
286      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
287      * You can specify subnets from one or more Availability Zones. You can specify one
288      * Elastic IP address per subnet if you need static IP addresses for your
289      * internet-facing load balancer. For internal load balancers, you can specify one
290      * private IP address per subnet from the IPv4 range of the subnet. For
291      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
292      */
AddSubnetMappings(const SubnetMapping & value)293     inline SetSubnetsRequest& AddSubnetMappings(const SubnetMapping& value) { m_subnetMappingsHasBeenSet = true; m_subnetMappings.push_back(value); return *this; }
294 
295     /**
296      * <p>The IDs of the public subnets. You can specify only one subnet per
297      * Availability Zone. You must specify either subnets or subnet mappings.</p>
298      * <p>[Application Load Balancers] You must specify subnets from at least two
299      * Availability Zones. You cannot specify Elastic IP addresses for your
300      * subnets.</p> <p>[Application Load Balancers on Outposts] You must specify one
301      * Outpost subnet.</p> <p>[Application Load Balancers on Local Zones] You can
302      * specify subnets from one or more Local Zones.</p> <p>[Network Load Balancers]
303      * You can specify subnets from one or more Availability Zones. You can specify one
304      * Elastic IP address per subnet if you need static IP addresses for your
305      * internet-facing load balancer. For internal load balancers, you can specify one
306      * private IP address per subnet from the IPv4 range of the subnet. For
307      * internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
308      */
AddSubnetMappings(SubnetMapping && value)309     inline SetSubnetsRequest& AddSubnetMappings(SubnetMapping&& value) { m_subnetMappingsHasBeenSet = true; m_subnetMappings.push_back(std::move(value)); return *this; }
310 
311 
312     /**
313      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
314      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
315      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
316      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
317      * listener. Internal load balancers must use <code>ipv4</code>.</p>
318      */
GetIpAddressType()319     inline const IpAddressType& GetIpAddressType() const{ return m_ipAddressType; }
320 
321     /**
322      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
323      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
324      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
325      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
326      * listener. Internal load balancers must use <code>ipv4</code>.</p>
327      */
IpAddressTypeHasBeenSet()328     inline bool IpAddressTypeHasBeenSet() const { return m_ipAddressTypeHasBeenSet; }
329 
330     /**
331      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
332      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
333      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
334      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
335      * listener. Internal load balancers must use <code>ipv4</code>.</p>
336      */
SetIpAddressType(const IpAddressType & value)337     inline void SetIpAddressType(const IpAddressType& value) { m_ipAddressTypeHasBeenSet = true; m_ipAddressType = value; }
338 
339     /**
340      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
341      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
342      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
343      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
344      * listener. Internal load balancers must use <code>ipv4</code>.</p>
345      */
SetIpAddressType(IpAddressType && value)346     inline void SetIpAddressType(IpAddressType&& value) { m_ipAddressTypeHasBeenSet = true; m_ipAddressType = std::move(value); }
347 
348     /**
349      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
350      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
351      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
352      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
353      * listener. Internal load balancers must use <code>ipv4</code>.</p>
354      */
WithIpAddressType(const IpAddressType & value)355     inline SetSubnetsRequest& WithIpAddressType(const IpAddressType& value) { SetIpAddressType(value); return *this;}
356 
357     /**
358      * <p>[Network Load Balancers] The type of IP addresses used by the subnets for
359      * your load balancer. The possible values are <code>ipv4</code> (for IPv4
360      * addresses) and <code>dualstack</code> (for IPv4 and IPv6 addresses). You can’t
361      * specify <code>dualstack</code> for a load balancer with a UDP or TCP_UDP
362      * listener. Internal load balancers must use <code>ipv4</code>.</p>
363      */
WithIpAddressType(IpAddressType && value)364     inline SetSubnetsRequest& WithIpAddressType(IpAddressType&& value) { SetIpAddressType(std::move(value)); return *this;}
365 
366   private:
367 
368     Aws::String m_loadBalancerArn;
369     bool m_loadBalancerArnHasBeenSet;
370 
371     Aws::Vector<Aws::String> m_subnets;
372     bool m_subnetsHasBeenSet;
373 
374     Aws::Vector<SubnetMapping> m_subnetMappings;
375     bool m_subnetMappingsHasBeenSet;
376 
377     IpAddressType m_ipAddressType;
378     bool m_ipAddressTypeHasBeenSet;
379   };
380 
381 } // namespace Model
382 } // namespace ElasticLoadBalancingv2
383 } // namespace Aws
384