AWS SDK for C++

AWS SDK for C++ Version 1.11.743

Loading...
Searching...
No Matches
Instance.h
1
6#pragma once
7#include <aws/core/utils/DateTime.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/lightsail/Lightsail_EXPORTS.h>
11#include <aws/lightsail/model/AddOn.h>
12#include <aws/lightsail/model/InstanceHardware.h>
13#include <aws/lightsail/model/InstanceMetadataOptions.h>
14#include <aws/lightsail/model/InstanceNetworking.h>
15#include <aws/lightsail/model/InstanceState.h>
16#include <aws/lightsail/model/IpAddressType.h>
17#include <aws/lightsail/model/ResourceLocation.h>
18#include <aws/lightsail/model/ResourceType.h>
19#include <aws/lightsail/model/Tag.h>
20
21#include <utility>
22
23namespace Aws {
24namespace Utils {
25namespace Json {
26class JsonValue;
27class JsonView;
28} // namespace Json
29} // namespace Utils
30namespace Lightsail {
31namespace Model {
32
39class Instance {
40 public:
41 AWS_LIGHTSAIL_API Instance() = default;
42 AWS_LIGHTSAIL_API Instance(Aws::Utils::Json::JsonView jsonValue);
43 AWS_LIGHTSAIL_API Instance& operator=(Aws::Utils::Json::JsonView jsonValue);
44 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
45
47
50 inline const Aws::String& GetName() const { return m_name; }
51 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
52 template <typename NameT = Aws::String>
53 void SetName(NameT&& value) {
54 m_nameHasBeenSet = true;
55 m_name = std::forward<NameT>(value);
56 }
57 template <typename NameT = Aws::String>
58 Instance& WithName(NameT&& value) {
59 SetName(std::forward<NameT>(value));
60 return *this;
61 }
63
65
69 inline const Aws::String& GetArn() const { return m_arn; }
70 inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; }
71 template <typename ArnT = Aws::String>
72 void SetArn(ArnT&& value) {
73 m_arnHasBeenSet = true;
74 m_arn = std::forward<ArnT>(value);
75 }
76 template <typename ArnT = Aws::String>
77 Instance& WithArn(ArnT&& value) {
78 SetArn(std::forward<ArnT>(value));
79 return *this;
80 }
82
84
89 inline const Aws::String& GetSupportCode() const { return m_supportCode; }
90 inline bool SupportCodeHasBeenSet() const { return m_supportCodeHasBeenSet; }
91 template <typename SupportCodeT = Aws::String>
92 void SetSupportCode(SupportCodeT&& value) {
93 m_supportCodeHasBeenSet = true;
94 m_supportCode = std::forward<SupportCodeT>(value);
95 }
96 template <typename SupportCodeT = Aws::String>
97 Instance& WithSupportCode(SupportCodeT&& value) {
98 SetSupportCode(std::forward<SupportCodeT>(value));
99 return *this;
100 }
102
104
108 inline const Aws::Utils::DateTime& GetCreatedAt() const { return m_createdAt; }
109 inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; }
110 template <typename CreatedAtT = Aws::Utils::DateTime>
111 void SetCreatedAt(CreatedAtT&& value) {
112 m_createdAtHasBeenSet = true;
113 m_createdAt = std::forward<CreatedAtT>(value);
114 }
115 template <typename CreatedAtT = Aws::Utils::DateTime>
116 Instance& WithCreatedAt(CreatedAtT&& value) {
117 SetCreatedAt(std::forward<CreatedAtT>(value));
118 return *this;
119 }
121
123
126 inline const ResourceLocation& GetLocation() const { return m_location; }
127 inline bool LocationHasBeenSet() const { return m_locationHasBeenSet; }
128 template <typename LocationT = ResourceLocation>
129 void SetLocation(LocationT&& value) {
130 m_locationHasBeenSet = true;
131 m_location = std::forward<LocationT>(value);
132 }
133 template <typename LocationT = ResourceLocation>
134 Instance& WithLocation(LocationT&& value) {
135 SetLocation(std::forward<LocationT>(value));
136 return *this;
137 }
139
141
144 inline ResourceType GetResourceType() const { return m_resourceType; }
145 inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }
146 inline void SetResourceType(ResourceType value) {
147 m_resourceTypeHasBeenSet = true;
148 m_resourceType = value;
149 }
151 SetResourceType(value);
152 return *this;
153 }
155
157
163 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
164 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
165 template <typename TagsT = Aws::Vector<Tag>>
166 void SetTags(TagsT&& value) {
167 m_tagsHasBeenSet = true;
168 m_tags = std::forward<TagsT>(value);
169 }
170 template <typename TagsT = Aws::Vector<Tag>>
171 Instance& WithTags(TagsT&& value) {
172 SetTags(std::forward<TagsT>(value));
173 return *this;
174 }
175 template <typename TagsT = Tag>
176 Instance& AddTags(TagsT&& value) {
177 m_tagsHasBeenSet = true;
178 m_tags.emplace_back(std::forward<TagsT>(value));
179 return *this;
180 }
182
184
187 inline const Aws::String& GetBlueprintId() const { return m_blueprintId; }
188 inline bool BlueprintIdHasBeenSet() const { return m_blueprintIdHasBeenSet; }
189 template <typename BlueprintIdT = Aws::String>
190 void SetBlueprintId(BlueprintIdT&& value) {
191 m_blueprintIdHasBeenSet = true;
192 m_blueprintId = std::forward<BlueprintIdT>(value);
193 }
194 template <typename BlueprintIdT = Aws::String>
195 Instance& WithBlueprintId(BlueprintIdT&& value) {
196 SetBlueprintId(std::forward<BlueprintIdT>(value));
197 return *this;
198 }
200
202
205 inline const Aws::String& GetBlueprintName() const { return m_blueprintName; }
206 inline bool BlueprintNameHasBeenSet() const { return m_blueprintNameHasBeenSet; }
207 template <typename BlueprintNameT = Aws::String>
208 void SetBlueprintName(BlueprintNameT&& value) {
209 m_blueprintNameHasBeenSet = true;
210 m_blueprintName = std::forward<BlueprintNameT>(value);
211 }
212 template <typename BlueprintNameT = Aws::String>
213 Instance& WithBlueprintName(BlueprintNameT&& value) {
214 SetBlueprintName(std::forward<BlueprintNameT>(value));
215 return *this;
216 }
218
220
223 inline const Aws::String& GetBundleId() const { return m_bundleId; }
224 inline bool BundleIdHasBeenSet() const { return m_bundleIdHasBeenSet; }
225 template <typename BundleIdT = Aws::String>
226 void SetBundleId(BundleIdT&& value) {
227 m_bundleIdHasBeenSet = true;
228 m_bundleId = std::forward<BundleIdT>(value);
229 }
230 template <typename BundleIdT = Aws::String>
231 Instance& WithBundleId(BundleIdT&& value) {
232 SetBundleId(std::forward<BundleIdT>(value));
233 return *this;
234 }
236
238
241 inline const Aws::Vector<AddOn>& GetAddOns() const { return m_addOns; }
242 inline bool AddOnsHasBeenSet() const { return m_addOnsHasBeenSet; }
243 template <typename AddOnsT = Aws::Vector<AddOn>>
244 void SetAddOns(AddOnsT&& value) {
245 m_addOnsHasBeenSet = true;
246 m_addOns = std::forward<AddOnsT>(value);
247 }
248 template <typename AddOnsT = Aws::Vector<AddOn>>
249 Instance& WithAddOns(AddOnsT&& value) {
250 SetAddOns(std::forward<AddOnsT>(value));
251 return *this;
252 }
253 template <typename AddOnsT = AddOn>
254 Instance& AddAddOns(AddOnsT&& value) {
255 m_addOnsHasBeenSet = true;
256 m_addOns.emplace_back(std::forward<AddOnsT>(value));
257 return *this;
258 }
260
262
266 inline bool GetIsStaticIp() const { return m_isStaticIp; }
267 inline bool IsStaticIpHasBeenSet() const { return m_isStaticIpHasBeenSet; }
268 inline void SetIsStaticIp(bool value) {
269 m_isStaticIpHasBeenSet = true;
270 m_isStaticIp = value;
271 }
272 inline Instance& WithIsStaticIp(bool value) {
273 SetIsStaticIp(value);
274 return *this;
275 }
277
279
282 inline const Aws::String& GetPrivateIpAddress() const { return m_privateIpAddress; }
283 inline bool PrivateIpAddressHasBeenSet() const { return m_privateIpAddressHasBeenSet; }
284 template <typename PrivateIpAddressT = Aws::String>
285 void SetPrivateIpAddress(PrivateIpAddressT&& value) {
286 m_privateIpAddressHasBeenSet = true;
287 m_privateIpAddress = std::forward<PrivateIpAddressT>(value);
288 }
289 template <typename PrivateIpAddressT = Aws::String>
290 Instance& WithPrivateIpAddress(PrivateIpAddressT&& value) {
291 SetPrivateIpAddress(std::forward<PrivateIpAddressT>(value));
292 return *this;
293 }
295
297
300 inline const Aws::String& GetPublicIpAddress() const { return m_publicIpAddress; }
301 inline bool PublicIpAddressHasBeenSet() const { return m_publicIpAddressHasBeenSet; }
302 template <typename PublicIpAddressT = Aws::String>
303 void SetPublicIpAddress(PublicIpAddressT&& value) {
304 m_publicIpAddressHasBeenSet = true;
305 m_publicIpAddress = std::forward<PublicIpAddressT>(value);
306 }
307 template <typename PublicIpAddressT = Aws::String>
308 Instance& WithPublicIpAddress(PublicIpAddressT&& value) {
309 SetPublicIpAddress(std::forward<PublicIpAddressT>(value));
310 return *this;
311 }
313
315
318 inline const Aws::Vector<Aws::String>& GetIpv6Addresses() const { return m_ipv6Addresses; }
319 inline bool Ipv6AddressesHasBeenSet() const { return m_ipv6AddressesHasBeenSet; }
320 template <typename Ipv6AddressesT = Aws::Vector<Aws::String>>
321 void SetIpv6Addresses(Ipv6AddressesT&& value) {
322 m_ipv6AddressesHasBeenSet = true;
323 m_ipv6Addresses = std::forward<Ipv6AddressesT>(value);
324 }
325 template <typename Ipv6AddressesT = Aws::Vector<Aws::String>>
326 Instance& WithIpv6Addresses(Ipv6AddressesT&& value) {
327 SetIpv6Addresses(std::forward<Ipv6AddressesT>(value));
328 return *this;
329 }
330 template <typename Ipv6AddressesT = Aws::String>
331 Instance& AddIpv6Addresses(Ipv6AddressesT&& value) {
332 m_ipv6AddressesHasBeenSet = true;
333 m_ipv6Addresses.emplace_back(std::forward<Ipv6AddressesT>(value));
334 return *this;
335 }
337
339
344 inline IpAddressType GetIpAddressType() const { return m_ipAddressType; }
345 inline bool IpAddressTypeHasBeenSet() const { return m_ipAddressTypeHasBeenSet; }
346 inline void SetIpAddressType(IpAddressType value) {
347 m_ipAddressTypeHasBeenSet = true;
348 m_ipAddressType = value;
349 }
351 SetIpAddressType(value);
352 return *this;
353 }
355
357
360 inline const InstanceHardware& GetHardware() const { return m_hardware; }
361 inline bool HardwareHasBeenSet() const { return m_hardwareHasBeenSet; }
362 template <typename HardwareT = InstanceHardware>
363 void SetHardware(HardwareT&& value) {
364 m_hardwareHasBeenSet = true;
365 m_hardware = std::forward<HardwareT>(value);
366 }
367 template <typename HardwareT = InstanceHardware>
368 Instance& WithHardware(HardwareT&& value) {
369 SetHardware(std::forward<HardwareT>(value));
370 return *this;
371 }
373
375
379 inline const InstanceNetworking& GetNetworking() const { return m_networking; }
380 inline bool NetworkingHasBeenSet() const { return m_networkingHasBeenSet; }
381 template <typename NetworkingT = InstanceNetworking>
382 void SetNetworking(NetworkingT&& value) {
383 m_networkingHasBeenSet = true;
384 m_networking = std::forward<NetworkingT>(value);
385 }
386 template <typename NetworkingT = InstanceNetworking>
387 Instance& WithNetworking(NetworkingT&& value) {
388 SetNetworking(std::forward<NetworkingT>(value));
389 return *this;
390 }
392
394
397 inline const InstanceState& GetState() const { return m_state; }
398 inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
399 template <typename StateT = InstanceState>
400 void SetState(StateT&& value) {
401 m_stateHasBeenSet = true;
402 m_state = std::forward<StateT>(value);
403 }
404 template <typename StateT = InstanceState>
405 Instance& WithState(StateT&& value) {
406 SetState(std::forward<StateT>(value));
407 return *this;
408 }
410
412
415 inline const Aws::String& GetUsername() const { return m_username; }
416 inline bool UsernameHasBeenSet() const { return m_usernameHasBeenSet; }
417 template <typename UsernameT = Aws::String>
418 void SetUsername(UsernameT&& value) {
419 m_usernameHasBeenSet = true;
420 m_username = std::forward<UsernameT>(value);
421 }
422 template <typename UsernameT = Aws::String>
423 Instance& WithUsername(UsernameT&& value) {
424 SetUsername(std::forward<UsernameT>(value));
425 return *this;
426 }
428
430
434 inline const Aws::String& GetSshKeyName() const { return m_sshKeyName; }
435 inline bool SshKeyNameHasBeenSet() const { return m_sshKeyNameHasBeenSet; }
436 template <typename SshKeyNameT = Aws::String>
437 void SetSshKeyName(SshKeyNameT&& value) {
438 m_sshKeyNameHasBeenSet = true;
439 m_sshKeyName = std::forward<SshKeyNameT>(value);
440 }
441 template <typename SshKeyNameT = Aws::String>
442 Instance& WithSshKeyName(SshKeyNameT&& value) {
443 SetSshKeyName(std::forward<SshKeyNameT>(value));
444 return *this;
445 }
447
449
452 inline const InstanceMetadataOptions& GetMetadataOptions() const { return m_metadataOptions; }
453 inline bool MetadataOptionsHasBeenSet() const { return m_metadataOptionsHasBeenSet; }
454 template <typename MetadataOptionsT = InstanceMetadataOptions>
455 void SetMetadataOptions(MetadataOptionsT&& value) {
456 m_metadataOptionsHasBeenSet = true;
457 m_metadataOptions = std::forward<MetadataOptionsT>(value);
458 }
459 template <typename MetadataOptionsT = InstanceMetadataOptions>
460 Instance& WithMetadataOptions(MetadataOptionsT&& value) {
461 SetMetadataOptions(std::forward<MetadataOptionsT>(value));
462 return *this;
463 }
465 private:
466 Aws::String m_name;
467
468 Aws::String m_arn;
469
470 Aws::String m_supportCode;
471
472 Aws::Utils::DateTime m_createdAt{};
473
474 ResourceLocation m_location;
475
476 ResourceType m_resourceType{ResourceType::NOT_SET};
477
478 Aws::Vector<Tag> m_tags;
479
480 Aws::String m_blueprintId;
481
482 Aws::String m_blueprintName;
483
484 Aws::String m_bundleId;
485
486 Aws::Vector<AddOn> m_addOns;
487
488 bool m_isStaticIp{false};
489
490 Aws::String m_privateIpAddress;
491
492 Aws::String m_publicIpAddress;
493
494 Aws::Vector<Aws::String> m_ipv6Addresses;
495
496 IpAddressType m_ipAddressType{IpAddressType::NOT_SET};
497
498 InstanceHardware m_hardware;
499
500 InstanceNetworking m_networking;
501
502 InstanceState m_state;
503
504 Aws::String m_username;
505
506 Aws::String m_sshKeyName;
507
508 InstanceMetadataOptions m_metadataOptions;
509 bool m_nameHasBeenSet = false;
510 bool m_arnHasBeenSet = false;
511 bool m_supportCodeHasBeenSet = false;
512 bool m_createdAtHasBeenSet = false;
513 bool m_locationHasBeenSet = false;
514 bool m_resourceTypeHasBeenSet = false;
515 bool m_tagsHasBeenSet = false;
516 bool m_blueprintIdHasBeenSet = false;
517 bool m_blueprintNameHasBeenSet = false;
518 bool m_bundleIdHasBeenSet = false;
519 bool m_addOnsHasBeenSet = false;
520 bool m_isStaticIpHasBeenSet = false;
521 bool m_privateIpAddressHasBeenSet = false;
522 bool m_publicIpAddressHasBeenSet = false;
523 bool m_ipv6AddressesHasBeenSet = false;
524 bool m_ipAddressTypeHasBeenSet = false;
525 bool m_hardwareHasBeenSet = false;
526 bool m_networkingHasBeenSet = false;
527 bool m_stateHasBeenSet = false;
528 bool m_usernameHasBeenSet = false;
529 bool m_sshKeyNameHasBeenSet = false;
530 bool m_metadataOptionsHasBeenSet = false;
531};
532
533} // namespace Model
534} // namespace Lightsail
535} // namespace Aws
void SetCreatedAt(CreatedAtT &&value)
Definition Instance.h:111
Instance & WithBlueprintId(BlueprintIdT &&value)
Definition Instance.h:195
void SetNetworking(NetworkingT &&value)
Definition Instance.h:382
const InstanceMetadataOptions & GetMetadataOptions() const
Definition Instance.h:452
bool Ipv6AddressesHasBeenSet() const
Definition Instance.h:319
Instance & AddAddOns(AddOnsT &&value)
Definition Instance.h:254
bool IpAddressTypeHasBeenSet() const
Definition Instance.h:345
Instance & WithSshKeyName(SshKeyNameT &&value)
Definition Instance.h:442
void SetPrivateIpAddress(PrivateIpAddressT &&value)
Definition Instance.h:285
const Aws::String & GetBlueprintId() const
Definition Instance.h:187
const Aws::String & GetPublicIpAddress() const
Definition Instance.h:300
void SetTags(TagsT &&value)
Definition Instance.h:166
AWS_LIGHTSAIL_API Instance()=default
Instance & AddIpv6Addresses(Ipv6AddressesT &&value)
Definition Instance.h:331
const Aws::String & GetName() const
Definition Instance.h:50
Instance & WithState(StateT &&value)
Definition Instance.h:405
const ResourceLocation & GetLocation() const
Definition Instance.h:126
Instance & WithSupportCode(SupportCodeT &&value)
Definition Instance.h:97
const Aws::String & GetBundleId() const
Definition Instance.h:223
AWS_LIGHTSAIL_API Instance(Aws::Utils::Json::JsonView jsonValue)
Instance & WithIsStaticIp(bool value)
Definition Instance.h:272
const InstanceHardware & GetHardware() const
Definition Instance.h:360
Instance & WithBundleId(BundleIdT &&value)
Definition Instance.h:231
Instance & WithIpAddressType(IpAddressType value)
Definition Instance.h:350
ResourceType GetResourceType() const
Definition Instance.h:144
bool BlueprintNameHasBeenSet() const
Definition Instance.h:206
Instance & WithBlueprintName(BlueprintNameT &&value)
Definition Instance.h:213
void SetSshKeyName(SshKeyNameT &&value)
Definition Instance.h:437
void SetUsername(UsernameT &&value)
Definition Instance.h:418
bool SupportCodeHasBeenSet() const
Definition Instance.h:90
const Aws::String & GetUsername() const
Definition Instance.h:415
void SetLocation(LocationT &&value)
Definition Instance.h:129
Instance & WithAddOns(AddOnsT &&value)
Definition Instance.h:249
void SetMetadataOptions(MetadataOptionsT &&value)
Definition Instance.h:455
bool ResourceTypeHasBeenSet() const
Definition Instance.h:145
bool PublicIpAddressHasBeenSet() const
Definition Instance.h:301
Instance & WithLocation(LocationT &&value)
Definition Instance.h:134
bool MetadataOptionsHasBeenSet() const
Definition Instance.h:453
void SetIpv6Addresses(Ipv6AddressesT &&value)
Definition Instance.h:321
Instance & WithResourceType(ResourceType value)
Definition Instance.h:150
Instance & WithName(NameT &&value)
Definition Instance.h:58
Instance & AddTags(TagsT &&value)
Definition Instance.h:176
const Aws::Vector< AddOn > & GetAddOns() const
Definition Instance.h:241
Instance & WithIpv6Addresses(Ipv6AddressesT &&value)
Definition Instance.h:326
void SetBundleId(BundleIdT &&value)
Definition Instance.h:226
Instance & WithPrivateIpAddress(PrivateIpAddressT &&value)
Definition Instance.h:290
const Aws::String & GetPrivateIpAddress() const
Definition Instance.h:282
bool PrivateIpAddressHasBeenSet() const
Definition Instance.h:283
void SetIsStaticIp(bool value)
Definition Instance.h:268
Instance & WithMetadataOptions(MetadataOptionsT &&value)
Definition Instance.h:460
Instance & WithPublicIpAddress(PublicIpAddressT &&value)
Definition Instance.h:308
const Aws::String & GetBlueprintName() const
Definition Instance.h:205
const Aws::String & GetSupportCode() const
Definition Instance.h:89
Instance & WithArn(ArnT &&value)
Definition Instance.h:77
void SetIpAddressType(IpAddressType value)
Definition Instance.h:346
const Aws::String & GetArn() const
Definition Instance.h:69
void SetAddOns(AddOnsT &&value)
Definition Instance.h:244
void SetHardware(HardwareT &&value)
Definition Instance.h:363
Instance & WithHardware(HardwareT &&value)
Definition Instance.h:368
const Aws::Vector< Tag > & GetTags() const
Definition Instance.h:163
void SetBlueprintId(BlueprintIdT &&value)
Definition Instance.h:190
const Aws::Utils::DateTime & GetCreatedAt() const
Definition Instance.h:108
void SetBlueprintName(BlueprintNameT &&value)
Definition Instance.h:208
AWS_LIGHTSAIL_API Instance & operator=(Aws::Utils::Json::JsonView jsonValue)
const Aws::String & GetSshKeyName() const
Definition Instance.h:434
IpAddressType GetIpAddressType() const
Definition Instance.h:344
void SetArn(ArnT &&value)
Definition Instance.h:72
const InstanceNetworking & GetNetworking() const
Definition Instance.h:379
void SetPublicIpAddress(PublicIpAddressT &&value)
Definition Instance.h:303
Instance & WithNetworking(NetworkingT &&value)
Definition Instance.h:387
void SetName(NameT &&value)
Definition Instance.h:53
void SetResourceType(ResourceType value)
Definition Instance.h:146
Instance & WithCreatedAt(CreatedAtT &&value)
Definition Instance.h:116
const InstanceState & GetState() const
Definition Instance.h:397
Instance & WithTags(TagsT &&value)
Definition Instance.h:171
void SetState(StateT &&value)
Definition Instance.h:400
void SetSupportCode(SupportCodeT &&value)
Definition Instance.h:92
const Aws::Vector< Aws::String > & GetIpv6Addresses() const
Definition Instance.h:318
Instance & WithUsername(UsernameT &&value)
Definition Instance.h:423
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue