AWS SDK for C++

AWS SDK for C++ Version 1.11.752

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/TreatMissingData.h>
21
22#include <utility>
23
24namespace Aws {
25namespace Utils {
26namespace Json {
27class JsonValue;
28class JsonView;
29} // namespace Json
30} // namespace Utils
31namespace Lightsail {
32namespace Model {
33
42class Alarm {
43 public:
44 AWS_LIGHTSAIL_API Alarm() = default;
45 AWS_LIGHTSAIL_API Alarm(Aws::Utils::Json::JsonView jsonValue);
46 AWS_LIGHTSAIL_API Alarm& operator=(Aws::Utils::Json::JsonView jsonValue);
47 AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const;
48
50
53 inline const Aws::String& GetName() const { return m_name; }
54 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
55 template <typename NameT = Aws::String>
56 void SetName(NameT&& value) {
57 m_nameHasBeenSet = true;
58 m_name = std::forward<NameT>(value);
59 }
60 template <typename NameT = Aws::String>
61 Alarm& WithName(NameT&& value) {
62 SetName(std::forward<NameT>(value));
63 return *this;
64 }
66
68
71 inline const Aws::String& GetArn() const { return m_arn; }
72 inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; }
73 template <typename ArnT = Aws::String>
74 void SetArn(ArnT&& value) {
75 m_arnHasBeenSet = true;
76 m_arn = std::forward<ArnT>(value);
77 }
78 template <typename ArnT = Aws::String>
79 Alarm& WithArn(ArnT&& value) {
80 SetArn(std::forward<ArnT>(value));
81 return *this;
82 }
84
86
89 inline const Aws::Utils::DateTime& GetCreatedAt() const { return m_createdAt; }
90 inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; }
91 template <typename CreatedAtT = Aws::Utils::DateTime>
92 void SetCreatedAt(CreatedAtT&& value) {
93 m_createdAtHasBeenSet = true;
94 m_createdAt = std::forward<CreatedAtT>(value);
95 }
96 template <typename CreatedAtT = Aws::Utils::DateTime>
97 Alarm& WithCreatedAt(CreatedAtT&& value) {
98 SetCreatedAt(std::forward<CreatedAtT>(value));
99 return *this;
100 }
102
104
107 inline const ResourceLocation& GetLocation() const { return m_location; }
108 inline bool LocationHasBeenSet() const { return m_locationHasBeenSet; }
109 template <typename LocationT = ResourceLocation>
110 void SetLocation(LocationT&& value) {
111 m_locationHasBeenSet = true;
112 m_location = std::forward<LocationT>(value);
113 }
114 template <typename LocationT = ResourceLocation>
115 Alarm& WithLocation(LocationT&& value) {
116 SetLocation(std::forward<LocationT>(value));
117 return *this;
118 }
120
122
125 inline ResourceType GetResourceType() const { return m_resourceType; }
126 inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }
127 inline void SetResourceType(ResourceType value) {
128 m_resourceTypeHasBeenSet = true;
129 m_resourceType = value;
130 }
132 SetResourceType(value);
133 return *this;
134 }
136
138
143 inline const Aws::String& GetSupportCode() const { return m_supportCode; }
144 inline bool SupportCodeHasBeenSet() const { return m_supportCodeHasBeenSet; }
145 template <typename SupportCodeT = Aws::String>
146 void SetSupportCode(SupportCodeT&& value) {
147 m_supportCodeHasBeenSet = true;
148 m_supportCode = std::forward<SupportCodeT>(value);
149 }
150 template <typename SupportCodeT = Aws::String>
151 Alarm& WithSupportCode(SupportCodeT&& value) {
152 SetSupportCode(std::forward<SupportCodeT>(value));
153 return *this;
154 }
156
158
162 inline const MonitoredResourceInfo& GetMonitoredResourceInfo() const { return m_monitoredResourceInfo; }
163 inline bool MonitoredResourceInfoHasBeenSet() const { return m_monitoredResourceInfoHasBeenSet; }
164 template <typename MonitoredResourceInfoT = MonitoredResourceInfo>
165 void SetMonitoredResourceInfo(MonitoredResourceInfoT&& value) {
166 m_monitoredResourceInfoHasBeenSet = true;
167 m_monitoredResourceInfo = std::forward<MonitoredResourceInfoT>(value);
168 }
169 template <typename MonitoredResourceInfoT = MonitoredResourceInfo>
170 Alarm& WithMonitoredResourceInfo(MonitoredResourceInfoT&& value) {
171 SetMonitoredResourceInfo(std::forward<MonitoredResourceInfoT>(value));
172 return *this;
173 }
175
177
181 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
182 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
184 m_comparisonOperatorHasBeenSet = true;
185 m_comparisonOperator = value;
186 }
189 return *this;
190 }
192
194
198 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
199 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
200 inline void SetEvaluationPeriods(int value) {
201 m_evaluationPeriodsHasBeenSet = true;
202 m_evaluationPeriods = value;
203 }
204 inline Alarm& WithEvaluationPeriods(int value) {
206 return *this;
207 }
209
211
214 inline int GetPeriod() const { return m_period; }
215 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
216 inline void SetPeriod(int value) {
217 m_periodHasBeenSet = true;
218 m_period = value;
219 }
220 inline Alarm& WithPeriod(int value) {
221 SetPeriod(value);
222 return *this;
223 }
225
227
230 inline double GetThreshold() const { return m_threshold; }
231 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
232 inline void SetThreshold(double value) {
233 m_thresholdHasBeenSet = true;
234 m_threshold = value;
235 }
236 inline Alarm& WithThreshold(double value) {
237 SetThreshold(value);
238 return *this;
239 }
241
243
247 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
248 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
249 inline void SetDatapointsToAlarm(int value) {
250 m_datapointsToAlarmHasBeenSet = true;
251 m_datapointsToAlarm = value;
252 }
253 inline Alarm& WithDatapointsToAlarm(int value) {
255 return *this;
256 }
258
260
272 inline TreatMissingData GetTreatMissingData() const { return m_treatMissingData; }
273 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
275 m_treatMissingDataHasBeenSet = true;
276 m_treatMissingData = value;
277 }
279 SetTreatMissingData(value);
280 return *this;
281 }
283
285
302 inline MetricStatistic GetStatistic() const { return m_statistic; }
303 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
304 inline void SetStatistic(MetricStatistic value) {
305 m_statisticHasBeenSet = true;
306 m_statistic = value;
307 }
309 SetStatistic(value);
310 return *this;
311 }
313
315
318 inline MetricName GetMetricName() const { return m_metricName; }
319 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
320 inline void SetMetricName(MetricName value) {
321 m_metricNameHasBeenSet = true;
322 m_metricName = value;
323 }
325 SetMetricName(value);
326 return *this;
327 }
329
331
339 inline AlarmState GetState() const { return m_state; }
340 inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
341 inline void SetState(AlarmState value) {
342 m_stateHasBeenSet = true;
343 m_state = value;
344 }
345 inline Alarm& WithState(AlarmState value) {
346 SetState(value);
347 return *this;
348 }
350
352
355 inline MetricUnit GetUnit() const { return m_unit; }
356 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
357 inline void SetUnit(MetricUnit value) {
358 m_unitHasBeenSet = true;
359 m_unit = value;
360 }
361 inline Alarm& WithUnit(MetricUnit value) {
362 SetUnit(value);
363 return *this;
364 }
366
368
372 inline const Aws::Vector<ContactProtocol>& GetContactProtocols() const { return m_contactProtocols; }
373 inline bool ContactProtocolsHasBeenSet() const { return m_contactProtocolsHasBeenSet; }
374 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
375 void SetContactProtocols(ContactProtocolsT&& value) {
376 m_contactProtocolsHasBeenSet = true;
377 m_contactProtocols = std::forward<ContactProtocolsT>(value);
378 }
379 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
380 Alarm& WithContactProtocols(ContactProtocolsT&& value) {
381 SetContactProtocols(std::forward<ContactProtocolsT>(value));
382 return *this;
383 }
385 m_contactProtocolsHasBeenSet = true;
386 m_contactProtocols.push_back(value);
387 return *this;
388 }
390
392
395 inline const Aws::Vector<AlarmState>& GetNotificationTriggers() const { return m_notificationTriggers; }
396 inline bool NotificationTriggersHasBeenSet() const { return m_notificationTriggersHasBeenSet; }
397 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
398 void SetNotificationTriggers(NotificationTriggersT&& value) {
399 m_notificationTriggersHasBeenSet = true;
400 m_notificationTriggers = std::forward<NotificationTriggersT>(value);
401 }
402 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
403 Alarm& WithNotificationTriggers(NotificationTriggersT&& value) {
404 SetNotificationTriggers(std::forward<NotificationTriggersT>(value));
405 return *this;
406 }
408 m_notificationTriggersHasBeenSet = true;
409 m_notificationTriggers.push_back(value);
410 return *this;
411 }
413
415
418 inline bool GetNotificationEnabled() const { return m_notificationEnabled; }
419 inline bool NotificationEnabledHasBeenSet() const { return m_notificationEnabledHasBeenSet; }
420 inline void SetNotificationEnabled(bool value) {
421 m_notificationEnabledHasBeenSet = true;
422 m_notificationEnabled = value;
423 }
424 inline Alarm& WithNotificationEnabled(bool value) {
426 return *this;
427 }
429 private:
430 Aws::String m_name;
431
432 Aws::String m_arn;
433
434 Aws::Utils::DateTime m_createdAt{};
435
436 ResourceLocation m_location;
437
438 ResourceType m_resourceType{ResourceType::NOT_SET};
439
440 Aws::String m_supportCode;
441
442 MonitoredResourceInfo m_monitoredResourceInfo;
443
445
446 int m_evaluationPeriods{0};
447
448 int m_period{0};
449
450 double m_threshold{0.0};
451
452 int m_datapointsToAlarm{0};
453
455
457
458 MetricName m_metricName{MetricName::NOT_SET};
459
461
463
464 Aws::Vector<ContactProtocol> m_contactProtocols;
465
466 Aws::Vector<AlarmState> m_notificationTriggers;
467
468 bool m_notificationEnabled{false};
469 bool m_nameHasBeenSet = false;
470 bool m_arnHasBeenSet = false;
471 bool m_createdAtHasBeenSet = false;
472 bool m_locationHasBeenSet = false;
473 bool m_resourceTypeHasBeenSet = false;
474 bool m_supportCodeHasBeenSet = false;
475 bool m_monitoredResourceInfoHasBeenSet = false;
476 bool m_comparisonOperatorHasBeenSet = false;
477 bool m_evaluationPeriodsHasBeenSet = false;
478 bool m_periodHasBeenSet = false;
479 bool m_thresholdHasBeenSet = false;
480 bool m_datapointsToAlarmHasBeenSet = false;
481 bool m_treatMissingDataHasBeenSet = false;
482 bool m_statisticHasBeenSet = false;
483 bool m_metricNameHasBeenSet = false;
484 bool m_stateHasBeenSet = false;
485 bool m_unitHasBeenSet = false;
486 bool m_contactProtocolsHasBeenSet = false;
487 bool m_notificationTriggersHasBeenSet = false;
488 bool m_notificationEnabledHasBeenSet = false;
489};
490
491} // namespace Model
492} // namespace Lightsail
493} // namespace Aws
void SetSupportCode(SupportCodeT &&value)
Definition Alarm.h:146
bool CreatedAtHasBeenSet() const
Definition Alarm.h:90
void SetThreshold(double value)
Definition Alarm.h:232
AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const
ResourceType GetResourceType() const
Definition Alarm.h:125
Alarm & WithArn(ArnT &&value)
Definition Alarm.h:79
Alarm & WithContactProtocols(ContactProtocolsT &&value)
Definition Alarm.h:380
double GetThreshold() const
Definition Alarm.h:230
void SetContactProtocols(ContactProtocolsT &&value)
Definition Alarm.h:375
bool GetNotificationEnabled() const
Definition Alarm.h:418
bool ThresholdHasBeenSet() const
Definition Alarm.h:231
Alarm & AddContactProtocols(ContactProtocol value)
Definition Alarm.h:384
Alarm & WithUnit(MetricUnit value)
Definition Alarm.h:361
void SetResourceType(ResourceType value)
Definition Alarm.h:127
Alarm & WithMonitoredResourceInfo(MonitoredResourceInfoT &&value)
Definition Alarm.h:170
bool LocationHasBeenSet() const
Definition Alarm.h:108
ComparisonOperator GetComparisonOperator() const
Definition Alarm.h:181
void SetCreatedAt(CreatedAtT &&value)
Definition Alarm.h:92
Alarm & WithCreatedAt(CreatedAtT &&value)
Definition Alarm.h:97
void SetNotificationEnabled(bool value)
Definition Alarm.h:420
const Aws::String & GetName() const
Definition Alarm.h:53
void SetArn(ArnT &&value)
Definition Alarm.h:74
MetricStatistic GetStatistic() const
Definition Alarm.h:302
bool TreatMissingDataHasBeenSet() const
Definition Alarm.h:273
const Aws::Vector< AlarmState > & GetNotificationTriggers() const
Definition Alarm.h:395
void SetMetricName(MetricName value)
Definition Alarm.h:320
Alarm & WithPeriod(int value)
Definition Alarm.h:220
void SetLocation(LocationT &&value)
Definition Alarm.h:110
Alarm & AddNotificationTriggers(AlarmState value)
Definition Alarm.h:407
void SetPeriod(int value)
Definition Alarm.h:216
bool MetricNameHasBeenSet() const
Definition Alarm.h:319
int GetDatapointsToAlarm() const
Definition Alarm.h:247
bool NameHasBeenSet() const
Definition Alarm.h:54
void SetDatapointsToAlarm(int value)
Definition Alarm.h:249
Alarm & WithNotificationEnabled(bool value)
Definition Alarm.h:424
AWS_LIGHTSAIL_API Alarm(Aws::Utils::Json::JsonView jsonValue)
Alarm & WithName(NameT &&value)
Definition Alarm.h:61
bool DatapointsToAlarmHasBeenSet() const
Definition Alarm.h:248
const MonitoredResourceInfo & GetMonitoredResourceInfo() const
Definition Alarm.h:162
bool UnitHasBeenSet() const
Definition Alarm.h:356
bool EvaluationPeriodsHasBeenSet() const
Definition Alarm.h:199
Alarm & WithNotificationTriggers(NotificationTriggersT &&value)
Definition Alarm.h:403
bool ResourceTypeHasBeenSet() const
Definition Alarm.h:126
void SetNotificationTriggers(NotificationTriggersT &&value)
Definition Alarm.h:398
void SetComparisonOperator(ComparisonOperator value)
Definition Alarm.h:183
Alarm & WithComparisonOperator(ComparisonOperator value)
Definition Alarm.h:187
Alarm & WithMetricName(MetricName value)
Definition Alarm.h:324
void SetEvaluationPeriods(int value)
Definition Alarm.h:200
void SetName(NameT &&value)
Definition Alarm.h:56
const Aws::Utils::DateTime & GetCreatedAt() const
Definition Alarm.h:89
const Aws::String & GetSupportCode() const
Definition Alarm.h:143
int GetEvaluationPeriods() const
Definition Alarm.h:198
Alarm & WithSupportCode(SupportCodeT &&value)
Definition Alarm.h:151
MetricUnit GetUnit() const
Definition Alarm.h:355
AWS_LIGHTSAIL_API Alarm()=default
void SetState(AlarmState value)
Definition Alarm.h:341
Alarm & WithEvaluationPeriods(int value)
Definition Alarm.h:204
void SetStatistic(MetricStatistic value)
Definition Alarm.h:304
Alarm & WithThreshold(double value)
Definition Alarm.h:236
bool ArnHasBeenSet() const
Definition Alarm.h:72
const Aws::Vector< ContactProtocol > & GetContactProtocols() const
Definition Alarm.h:372
bool StatisticHasBeenSet() const
Definition Alarm.h:303
Alarm & WithStatistic(MetricStatistic value)
Definition Alarm.h:308
void SetTreatMissingData(TreatMissingData value)
Definition Alarm.h:274
bool ComparisonOperatorHasBeenSet() const
Definition Alarm.h:182
Alarm & WithLocation(LocationT &&value)
Definition Alarm.h:115
bool MonitoredResourceInfoHasBeenSet() const
Definition Alarm.h:163
Alarm & WithResourceType(ResourceType value)
Definition Alarm.h:131
bool NotificationEnabledHasBeenSet() const
Definition Alarm.h:419
const Aws::String & GetArn() const
Definition Alarm.h:71
AWS_LIGHTSAIL_API Alarm & operator=(Aws::Utils::Json::JsonView jsonValue)
Alarm & WithDatapointsToAlarm(int value)
Definition Alarm.h:253
bool NotificationTriggersHasBeenSet() const
Definition Alarm.h:396
bool SupportCodeHasBeenSet() const
Definition Alarm.h:144
void SetMonitoredResourceInfo(MonitoredResourceInfoT &&value)
Definition Alarm.h:165
void SetUnit(MetricUnit value)
Definition Alarm.h:357
bool PeriodHasBeenSet() const
Definition Alarm.h:215
TreatMissingData GetTreatMissingData() const
Definition Alarm.h:272
const ResourceLocation & GetLocation() const
Definition Alarm.h:107
AlarmState GetState() const
Definition Alarm.h:339
Alarm & WithTreatMissingData(TreatMissingData value)
Definition Alarm.h:278
bool StateHasBeenSet() const
Definition Alarm.h:340
MetricName GetMetricName() const
Definition Alarm.h:318
bool ContactProtocolsHasBeenSet() const
Definition Alarm.h:373
Alarm & WithState(AlarmState value)
Definition Alarm.h:345
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue