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/codedeploy/CodeDeploy_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/codedeploy/model/TargetStatus.h>
10 #include <aws/core/utils/DateTime.h>
11 #include <aws/core/utils/memory/stl/AWSVector.h>
12 #include <aws/codedeploy/model/TargetLabel.h>
13 #include <aws/codedeploy/model/LifecycleEvent.h>
14 #include <utility>
15 
16 namespace Aws
17 {
18 namespace Utils
19 {
20 namespace Json
21 {
22   class JsonValue;
23   class JsonView;
24 } // namespace Json
25 } // namespace Utils
26 namespace CodeDeploy
27 {
28 namespace Model
29 {
30 
31   /**
32    * <p> A target Amazon EC2 or on-premises instance during a deployment that uses
33    * the EC2/On-premises compute platform. </p><p><h3>See Also:</h3>   <a
34    * href="http://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/InstanceTarget">AWS
35    * API Reference</a></p>
36    */
37   class AWS_CODEDEPLOY_API InstanceTarget
38   {
39   public:
40     InstanceTarget();
41     InstanceTarget(Aws::Utils::Json::JsonView jsonValue);
42     InstanceTarget& operator=(Aws::Utils::Json::JsonView jsonValue);
43     Aws::Utils::Json::JsonValue Jsonize() const;
44 
45 
46     /**
47      * <p> The unique ID of a deployment. </p>
48      */
GetDeploymentId()49     inline const Aws::String& GetDeploymentId() const{ return m_deploymentId; }
50 
51     /**
52      * <p> The unique ID of a deployment. </p>
53      */
DeploymentIdHasBeenSet()54     inline bool DeploymentIdHasBeenSet() const { return m_deploymentIdHasBeenSet; }
55 
56     /**
57      * <p> The unique ID of a deployment. </p>
58      */
SetDeploymentId(const Aws::String & value)59     inline void SetDeploymentId(const Aws::String& value) { m_deploymentIdHasBeenSet = true; m_deploymentId = value; }
60 
61     /**
62      * <p> The unique ID of a deployment. </p>
63      */
SetDeploymentId(Aws::String && value)64     inline void SetDeploymentId(Aws::String&& value) { m_deploymentIdHasBeenSet = true; m_deploymentId = std::move(value); }
65 
66     /**
67      * <p> The unique ID of a deployment. </p>
68      */
SetDeploymentId(const char * value)69     inline void SetDeploymentId(const char* value) { m_deploymentIdHasBeenSet = true; m_deploymentId.assign(value); }
70 
71     /**
72      * <p> The unique ID of a deployment. </p>
73      */
WithDeploymentId(const Aws::String & value)74     inline InstanceTarget& WithDeploymentId(const Aws::String& value) { SetDeploymentId(value); return *this;}
75 
76     /**
77      * <p> The unique ID of a deployment. </p>
78      */
WithDeploymentId(Aws::String && value)79     inline InstanceTarget& WithDeploymentId(Aws::String&& value) { SetDeploymentId(std::move(value)); return *this;}
80 
81     /**
82      * <p> The unique ID of a deployment. </p>
83      */
WithDeploymentId(const char * value)84     inline InstanceTarget& WithDeploymentId(const char* value) { SetDeploymentId(value); return *this;}
85 
86 
87     /**
88      * <p> The unique ID of a deployment target that has a type of
89      * <code>instanceTarget</code>. </p>
90      */
GetTargetId()91     inline const Aws::String& GetTargetId() const{ return m_targetId; }
92 
93     /**
94      * <p> The unique ID of a deployment target that has a type of
95      * <code>instanceTarget</code>. </p>
96      */
TargetIdHasBeenSet()97     inline bool TargetIdHasBeenSet() const { return m_targetIdHasBeenSet; }
98 
99     /**
100      * <p> The unique ID of a deployment target that has a type of
101      * <code>instanceTarget</code>. </p>
102      */
SetTargetId(const Aws::String & value)103     inline void SetTargetId(const Aws::String& value) { m_targetIdHasBeenSet = true; m_targetId = value; }
104 
105     /**
106      * <p> The unique ID of a deployment target that has a type of
107      * <code>instanceTarget</code>. </p>
108      */
SetTargetId(Aws::String && value)109     inline void SetTargetId(Aws::String&& value) { m_targetIdHasBeenSet = true; m_targetId = std::move(value); }
110 
111     /**
112      * <p> The unique ID of a deployment target that has a type of
113      * <code>instanceTarget</code>. </p>
114      */
SetTargetId(const char * value)115     inline void SetTargetId(const char* value) { m_targetIdHasBeenSet = true; m_targetId.assign(value); }
116 
117     /**
118      * <p> The unique ID of a deployment target that has a type of
119      * <code>instanceTarget</code>. </p>
120      */
WithTargetId(const Aws::String & value)121     inline InstanceTarget& WithTargetId(const Aws::String& value) { SetTargetId(value); return *this;}
122 
123     /**
124      * <p> The unique ID of a deployment target that has a type of
125      * <code>instanceTarget</code>. </p>
126      */
WithTargetId(Aws::String && value)127     inline InstanceTarget& WithTargetId(Aws::String&& value) { SetTargetId(std::move(value)); return *this;}
128 
129     /**
130      * <p> The unique ID of a deployment target that has a type of
131      * <code>instanceTarget</code>. </p>
132      */
WithTargetId(const char * value)133     inline InstanceTarget& WithTargetId(const char* value) { SetTargetId(value); return *this;}
134 
135 
136     /**
137      * <p> The Amazon Resource Name (ARN) of the target. </p>
138      */
GetTargetArn()139     inline const Aws::String& GetTargetArn() const{ return m_targetArn; }
140 
141     /**
142      * <p> The Amazon Resource Name (ARN) of the target. </p>
143      */
TargetArnHasBeenSet()144     inline bool TargetArnHasBeenSet() const { return m_targetArnHasBeenSet; }
145 
146     /**
147      * <p> The Amazon Resource Name (ARN) of the target. </p>
148      */
SetTargetArn(const Aws::String & value)149     inline void SetTargetArn(const Aws::String& value) { m_targetArnHasBeenSet = true; m_targetArn = value; }
150 
151     /**
152      * <p> The Amazon Resource Name (ARN) of the target. </p>
153      */
SetTargetArn(Aws::String && value)154     inline void SetTargetArn(Aws::String&& value) { m_targetArnHasBeenSet = true; m_targetArn = std::move(value); }
155 
156     /**
157      * <p> The Amazon Resource Name (ARN) of the target. </p>
158      */
SetTargetArn(const char * value)159     inline void SetTargetArn(const char* value) { m_targetArnHasBeenSet = true; m_targetArn.assign(value); }
160 
161     /**
162      * <p> The Amazon Resource Name (ARN) of the target. </p>
163      */
WithTargetArn(const Aws::String & value)164     inline InstanceTarget& WithTargetArn(const Aws::String& value) { SetTargetArn(value); return *this;}
165 
166     /**
167      * <p> The Amazon Resource Name (ARN) of the target. </p>
168      */
WithTargetArn(Aws::String && value)169     inline InstanceTarget& WithTargetArn(Aws::String&& value) { SetTargetArn(std::move(value)); return *this;}
170 
171     /**
172      * <p> The Amazon Resource Name (ARN) of the target. </p>
173      */
WithTargetArn(const char * value)174     inline InstanceTarget& WithTargetArn(const char* value) { SetTargetArn(value); return *this;}
175 
176 
177     /**
178      * <p> The status an EC2/On-premises deployment's target instance. </p>
179      */
GetStatus()180     inline const TargetStatus& GetStatus() const{ return m_status; }
181 
182     /**
183      * <p> The status an EC2/On-premises deployment's target instance. </p>
184      */
StatusHasBeenSet()185     inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; }
186 
187     /**
188      * <p> The status an EC2/On-premises deployment's target instance. </p>
189      */
SetStatus(const TargetStatus & value)190     inline void SetStatus(const TargetStatus& value) { m_statusHasBeenSet = true; m_status = value; }
191 
192     /**
193      * <p> The status an EC2/On-premises deployment's target instance. </p>
194      */
SetStatus(TargetStatus && value)195     inline void SetStatus(TargetStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
196 
197     /**
198      * <p> The status an EC2/On-premises deployment's target instance. </p>
199      */
WithStatus(const TargetStatus & value)200     inline InstanceTarget& WithStatus(const TargetStatus& value) { SetStatus(value); return *this;}
201 
202     /**
203      * <p> The status an EC2/On-premises deployment's target instance. </p>
204      */
WithStatus(TargetStatus && value)205     inline InstanceTarget& WithStatus(TargetStatus&& value) { SetStatus(std::move(value)); return *this;}
206 
207 
208     /**
209      * <p> The date and time when the target instance was updated by a deployment. </p>
210      */
GetLastUpdatedAt()211     inline const Aws::Utils::DateTime& GetLastUpdatedAt() const{ return m_lastUpdatedAt; }
212 
213     /**
214      * <p> The date and time when the target instance was updated by a deployment. </p>
215      */
LastUpdatedAtHasBeenSet()216     inline bool LastUpdatedAtHasBeenSet() const { return m_lastUpdatedAtHasBeenSet; }
217 
218     /**
219      * <p> The date and time when the target instance was updated by a deployment. </p>
220      */
SetLastUpdatedAt(const Aws::Utils::DateTime & value)221     inline void SetLastUpdatedAt(const Aws::Utils::DateTime& value) { m_lastUpdatedAtHasBeenSet = true; m_lastUpdatedAt = value; }
222 
223     /**
224      * <p> The date and time when the target instance was updated by a deployment. </p>
225      */
SetLastUpdatedAt(Aws::Utils::DateTime && value)226     inline void SetLastUpdatedAt(Aws::Utils::DateTime&& value) { m_lastUpdatedAtHasBeenSet = true; m_lastUpdatedAt = std::move(value); }
227 
228     /**
229      * <p> The date and time when the target instance was updated by a deployment. </p>
230      */
WithLastUpdatedAt(const Aws::Utils::DateTime & value)231     inline InstanceTarget& WithLastUpdatedAt(const Aws::Utils::DateTime& value) { SetLastUpdatedAt(value); return *this;}
232 
233     /**
234      * <p> The date and time when the target instance was updated by a deployment. </p>
235      */
WithLastUpdatedAt(Aws::Utils::DateTime && value)236     inline InstanceTarget& WithLastUpdatedAt(Aws::Utils::DateTime&& value) { SetLastUpdatedAt(std::move(value)); return *this;}
237 
238 
239     /**
240      * <p> The lifecycle events of the deployment to this target instance. </p>
241      */
GetLifecycleEvents()242     inline const Aws::Vector<LifecycleEvent>& GetLifecycleEvents() const{ return m_lifecycleEvents; }
243 
244     /**
245      * <p> The lifecycle events of the deployment to this target instance. </p>
246      */
LifecycleEventsHasBeenSet()247     inline bool LifecycleEventsHasBeenSet() const { return m_lifecycleEventsHasBeenSet; }
248 
249     /**
250      * <p> The lifecycle events of the deployment to this target instance. </p>
251      */
SetLifecycleEvents(const Aws::Vector<LifecycleEvent> & value)252     inline void SetLifecycleEvents(const Aws::Vector<LifecycleEvent>& value) { m_lifecycleEventsHasBeenSet = true; m_lifecycleEvents = value; }
253 
254     /**
255      * <p> The lifecycle events of the deployment to this target instance. </p>
256      */
SetLifecycleEvents(Aws::Vector<LifecycleEvent> && value)257     inline void SetLifecycleEvents(Aws::Vector<LifecycleEvent>&& value) { m_lifecycleEventsHasBeenSet = true; m_lifecycleEvents = std::move(value); }
258 
259     /**
260      * <p> The lifecycle events of the deployment to this target instance. </p>
261      */
WithLifecycleEvents(const Aws::Vector<LifecycleEvent> & value)262     inline InstanceTarget& WithLifecycleEvents(const Aws::Vector<LifecycleEvent>& value) { SetLifecycleEvents(value); return *this;}
263 
264     /**
265      * <p> The lifecycle events of the deployment to this target instance. </p>
266      */
WithLifecycleEvents(Aws::Vector<LifecycleEvent> && value)267     inline InstanceTarget& WithLifecycleEvents(Aws::Vector<LifecycleEvent>&& value) { SetLifecycleEvents(std::move(value)); return *this;}
268 
269     /**
270      * <p> The lifecycle events of the deployment to this target instance. </p>
271      */
AddLifecycleEvents(const LifecycleEvent & value)272     inline InstanceTarget& AddLifecycleEvents(const LifecycleEvent& value) { m_lifecycleEventsHasBeenSet = true; m_lifecycleEvents.push_back(value); return *this; }
273 
274     /**
275      * <p> The lifecycle events of the deployment to this target instance. </p>
276      */
AddLifecycleEvents(LifecycleEvent && value)277     inline InstanceTarget& AddLifecycleEvents(LifecycleEvent&& value) { m_lifecycleEventsHasBeenSet = true; m_lifecycleEvents.push_back(std::move(value)); return *this; }
278 
279 
280     /**
281      * <p> A label that identifies whether the instance is an original target
282      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
283      */
GetInstanceLabel()284     inline const TargetLabel& GetInstanceLabel() const{ return m_instanceLabel; }
285 
286     /**
287      * <p> A label that identifies whether the instance is an original target
288      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
289      */
InstanceLabelHasBeenSet()290     inline bool InstanceLabelHasBeenSet() const { return m_instanceLabelHasBeenSet; }
291 
292     /**
293      * <p> A label that identifies whether the instance is an original target
294      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
295      */
SetInstanceLabel(const TargetLabel & value)296     inline void SetInstanceLabel(const TargetLabel& value) { m_instanceLabelHasBeenSet = true; m_instanceLabel = value; }
297 
298     /**
299      * <p> A label that identifies whether the instance is an original target
300      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
301      */
SetInstanceLabel(TargetLabel && value)302     inline void SetInstanceLabel(TargetLabel&& value) { m_instanceLabelHasBeenSet = true; m_instanceLabel = std::move(value); }
303 
304     /**
305      * <p> A label that identifies whether the instance is an original target
306      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
307      */
WithInstanceLabel(const TargetLabel & value)308     inline InstanceTarget& WithInstanceLabel(const TargetLabel& value) { SetInstanceLabel(value); return *this;}
309 
310     /**
311      * <p> A label that identifies whether the instance is an original target
312      * (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
313      */
WithInstanceLabel(TargetLabel && value)314     inline InstanceTarget& WithInstanceLabel(TargetLabel&& value) { SetInstanceLabel(std::move(value)); return *this;}
315 
316   private:
317 
318     Aws::String m_deploymentId;
319     bool m_deploymentIdHasBeenSet;
320 
321     Aws::String m_targetId;
322     bool m_targetIdHasBeenSet;
323 
324     Aws::String m_targetArn;
325     bool m_targetArnHasBeenSet;
326 
327     TargetStatus m_status;
328     bool m_statusHasBeenSet;
329 
330     Aws::Utils::DateTime m_lastUpdatedAt;
331     bool m_lastUpdatedAtHasBeenSet;
332 
333     Aws::Vector<LifecycleEvent> m_lifecycleEvents;
334     bool m_lifecycleEventsHasBeenSet;
335 
336     TargetLabel m_instanceLabel;
337     bool m_instanceLabelHasBeenSet;
338   };
339 
340 } // namespace Model
341 } // namespace CodeDeploy
342 } // namespace Aws
343