AWS SDK for C++

AWS SDK for C++ Version 1.11.788

Loading...
Searching...
No Matches
Alarm.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/AlarmState.h>
12#include <aws/lightsail/model/ComparisonOperator.h>
13#include <aws/lightsail/model/ContactProtocol.h>
14#include <aws/lightsail/model/MetricName.h>
15#include <aws/lightsail/model/MetricStatistic.h>
16#include <aws/lightsail/model/MetricUnit.h>
17#include <aws/lightsail/model/MonitoredResourceInfo.h>
18#include <aws/lightsail/model/ResourceLocation.h>
19#include <aws/lightsail/model/ResourceType.h>
20#include <aws/lightsail/model/Tag.h>
21#include <aws/lightsail/model/TreatMissingData.h>
22
23#include <utility>
24
25namespace Aws {
26namespace Utils {
27namespace Json {
28class JsonValue;
29class JsonView;
30} // namespace Json
31} // namespace Utils
32namespace Lightsail {
33namespace Model {
34
43class Alarm {
44 public:
45 AWS_LIGHTSAIL_API Alarm() = default;
46 AWS_LIGHTSAIL_API Alarm(Aws::Utils::Json::JsonView jsonValue);
47 AWS_LIGHTSAIL_API Alarm& operator=(Aws::Utils::Json::JsonView jsonValue);
48 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
49
51
54 inline const Aws::String& GetName() const { return m_name; }
55 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
56 template <typename NameT = Aws::String>
57 void SetName(NameT&& value) {
58 m_nameHasBeenSet = true;
59 m_name = std::forward<NameT>(value);
60 }
61 template <typename NameT = Aws::String>
62 Alarm& WithName(NameT&& value) {
63 SetName(std::forward<NameT>(value));
64 return *this;
65 }
67
69
72 inline const Aws::String& GetArn() const { return m_arn; }
73 inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; }
74 template <typename ArnT = Aws::String>
75 void SetArn(ArnT&& value) {
76 m_arnHasBeenSet = true;
77 m_arn = std::forward<ArnT>(value);
78 }
79 template <typename ArnT = Aws::String>
80 Alarm& WithArn(ArnT&& value) {
81 SetArn(std::forward<ArnT>(value));
82 return *this;
83 }
85
87
90 inline const Aws::Utils::DateTime& GetCreatedAt() const { return m_createdAt; }
91 inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; }
92 template <typename CreatedAtT = Aws::Utils::DateTime>
93 void SetCreatedAt(CreatedAtT&& value) {
94 m_createdAtHasBeenSet = true;
95 m_createdAt = std::forward<CreatedAtT>(value);
96 }
97 template <typename CreatedAtT = Aws::Utils::DateTime>
98 Alarm& WithCreatedAt(CreatedAtT&& value) {
99 SetCreatedAt(std::forward<CreatedAtT>(value));
100 return *this;
101 }
103
105
108 inline const ResourceLocation& GetLocation() const { return m_location; }
109 inline bool LocationHasBeenSet() const { return m_locationHasBeenSet; }
110 template <typename LocationT = ResourceLocation>
111 void SetLocation(LocationT&& value) {
112 m_locationHasBeenSet = true;
113 m_location = std::forward<LocationT>(value);
114 }
115 template <typename LocationT = ResourceLocation>
116 Alarm& WithLocation(LocationT&& value) {
117 SetLocation(std::forward<LocationT>(value));
118 return *this;
119 }
121
123
126 inline ResourceType GetResourceType() const { return m_resourceType; }
127 inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }
128 inline void SetResourceType(ResourceType value) {
129 m_resourceTypeHasBeenSet = true;
130 m_resourceType = value;
131 }
133 SetResourceType(value);
134 return *this;
135 }
137
139
144 inline const Aws::String& GetSupportCode() const { return m_supportCode; }
145 inline bool SupportCodeHasBeenSet() const { return m_supportCodeHasBeenSet; }
146 template <typename SupportCodeT = Aws::String>
147 void SetSupportCode(SupportCodeT&& value) {
148 m_supportCodeHasBeenSet = true;
149 m_supportCode = std::forward<SupportCodeT>(value);
150 }
151 template <typename SupportCodeT = Aws::String>
152 Alarm& WithSupportCode(SupportCodeT&& value) {
153 SetSupportCode(std::forward<SupportCodeT>(value));
154 return *this;
155 }
157
159
163 inline const MonitoredResourceInfo& GetMonitoredResourceInfo() const { return m_monitoredResourceInfo; }
164 inline bool MonitoredResourceInfoHasBeenSet() const { return m_monitoredResourceInfoHasBeenSet; }
165 template <typename MonitoredResourceInfoT = MonitoredResourceInfo>
166 void SetMonitoredResourceInfo(MonitoredResourceInfoT&& value) {
167 m_monitoredResourceInfoHasBeenSet = true;
168 m_monitoredResourceInfo = std::forward<MonitoredResourceInfoT>(value);
169 }
170 template <typename MonitoredResourceInfoT = MonitoredResourceInfo>
171 Alarm& WithMonitoredResourceInfo(MonitoredResourceInfoT&& value) {
172 SetMonitoredResourceInfo(std::forward<MonitoredResourceInfoT>(value));
173 return *this;
174 }
176
178
182 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
183 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
185 m_comparisonOperatorHasBeenSet = true;
186 m_comparisonOperator = value;
187 }
190 return *this;
191 }
193
195
199 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
200 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
201 inline void SetEvaluationPeriods(int value) {
202 m_evaluationPeriodsHasBeenSet = true;
203 m_evaluationPeriods = value;
204 }
205 inline Alarm& WithEvaluationPeriods(int value) {
207 return *this;
208 }
210
212
215 inline int GetPeriod() const { return m_period; }
216 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
217 inline void SetPeriod(int value) {
218 m_periodHasBeenSet = true;
219 m_period = value;
220 }
221 inline Alarm& WithPeriod(int value) {
222 SetPeriod(value);
223 return *this;
224 }
226
228
231 inline double GetThreshold() const { return m_threshold; }
232 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
233 inline void SetThreshold(double value) {
234 m_thresholdHasBeenSet = true;
235 m_threshold = value;
236 }
237 inline Alarm& WithThreshold(double value) {
238 SetThreshold(value);
239 return *this;
240 }
242
244
248 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
249 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
250 inline void SetDatapointsToAlarm(int value) {
251 m_datapointsToAlarmHasBeenSet = true;
252 m_datapointsToAlarm = value;
253 }
254 inline Alarm& WithDatapointsToAlarm(int value) {
256 return *this;
257 }
259
261
273 inline TreatMissingData GetTreatMissingData() const { return m_treatMissingData; }
274 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
276 m_treatMissingDataHasBeenSet = true;
277 m_treatMissingData = value;
278 }
280 SetTreatMissingData(value);
281 return *this;
282 }
284
286
303 inline MetricStatistic GetStatistic() const { return m_statistic; }
304 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
305 inline void SetStatistic(MetricStatistic value) {
306 m_statisticHasBeenSet = true;
307 m_statistic = value;
308 }
310 SetStatistic(value);
311 return *this;
312 }
314
316
319 inline MetricName GetMetricName() const { return m_metricName; }
320 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
321 inline void SetMetricName(MetricName value) {
322 m_metricNameHasBeenSet = true;
323 m_metricName = value;
324 }
326 SetMetricName(value);
327 return *this;
328 }
330
332
340 inline AlarmState GetState() const { return m_state; }
341 inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
342 inline void SetState(AlarmState value) {
343 m_stateHasBeenSet = true;
344 m_state = value;
345 }
346 inline Alarm& WithState(AlarmState value) {
347 SetState(value);
348 return *this;
349 }
351
353
356 inline MetricUnit GetUnit() const { return m_unit; }
357 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
358 inline void SetUnit(MetricUnit value) {
359 m_unitHasBeenSet = true;
360 m_unit = value;
361 }
362 inline Alarm& WithUnit(MetricUnit value) {
363 SetUnit(value);
364 return *this;
365 }
367
369
373 inline const Aws::Vector<ContactProtocol>& GetContactProtocols() const { return m_contactProtocols; }
374 inline bool ContactProtocolsHasBeenSet() const { return m_contactProtocolsHasBeenSet; }
375 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
376 void SetContactProtocols(ContactProtocolsT&& value) {
377 m_contactProtocolsHasBeenSet = true;
378 m_contactProtocols = std::forward<ContactProtocolsT>(value);
379 }
380 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
381 Alarm& WithContactProtocols(ContactProtocolsT&& value) {
382 SetContactProtocols(std::forward<ContactProtocolsT>(value));
383 return *this;
384 }
386 m_contactProtocolsHasBeenSet = true;
387 m_contactProtocols.push_back(value);
388 return *this;
389 }
391
393
396 inline const Aws::Vector<AlarmState>& GetNotificationTriggers() const { return m_notificationTriggers; }
397 inline bool NotificationTriggersHasBeenSet() const { return m_notificationTriggersHasBeenSet; }
398 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
399 void SetNotificationTriggers(NotificationTriggersT&& value) {
400 m_notificationTriggersHasBeenSet = true;
401 m_notificationTriggers = std::forward<NotificationTriggersT>(value);
402 }
403 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
404 Alarm& WithNotificationTriggers(NotificationTriggersT&& value) {
405 SetNotificationTriggers(std::forward<NotificationTriggersT>(value));
406 return *this;
407 }
409 m_notificationTriggersHasBeenSet = true;
410 m_notificationTriggers.push_back(value);
411 return *this;
412 }
414
416
419 inline bool GetNotificationEnabled() const { return m_notificationEnabled; }
420 inline bool NotificationEnabledHasBeenSet() const { return m_notificationEnabledHasBeenSet; }
421 inline void SetNotificationEnabled(bool value) {
422 m_notificationEnabledHasBeenSet = true;
423 m_notificationEnabled = value;
424 }
425 inline Alarm& WithNotificationEnabled(bool value) {
427 return *this;
428 }
430
432
438 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
439 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
440 template <typename TagsT = Aws::Vector<Tag>>
441 void SetTags(TagsT&& value) {
442 m_tagsHasBeenSet = true;
443 m_tags = std::forward<TagsT>(value);
444 }
445 template <typename TagsT = Aws::Vector<Tag>>
446 Alarm& WithTags(TagsT&& value) {
447 SetTags(std::forward<TagsT>(value));
448 return *this;
449 }
450 template <typename TagsT = Tag>
451 Alarm& AddTags(TagsT&& value) {
452 m_tagsHasBeenSet = true;
453 m_tags.emplace_back(std::forward<TagsT>(value));
454 return *this;
455 }
457 private:
458 Aws::String m_name;
459
460 Aws::String m_arn;
461
462 Aws::Utils::DateTime m_createdAt{};
463
464 ResourceLocation m_location;
465
466 ResourceType m_resourceType{ResourceType::NOT_SET};
467
468 Aws::String m_supportCode;
469
470 MonitoredResourceInfo m_monitoredResourceInfo;
471
473
474 int m_evaluationPeriods{0};
475
476 int m_period{0};
477
478 double m_threshold{0.0};
479
480 int m_datapointsToAlarm{0};
481
483
485
486 MetricName m_metricName{MetricName::NOT_SET};
487
489
491
492 Aws::Vector<ContactProtocol> m_contactProtocols;
493
494 Aws::Vector<AlarmState> m_notificationTriggers;
495
496 bool m_notificationEnabled{false};
497
498 Aws::Vector<Tag> m_tags;
499 bool m_nameHasBeenSet = false;
500 bool m_arnHasBeenSet = false;
501 bool m_createdAtHasBeenSet = false;
502 bool m_locationHasBeenSet = false;
503 bool m_resourceTypeHasBeenSet = false;
504 bool m_supportCodeHasBeenSet = false;
505 bool m_monitoredResourceInfoHasBeenSet = false;
506 bool m_comparisonOperatorHasBeenSet = false;
507 bool m_evaluationPeriodsHasBeenSet = false;
508 bool m_periodHasBeenSet = false;
509 bool m_thresholdHasBeenSet = false;
510 bool m_datapointsToAlarmHasBeenSet = false;
511 bool m_treatMissingDataHasBeenSet = false;
512 bool m_statisticHasBeenSet = false;
513 bool m_metricNameHasBeenSet = false;
514 bool m_stateHasBeenSet = false;
515 bool m_unitHasBeenSet = false;
516 bool m_contactProtocolsHasBeenSet = false;
517 bool m_notificationTriggersHasBeenSet = false;
518 bool m_notificationEnabledHasBeenSet = false;
519 bool m_tagsHasBeenSet = false;
520};
521
522} // namespace Model
523} // namespace Lightsail
524} // namespace Aws
void SetSupportCode(SupportCodeT &&value)
Definition Alarm.h:147
bool CreatedAtHasBeenSet() const
Definition Alarm.h:91
void SetThreshold(double value)
Definition Alarm.h:233
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
ResourceType GetResourceType() const
Definition Alarm.h:126
bool TagsHasBeenSet() const
Definition Alarm.h:439
Alarm & WithArn(ArnT &&value)
Definition Alarm.h:80
Alarm & WithContactProtocols(ContactProtocolsT &&value)
Definition Alarm.h:381
double GetThreshold() const
Definition Alarm.h:231
void SetContactProtocols(ContactProtocolsT &&value)
Definition Alarm.h:376
bool GetNotificationEnabled() const
Definition Alarm.h:419
bool ThresholdHasBeenSet() const
Definition Alarm.h:232
Alarm & AddContactProtocols(ContactProtocol value)
Definition Alarm.h:385
Alarm & WithUnit(MetricUnit value)
Definition Alarm.h:362
void SetResourceType(ResourceType value)
Definition Alarm.h:128
Alarm & WithMonitoredResourceInfo(MonitoredResourceInfoT &&value)
Definition Alarm.h:171
Alarm & AddTags(TagsT &&value)
Definition Alarm.h:451
bool LocationHasBeenSet() const
Definition Alarm.h:109
ComparisonOperator GetComparisonOperator() const
Definition Alarm.h:182
void SetCreatedAt(CreatedAtT &&value)
Definition Alarm.h:93
Alarm & WithCreatedAt(CreatedAtT &&value)
Definition Alarm.h:98
void SetNotificationEnabled(bool value)
Definition Alarm.h:421
const Aws::String & GetName() const
Definition Alarm.h:54
void SetArn(ArnT &&value)
Definition Alarm.h:75
MetricStatistic GetStatistic() const
Definition Alarm.h:303
bool TreatMissingDataHasBeenSet() const
Definition Alarm.h:274
const Aws::Vector< AlarmState > & GetNotificationTriggers() const
Definition Alarm.h:396
void SetMetricName(MetricName value)
Definition Alarm.h:321
void SetTags(TagsT &&value)
Definition Alarm.h:441
Alarm & WithPeriod(int value)
Definition Alarm.h:221
void SetLocation(LocationT &&value)
Definition Alarm.h:111
Alarm & AddNotificationTriggers(AlarmState value)
Definition Alarm.h:408
void SetPeriod(int value)
Definition Alarm.h:217
bool MetricNameHasBeenSet() const
Definition Alarm.h:320
int GetDatapointsToAlarm() const
Definition Alarm.h:248
Alarm & WithTags(TagsT &&value)
Definition Alarm.h:446
bool NameHasBeenSet() const
Definition Alarm.h:55
void SetDatapointsToAlarm(int value)
Definition Alarm.h:250
Alarm & WithNotificationEnabled(bool value)
Definition Alarm.h:425
AWS_LIGHTSAIL_API Alarm(Aws::Utils::Json::JsonView jsonValue)
Alarm & WithName(NameT &&value)
Definition Alarm.h:62
const Aws::Vector< Tag > & GetTags() const
Definition Alarm.h:438
bool DatapointsToAlarmHasBeenSet() const
Definition Alarm.h:249
const MonitoredResourceInfo & GetMonitoredResourceInfo() const
Definition Alarm.h:163
bool UnitHasBeenSet() const
Definition Alarm.h:357
bool EvaluationPeriodsHasBeenSet() const
Definition Alarm.h:200
Alarm & WithNotificationTriggers(NotificationTriggersT &&value)
Definition Alarm.h:404
bool ResourceTypeHasBeenSet() const
Definition Alarm.h:127
void SetNotificationTriggers(NotificationTriggersT &&value)
Definition Alarm.h:399
void SetComparisonOperator(ComparisonOperator value)
Definition Alarm.h:184
Alarm & WithComparisonOperator(ComparisonOperator value)
Definition Alarm.h:188
Alarm & WithMetricName(MetricName value)
Definition Alarm.h:325
void SetEvaluationPeriods(int value)
Definition Alarm.h:201
void SetName(NameT &&value)
Definition Alarm.h:57
const Aws::Utils::DateTime & GetCreatedAt() const
Definition Alarm.h:90
const Aws::String & GetSupportCode() const
Definition Alarm.h:144
int GetEvaluationPeriods() const
Definition Alarm.h:199
Alarm & WithSupportCode(SupportCodeT &&value)
Definition Alarm.h:152
MetricUnit GetUnit() const
Definition Alarm.h:356
AWS_LIGHTSAIL_API Alarm()=default
void SetState(AlarmState value)
Definition Alarm.h:342
Alarm & WithEvaluationPeriods(int value)
Definition Alarm.h:205
void SetStatistic(MetricStatistic value)
Definition Alarm.h:305
Alarm & WithThreshold(double value)
Definition Alarm.h:237
bool ArnHasBeenSet() const
Definition Alarm.h:73
const Aws::Vector< ContactProtocol > & GetContactProtocols() const
Definition Alarm.h:373
bool StatisticHasBeenSet() const
Definition Alarm.h:304
Alarm & WithStatistic(MetricStatistic value)
Definition Alarm.h:309
void SetTreatMissingData(TreatMissingData value)
Definition Alarm.h:275
bool ComparisonOperatorHasBeenSet() const
Definition Alarm.h:183
Alarm & WithLocation(LocationT &&value)
Definition Alarm.h:116
bool MonitoredResourceInfoHasBeenSet() const
Definition Alarm.h:164
Alarm & WithResourceType(ResourceType value)
Definition Alarm.h:132
bool NotificationEnabledHasBeenSet() const
Definition Alarm.h:420
const Aws::String & GetArn() const
Definition Alarm.h:72
AWS_LIGHTSAIL_API Alarm & operator=(Aws::Utils::Json::JsonView jsonValue)
Alarm & WithDatapointsToAlarm(int value)
Definition Alarm.h:254
bool NotificationTriggersHasBeenSet() const
Definition Alarm.h:397
bool SupportCodeHasBeenSet() const
Definition Alarm.h:145
void SetMonitoredResourceInfo(MonitoredResourceInfoT &&value)
Definition Alarm.h:166
void SetUnit(MetricUnit value)
Definition Alarm.h:358
bool PeriodHasBeenSet() const
Definition Alarm.h:216
TreatMissingData GetTreatMissingData() const
Definition Alarm.h:273
const ResourceLocation & GetLocation() const
Definition Alarm.h:108
AlarmState GetState() const
Definition Alarm.h:340
Alarm & WithTreatMissingData(TreatMissingData value)
Definition Alarm.h:279
bool StateHasBeenSet() const
Definition Alarm.h:341
MetricName GetMetricName() const
Definition Alarm.h:319
bool ContactProtocolsHasBeenSet() const
Definition Alarm.h:374
Alarm & WithState(AlarmState value)
Definition Alarm.h:346
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue