AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
Volume.h
1
6#pragma once
7#include <aws/core/utils/DateTime.h>
8#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/ec2/EC2_EXPORTS.h>
12#include <aws/ec2/model/OperatorResponse.h>
13#include <aws/ec2/model/ResponseMetadata.h>
14#include <aws/ec2/model/SSEType.h>
15#include <aws/ec2/model/Tag.h>
16#include <aws/ec2/model/VolumeAttachment.h>
17#include <aws/ec2/model/VolumeState.h>
18#include <aws/ec2/model/VolumeType.h>
19
20#include <utility>
21
22namespace Aws {
23namespace Utils {
24namespace Xml {
25class XmlNode;
26} // namespace Xml
27} // namespace Utils
28namespace EC2 {
29namespace Model {
30
36class Volume {
37 public:
38 AWS_EC2_API Volume() = default;
39 AWS_EC2_API Volume(const Aws::Utils::Xml::XmlNode& xmlNode);
40 AWS_EC2_API Volume& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
41
42 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
43 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
44
46
49 inline const Aws::String& GetAvailabilityZoneId() const { return m_availabilityZoneId; }
50 inline bool AvailabilityZoneIdHasBeenSet() const { return m_availabilityZoneIdHasBeenSet; }
51 template <typename AvailabilityZoneIdT = Aws::String>
52 void SetAvailabilityZoneId(AvailabilityZoneIdT&& value) {
53 m_availabilityZoneIdHasBeenSet = true;
54 m_availabilityZoneId = std::forward<AvailabilityZoneIdT>(value);
55 }
56 template <typename AvailabilityZoneIdT = Aws::String>
57 Volume& WithAvailabilityZoneId(AvailabilityZoneIdT&& value) {
58 SetAvailabilityZoneId(std::forward<AvailabilityZoneIdT>(value));
59 return *this;
60 }
62
64
67 inline const Aws::String& GetOutpostArn() const { return m_outpostArn; }
68 inline bool OutpostArnHasBeenSet() const { return m_outpostArnHasBeenSet; }
69 template <typename OutpostArnT = Aws::String>
70 void SetOutpostArn(OutpostArnT&& value) {
71 m_outpostArnHasBeenSet = true;
72 m_outpostArn = std::forward<OutpostArnT>(value);
73 }
74 template <typename OutpostArnT = Aws::String>
75 Volume& WithOutpostArn(OutpostArnT&& value) {
76 SetOutpostArn(std::forward<OutpostArnT>(value));
77 return *this;
78 }
80
82
86 inline const Aws::String& GetSourceVolumeId() const { return m_sourceVolumeId; }
87 inline bool SourceVolumeIdHasBeenSet() const { return m_sourceVolumeIdHasBeenSet; }
88 template <typename SourceVolumeIdT = Aws::String>
89 void SetSourceVolumeId(SourceVolumeIdT&& value) {
90 m_sourceVolumeIdHasBeenSet = true;
91 m_sourceVolumeId = std::forward<SourceVolumeIdT>(value);
92 }
93 template <typename SourceVolumeIdT = Aws::String>
94 Volume& WithSourceVolumeId(SourceVolumeIdT&& value) {
95 SetSourceVolumeId(std::forward<SourceVolumeIdT>(value));
96 return *this;
97 }
99
101
108 inline int GetIops() const { return m_iops; }
109 inline bool IopsHasBeenSet() const { return m_iopsHasBeenSet; }
110 inline void SetIops(int value) {
111 m_iopsHasBeenSet = true;
112 m_iops = value;
113 }
114 inline Volume& WithIops(int value) {
115 SetIops(value);
116 return *this;
117 }
119
121
124 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
125 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
126 template <typename TagsT = Aws::Vector<Tag>>
127 void SetTags(TagsT&& value) {
128 m_tagsHasBeenSet = true;
129 m_tags = std::forward<TagsT>(value);
130 }
131 template <typename TagsT = Aws::Vector<Tag>>
132 Volume& WithTags(TagsT&& value) {
133 SetTags(std::forward<TagsT>(value));
134 return *this;
135 }
136 template <typename TagsT = Tag>
137 Volume& AddTags(TagsT&& value) {
138 m_tagsHasBeenSet = true;
139 m_tags.emplace_back(std::forward<TagsT>(value));
140 return *this;
141 }
143
145
148 inline VolumeType GetVolumeType() const { return m_volumeType; }
149 inline bool VolumeTypeHasBeenSet() const { return m_volumeTypeHasBeenSet; }
150 inline void SetVolumeType(VolumeType value) {
151 m_volumeTypeHasBeenSet = true;
152 m_volumeType = value;
153 }
155 SetVolumeType(value);
156 return *this;
157 }
159
161
165 inline bool GetFastRestored() const { return m_fastRestored; }
166 inline bool FastRestoredHasBeenSet() const { return m_fastRestoredHasBeenSet; }
167 inline void SetFastRestored(bool value) {
168 m_fastRestoredHasBeenSet = true;
169 m_fastRestored = value;
170 }
171 inline Volume& WithFastRestored(bool value) {
172 SetFastRestored(value);
173 return *this;
174 }
176
178
181 inline bool GetMultiAttachEnabled() const { return m_multiAttachEnabled; }
182 inline bool MultiAttachEnabledHasBeenSet() const { return m_multiAttachEnabledHasBeenSet; }
183 inline void SetMultiAttachEnabled(bool value) {
184 m_multiAttachEnabledHasBeenSet = true;
185 m_multiAttachEnabled = value;
186 }
187 inline Volume& WithMultiAttachEnabled(bool value) {
189 return *this;
190 }
192
194
197 inline int GetThroughput() const { return m_throughput; }
198 inline bool ThroughputHasBeenSet() const { return m_throughputHasBeenSet; }
199 inline void SetThroughput(int value) {
200 m_throughputHasBeenSet = true;
201 m_throughput = value;
202 }
203 inline Volume& WithThroughput(int value) {
204 SetThroughput(value);
205 return *this;
206 }
208
210
214 inline SSEType GetSseType() const { return m_sseType; }
215 inline bool SseTypeHasBeenSet() const { return m_sseTypeHasBeenSet; }
216 inline void SetSseType(SSEType value) {
217 m_sseTypeHasBeenSet = true;
218 m_sseType = value;
219 }
220 inline Volume& WithSseType(SSEType value) {
221 SetSseType(value);
222 return *this;
223 }
225
227
230 inline const OperatorResponse& GetOperator() const { return m_operator; }
231 inline bool OperatorHasBeenSet() const { return m_operatorHasBeenSet; }
232 template <typename OperatorT = OperatorResponse>
233 void SetOperator(OperatorT&& value) {
234 m_operatorHasBeenSet = true;
235 m_operator = std::forward<OperatorT>(value);
236 }
237 template <typename OperatorT = OperatorResponse>
238 Volume& WithOperator(OperatorT&& value) {
239 SetOperator(std::forward<OperatorT>(value));
240 return *this;
241 }
243
245
250 inline int GetVolumeInitializationRate() const { return m_volumeInitializationRate; }
251 inline bool VolumeInitializationRateHasBeenSet() const { return m_volumeInitializationRateHasBeenSet; }
252 inline void SetVolumeInitializationRate(int value) {
253 m_volumeInitializationRateHasBeenSet = true;
254 m_volumeInitializationRate = value;
255 }
258 return *this;
259 }
261
263
266 inline const Aws::String& GetVolumeId() const { return m_volumeId; }
267 inline bool VolumeIdHasBeenSet() const { return m_volumeIdHasBeenSet; }
268 template <typename VolumeIdT = Aws::String>
269 void SetVolumeId(VolumeIdT&& value) {
270 m_volumeIdHasBeenSet = true;
271 m_volumeId = std::forward<VolumeIdT>(value);
272 }
273 template <typename VolumeIdT = Aws::String>
274 Volume& WithVolumeId(VolumeIdT&& value) {
275 SetVolumeId(std::forward<VolumeIdT>(value));
276 return *this;
277 }
279
281
284 inline int GetSize() const { return m_size; }
285 inline bool SizeHasBeenSet() const { return m_sizeHasBeenSet; }
286 inline void SetSize(int value) {
287 m_sizeHasBeenSet = true;
288 m_size = value;
289 }
290 inline Volume& WithSize(int value) {
291 SetSize(value);
292 return *this;
293 }
295
297
300 inline const Aws::String& GetSnapshotId() const { return m_snapshotId; }
301 inline bool SnapshotIdHasBeenSet() const { return m_snapshotIdHasBeenSet; }
302 template <typename SnapshotIdT = Aws::String>
303 void SetSnapshotId(SnapshotIdT&& value) {
304 m_snapshotIdHasBeenSet = true;
305 m_snapshotId = std::forward<SnapshotIdT>(value);
306 }
307 template <typename SnapshotIdT = Aws::String>
308 Volume& WithSnapshotId(SnapshotIdT&& value) {
309 SetSnapshotId(std::forward<SnapshotIdT>(value));
310 return *this;
311 }
313
315
318 inline const Aws::String& GetAvailabilityZone() const { return m_availabilityZone; }
319 inline bool AvailabilityZoneHasBeenSet() const { return m_availabilityZoneHasBeenSet; }
320 template <typename AvailabilityZoneT = Aws::String>
321 void SetAvailabilityZone(AvailabilityZoneT&& value) {
322 m_availabilityZoneHasBeenSet = true;
323 m_availabilityZone = std::forward<AvailabilityZoneT>(value);
324 }
325 template <typename AvailabilityZoneT = Aws::String>
326 Volume& WithAvailabilityZone(AvailabilityZoneT&& value) {
327 SetAvailabilityZone(std::forward<AvailabilityZoneT>(value));
328 return *this;
329 }
331
333
336 inline VolumeState GetState() const { return m_state; }
337 inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
338 inline void SetState(VolumeState value) {
339 m_stateHasBeenSet = true;
340 m_state = value;
341 }
342 inline Volume& WithState(VolumeState value) {
343 SetState(value);
344 return *this;
345 }
347
349
352 inline const Aws::Utils::DateTime& GetCreateTime() const { return m_createTime; }
353 inline bool CreateTimeHasBeenSet() const { return m_createTimeHasBeenSet; }
354 template <typename CreateTimeT = Aws::Utils::DateTime>
355 void SetCreateTime(CreateTimeT&& value) {
356 m_createTimeHasBeenSet = true;
357 m_createTime = std::forward<CreateTimeT>(value);
358 }
359 template <typename CreateTimeT = Aws::Utils::DateTime>
360 Volume& WithCreateTime(CreateTimeT&& value) {
361 SetCreateTime(std::forward<CreateTimeT>(value));
362 return *this;
363 }
365
367
371 inline const Aws::Vector<VolumeAttachment>& GetAttachments() const { return m_attachments; }
372 inline bool AttachmentsHasBeenSet() const { return m_attachmentsHasBeenSet; }
373 template <typename AttachmentsT = Aws::Vector<VolumeAttachment>>
374 void SetAttachments(AttachmentsT&& value) {
375 m_attachmentsHasBeenSet = true;
376 m_attachments = std::forward<AttachmentsT>(value);
377 }
378 template <typename AttachmentsT = Aws::Vector<VolumeAttachment>>
379 Volume& WithAttachments(AttachmentsT&& value) {
380 SetAttachments(std::forward<AttachmentsT>(value));
381 return *this;
382 }
383 template <typename AttachmentsT = VolumeAttachment>
384 Volume& AddAttachments(AttachmentsT&& value) {
385 m_attachmentsHasBeenSet = true;
386 m_attachments.emplace_back(std::forward<AttachmentsT>(value));
387 return *this;
388 }
390
392
395 inline bool GetEncrypted() const { return m_encrypted; }
396 inline bool EncryptedHasBeenSet() const { return m_encryptedHasBeenSet; }
397 inline void SetEncrypted(bool value) {
398 m_encryptedHasBeenSet = true;
399 m_encrypted = value;
400 }
401 inline Volume& WithEncrypted(bool value) {
402 SetEncrypted(value);
403 return *this;
404 }
406
408
412 inline const Aws::String& GetKmsKeyId() const { return m_kmsKeyId; }
413 inline bool KmsKeyIdHasBeenSet() const { return m_kmsKeyIdHasBeenSet; }
414 template <typename KmsKeyIdT = Aws::String>
415 void SetKmsKeyId(KmsKeyIdT&& value) {
416 m_kmsKeyIdHasBeenSet = true;
417 m_kmsKeyId = std::forward<KmsKeyIdT>(value);
418 }
419 template <typename KmsKeyIdT = Aws::String>
420 Volume& WithKmsKeyId(KmsKeyIdT&& value) {
421 SetKmsKeyId(std::forward<KmsKeyIdT>(value));
422 return *this;
423 }
425
427
428 inline const ResponseMetadata& GetResponseMetadata() const { return m_responseMetadata; }
429 template <typename ResponseMetadataT = ResponseMetadata>
430 void SetResponseMetadata(ResponseMetadataT&& value) {
431 m_responseMetadataHasBeenSet = true;
432 m_responseMetadata = std::forward<ResponseMetadataT>(value);
433 }
434 template <typename ResponseMetadataT = ResponseMetadata>
435 Volume& WithResponseMetadata(ResponseMetadataT&& value) {
436 SetResponseMetadata(std::forward<ResponseMetadataT>(value));
437 return *this;
438 }
440 private:
441 Aws::String m_availabilityZoneId;
442
443 Aws::String m_outpostArn;
444
445 Aws::String m_sourceVolumeId;
446
447 int m_iops{0};
448
449 Aws::Vector<Tag> m_tags;
450
451 VolumeType m_volumeType{VolumeType::NOT_SET};
452
453 bool m_fastRestored{false};
454
455 bool m_multiAttachEnabled{false};
456
457 int m_throughput{0};
458
459 SSEType m_sseType{SSEType::NOT_SET};
460
461 OperatorResponse m_operator;
462
463 int m_volumeInitializationRate{0};
464
465 Aws::String m_volumeId;
466
467 int m_size{0};
468
469 Aws::String m_snapshotId;
470
471 Aws::String m_availabilityZone;
472
474
475 Aws::Utils::DateTime m_createTime{};
476
477 Aws::Vector<VolumeAttachment> m_attachments;
478
479 bool m_encrypted{false};
480
481 Aws::String m_kmsKeyId;
482
483 ResponseMetadata m_responseMetadata;
484 bool m_availabilityZoneIdHasBeenSet = false;
485 bool m_outpostArnHasBeenSet = false;
486 bool m_sourceVolumeIdHasBeenSet = false;
487 bool m_iopsHasBeenSet = false;
488 bool m_tagsHasBeenSet = false;
489 bool m_volumeTypeHasBeenSet = false;
490 bool m_fastRestoredHasBeenSet = false;
491 bool m_multiAttachEnabledHasBeenSet = false;
492 bool m_throughputHasBeenSet = false;
493 bool m_sseTypeHasBeenSet = false;
494 bool m_operatorHasBeenSet = false;
495 bool m_volumeInitializationRateHasBeenSet = false;
496 bool m_volumeIdHasBeenSet = false;
497 bool m_sizeHasBeenSet = false;
498 bool m_snapshotIdHasBeenSet = false;
499 bool m_availabilityZoneHasBeenSet = false;
500 bool m_stateHasBeenSet = false;
501 bool m_createTimeHasBeenSet = false;
502 bool m_attachmentsHasBeenSet = false;
503 bool m_encryptedHasBeenSet = false;
504 bool m_kmsKeyIdHasBeenSet = false;
505 bool m_responseMetadataHasBeenSet = true;
506};
507
508} // namespace Model
509} // namespace EC2
510} // namespace Aws
const Aws::Vector< Tag > & GetTags() const
Definition Volume.h:124
void SetAttachments(AttachmentsT &&value)
Definition Volume.h:374
void SetMultiAttachEnabled(bool value)
Definition Volume.h:183
void SetOperator(OperatorT &&value)
Definition Volume.h:233
Volume & WithTags(TagsT &&value)
Definition Volume.h:132
bool SseTypeHasBeenSet() const
Definition Volume.h:215
bool GetFastRestored() const
Definition Volume.h:165
void SetVolumeId(VolumeIdT &&value)
Definition Volume.h:269
Volume & WithAvailabilityZoneId(AvailabilityZoneIdT &&value)
Definition Volume.h:57
bool VolumeTypeHasBeenSet() const
Definition Volume.h:149
const Aws::String & GetSourceVolumeId() const
Definition Volume.h:86
void SetSnapshotId(SnapshotIdT &&value)
Definition Volume.h:303
void SetAvailabilityZoneId(AvailabilityZoneIdT &&value)
Definition Volume.h:52
void SetVolumeInitializationRate(int value)
Definition Volume.h:252
SSEType GetSseType() const
Definition Volume.h:214
Volume & WithOutpostArn(OutpostArnT &&value)
Definition Volume.h:75
Volume & WithOperator(OperatorT &&value)
Definition Volume.h:238
const Aws::String & GetKmsKeyId() const
Definition Volume.h:412
bool GetEncrypted() const
Definition Volume.h:395
bool MultiAttachEnabledHasBeenSet() const
Definition Volume.h:182
Volume & WithSnapshotId(SnapshotIdT &&value)
Definition Volume.h:308
Volume & WithThroughput(int value)
Definition Volume.h:203
Volume & AddAttachments(AttachmentsT &&value)
Definition Volume.h:384
void SetAvailabilityZone(AvailabilityZoneT &&value)
Definition Volume.h:321
bool AttachmentsHasBeenSet() const
Definition Volume.h:372
AWS_EC2_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
Volume & WithFastRestored(bool value)
Definition Volume.h:171
bool KmsKeyIdHasBeenSet() const
Definition Volume.h:413
Volume & AddTags(TagsT &&value)
Definition Volume.h:137
Volume & WithAttachments(AttachmentsT &&value)
Definition Volume.h:379
Volume & WithSize(int value)
Definition Volume.h:290
bool OperatorHasBeenSet() const
Definition Volume.h:231
bool VolumeIdHasBeenSet() const
Definition Volume.h:267
const Aws::Utils::DateTime & GetCreateTime() const
Definition Volume.h:352
Volume & WithIops(int value)
Definition Volume.h:114
int GetThroughput() const
Definition Volume.h:197
void SetFastRestored(bool value)
Definition Volume.h:167
int GetIops() const
Definition Volume.h:108
const Aws::String & GetSnapshotId() const
Definition Volume.h:300
AWS_EC2_API Volume()=default
const Aws::String & GetVolumeId() const
Definition Volume.h:266
const Aws::String & GetAvailabilityZoneId() const
Definition Volume.h:49
void SetSourceVolumeId(SourceVolumeIdT &&value)
Definition Volume.h:89
Volume & WithKmsKeyId(KmsKeyIdT &&value)
Definition Volume.h:420
Volume & WithState(VolumeState value)
Definition Volume.h:342
bool AvailabilityZoneHasBeenSet() const
Definition Volume.h:319
void SetSseType(SSEType value)
Definition Volume.h:216
int GetSize() const
Definition Volume.h:284
AWS_EC2_API Volume(const Aws::Utils::Xml::XmlNode &xmlNode)
AWS_EC2_API void OutputToStream(Aws::OStream &oStream, const char *location) const
void SetResponseMetadata(ResponseMetadataT &&value)
Definition Volume.h:430
Volume & WithMultiAttachEnabled(bool value)
Definition Volume.h:187
Volume & WithSourceVolumeId(SourceVolumeIdT &&value)
Definition Volume.h:94
void SetOutpostArn(OutpostArnT &&value)
Definition Volume.h:70
bool SizeHasBeenSet() const
Definition Volume.h:285
void SetState(VolumeState value)
Definition Volume.h:338
bool AvailabilityZoneIdHasBeenSet() const
Definition Volume.h:50
Volume & WithCreateTime(CreateTimeT &&value)
Definition Volume.h:360
const Aws::Vector< VolumeAttachment > & GetAttachments() const
Definition Volume.h:371
bool IopsHasBeenSet() const
Definition Volume.h:109
Volume & WithVolumeId(VolumeIdT &&value)
Definition Volume.h:274
const Aws::String & GetOutpostArn() const
Definition Volume.h:67
int GetVolumeInitializationRate() const
Definition Volume.h:250
bool SnapshotIdHasBeenSet() const
Definition Volume.h:301
bool StateHasBeenSet() const
Definition Volume.h:337
void SetCreateTime(CreateTimeT &&value)
Definition Volume.h:355
AWS_EC2_API Volume & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
bool FastRestoredHasBeenSet() const
Definition Volume.h:166
bool GetMultiAttachEnabled() const
Definition Volume.h:181
void SetThroughput(int value)
Definition Volume.h:199
Volume & WithVolumeType(VolumeType value)
Definition Volume.h:154
void SetTags(TagsT &&value)
Definition Volume.h:127
Volume & WithVolumeInitializationRate(int value)
Definition Volume.h:256
bool SourceVolumeIdHasBeenSet() const
Definition Volume.h:87
Volume & WithSseType(SSEType value)
Definition Volume.h:220
bool VolumeInitializationRateHasBeenSet() const
Definition Volume.h:251
void SetVolumeType(VolumeType value)
Definition Volume.h:150
VolumeType GetVolumeType() const
Definition Volume.h:148
bool EncryptedHasBeenSet() const
Definition Volume.h:396
const Aws::String & GetAvailabilityZone() const
Definition Volume.h:318
bool CreateTimeHasBeenSet() const
Definition Volume.h:353
void SetEncrypted(bool value)
Definition Volume.h:397
bool OutpostArnHasBeenSet() const
Definition Volume.h:68
bool ThroughputHasBeenSet() const
Definition Volume.h:198
void SetKmsKeyId(KmsKeyIdT &&value)
Definition Volume.h:415
void SetIops(int value)
Definition Volume.h:110
Volume & WithEncrypted(bool value)
Definition Volume.h:401
VolumeState GetState() const
Definition Volume.h:336
const OperatorResponse & GetOperator() const
Definition Volume.h:230
void SetSize(int value)
Definition Volume.h:286
bool TagsHasBeenSet() const
Definition Volume.h:125
Volume & WithAvailabilityZone(AvailabilityZoneT &&value)
Definition Volume.h:326
Volume & WithResponseMetadata(ResponseMetadataT &&value)
Definition Volume.h:435
const ResponseMetadata & GetResponseMetadata() const
Definition Volume.h:428
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::basic_ostream< char, std::char_traits< char > > OStream