AWS SDK for C++  0.12.9
AWS SDK for C++
Volume.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>
25 #include <aws/ec2/model/Tag.h>
26 
27 namespace Aws
28 {
29 namespace Utils
30 {
31 namespace Xml
32 {
33  class XmlNode;
34 } // namespace Xml
35 } // namespace Utils
36 namespace EC2
37 {
38 namespace Model
39 {
40 
45  {
46  public:
47  Volume();
48  Volume(const Aws::Utils::Xml::XmlNode& xmlNode);
49  Volume& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
50 
51  void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
52  void OutputToStream(Aws::OStream& oStream, const char* location) const;
53 
57  inline const Aws::String& GetVolumeId() const{ return m_volumeId; }
58 
62  inline void SetVolumeId(const Aws::String& value) { m_volumeIdHasBeenSet = true; m_volumeId = value; }
63 
67  inline void SetVolumeId(Aws::String&& value) { m_volumeIdHasBeenSet = true; m_volumeId = value; }
68 
72  inline void SetVolumeId(const char* value) { m_volumeIdHasBeenSet = true; m_volumeId.assign(value); }
73 
77  inline Volume& WithVolumeId(const Aws::String& value) { SetVolumeId(value); return *this;}
78 
82  inline Volume& WithVolumeId(Aws::String&& value) { SetVolumeId(value); return *this;}
83 
87  inline Volume& WithVolumeId(const char* value) { SetVolumeId(value); return *this;}
88 
92  inline long GetSize() const{ return m_size; }
93 
97  inline void SetSize(long value) { m_sizeHasBeenSet = true; m_size = value; }
98 
102  inline Volume& WithSize(long value) { SetSize(value); return *this;}
103 
107  inline const Aws::String& GetSnapshotId() const{ return m_snapshotId; }
108 
112  inline void SetSnapshotId(const Aws::String& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
113 
117  inline void SetSnapshotId(Aws::String&& value) { m_snapshotIdHasBeenSet = true; m_snapshotId = value; }
118 
122  inline void SetSnapshotId(const char* value) { m_snapshotIdHasBeenSet = true; m_snapshotId.assign(value); }
123 
127  inline Volume& WithSnapshotId(const Aws::String& value) { SetSnapshotId(value); return *this;}
128 
132  inline Volume& WithSnapshotId(Aws::String&& value) { SetSnapshotId(value); return *this;}
133 
137  inline Volume& WithSnapshotId(const char* value) { SetSnapshotId(value); return *this;}
138 
142  inline const Aws::String& GetAvailabilityZone() const{ return m_availabilityZone; }
143 
147  inline void SetAvailabilityZone(const Aws::String& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = value; }
148 
152  inline void SetAvailabilityZone(Aws::String&& value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone = value; }
153 
157  inline void SetAvailabilityZone(const char* value) { m_availabilityZoneHasBeenSet = true; m_availabilityZone.assign(value); }
158 
162  inline Volume& WithAvailabilityZone(const Aws::String& value) { SetAvailabilityZone(value); return *this;}
163 
167  inline Volume& WithAvailabilityZone(Aws::String&& value) { SetAvailabilityZone(value); return *this;}
168 
172  inline Volume& WithAvailabilityZone(const char* value) { SetAvailabilityZone(value); return *this;}
173 
177  inline const VolumeState& GetState() const{ return m_state; }
178 
182  inline void SetState(const VolumeState& value) { m_stateHasBeenSet = true; m_state = value; }
183 
187  inline void SetState(VolumeState&& value) { m_stateHasBeenSet = true; m_state = value; }
188 
192  inline Volume& WithState(const VolumeState& value) { SetState(value); return *this;}
193 
197  inline Volume& WithState(VolumeState&& value) { SetState(value); return *this;}
198 
202  inline const Aws::Utils::DateTime& GetCreateTime() const{ return m_createTime; }
203 
207  inline void SetCreateTime(const Aws::Utils::DateTime& value) { m_createTimeHasBeenSet = true; m_createTime = value; }
208 
212  inline void SetCreateTime(Aws::Utils::DateTime&& value) { m_createTimeHasBeenSet = true; m_createTime = value; }
213 
217  inline Volume& WithCreateTime(const Aws::Utils::DateTime& value) { SetCreateTime(value); return *this;}
218 
222  inline Volume& WithCreateTime(Aws::Utils::DateTime&& value) { SetCreateTime(value); return *this;}
223 
227  inline const Aws::Vector<VolumeAttachment>& GetAttachments() const{ return m_attachments; }
228 
232  inline void SetAttachments(const Aws::Vector<VolumeAttachment>& value) { m_attachmentsHasBeenSet = true; m_attachments = value; }
233 
237  inline void SetAttachments(Aws::Vector<VolumeAttachment>&& value) { m_attachmentsHasBeenSet = true; m_attachments = value; }
238 
242  inline Volume& WithAttachments(const Aws::Vector<VolumeAttachment>& value) { SetAttachments(value); return *this;}
243 
247  inline Volume& WithAttachments(Aws::Vector<VolumeAttachment>&& value) { SetAttachments(value); return *this;}
248 
252  inline Volume& AddAttachments(const VolumeAttachment& value) { m_attachmentsHasBeenSet = true; m_attachments.push_back(value); return *this; }
253 
257  inline Volume& AddAttachments(VolumeAttachment&& value) { m_attachmentsHasBeenSet = true; m_attachments.push_back(value); return *this; }
258 
262  inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }
263 
267  inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }
268 
272  inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = value; }
273 
277  inline Volume& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}
278 
282  inline Volume& WithTags(Aws::Vector<Tag>&& value) { SetTags(value); return *this;}
283 
287  inline Volume& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
288 
292  inline Volume& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }
293 
300  inline const VolumeType& GetVolumeType() const{ return m_volumeType; }
301 
308  inline void SetVolumeType(const VolumeType& value) { m_volumeTypeHasBeenSet = true; m_volumeType = value; }
309 
316  inline void SetVolumeType(VolumeType&& value) { m_volumeTypeHasBeenSet = true; m_volumeType = value; }
317 
324  inline Volume& WithVolumeType(const VolumeType& value) { SetVolumeType(value); return *this;}
325 
332  inline Volume& WithVolumeType(VolumeType&& value) { SetVolumeType(value); return *this;}
333 
349  inline long GetIops() const{ return m_iops; }
350 
366  inline void SetIops(long value) { m_iopsHasBeenSet = true; m_iops = value; }
367 
383  inline Volume& WithIops(long value) { SetIops(value); return *this;}
384 
388  inline bool GetEncrypted() const{ return m_encrypted; }
389 
393  inline void SetEncrypted(bool value) { m_encryptedHasBeenSet = true; m_encrypted = value; }
394 
398  inline Volume& WithEncrypted(bool value) { SetEncrypted(value); return *this;}
399 
404  inline const Aws::String& GetKmsKeyId() const{ return m_kmsKeyId; }
405 
410  inline void SetKmsKeyId(const Aws::String& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; }
411 
416  inline void SetKmsKeyId(Aws::String&& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; }
417 
422  inline void SetKmsKeyId(const char* value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId.assign(value); }
423 
428  inline Volume& WithKmsKeyId(const Aws::String& value) { SetKmsKeyId(value); return *this;}
429 
434  inline Volume& WithKmsKeyId(Aws::String&& value) { SetKmsKeyId(value); return *this;}
435 
440  inline Volume& WithKmsKeyId(const char* value) { SetKmsKeyId(value); return *this;}
441 
442 
443  inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }
444 
445 
446  inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadataHasBeenSet = true; m_responseMetadata = value; }
447 
448 
449  inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadataHasBeenSet = true; m_responseMetadata = value; }
450 
451 
452  inline Volume& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}
453 
454 
455  inline Volume& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(value); return *this;}
456 
457  private:
458  Aws::String m_volumeId;
459  bool m_volumeIdHasBeenSet;
460  long m_size;
461  bool m_sizeHasBeenSet;
462  Aws::String m_snapshotId;
463  bool m_snapshotIdHasBeenSet;
464  Aws::String m_availabilityZone;
465  bool m_availabilityZoneHasBeenSet;
466  VolumeState m_state;
467  bool m_stateHasBeenSet;
468  Aws::Utils::DateTime m_createTime;
469  bool m_createTimeHasBeenSet;
470  Aws::Vector<VolumeAttachment> m_attachments;
471  bool m_attachmentsHasBeenSet;
472  Aws::Vector<Tag> m_tags;
473  bool m_tagsHasBeenSet;
474  VolumeType m_volumeType;
475  bool m_volumeTypeHasBeenSet;
476  long m_iops;
477  bool m_iopsHasBeenSet;
478  bool m_encrypted;
479  bool m_encryptedHasBeenSet;
480  Aws::String m_kmsKeyId;
481  bool m_kmsKeyIdHasBeenSet;
482  ResponseMetadata m_responseMetadata;
483  bool m_responseMetadataHasBeenSet;
484  };
485 
486 } // namespace Model
487 } // namespace EC2
488 } // namespace Aws
long GetIops() const
Definition: Volume.h:349
void SetVolumeId(const char *value)
Definition: Volume.h:72
Volume & WithAvailabilityZone(Aws::String &&value)
Definition: Volume.h:167
void SetVolumeId(Aws::String &&value)
Definition: Volume.h:67
Volume & WithKmsKeyId(const char *value)
Definition: Volume.h:440
void SetAttachments(Aws::Vector< VolumeAttachment > &&value)
Definition: Volume.h:237
void SetResponseMetadata(const ResponseMetadata &value)
Definition: Volume.h:446
void SetAvailabilityZone(const char *value)
Definition: Volume.h:157
void SetTags(Aws::Vector< Tag > &&value)
Definition: Volume.h:272
Volume & WithSnapshotId(Aws::String &&value)
Definition: Volume.h:132
Volume & WithCreateTime(Aws::Utils::DateTime &&value)
Definition: Volume.h:222
void SetAttachments(const Aws::Vector< VolumeAttachment > &value)
Definition: Volume.h:232
const Aws::Vector< VolumeAttachment > & GetAttachments() const
Definition: Volume.h:227
Volume & WithCreateTime(const Aws::Utils::DateTime &value)
Definition: Volume.h:217
const Aws::String & GetAvailabilityZone() const
Definition: Volume.h:142
void SetKmsKeyId(Aws::String &&value)
Definition: Volume.h:416
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
void SetTags(const Aws::Vector< Tag > &value)
Definition: Volume.h:267
const VolumeState & GetState() const
Definition: Volume.h:177
Volume & WithTags(Aws::Vector< Tag > &&value)
Definition: Volume.h:282
Volume & WithVolumeId(const Aws::String &value)
Definition: Volume.h:77
void SetIops(long value)
Definition: Volume.h:366
Volume & WithSnapshotId(const Aws::String &value)
Definition: Volume.h:127
Volume & AddAttachments(VolumeAttachment &&value)
Definition: Volume.h:257
void SetState(VolumeState &&value)
Definition: Volume.h:187
void SetState(const VolumeState &value)
Definition: Volume.h:182
void SetSnapshotId(Aws::String &&value)
Definition: Volume.h:117
Volume & WithTags(const Aws::Vector< Tag > &value)
Definition: Volume.h:277
void SetSnapshotId(const Aws::String &value)
Definition: Volume.h:112
Volume & AddTags(Tag &&value)
Definition: Volume.h:292
Volume & WithSnapshotId(const char *value)
Definition: Volume.h:137
const Aws::String & GetVolumeId() const
Definition: Volume.h:57
Volume & AddAttachments(const VolumeAttachment &value)
Definition: Volume.h:252
Volume & WithKmsKeyId(Aws::String &&value)
Definition: Volume.h:434
void SetKmsKeyId(const char *value)
Definition: Volume.h:422
Volume & WithKmsKeyId(const Aws::String &value)
Definition: Volume.h:428
long GetSize() const
Definition: Volume.h:92
Volume & WithState(VolumeState &&value)
Definition: Volume.h:197
std::basic_ostream< char, std::char_traits< char > > OStream
Definition: AWSStreamFwd.h:31
Volume & WithAvailabilityZone(const Aws::String &value)
Definition: Volume.h:162
const Aws::String & GetSnapshotId() const
Definition: Volume.h:107
Volume & AddTags(const Tag &value)
Definition: Volume.h:287
const Aws::String & GetKmsKeyId() const
Definition: Volume.h:404
void SetVolumeId(const Aws::String &value)
Definition: Volume.h:62
Volume & WithIops(long value)
Definition: Volume.h:383
void SetCreateTime(const Aws::Utils::DateTime &value)
Definition: Volume.h:207
void SetAvailabilityZone(const Aws::String &value)
Definition: Volume.h:147
void SetCreateTime(Aws::Utils::DateTime &&value)
Definition: Volume.h:212
void SetAvailabilityZone(Aws::String &&value)
Definition: Volume.h:152
Volume & WithState(const VolumeState &value)
Definition: Volume.h:192
Volume & WithAvailabilityZone(const char *value)
Definition: Volume.h:172
Volume & WithAttachments(Aws::Vector< VolumeAttachment > &&value)
Definition: Volume.h:247
void SetVolumeType(VolumeType &&value)
Definition: Volume.h:316
Volume & WithVolumeType(const VolumeType &value)
Definition: Volume.h:324
const Aws::Vector< Tag > & GetTags() const
Definition: Volume.h:262
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
void SetVolumeType(const VolumeType &value)
Definition: Volume.h:308
void SetSize(long value)
Definition: Volume.h:97
Volume & WithResponseMetadata(ResponseMetadata &&value)
Definition: Volume.h:455
Volume & WithVolumeId(Aws::String &&value)
Definition: Volume.h:82
const ResponseMetadata & GetResponseMetadata() const
Definition: Volume.h:443
Volume & WithSize(long value)
Definition: Volume.h:102
void SetKmsKeyId(const Aws::String &value)
Definition: Volume.h:410
Volume & WithEncrypted(bool value)
Definition: Volume.h:398
#define AWS_EC2_API
Definition: EC2_EXPORTS.h:34
Volume & WithResponseMetadata(const ResponseMetadata &value)
Definition: Volume.h:452
Volume & WithVolumeId(const char *value)
Definition: Volume.h:87
Volume & WithVolumeType(VolumeType &&value)
Definition: Volume.h:332
const Aws::Utils::DateTime & GetCreateTime() const
Definition: Volume.h:202
void SetSnapshotId(const char *value)
Definition: Volume.h:122
void SetEncrypted(bool value)
Definition: Volume.h:393
void SetResponseMetadata(ResponseMetadata &&value)
Definition: Volume.h:449
bool GetEncrypted() const
Definition: Volume.h:388
JSON (JavaScript Object Notation).
Volume & WithAttachments(const Aws::Vector< VolumeAttachment > &value)
Definition: Volume.h:242
const VolumeType & GetVolumeType() const
Definition: Volume.h:300