AWS SDK for C++  0.14.3
AWS SDK for C++
Subnet.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
16 #include <aws/ec2/EC2_EXPORTS.h>
21 #include <aws/ec2/model/Tag.h>
22 
23 namespace Aws
24 {
25 namespace Utils
26 {
27 namespace Xml
28 {
29  class XmlNode;
30 } // namespace Xml
31 } // namespace Utils
32 namespace EC2
33 {
34 namespace Model
35 {
36 
41  {
42  public:
43  Subnet();
44  Subnet(const Aws::Utils::Xml::XmlNode& xmlNode);
45  Subnet& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
46 
47  void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
48  void OutputToStream(Aws::OStream& oStream, const char* location) const;
49 
53  inline const Aws::String& GetSubnetId() const{ return m_subnetId; }
54 
58  inline void SetSubnetId(const Aws::String& value) { m_subnetIdHasBeenSet = true; m_subnetId = value; }
59 
63  inline void SetSubnetId(Aws::String&& value) { m_subnetIdHasBeenSet = true; m_subnetId = value; }
64 
68  inline void SetSubnetId(const char* value) { m_subnetIdHasBeenSet = true; m_subnetId.assign(value); }
69 
73  inline Subnet& WithSubnetId(const Aws::String& value) { SetSubnetId(value); return *this;}
74 
78  inline Subnet& WithSubnetId(Aws::String&& value) { SetSubnetId(value); return *this;}
79 
83  inline Subnet& WithSubnetId(const char* value) { SetSubnetId(value); return *this;}
84 
88  inline const SubnetState& GetState() const{ return m_state; }
89 
93  inline void SetState(const SubnetState& value) { m_stateHasBeenSet = true; m_state = value; }
94 
98  inline void SetState(SubnetState&& value) { m_stateHasBeenSet = true; m_state = value; }
99 
103  inline Subnet& WithState(const SubnetState& value) { SetState(value); return *this;}
104 
108  inline Subnet& WithState(SubnetState&& value) { SetState(value); return *this;}
109 
113  inline const Aws::String& GetVpcId() const{ return m_vpcId; }
114 
118  inline void SetVpcId(const Aws::String& value) { m_vpcIdHasBeenSet = true; m_vpcId = value; }
119 
123  inline void SetVpcId(Aws::String&& value) { m_vpcIdHasBeenSet = true; m_vpcId = value; }
124 
128  inline void SetVpcId(const char* value) { m_vpcIdHasBeenSet = true; m_vpcId.assign(value); }
129 
133  inline Subnet& WithVpcId(const Aws::String& value) { SetVpcId(value); return *this;}
134 
138  inline Subnet& WithVpcId(Aws::String&& value) { SetVpcId(value); return *this;}
139 
143  inline Subnet& WithVpcId(const char* value) { SetVpcId(value); return *this;}
144 
148  inline const Aws::String& GetCidrBlock() const{ return m_cidrBlock; }
149 
153  inline void SetCidrBlock(const Aws::String& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = value; }
154 
158  inline void SetCidrBlock(Aws::String&& value) { m_cidrBlockHasBeenSet = true; m_cidrBlock = value; }
159 
163  inline void SetCidrBlock(const char* value) { m_cidrBlockHasBeenSet = true; m_cidrBlock.assign(value); }
164 
168  inline Subnet& WithCidrBlock(const Aws::String& value) { SetCidrBlock(value); return *this;}
169 
173  inline Subnet& WithCidrBlock(Aws::String&& value) { SetCidrBlock(value); return *this;}
174 
178  inline Subnet& WithCidrBlock(const char* value) { SetCidrBlock(value); return *this;}
179 
184  inline int GetAvailableIpAddressCount() const{ return m_availableIpAddressCount; }
185 
190  inline void SetAvailableIpAddressCount(int value) { m_availableIpAddressCountHasBeenSet = true; m_availableIpAddressCount = value; }
191 
196  inline Subnet& WithAvailableIpAddressCount(int value) { SetAvailableIpAddressCount(value); return *this;}
197 
201  inline const Aws::String& GetAvailabilityZone() const{ return m_availabilityZone; }
202 
206  inline void SetAvailabilityZone(const Aws::String& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = value; }
207 
211  inline void SetAvailabilityZone(Aws::String&& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = value; }
212 
216  inline void SetAvailabilityZone(const char* value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone.assign(value); }
217 
221  inline Subnet& WithAvailabilityZone(const Aws::String& value) { SetAvailabilityZone(value); return *this;}
222 
226  inline Subnet& WithAvailabilityZone(Aws::String&& value) { SetAvailabilityZone(value); return *this;}
227 
231  inline Subnet& WithAvailabilityZone(const char* value) { SetAvailabilityZone(value); return *this;}
232 
236  inline bool GetDefaultForAz() const{ return m_defaultForAz; }
237 
241  inline void SetDefaultForAz(bool value) { m_defaultForAzHasBeenSet = true; m_defaultForAz = value; }
242 
246  inline Subnet& WithDefaultForAz(bool value) { SetDefaultForAz(value); return *this;}
247 
252  inline bool GetMapPublicIpOnLaunch() const{ return m_mapPublicIpOnLaunch; }
253 
258  inline void SetMapPublicIpOnLaunch(bool value) { m_mapPublicIpOnLaunchHasBeenSet = true; m_mapPublicIpOnLaunch = value; }
259 
264  inline Subnet& WithMapPublicIpOnLaunch(bool value) { SetMapPublicIpOnLaunch(value); return *this;}
265 
269  inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
270 
274  inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
275 
279  inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = value; }
280 
284  inline Subnet& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
285 
289  inline Subnet& WithTags(Aws::Vector<Tag>&& value) { SetTags(value); return *this;}
290 
294  inline Subnet& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
295 
299  inline Subnet& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
300 
301  private:
302  Aws::String m_subnetId;
303  bool m_subnetIdHasBeenSet;
304  SubnetState m_state;
305  bool m_stateHasBeenSet;
306  Aws::String m_vpcId;
307  bool m_vpcIdHasBeenSet;
308  Aws::String m_cidrBlock;
309  bool m_cidrBlockHasBeenSet;
310  int m_availableIpAddressCount;
311  bool m_availableIpAddressCountHasBeenSet;
312  Aws::String m_availabilityZone;
313  bool m_availabilityZoneHasBeenSet;
314  bool m_defaultForAz;
315  bool m_defaultForAzHasBeenSet;
316  bool m_mapPublicIpOnLaunch;
317  bool m_mapPublicIpOnLaunchHasBeenSet;
318  Aws::Vector<Tag> m_tags;
319  bool m_tagsHasBeenSet;
320  };
321 
322 } // namespace Model
323 } // namespace EC2
324 } // namespace Aws
Subnet & WithMapPublicIpOnLaunch(bool value)
Definition: Subnet.h:264
void SetAvailabilityZone(Aws::String &&value)
Definition: Subnet.h:211
void SetAvailabilityZone(const char *value)
Definition: Subnet.h:216
const Aws::String & GetAvailabilityZone() const
Definition: Subnet.h:201
void SetVpcId(Aws::String &&value)
Definition: Subnet.h:123
Subnet & WithDefaultForAz(bool value)
Definition: Subnet.h:246
void SetVpcId(const Aws::String &value)
Definition: Subnet.h:118
Subnet & WithVpcId(const char *value)
Definition: Subnet.h:143
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
void SetSubnetId(Aws::String &&value)
Definition: Subnet.h:63
Subnet & WithCidrBlock(Aws::String &&value)
Definition: Subnet.h:173
Subnet & WithAvailabilityZone(const Aws::String &value)
Definition: Subnet.h:221
const SubnetState & GetState() const
Definition: Subnet.h:88
void SetSubnetId(const char *value)
Definition: Subnet.h:68
Subnet & WithCidrBlock(const char *value)
Definition: Subnet.h:178
void SetAvailabilityZone(const Aws::String &value)
Definition: Subnet.h:206
Subnet & AddTags(const Tag &value)
Definition: Subnet.h:294
Subnet & WithCidrBlock(const Aws::String &value)
Definition: Subnet.h:168
Subnet & WithAvailabilityZone(const char *value)
Definition: Subnet.h:231
Subnet & WithState(const SubnetState &value)
Definition: Subnet.h:103
Subnet & WithAvailableIpAddressCount(int value)
Definition: Subnet.h:196
Subnet & WithTags(const Aws::Vector< Tag > &value)
Definition: Subnet.h:284
std::basic_ostream< char, std::char_traits< char > > OStream
Definition: AWSStreamFwd.h:31
void SetCidrBlock(Aws::String &&value)
Definition: Subnet.h:158
Subnet & WithSubnetId(const Aws::String &value)
Definition: Subnet.h:73
void SetTags(const Aws::Vector< Tag > &value)
Definition: Subnet.h:274
Subnet & WithSubnetId(const char *value)
Definition: Subnet.h:83
void SetSubnetId(const Aws::String &value)
Definition: Subnet.h:58
Subnet & WithVpcId(Aws::String &&value)
Definition: Subnet.h:138
Subnet & WithState(SubnetState &&value)
Definition: Subnet.h:108
void SetState(const SubnetState &value)
Definition: Subnet.h:93
void SetAvailableIpAddressCount(int value)
Definition: Subnet.h:190
void SetTags(Aws::Vector< Tag > &&value)
Definition: Subnet.h:279
const Aws::String & GetSubnetId() const
Definition: Subnet.h:53
int GetAvailableIpAddressCount() const
Definition: Subnet.h:184
const Aws::Vector< Tag > & GetTags() const
Definition: Subnet.h:269
Subnet & AddTags(Tag &&value)
Definition: Subnet.h:299
const Aws::String & GetCidrBlock() const
Definition: Subnet.h:148
void SetDefaultForAz(bool value)
Definition: Subnet.h:241
bool GetMapPublicIpOnLaunch() const
Definition: Subnet.h:252
void SetMapPublicIpOnLaunch(bool value)
Definition: Subnet.h:258
const Aws::String & GetVpcId() const
Definition: Subnet.h:113
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
void SetCidrBlock(const Aws::String &value)
Definition: Subnet.h:153
Subnet & WithVpcId(const Aws::String &value)
Definition: Subnet.h:133
Subnet & WithTags(Aws::Vector< Tag > &&value)
Definition: Subnet.h:289
#define AWS_EC2_API
Definition: EC2_EXPORTS.h:37
void SetCidrBlock(const char *value)
Definition: Subnet.h:163
Subnet & WithSubnetId(Aws::String &&value)
Definition: Subnet.h:78
void SetVpcId(const char *value)
Definition: Subnet.h:128
bool GetDefaultForAz() const
Definition: Subnet.h:236
JSON (JavaScript Object Notation).
void SetState(SubnetState &&value)
Definition: Subnet.h:98
Subnet & WithAvailabilityZone(Aws::String &&value)
Definition: Subnet.h:226