AWS SDK for C++

AWS SDK for C++ Version 1.11.784

Loading...
Searching...
No Matches
CreateFleetRequest.h
1
6#pragma once
7#include <aws/core/utils/DateTime.h>
8#include <aws/core/utils/UUID.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/ec2/EC2Request.h>
12#include <aws/ec2/EC2_EXPORTS.h>
13#include <aws/ec2/model/FleetExcessCapacityTerminationPolicy.h>
14#include <aws/ec2/model/FleetLaunchTemplateConfigRequest.h>
15#include <aws/ec2/model/FleetType.h>
16#include <aws/ec2/model/OnDemandOptionsRequest.h>
17#include <aws/ec2/model/ReservedCapacityOptionsRequest.h>
18#include <aws/ec2/model/SpotOptionsRequest.h>
19#include <aws/ec2/model/TagSpecification.h>
20#include <aws/ec2/model/TargetCapacitySpecificationRequest.h>
21
22#include <utility>
23
24namespace Aws {
25namespace EC2 {
26namespace Model {
27
31 public:
32 AWS_EC2_API CreateFleetRequest() = default;
33
34 // Service request name is the Operation name which will send this request out,
35 // each operation should has unique request name, so that we can get operation's name from this request.
36 // Note: this is not true for response, multiple operations may have the same response name,
37 // so we can not get operation's name from response.
38 inline virtual const char* GetServiceRequestName() const override { return "CreateFleet"; }
39
40 AWS_EC2_API Aws::String SerializePayload() const override;
41
42 protected:
43 AWS_EC2_API void DumpBodyToUrl(Aws::Http::URI& uri) const override;
44
45 public:
47
53 inline bool GetDryRun() const { return m_dryRun; }
54 inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
55 inline void SetDryRun(bool value) {
56 m_dryRunHasBeenSet = true;
57 m_dryRun = value;
58 }
59 inline CreateFleetRequest& WithDryRun(bool value) {
60 SetDryRun(value);
61 return *this;
62 }
64
66
74 inline const Aws::String& GetClientToken() const { return m_clientToken; }
75 inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; }
76 template <typename ClientTokenT = Aws::String>
77 void SetClientToken(ClientTokenT&& value) {
78 m_clientTokenHasBeenSet = true;
79 m_clientToken = std::forward<ClientTokenT>(value);
80 }
81 template <typename ClientTokenT = Aws::String>
82 CreateFleetRequest& WithClientToken(ClientTokenT&& value) {
83 SetClientToken(std::forward<ClientTokenT>(value));
84 return *this;
85 }
87
89
92 inline const SpotOptionsRequest& GetSpotOptions() const { return m_spotOptions; }
93 inline bool SpotOptionsHasBeenSet() const { return m_spotOptionsHasBeenSet; }
94 template <typename SpotOptionsT = SpotOptionsRequest>
95 void SetSpotOptions(SpotOptionsT&& value) {
96 m_spotOptionsHasBeenSet = true;
97 m_spotOptions = std::forward<SpotOptionsT>(value);
98 }
99 template <typename SpotOptionsT = SpotOptionsRequest>
100 CreateFleetRequest& WithSpotOptions(SpotOptionsT&& value) {
101 SetSpotOptions(std::forward<SpotOptionsT>(value));
102 return *this;
103 }
105
107
110 inline const OnDemandOptionsRequest& GetOnDemandOptions() const { return m_onDemandOptions; }
111 inline bool OnDemandOptionsHasBeenSet() const { return m_onDemandOptionsHasBeenSet; }
112 template <typename OnDemandOptionsT = OnDemandOptionsRequest>
113 void SetOnDemandOptions(OnDemandOptionsT&& value) {
114 m_onDemandOptionsHasBeenSet = true;
115 m_onDemandOptions = std::forward<OnDemandOptionsT>(value);
116 }
117 template <typename OnDemandOptionsT = OnDemandOptionsRequest>
118 CreateFleetRequest& WithOnDemandOptions(OnDemandOptionsT&& value) {
119 SetOnDemandOptions(std::forward<OnDemandOptionsT>(value));
120 return *this;
121 }
123
125
130 inline const ReservedCapacityOptionsRequest& GetReservedCapacityOptions() const { return m_reservedCapacityOptions; }
131 inline bool ReservedCapacityOptionsHasBeenSet() const { return m_reservedCapacityOptionsHasBeenSet; }
132 template <typename ReservedCapacityOptionsT = ReservedCapacityOptionsRequest>
133 void SetReservedCapacityOptions(ReservedCapacityOptionsT&& value) {
134 m_reservedCapacityOptionsHasBeenSet = true;
135 m_reservedCapacityOptions = std::forward<ReservedCapacityOptionsT>(value);
136 }
137 template <typename ReservedCapacityOptionsT = ReservedCapacityOptionsRequest>
138 CreateFleetRequest& WithReservedCapacityOptions(ReservedCapacityOptionsT&& value) {
139 SetReservedCapacityOptions(std::forward<ReservedCapacityOptionsT>(value));
140 return *this;
141 }
143
145
150 inline FleetExcessCapacityTerminationPolicy GetExcessCapacityTerminationPolicy() const { return m_excessCapacityTerminationPolicy; }
151 inline bool ExcessCapacityTerminationPolicyHasBeenSet() const { return m_excessCapacityTerminationPolicyHasBeenSet; }
153 m_excessCapacityTerminationPolicyHasBeenSet = true;
154 m_excessCapacityTerminationPolicy = value;
155 }
158 return *this;
159 }
161
163
166 inline const Aws::Vector<FleetLaunchTemplateConfigRequest>& GetLaunchTemplateConfigs() const { return m_launchTemplateConfigs; }
167 inline bool LaunchTemplateConfigsHasBeenSet() const { return m_launchTemplateConfigsHasBeenSet; }
168 template <typename LaunchTemplateConfigsT = Aws::Vector<FleetLaunchTemplateConfigRequest>>
169 void SetLaunchTemplateConfigs(LaunchTemplateConfigsT&& value) {
170 m_launchTemplateConfigsHasBeenSet = true;
171 m_launchTemplateConfigs = std::forward<LaunchTemplateConfigsT>(value);
172 }
173 template <typename LaunchTemplateConfigsT = Aws::Vector<FleetLaunchTemplateConfigRequest>>
174 CreateFleetRequest& WithLaunchTemplateConfigs(LaunchTemplateConfigsT&& value) {
175 SetLaunchTemplateConfigs(std::forward<LaunchTemplateConfigsT>(value));
176 return *this;
177 }
178 template <typename LaunchTemplateConfigsT = FleetLaunchTemplateConfigRequest>
179 CreateFleetRequest& AddLaunchTemplateConfigs(LaunchTemplateConfigsT&& value) {
180 m_launchTemplateConfigsHasBeenSet = true;
181 m_launchTemplateConfigs.emplace_back(std::forward<LaunchTemplateConfigsT>(value));
182 return *this;
183 }
185
187
190 inline const TargetCapacitySpecificationRequest& GetTargetCapacitySpecification() const { return m_targetCapacitySpecification; }
191 inline bool TargetCapacitySpecificationHasBeenSet() const { return m_targetCapacitySpecificationHasBeenSet; }
192 template <typename TargetCapacitySpecificationT = TargetCapacitySpecificationRequest>
193 void SetTargetCapacitySpecification(TargetCapacitySpecificationT&& value) {
194 m_targetCapacitySpecificationHasBeenSet = true;
195 m_targetCapacitySpecification = std::forward<TargetCapacitySpecificationT>(value);
196 }
197 template <typename TargetCapacitySpecificationT = TargetCapacitySpecificationRequest>
198 CreateFleetRequest& WithTargetCapacitySpecification(TargetCapacitySpecificationT&& value) {
199 SetTargetCapacitySpecification(std::forward<TargetCapacitySpecificationT>(value));
200 return *this;
201 }
203
205
209 inline bool GetTerminateInstancesWithExpiration() const { return m_terminateInstancesWithExpiration; }
210 inline bool TerminateInstancesWithExpirationHasBeenSet() const { return m_terminateInstancesWithExpirationHasBeenSet; }
211 inline void SetTerminateInstancesWithExpiration(bool value) {
212 m_terminateInstancesWithExpirationHasBeenSet = true;
213 m_terminateInstancesWithExpiration = value;
214 }
217 return *this;
218 }
220
222
237 inline FleetType GetType() const { return m_type; }
238 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
239 inline void SetType(FleetType value) {
240 m_typeHasBeenSet = true;
241 m_type = value;
242 }
244 SetType(value);
245 return *this;
246 }
248
250
255 inline const Aws::Utils::DateTime& GetValidFrom() const { return m_validFrom; }
256 inline bool ValidFromHasBeenSet() const { return m_validFromHasBeenSet; }
257 template <typename ValidFromT = Aws::Utils::DateTime>
258 void SetValidFrom(ValidFromT&& value) {
259 m_validFromHasBeenSet = true;
260 m_validFrom = std::forward<ValidFromT>(value);
261 }
262 template <typename ValidFromT = Aws::Utils::DateTime>
263 CreateFleetRequest& WithValidFrom(ValidFromT&& value) {
264 SetValidFrom(std::forward<ValidFromT>(value));
265 return *this;
266 }
268
270
276 inline const Aws::Utils::DateTime& GetValidUntil() const { return m_validUntil; }
277 inline bool ValidUntilHasBeenSet() const { return m_validUntilHasBeenSet; }
278 template <typename ValidUntilT = Aws::Utils::DateTime>
279 void SetValidUntil(ValidUntilT&& value) {
280 m_validUntilHasBeenSet = true;
281 m_validUntil = std::forward<ValidUntilT>(value);
282 }
283 template <typename ValidUntilT = Aws::Utils::DateTime>
284 CreateFleetRequest& WithValidUntil(ValidUntilT&& value) {
285 SetValidUntil(std::forward<ValidUntilT>(value));
286 return *this;
287 }
289
291
298 inline bool GetReplaceUnhealthyInstances() const { return m_replaceUnhealthyInstances; }
299 inline bool ReplaceUnhealthyInstancesHasBeenSet() const { return m_replaceUnhealthyInstancesHasBeenSet; }
300 inline void SetReplaceUnhealthyInstances(bool value) {
301 m_replaceUnhealthyInstancesHasBeenSet = true;
302 m_replaceUnhealthyInstances = value;
303 }
306 return *this;
307 }
309
311
324 inline const Aws::Vector<TagSpecification>& GetTagSpecifications() const { return m_tagSpecifications; }
325 inline bool TagSpecificationsHasBeenSet() const { return m_tagSpecificationsHasBeenSet; }
326 template <typename TagSpecificationsT = Aws::Vector<TagSpecification>>
327 void SetTagSpecifications(TagSpecificationsT&& value) {
328 m_tagSpecificationsHasBeenSet = true;
329 m_tagSpecifications = std::forward<TagSpecificationsT>(value);
330 }
331 template <typename TagSpecificationsT = Aws::Vector<TagSpecification>>
332 CreateFleetRequest& WithTagSpecifications(TagSpecificationsT&& value) {
333 SetTagSpecifications(std::forward<TagSpecificationsT>(value));
334 return *this;
335 }
336 template <typename TagSpecificationsT = TagSpecification>
337 CreateFleetRequest& AddTagSpecifications(TagSpecificationsT&& value) {
338 m_tagSpecificationsHasBeenSet = true;
339 m_tagSpecifications.emplace_back(std::forward<TagSpecificationsT>(value));
340 return *this;
341 }
343
345
348 inline const Aws::String& GetContext() const { return m_context; }
349 inline bool ContextHasBeenSet() const { return m_contextHasBeenSet; }
350 template <typename ContextT = Aws::String>
351 void SetContext(ContextT&& value) {
352 m_contextHasBeenSet = true;
353 m_context = std::forward<ContextT>(value);
354 }
355 template <typename ContextT = Aws::String>
356 CreateFleetRequest& WithContext(ContextT&& value) {
357 SetContext(std::forward<ContextT>(value));
358 return *this;
359 }
361 private:
362 bool m_dryRun{false};
363
365
366 SpotOptionsRequest m_spotOptions;
367
368 OnDemandOptionsRequest m_onDemandOptions;
369
370 ReservedCapacityOptionsRequest m_reservedCapacityOptions;
371
373
374 Aws::Vector<FleetLaunchTemplateConfigRequest> m_launchTemplateConfigs;
375
376 TargetCapacitySpecificationRequest m_targetCapacitySpecification;
377
378 bool m_terminateInstancesWithExpiration{false};
379
381
382 Aws::Utils::DateTime m_validFrom{};
383
384 Aws::Utils::DateTime m_validUntil{};
385
386 bool m_replaceUnhealthyInstances{false};
387
388 Aws::Vector<TagSpecification> m_tagSpecifications;
389
390 Aws::String m_context;
391 bool m_dryRunHasBeenSet = false;
392 bool m_clientTokenHasBeenSet = true;
393 bool m_spotOptionsHasBeenSet = false;
394 bool m_onDemandOptionsHasBeenSet = false;
395 bool m_reservedCapacityOptionsHasBeenSet = false;
396 bool m_excessCapacityTerminationPolicyHasBeenSet = false;
397 bool m_launchTemplateConfigsHasBeenSet = false;
398 bool m_targetCapacitySpecificationHasBeenSet = false;
399 bool m_terminateInstancesWithExpirationHasBeenSet = false;
400 bool m_typeHasBeenSet = false;
401 bool m_validFromHasBeenSet = false;
402 bool m_validUntilHasBeenSet = false;
403 bool m_replaceUnhealthyInstancesHasBeenSet = false;
404 bool m_tagSpecificationsHasBeenSet = false;
405 bool m_contextHasBeenSet = false;
406};
407
408} // namespace Model
409} // namespace EC2
410} // namespace Aws
const Aws::Utils::DateTime & GetValidFrom() const
const Aws::String & GetContext() const
void SetOnDemandOptions(OnDemandOptionsT &&value)
void SetReservedCapacityOptions(ReservedCapacityOptionsT &&value)
CreateFleetRequest & AddLaunchTemplateConfigs(LaunchTemplateConfigsT &&value)
CreateFleetRequest & WithTagSpecifications(TagSpecificationsT &&value)
void SetValidUntil(ValidUntilT &&value)
const Aws::String & GetClientToken() const
void SetTargetCapacitySpecification(TargetCapacitySpecificationT &&value)
virtual const char * GetServiceRequestName() const override
CreateFleetRequest & WithClientToken(ClientTokenT &&value)
void SetLaunchTemplateConfigs(LaunchTemplateConfigsT &&value)
void SetTagSpecifications(TagSpecificationsT &&value)
CreateFleetRequest & WithExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy value)
CreateFleetRequest & WithLaunchTemplateConfigs(LaunchTemplateConfigsT &&value)
CreateFleetRequest & WithSpotOptions(SpotOptionsT &&value)
const Aws::Vector< FleetLaunchTemplateConfigRequest > & GetLaunchTemplateConfigs() const
void SetExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy value)
const TargetCapacitySpecificationRequest & GetTargetCapacitySpecification() const
AWS_EC2_API void DumpBodyToUrl(Aws::Http::URI &uri) const override
CreateFleetRequest & AddTagSpecifications(TagSpecificationsT &&value)
CreateFleetRequest & WithOnDemandOptions(OnDemandOptionsT &&value)
CreateFleetRequest & WithValidFrom(ValidFromT &&value)
void SetClientToken(ClientTokenT &&value)
CreateFleetRequest & WithDryRun(bool value)
void SetSpotOptions(SpotOptionsT &&value)
const SpotOptionsRequest & GetSpotOptions() const
FleetExcessCapacityTerminationPolicy GetExcessCapacityTerminationPolicy() const
CreateFleetRequest & WithReplaceUnhealthyInstances(bool value)
CreateFleetRequest & WithType(FleetType value)
AWS_EC2_API Aws::String SerializePayload() const override
CreateFleetRequest & WithTargetCapacitySpecification(TargetCapacitySpecificationT &&value)
const Aws::Vector< TagSpecification > & GetTagSpecifications() const
AWS_EC2_API CreateFleetRequest()=default
const Aws::Utils::DateTime & GetValidUntil() const
CreateFleetRequest & WithTerminateInstancesWithExpiration(bool value)
const ReservedCapacityOptionsRequest & GetReservedCapacityOptions() const
CreateFleetRequest & WithValidUntil(ValidUntilT &&value)
CreateFleetRequest & WithReservedCapacityOptions(ReservedCapacityOptionsT &&value)
const OnDemandOptionsRequest & GetOnDemandOptions() const
CreateFleetRequest & WithContext(ContextT &&value)
static Aws::Utils::UUID PseudoRandomUUID()
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector