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/autoscaling/AutoScaling_EXPORTS.h>
8 #include <aws/autoscaling/AutoScalingRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/autoscaling/model/RefreshStrategy.h>
11 #include <aws/autoscaling/model/DesiredConfiguration.h>
12 #include <aws/autoscaling/model/RefreshPreferences.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace AutoScaling
18 {
19 namespace Model
20 {
21 
22   /**
23    */
24   class AWS_AUTOSCALING_API StartInstanceRefreshRequest : public AutoScalingRequest
25   {
26   public:
27     StartInstanceRefreshRequest();
28 
29     // Service request name is the Operation name which will send this request out,
30     // each operation should has unique request name, so that we can get operation's name from this request.
31     // Note: this is not true for response, multiple operations may have the same response name,
32     // so we can not get operation's name from response.
GetServiceRequestName()33     inline virtual const char* GetServiceRequestName() const override { return "StartInstanceRefresh"; }
34 
35     Aws::String SerializePayload() const override;
36 
37   protected:
38     void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
39 
40   public:
41 
42     /**
43      * <p>The name of the Auto Scaling group.</p>
44      */
GetAutoScalingGroupName()45     inline const Aws::String& GetAutoScalingGroupName() const{ return m_autoScalingGroupName; }
46 
47     /**
48      * <p>The name of the Auto Scaling group.</p>
49      */
AutoScalingGroupNameHasBeenSet()50     inline bool AutoScalingGroupNameHasBeenSet() const { return m_autoScalingGroupNameHasBeenSet; }
51 
52     /**
53      * <p>The name of the Auto Scaling group.</p>
54      */
SetAutoScalingGroupName(const Aws::String & value)55     inline void SetAutoScalingGroupName(const Aws::String& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = value; }
56 
57     /**
58      * <p>The name of the Auto Scaling group.</p>
59      */
SetAutoScalingGroupName(Aws::String && value)60     inline void SetAutoScalingGroupName(Aws::String&& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = std::move(value); }
61 
62     /**
63      * <p>The name of the Auto Scaling group.</p>
64      */
SetAutoScalingGroupName(const char * value)65     inline void SetAutoScalingGroupName(const char* value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName.assign(value); }
66 
67     /**
68      * <p>The name of the Auto Scaling group.</p>
69      */
WithAutoScalingGroupName(const Aws::String & value)70     inline StartInstanceRefreshRequest& WithAutoScalingGroupName(const Aws::String& value) { SetAutoScalingGroupName(value); return *this;}
71 
72     /**
73      * <p>The name of the Auto Scaling group.</p>
74      */
WithAutoScalingGroupName(Aws::String && value)75     inline StartInstanceRefreshRequest& WithAutoScalingGroupName(Aws::String&& value) { SetAutoScalingGroupName(std::move(value)); return *this;}
76 
77     /**
78      * <p>The name of the Auto Scaling group.</p>
79      */
WithAutoScalingGroupName(const char * value)80     inline StartInstanceRefreshRequest& WithAutoScalingGroupName(const char* value) { SetAutoScalingGroupName(value); return *this;}
81 
82 
83     /**
84      * <p>The strategy to use for the instance refresh. The only valid value is
85      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
86      * gradually. A rolling update can fail due to failed health checks or if instances
87      * are on standby or are protected from scale in. If the rolling update process
88      * fails, any instances that are replaced are not rolled back to their previous
89      * configuration. </p>
90      */
GetStrategy()91     inline const RefreshStrategy& GetStrategy() const{ return m_strategy; }
92 
93     /**
94      * <p>The strategy to use for the instance refresh. The only valid value is
95      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
96      * gradually. A rolling update can fail due to failed health checks or if instances
97      * are on standby or are protected from scale in. If the rolling update process
98      * fails, any instances that are replaced are not rolled back to their previous
99      * configuration. </p>
100      */
StrategyHasBeenSet()101     inline bool StrategyHasBeenSet() const { return m_strategyHasBeenSet; }
102 
103     /**
104      * <p>The strategy to use for the instance refresh. The only valid value is
105      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
106      * gradually. A rolling update can fail due to failed health checks or if instances
107      * are on standby or are protected from scale in. If the rolling update process
108      * fails, any instances that are replaced are not rolled back to their previous
109      * configuration. </p>
110      */
SetStrategy(const RefreshStrategy & value)111     inline void SetStrategy(const RefreshStrategy& value) { m_strategyHasBeenSet = true; m_strategy = value; }
112 
113     /**
114      * <p>The strategy to use for the instance refresh. The only valid value is
115      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
116      * gradually. A rolling update can fail due to failed health checks or if instances
117      * are on standby or are protected from scale in. If the rolling update process
118      * fails, any instances that are replaced are not rolled back to their previous
119      * configuration. </p>
120      */
SetStrategy(RefreshStrategy && value)121     inline void SetStrategy(RefreshStrategy&& value) { m_strategyHasBeenSet = true; m_strategy = std::move(value); }
122 
123     /**
124      * <p>The strategy to use for the instance refresh. The only valid value is
125      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
126      * gradually. A rolling update can fail due to failed health checks or if instances
127      * are on standby or are protected from scale in. If the rolling update process
128      * fails, any instances that are replaced are not rolled back to their previous
129      * configuration. </p>
130      */
WithStrategy(const RefreshStrategy & value)131     inline StartInstanceRefreshRequest& WithStrategy(const RefreshStrategy& value) { SetStrategy(value); return *this;}
132 
133     /**
134      * <p>The strategy to use for the instance refresh. The only valid value is
135      * <code>Rolling</code>.</p> <p>A rolling update helps you update your instances
136      * gradually. A rolling update can fail due to failed health checks or if instances
137      * are on standby or are protected from scale in. If the rolling update process
138      * fails, any instances that are replaced are not rolled back to their previous
139      * configuration. </p>
140      */
WithStrategy(RefreshStrategy && value)141     inline StartInstanceRefreshRequest& WithStrategy(RefreshStrategy&& value) { SetStrategy(std::move(value)); return *this;}
142 
143 
144     /**
145      * <p>The desired configuration. For example, the desired configuration can specify
146      * a new launch template or a new version of the current launch template.</p>
147      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
148      * settings of the Auto Scaling group to reflect the new desired configuration.
149      * </p>  <p>When you specify a new launch template or a new version of the
150      * current launch template for your desired configuration, consider enabling the
151      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
152      * Auto Scaling skips replacing instances that already use the specified launch
153      * template and version. This can help you reduce the number of replacements that
154      * are required to apply updates. </p>
155      */
GetDesiredConfiguration()156     inline const DesiredConfiguration& GetDesiredConfiguration() const{ return m_desiredConfiguration; }
157 
158     /**
159      * <p>The desired configuration. For example, the desired configuration can specify
160      * a new launch template or a new version of the current launch template.</p>
161      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
162      * settings of the Auto Scaling group to reflect the new desired configuration.
163      * </p>  <p>When you specify a new launch template or a new version of the
164      * current launch template for your desired configuration, consider enabling the
165      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
166      * Auto Scaling skips replacing instances that already use the specified launch
167      * template and version. This can help you reduce the number of replacements that
168      * are required to apply updates. </p>
169      */
DesiredConfigurationHasBeenSet()170     inline bool DesiredConfigurationHasBeenSet() const { return m_desiredConfigurationHasBeenSet; }
171 
172     /**
173      * <p>The desired configuration. For example, the desired configuration can specify
174      * a new launch template or a new version of the current launch template.</p>
175      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
176      * settings of the Auto Scaling group to reflect the new desired configuration.
177      * </p>  <p>When you specify a new launch template or a new version of the
178      * current launch template for your desired configuration, consider enabling the
179      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
180      * Auto Scaling skips replacing instances that already use the specified launch
181      * template and version. This can help you reduce the number of replacements that
182      * are required to apply updates. </p>
183      */
SetDesiredConfiguration(const DesiredConfiguration & value)184     inline void SetDesiredConfiguration(const DesiredConfiguration& value) { m_desiredConfigurationHasBeenSet = true; m_desiredConfiguration = value; }
185 
186     /**
187      * <p>The desired configuration. For example, the desired configuration can specify
188      * a new launch template or a new version of the current launch template.</p>
189      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
190      * settings of the Auto Scaling group to reflect the new desired configuration.
191      * </p>  <p>When you specify a new launch template or a new version of the
192      * current launch template for your desired configuration, consider enabling the
193      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
194      * Auto Scaling skips replacing instances that already use the specified launch
195      * template and version. This can help you reduce the number of replacements that
196      * are required to apply updates. </p>
197      */
SetDesiredConfiguration(DesiredConfiguration && value)198     inline void SetDesiredConfiguration(DesiredConfiguration&& value) { m_desiredConfigurationHasBeenSet = true; m_desiredConfiguration = std::move(value); }
199 
200     /**
201      * <p>The desired configuration. For example, the desired configuration can specify
202      * a new launch template or a new version of the current launch template.</p>
203      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
204      * settings of the Auto Scaling group to reflect the new desired configuration.
205      * </p>  <p>When you specify a new launch template or a new version of the
206      * current launch template for your desired configuration, consider enabling the
207      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
208      * Auto Scaling skips replacing instances that already use the specified launch
209      * template and version. This can help you reduce the number of replacements that
210      * are required to apply updates. </p>
211      */
WithDesiredConfiguration(const DesiredConfiguration & value)212     inline StartInstanceRefreshRequest& WithDesiredConfiguration(const DesiredConfiguration& value) { SetDesiredConfiguration(value); return *this;}
213 
214     /**
215      * <p>The desired configuration. For example, the desired configuration can specify
216      * a new launch template or a new version of the current launch template.</p>
217      * <p>Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the
218      * settings of the Auto Scaling group to reflect the new desired configuration.
219      * </p>  <p>When you specify a new launch template or a new version of the
220      * current launch template for your desired configuration, consider enabling the
221      * <code>SkipMatching</code> property in preferences. If it's enabled, Amazon EC2
222      * Auto Scaling skips replacing instances that already use the specified launch
223      * template and version. This can help you reduce the number of replacements that
224      * are required to apply updates. </p>
225      */
WithDesiredConfiguration(DesiredConfiguration && value)226     inline StartInstanceRefreshRequest& WithDesiredConfiguration(DesiredConfiguration&& value) { SetDesiredConfiguration(std::move(value)); return *this;}
227 
228 
229     /**
230      * <p>Set of preferences associated with the instance refresh request. If not
231      * provided, the default values are used.</p>
232      */
GetPreferences()233     inline const RefreshPreferences& GetPreferences() const{ return m_preferences; }
234 
235     /**
236      * <p>Set of preferences associated with the instance refresh request. If not
237      * provided, the default values are used.</p>
238      */
PreferencesHasBeenSet()239     inline bool PreferencesHasBeenSet() const { return m_preferencesHasBeenSet; }
240 
241     /**
242      * <p>Set of preferences associated with the instance refresh request. If not
243      * provided, the default values are used.</p>
244      */
SetPreferences(const RefreshPreferences & value)245     inline void SetPreferences(const RefreshPreferences& value) { m_preferencesHasBeenSet = true; m_preferences = value; }
246 
247     /**
248      * <p>Set of preferences associated with the instance refresh request. If not
249      * provided, the default values are used.</p>
250      */
SetPreferences(RefreshPreferences && value)251     inline void SetPreferences(RefreshPreferences&& value) { m_preferencesHasBeenSet = true; m_preferences = std::move(value); }
252 
253     /**
254      * <p>Set of preferences associated with the instance refresh request. If not
255      * provided, the default values are used.</p>
256      */
WithPreferences(const RefreshPreferences & value)257     inline StartInstanceRefreshRequest& WithPreferences(const RefreshPreferences& value) { SetPreferences(value); return *this;}
258 
259     /**
260      * <p>Set of preferences associated with the instance refresh request. If not
261      * provided, the default values are used.</p>
262      */
WithPreferences(RefreshPreferences && value)263     inline StartInstanceRefreshRequest& WithPreferences(RefreshPreferences&& value) { SetPreferences(std::move(value)); return *this;}
264 
265   private:
266 
267     Aws::String m_autoScalingGroupName;
268     bool m_autoScalingGroupNameHasBeenSet;
269 
270     RefreshStrategy m_strategy;
271     bool m_strategyHasBeenSet;
272 
273     DesiredConfiguration m_desiredConfiguration;
274     bool m_desiredConfigurationHasBeenSet;
275 
276     RefreshPreferences m_preferences;
277     bool m_preferencesHasBeenSet;
278   };
279 
280 } // namespace Model
281 } // namespace AutoScaling
282 } // namespace Aws
283