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/ec2/EC2Request.h>
9 #include <aws/ec2/model/Affinity.h>
10 #include <aws/core/utils/memory/stl/AWSString.h>
11 #include <aws/ec2/model/HostTenancy.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace EC2
17 {
18 namespace Model
19 {
20 
21   /**
22    */
23   class AWS_EC2_API ModifyInstancePlacementRequest : public EC2Request
24   {
25   public:
26     ModifyInstancePlacementRequest();
27 
28     // Service request name is the Operation name which will send this request out,
29     // each operation should has unique request name, so that we can get operation's name from this request.
30     // Note: this is not true for response, multiple operations may have the same response name,
31     // so we can not get operation's name from response.
GetServiceRequestName()32     inline virtual const char* GetServiceRequestName() const override { return "ModifyInstancePlacement"; }
33 
34     Aws::String SerializePayload() const override;
35 
36   protected:
37     void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
38 
39   public:
40 
41     /**
42      * <p>The affinity setting for the instance.</p>
43      */
GetAffinity()44     inline const Affinity& GetAffinity() const{ return m_affinity; }
45 
46     /**
47      * <p>The affinity setting for the instance.</p>
48      */
AffinityHasBeenSet()49     inline bool AffinityHasBeenSet() const { return m_affinityHasBeenSet; }
50 
51     /**
52      * <p>The affinity setting for the instance.</p>
53      */
SetAffinity(const Affinity & value)54     inline void SetAffinity(const Affinity& value) { m_affinityHasBeenSet = true; m_affinity = value; }
55 
56     /**
57      * <p>The affinity setting for the instance.</p>
58      */
SetAffinity(Affinity && value)59     inline void SetAffinity(Affinity&& value) { m_affinityHasBeenSet = true; m_affinity = std::move(value); }
60 
61     /**
62      * <p>The affinity setting for the instance.</p>
63      */
WithAffinity(const Affinity & value)64     inline ModifyInstancePlacementRequest& WithAffinity(const Affinity& value) { SetAffinity(value); return *this;}
65 
66     /**
67      * <p>The affinity setting for the instance.</p>
68      */
WithAffinity(Affinity && value)69     inline ModifyInstancePlacementRequest& WithAffinity(Affinity&& value) { SetAffinity(std::move(value)); return *this;}
70 
71 
72     /**
73      * <p>The name of the placement group in which to place the instance. For spread
74      * placement groups, the instance must have a tenancy of <code>default</code>. For
75      * cluster and partition placement groups, the instance must have a tenancy of
76      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
77      * from a placement group, specify an empty string ("").</p>
78      */
GetGroupName()79     inline const Aws::String& GetGroupName() const{ return m_groupName; }
80 
81     /**
82      * <p>The name of the placement group in which to place the instance. For spread
83      * placement groups, the instance must have a tenancy of <code>default</code>. For
84      * cluster and partition placement groups, the instance must have a tenancy of
85      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
86      * from a placement group, specify an empty string ("").</p>
87      */
GroupNameHasBeenSet()88     inline bool GroupNameHasBeenSet() const { return m_groupNameHasBeenSet; }
89 
90     /**
91      * <p>The name of the placement group in which to place the instance. For spread
92      * placement groups, the instance must have a tenancy of <code>default</code>. For
93      * cluster and partition placement groups, the instance must have a tenancy of
94      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
95      * from a placement group, specify an empty string ("").</p>
96      */
SetGroupName(const Aws::String & value)97     inline void SetGroupName(const Aws::String& value) { m_groupNameHasBeenSet = true; m_groupName = value; }
98 
99     /**
100      * <p>The name of the placement group in which to place the instance. For spread
101      * placement groups, the instance must have a tenancy of <code>default</code>. For
102      * cluster and partition placement groups, the instance must have a tenancy of
103      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
104      * from a placement group, specify an empty string ("").</p>
105      */
SetGroupName(Aws::String && value)106     inline void SetGroupName(Aws::String&& value) { m_groupNameHasBeenSet = true; m_groupName = std::move(value); }
107 
108     /**
109      * <p>The name of the placement group in which to place the instance. For spread
110      * placement groups, the instance must have a tenancy of <code>default</code>. For
111      * cluster and partition placement groups, the instance must have a tenancy of
112      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
113      * from a placement group, specify an empty string ("").</p>
114      */
SetGroupName(const char * value)115     inline void SetGroupName(const char* value) { m_groupNameHasBeenSet = true; m_groupName.assign(value); }
116 
117     /**
118      * <p>The name of the placement group in which to place the instance. For spread
119      * placement groups, the instance must have a tenancy of <code>default</code>. For
120      * cluster and partition placement groups, the instance must have a tenancy of
121      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
122      * from a placement group, specify an empty string ("").</p>
123      */
WithGroupName(const Aws::String & value)124     inline ModifyInstancePlacementRequest& WithGroupName(const Aws::String& value) { SetGroupName(value); return *this;}
125 
126     /**
127      * <p>The name of the placement group in which to place the instance. For spread
128      * placement groups, the instance must have a tenancy of <code>default</code>. For
129      * cluster and partition placement groups, the instance must have a tenancy of
130      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
131      * from a placement group, specify an empty string ("").</p>
132      */
WithGroupName(Aws::String && value)133     inline ModifyInstancePlacementRequest& WithGroupName(Aws::String&& value) { SetGroupName(std::move(value)); return *this;}
134 
135     /**
136      * <p>The name of the placement group in which to place the instance. For spread
137      * placement groups, the instance must have a tenancy of <code>default</code>. For
138      * cluster and partition placement groups, the instance must have a tenancy of
139      * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
140      * from a placement group, specify an empty string ("").</p>
141      */
WithGroupName(const char * value)142     inline ModifyInstancePlacementRequest& WithGroupName(const char* value) { SetGroupName(value); return *this;}
143 
144 
145     /**
146      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
147      */
GetHostId()148     inline const Aws::String& GetHostId() const{ return m_hostId; }
149 
150     /**
151      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
152      */
HostIdHasBeenSet()153     inline bool HostIdHasBeenSet() const { return m_hostIdHasBeenSet; }
154 
155     /**
156      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
157      */
SetHostId(const Aws::String & value)158     inline void SetHostId(const Aws::String& value) { m_hostIdHasBeenSet = true; m_hostId = value; }
159 
160     /**
161      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
162      */
SetHostId(Aws::String && value)163     inline void SetHostId(Aws::String&& value) { m_hostIdHasBeenSet = true; m_hostId = std::move(value); }
164 
165     /**
166      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
167      */
SetHostId(const char * value)168     inline void SetHostId(const char* value) { m_hostIdHasBeenSet = true; m_hostId.assign(value); }
169 
170     /**
171      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
172      */
WithHostId(const Aws::String & value)173     inline ModifyInstancePlacementRequest& WithHostId(const Aws::String& value) { SetHostId(value); return *this;}
174 
175     /**
176      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
177      */
WithHostId(Aws::String && value)178     inline ModifyInstancePlacementRequest& WithHostId(Aws::String&& value) { SetHostId(std::move(value)); return *this;}
179 
180     /**
181      * <p>The ID of the Dedicated Host with which to associate the instance.</p>
182      */
WithHostId(const char * value)183     inline ModifyInstancePlacementRequest& WithHostId(const char* value) { SetHostId(value); return *this;}
184 
185 
186     /**
187      * <p>The ID of the instance that you are modifying.</p>
188      */
GetInstanceId()189     inline const Aws::String& GetInstanceId() const{ return m_instanceId; }
190 
191     /**
192      * <p>The ID of the instance that you are modifying.</p>
193      */
InstanceIdHasBeenSet()194     inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
195 
196     /**
197      * <p>The ID of the instance that you are modifying.</p>
198      */
SetInstanceId(const Aws::String & value)199     inline void SetInstanceId(const Aws::String& value) { m_instanceIdHasBeenSet = true; m_instanceId = value; }
200 
201     /**
202      * <p>The ID of the instance that you are modifying.</p>
203      */
SetInstanceId(Aws::String && value)204     inline void SetInstanceId(Aws::String&& value) { m_instanceIdHasBeenSet = true; m_instanceId = std::move(value); }
205 
206     /**
207      * <p>The ID of the instance that you are modifying.</p>
208      */
SetInstanceId(const char * value)209     inline void SetInstanceId(const char* value) { m_instanceIdHasBeenSet = true; m_instanceId.assign(value); }
210 
211     /**
212      * <p>The ID of the instance that you are modifying.</p>
213      */
WithInstanceId(const Aws::String & value)214     inline ModifyInstancePlacementRequest& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;}
215 
216     /**
217      * <p>The ID of the instance that you are modifying.</p>
218      */
WithInstanceId(Aws::String && value)219     inline ModifyInstancePlacementRequest& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;}
220 
221     /**
222      * <p>The ID of the instance that you are modifying.</p>
223      */
WithInstanceId(const char * value)224     inline ModifyInstancePlacementRequest& WithInstanceId(const char* value) { SetInstanceId(value); return *this;}
225 
226 
227     /**
228      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
229      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
230      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
231      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
232      * code.</p>
233      */
GetTenancy()234     inline const HostTenancy& GetTenancy() const{ return m_tenancy; }
235 
236     /**
237      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
238      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
239      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
240      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
241      * code.</p>
242      */
TenancyHasBeenSet()243     inline bool TenancyHasBeenSet() const { return m_tenancyHasBeenSet; }
244 
245     /**
246      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
247      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
248      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
249      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
250      * code.</p>
251      */
SetTenancy(const HostTenancy & value)252     inline void SetTenancy(const HostTenancy& value) { m_tenancyHasBeenSet = true; m_tenancy = value; }
253 
254     /**
255      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
256      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
257      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
258      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
259      * code.</p>
260      */
SetTenancy(HostTenancy && value)261     inline void SetTenancy(HostTenancy&& value) { m_tenancyHasBeenSet = true; m_tenancy = std::move(value); }
262 
263     /**
264      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
265      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
266      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
267      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
268      * code.</p>
269      */
WithTenancy(const HostTenancy & value)270     inline ModifyInstancePlacementRequest& WithTenancy(const HostTenancy& value) { SetTenancy(value); return *this;}
271 
272     /**
273      * <p>The tenancy for the instance.</p>  <p>For T3 instances, you can't
274      * change the tenancy from <code>dedicated</code> to <code>host</code>, or from
275      * <code>host</code> to <code>dedicated</code>. Attempting to make one of these
276      * unsupported tenancy changes results in the <code>InvalidTenancy</code> error
277      * code.</p>
278      */
WithTenancy(HostTenancy && value)279     inline ModifyInstancePlacementRequest& WithTenancy(HostTenancy&& value) { SetTenancy(std::move(value)); return *this;}
280 
281 
282     /**
283      * <p>Reserved for future use.</p>
284      */
GetPartitionNumber()285     inline int GetPartitionNumber() const{ return m_partitionNumber; }
286 
287     /**
288      * <p>Reserved for future use.</p>
289      */
PartitionNumberHasBeenSet()290     inline bool PartitionNumberHasBeenSet() const { return m_partitionNumberHasBeenSet; }
291 
292     /**
293      * <p>Reserved for future use.</p>
294      */
SetPartitionNumber(int value)295     inline void SetPartitionNumber(int value) { m_partitionNumberHasBeenSet = true; m_partitionNumber = value; }
296 
297     /**
298      * <p>Reserved for future use.</p>
299      */
WithPartitionNumber(int value)300     inline ModifyInstancePlacementRequest& WithPartitionNumber(int value) { SetPartitionNumber(value); return *this;}
301 
302 
303     /**
304      * <p>The ARN of the host resource group in which to place the instance.</p>
305      */
GetHostResourceGroupArn()306     inline const Aws::String& GetHostResourceGroupArn() const{ return m_hostResourceGroupArn; }
307 
308     /**
309      * <p>The ARN of the host resource group in which to place the instance.</p>
310      */
HostResourceGroupArnHasBeenSet()311     inline bool HostResourceGroupArnHasBeenSet() const { return m_hostResourceGroupArnHasBeenSet; }
312 
313     /**
314      * <p>The ARN of the host resource group in which to place the instance.</p>
315      */
SetHostResourceGroupArn(const Aws::String & value)316     inline void SetHostResourceGroupArn(const Aws::String& value) { m_hostResourceGroupArnHasBeenSet = true; m_hostResourceGroupArn = value; }
317 
318     /**
319      * <p>The ARN of the host resource group in which to place the instance.</p>
320      */
SetHostResourceGroupArn(Aws::String && value)321     inline void SetHostResourceGroupArn(Aws::String&& value) { m_hostResourceGroupArnHasBeenSet = true; m_hostResourceGroupArn = std::move(value); }
322 
323     /**
324      * <p>The ARN of the host resource group in which to place the instance.</p>
325      */
SetHostResourceGroupArn(const char * value)326     inline void SetHostResourceGroupArn(const char* value) { m_hostResourceGroupArnHasBeenSet = true; m_hostResourceGroupArn.assign(value); }
327 
328     /**
329      * <p>The ARN of the host resource group in which to place the instance.</p>
330      */
WithHostResourceGroupArn(const Aws::String & value)331     inline ModifyInstancePlacementRequest& WithHostResourceGroupArn(const Aws::String& value) { SetHostResourceGroupArn(value); return *this;}
332 
333     /**
334      * <p>The ARN of the host resource group in which to place the instance.</p>
335      */
WithHostResourceGroupArn(Aws::String && value)336     inline ModifyInstancePlacementRequest& WithHostResourceGroupArn(Aws::String&& value) { SetHostResourceGroupArn(std::move(value)); return *this;}
337 
338     /**
339      * <p>The ARN of the host resource group in which to place the instance.</p>
340      */
WithHostResourceGroupArn(const char * value)341     inline ModifyInstancePlacementRequest& WithHostResourceGroupArn(const char* value) { SetHostResourceGroupArn(value); return *this;}
342 
343   private:
344 
345     Affinity m_affinity;
346     bool m_affinityHasBeenSet;
347 
348     Aws::String m_groupName;
349     bool m_groupNameHasBeenSet;
350 
351     Aws::String m_hostId;
352     bool m_hostIdHasBeenSet;
353 
354     Aws::String m_instanceId;
355     bool m_instanceIdHasBeenSet;
356 
357     HostTenancy m_tenancy;
358     bool m_tenancyHasBeenSet;
359 
360     int m_partitionNumber;
361     bool m_partitionNumberHasBeenSet;
362 
363     Aws::String m_hostResourceGroupArn;
364     bool m_hostResourceGroupArnHasBeenSet;
365   };
366 
367 } // namespace Model
368 } // namespace EC2
369 } // namespace Aws
370