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/memory/stl/AWSString.h>
10 #include <aws/ec2/model/InstanceHealthStatus.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Xml
18 {
19   class XmlNode;
20 } // namespace Xml
21 } // namespace Utils
22 namespace EC2
23 {
24 namespace Model
25 {
26 
27   /**
28    * <p>Describes a running instance in a Spot Fleet.</p><p><h3>See Also:</h3>   <a
29    * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ActiveInstance">AWS
30    * API Reference</a></p>
31    */
32   class AWS_EC2_API ActiveInstance
33   {
34   public:
35     ActiveInstance();
36     ActiveInstance(const Aws::Utils::Xml::XmlNode& xmlNode);
37     ActiveInstance& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
38 
39     void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
40     void OutputToStream(Aws::OStream& oStream, const char* location) const;
41 
42 
43     /**
44      * <p>The ID of the instance.</p>
45      */
GetInstanceId()46     inline const Aws::String& GetInstanceId() const{ return m_instanceId; }
47 
48     /**
49      * <p>The ID of the instance.</p>
50      */
InstanceIdHasBeenSet()51     inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
52 
53     /**
54      * <p>The ID of the instance.</p>
55      */
SetInstanceId(const Aws::String & value)56     inline void SetInstanceId(const Aws::String& value) { m_instanceIdHasBeenSet = true; m_instanceId = value; }
57 
58     /**
59      * <p>The ID of the instance.</p>
60      */
SetInstanceId(Aws::String && value)61     inline void SetInstanceId(Aws::String&& value) { m_instanceIdHasBeenSet = true; m_instanceId = std::move(value); }
62 
63     /**
64      * <p>The ID of the instance.</p>
65      */
SetInstanceId(const char * value)66     inline void SetInstanceId(const char* value) { m_instanceIdHasBeenSet = true; m_instanceId.assign(value); }
67 
68     /**
69      * <p>The ID of the instance.</p>
70      */
WithInstanceId(const Aws::String & value)71     inline ActiveInstance& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;}
72 
73     /**
74      * <p>The ID of the instance.</p>
75      */
WithInstanceId(Aws::String && value)76     inline ActiveInstance& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;}
77 
78     /**
79      * <p>The ID of the instance.</p>
80      */
WithInstanceId(const char * value)81     inline ActiveInstance& WithInstanceId(const char* value) { SetInstanceId(value); return *this;}
82 
83 
84     /**
85      * <p>The instance type.</p>
86      */
GetInstanceType()87     inline const Aws::String& GetInstanceType() const{ return m_instanceType; }
88 
89     /**
90      * <p>The instance type.</p>
91      */
InstanceTypeHasBeenSet()92     inline bool InstanceTypeHasBeenSet() const { return m_instanceTypeHasBeenSet; }
93 
94     /**
95      * <p>The instance type.</p>
96      */
SetInstanceType(const Aws::String & value)97     inline void SetInstanceType(const Aws::String& value) { m_instanceTypeHasBeenSet = true; m_instanceType = value; }
98 
99     /**
100      * <p>The instance type.</p>
101      */
SetInstanceType(Aws::String && value)102     inline void SetInstanceType(Aws::String&& value) { m_instanceTypeHasBeenSet = true; m_instanceType = std::move(value); }
103 
104     /**
105      * <p>The instance type.</p>
106      */
SetInstanceType(const char * value)107     inline void SetInstanceType(const char* value) { m_instanceTypeHasBeenSet = true; m_instanceType.assign(value); }
108 
109     /**
110      * <p>The instance type.</p>
111      */
WithInstanceType(const Aws::String & value)112     inline ActiveInstance& WithInstanceType(const Aws::String& value) { SetInstanceType(value); return *this;}
113 
114     /**
115      * <p>The instance type.</p>
116      */
WithInstanceType(Aws::String && value)117     inline ActiveInstance& WithInstanceType(Aws::String&& value) { SetInstanceType(std::move(value)); return *this;}
118 
119     /**
120      * <p>The instance type.</p>
121      */
WithInstanceType(const char * value)122     inline ActiveInstance& WithInstanceType(const char* value) { SetInstanceType(value); return *this;}
123 
124 
125     /**
126      * <p>The ID of the Spot Instance request.</p>
127      */
GetSpotInstanceRequestId()128     inline const Aws::String& GetSpotInstanceRequestId() const{ return m_spotInstanceRequestId; }
129 
130     /**
131      * <p>The ID of the Spot Instance request.</p>
132      */
SpotInstanceRequestIdHasBeenSet()133     inline bool SpotInstanceRequestIdHasBeenSet() const { return m_spotInstanceRequestIdHasBeenSet; }
134 
135     /**
136      * <p>The ID of the Spot Instance request.</p>
137      */
SetSpotInstanceRequestId(const Aws::String & value)138     inline void SetSpotInstanceRequestId(const Aws::String& value) { m_spotInstanceRequestIdHasBeenSet = true; m_spotInstanceRequestId = value; }
139 
140     /**
141      * <p>The ID of the Spot Instance request.</p>
142      */
SetSpotInstanceRequestId(Aws::String && value)143     inline void SetSpotInstanceRequestId(Aws::String&& value) { m_spotInstanceRequestIdHasBeenSet = true; m_spotInstanceRequestId = std::move(value); }
144 
145     /**
146      * <p>The ID of the Spot Instance request.</p>
147      */
SetSpotInstanceRequestId(const char * value)148     inline void SetSpotInstanceRequestId(const char* value) { m_spotInstanceRequestIdHasBeenSet = true; m_spotInstanceRequestId.assign(value); }
149 
150     /**
151      * <p>The ID of the Spot Instance request.</p>
152      */
WithSpotInstanceRequestId(const Aws::String & value)153     inline ActiveInstance& WithSpotInstanceRequestId(const Aws::String& value) { SetSpotInstanceRequestId(value); return *this;}
154 
155     /**
156      * <p>The ID of the Spot Instance request.</p>
157      */
WithSpotInstanceRequestId(Aws::String && value)158     inline ActiveInstance& WithSpotInstanceRequestId(Aws::String&& value) { SetSpotInstanceRequestId(std::move(value)); return *this;}
159 
160     /**
161      * <p>The ID of the Spot Instance request.</p>
162      */
WithSpotInstanceRequestId(const char * value)163     inline ActiveInstance& WithSpotInstanceRequestId(const char* value) { SetSpotInstanceRequestId(value); return *this;}
164 
165 
166     /**
167      * <p>The health status of the instance. If the status of either the instance
168      * status check or the system status check is <code>impaired</code>, the health
169      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
170      * is <code>healthy</code>.</p>
171      */
GetInstanceHealth()172     inline const InstanceHealthStatus& GetInstanceHealth() const{ return m_instanceHealth; }
173 
174     /**
175      * <p>The health status of the instance. If the status of either the instance
176      * status check or the system status check is <code>impaired</code>, the health
177      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
178      * is <code>healthy</code>.</p>
179      */
InstanceHealthHasBeenSet()180     inline bool InstanceHealthHasBeenSet() const { return m_instanceHealthHasBeenSet; }
181 
182     /**
183      * <p>The health status of the instance. If the status of either the instance
184      * status check or the system status check is <code>impaired</code>, the health
185      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
186      * is <code>healthy</code>.</p>
187      */
SetInstanceHealth(const InstanceHealthStatus & value)188     inline void SetInstanceHealth(const InstanceHealthStatus& value) { m_instanceHealthHasBeenSet = true; m_instanceHealth = value; }
189 
190     /**
191      * <p>The health status of the instance. If the status of either the instance
192      * status check or the system status check is <code>impaired</code>, the health
193      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
194      * is <code>healthy</code>.</p>
195      */
SetInstanceHealth(InstanceHealthStatus && value)196     inline void SetInstanceHealth(InstanceHealthStatus&& value) { m_instanceHealthHasBeenSet = true; m_instanceHealth = std::move(value); }
197 
198     /**
199      * <p>The health status of the instance. If the status of either the instance
200      * status check or the system status check is <code>impaired</code>, the health
201      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
202      * is <code>healthy</code>.</p>
203      */
WithInstanceHealth(const InstanceHealthStatus & value)204     inline ActiveInstance& WithInstanceHealth(const InstanceHealthStatus& value) { SetInstanceHealth(value); return *this;}
205 
206     /**
207      * <p>The health status of the instance. If the status of either the instance
208      * status check or the system status check is <code>impaired</code>, the health
209      * status of the instance is <code>unhealthy</code>. Otherwise, the health status
210      * is <code>healthy</code>.</p>
211      */
WithInstanceHealth(InstanceHealthStatus && value)212     inline ActiveInstance& WithInstanceHealth(InstanceHealthStatus&& value) { SetInstanceHealth(std::move(value)); return *this;}
213 
214   private:
215 
216     Aws::String m_instanceId;
217     bool m_instanceIdHasBeenSet;
218 
219     Aws::String m_instanceType;
220     bool m_instanceTypeHasBeenSet;
221 
222     Aws::String m_spotInstanceRequestId;
223     bool m_spotInstanceRequestIdHasBeenSet;
224 
225     InstanceHealthStatus m_instanceHealth;
226     bool m_instanceHealthHasBeenSet;
227   };
228 
229 } // namespace Model
230 } // namespace EC2
231 } // namespace Aws
232