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/ec2/EC2_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h>
9 #include <aws/core/utils/DateTime.h>
10 #include <aws/ec2/model/AttachmentStatus.h>
11 #include <aws/core/utils/memory/stl/AWSString.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Xml
19 {
20   class XmlNode;
21 } // namespace Xml
22 } // namespace Utils
23 namespace EC2
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>Describes a parameter used to set up an EBS volume in a block device
30    * mapping.</p><p><h3>See Also:</h3>   <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsInstanceBlockDevice">AWS
32    * API Reference</a></p>
33    */
34   class AWS_EC2_API EbsInstanceBlockDevice
35   {
36   public:
37     EbsInstanceBlockDevice();
38     EbsInstanceBlockDevice(const Aws::Utils::Xml::XmlNode& xmlNode);
39     EbsInstanceBlockDevice& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
40 
41     void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
42     void OutputToStream(Aws::OStream& oStream, const char* location) const;
43 
44 
45     /**
46      * <p>The time stamp when the attachment initiated.</p>
47      */
GetAttachTime()48     inline const Aws::Utils::DateTime& GetAttachTime() const{ return m_attachTime; }
49 
50     /**
51      * <p>The time stamp when the attachment initiated.</p>
52      */
AttachTimeHasBeenSet()53     inline bool AttachTimeHasBeenSet() const { return m_attachTimeHasBeenSet; }
54 
55     /**
56      * <p>The time stamp when the attachment initiated.</p>
57      */
SetAttachTime(const Aws::Utils::DateTime & value)58     inline void SetAttachTime(const Aws::Utils::DateTime& value) { m_attachTimeHasBeenSet = true; m_attachTime = value; }
59 
60     /**
61      * <p>The time stamp when the attachment initiated.</p>
62      */
SetAttachTime(Aws::Utils::DateTime && value)63     inline void SetAttachTime(Aws::Utils::DateTime&& value) { m_attachTimeHasBeenSet = true; m_attachTime = std::move(value); }
64 
65     /**
66      * <p>The time stamp when the attachment initiated.</p>
67      */
WithAttachTime(const Aws::Utils::DateTime & value)68     inline EbsInstanceBlockDevice& WithAttachTime(const Aws::Utils::DateTime& value) { SetAttachTime(value); return *this;}
69 
70     /**
71      * <p>The time stamp when the attachment initiated.</p>
72      */
WithAttachTime(Aws::Utils::DateTime && value)73     inline EbsInstanceBlockDevice& WithAttachTime(Aws::Utils::DateTime&& value) { SetAttachTime(std::move(value)); return *this;}
74 
75 
76     /**
77      * <p>Indicates whether the volume is deleted on instance termination.</p>
78      */
GetDeleteOnTermination()79     inline bool GetDeleteOnTermination() const{ return m_deleteOnTermination; }
80 
81     /**
82      * <p>Indicates whether the volume is deleted on instance termination.</p>
83      */
DeleteOnTerminationHasBeenSet()84     inline bool DeleteOnTerminationHasBeenSet() const { return m_deleteOnTerminationHasBeenSet; }
85 
86     /**
87      * <p>Indicates whether the volume is deleted on instance termination.</p>
88      */
SetDeleteOnTermination(bool value)89     inline void SetDeleteOnTermination(bool value) { m_deleteOnTerminationHasBeenSet = true; m_deleteOnTermination = value; }
90 
91     /**
92      * <p>Indicates whether the volume is deleted on instance termination.</p>
93      */
WithDeleteOnTermination(bool value)94     inline EbsInstanceBlockDevice& WithDeleteOnTermination(bool value) { SetDeleteOnTermination(value); return *this;}
95 
96 
97     /**
98      * <p>The attachment state.</p>
99      */
GetStatus()100     inline const AttachmentStatus& GetStatus() const{ return m_status; }
101 
102     /**
103      * <p>The attachment state.</p>
104      */
StatusHasBeenSet()105     inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }
106 
107     /**
108      * <p>The attachment state.</p>
109      */
SetStatus(const AttachmentStatus & value)110     inline void SetStatus(const AttachmentStatus& value) { m_statusHasBeenSet = true; m_status = value; }
111 
112     /**
113      * <p>The attachment state.</p>
114      */
SetStatus(AttachmentStatus && value)115     inline void SetStatus(AttachmentStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
116 
117     /**
118      * <p>The attachment state.</p>
119      */
WithStatus(const AttachmentStatus & value)120     inline EbsInstanceBlockDevice& WithStatus(const AttachmentStatus& value) { SetStatus(value); return *this;}
121 
122     /**
123      * <p>The attachment state.</p>
124      */
WithStatus(AttachmentStatus && value)125     inline EbsInstanceBlockDevice& WithStatus(AttachmentStatus&& value) { SetStatus(std::move(value)); return *this;}
126 
127 
128     /**
129      * <p>The ID of the EBS volume.</p>
130      */
GetVolumeId()131     inline const Aws::String& GetVolumeId() const{ return m_volumeId; }
132 
133     /**
134      * <p>The ID of the EBS volume.</p>
135      */
VolumeIdHasBeenSet()136     inline bool VolumeIdHasBeenSet() const { return m_volumeIdHasBeenSet; }
137 
138     /**
139      * <p>The ID of the EBS volume.</p>
140      */
SetVolumeId(const Aws::String & value)141     inline void SetVolumeId(const Aws::String& value) { m_volumeIdHasBeenSet = true; m_volumeId = value; }
142 
143     /**
144      * <p>The ID of the EBS volume.</p>
145      */
SetVolumeId(Aws::String && value)146     inline void SetVolumeId(Aws::String&& value) { m_volumeIdHasBeenSet = true; m_volumeId = std::move(value); }
147 
148     /**
149      * <p>The ID of the EBS volume.</p>
150      */
SetVolumeId(const char * value)151     inline void SetVolumeId(const char* value) { m_volumeIdHasBeenSet = true; m_volumeId.assign(value); }
152 
153     /**
154      * <p>The ID of the EBS volume.</p>
155      */
WithVolumeId(const Aws::String & value)156     inline EbsInstanceBlockDevice& WithVolumeId(const Aws::String& value) { SetVolumeId(value); return *this;}
157 
158     /**
159      * <p>The ID of the EBS volume.</p>
160      */
WithVolumeId(Aws::String && value)161     inline EbsInstanceBlockDevice& WithVolumeId(Aws::String&& value) { SetVolumeId(std::move(value)); return *this;}
162 
163     /**
164      * <p>The ID of the EBS volume.</p>
165      */
WithVolumeId(const char * value)166     inline EbsInstanceBlockDevice& WithVolumeId(const char* value) { SetVolumeId(value); return *this;}
167 
168   private:
169 
170     Aws::Utils::DateTime m_attachTime;
171     bool m_attachTimeHasBeenSet;
172 
173     bool m_deleteOnTermination;
174     bool m_deleteOnTerminationHasBeenSet;
175 
176     AttachmentStatus m_status;
177     bool m_statusHasBeenSet;
178 
179     Aws::String m_volumeId;
180     bool m_volumeIdHasBeenSet;
181   };
182 
183 } // namespace Model
184 } // namespace EC2
185 } // namespace Aws
186