AWS SDK for C++

AWS SDK for C++ Version 1.11.789

Loading...
Searching...
No Matches
PutMetricAlarmRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/monitoring/CloudWatchRequest.h>
10#include <aws/monitoring/CloudWatch_EXPORTS.h>
11#include <aws/monitoring/model/ComparisonOperator.h>
12#include <aws/monitoring/model/Dimension.h>
13#include <aws/monitoring/model/EvaluationCriteria.h>
14#include <aws/monitoring/model/MetricDataQuery.h>
15#include <aws/monitoring/model/StandardUnit.h>
16#include <aws/monitoring/model/Statistic.h>
17#include <aws/monitoring/model/Tag.h>
18
19#include <utility>
20
21namespace Aws {
22namespace CloudWatch {
23namespace Model {
24
28 public:
29 AWS_CLOUDWATCH_API PutMetricAlarmRequest() = default;
30
31 // Service request name is the Operation name which will send this request out,
32 // each operation should has unique request name, so that we can get operation's name from this request.
33 // Note: this is not true for response, multiple operations may have the same response name,
34 // so we can not get operation's name from response.
35 inline virtual const char* GetServiceRequestName() const override { return "PutMetricAlarm"; }
36
37 AWS_CLOUDWATCH_API Aws::String SerializePayload() const override;
38
40
42
47 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
48 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
49 template <typename AlarmNameT = Aws::String>
50 void SetAlarmName(AlarmNameT&& value) {
51 m_alarmNameHasBeenSet = true;
52 m_alarmName = std::forward<AlarmNameT>(value);
53 }
54 template <typename AlarmNameT = Aws::String>
55 PutMetricAlarmRequest& WithAlarmName(AlarmNameT&& value) {
56 SetAlarmName(std::forward<AlarmNameT>(value));
57 return *this;
58 }
60
62
65 inline const Aws::String& GetAlarmDescription() const { return m_alarmDescription; }
66 inline bool AlarmDescriptionHasBeenSet() const { return m_alarmDescriptionHasBeenSet; }
67 template <typename AlarmDescriptionT = Aws::String>
68 void SetAlarmDescription(AlarmDescriptionT&& value) {
69 m_alarmDescriptionHasBeenSet = true;
70 m_alarmDescription = std::forward<AlarmDescriptionT>(value);
71 }
72 template <typename AlarmDescriptionT = Aws::String>
73 PutMetricAlarmRequest& WithAlarmDescription(AlarmDescriptionT&& value) {
74 SetAlarmDescription(std::forward<AlarmDescriptionT>(value));
75 return *this;
76 }
78
80
84 inline bool GetActionsEnabled() const { return m_actionsEnabled; }
85 inline bool ActionsEnabledHasBeenSet() const { return m_actionsEnabledHasBeenSet; }
86 inline void SetActionsEnabled(bool value) {
87 m_actionsEnabledHasBeenSet = true;
88 m_actionsEnabled = value;
89 }
91 SetActionsEnabled(value);
92 return *this;
93 }
95
97
129 inline const Aws::Vector<Aws::String>& GetOKActions() const { return m_oKActions; }
130 inline bool OKActionsHasBeenSet() const { return m_oKActionsHasBeenSet; }
131 template <typename OKActionsT = Aws::Vector<Aws::String>>
132 void SetOKActions(OKActionsT&& value) {
133 m_oKActionsHasBeenSet = true;
134 m_oKActions = std::forward<OKActionsT>(value);
135 }
136 template <typename OKActionsT = Aws::Vector<Aws::String>>
138 SetOKActions(std::forward<OKActionsT>(value));
139 return *this;
140 }
141 template <typename OKActionsT = Aws::String>
142 PutMetricAlarmRequest& AddOKActions(OKActionsT&& value) {
143 m_oKActionsHasBeenSet = true;
144 m_oKActions.emplace_back(std::forward<OKActionsT>(value));
145 return *this;
146 }
148
150
185 inline const Aws::Vector<Aws::String>& GetAlarmActions() const { return m_alarmActions; }
186 inline bool AlarmActionsHasBeenSet() const { return m_alarmActionsHasBeenSet; }
187 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
188 void SetAlarmActions(AlarmActionsT&& value) {
189 m_alarmActionsHasBeenSet = true;
190 m_alarmActions = std::forward<AlarmActionsT>(value);
191 }
192 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
193 PutMetricAlarmRequest& WithAlarmActions(AlarmActionsT&& value) {
194 SetAlarmActions(std::forward<AlarmActionsT>(value));
195 return *this;
196 }
197 template <typename AlarmActionsT = Aws::String>
198 PutMetricAlarmRequest& AddAlarmActions(AlarmActionsT&& value) {
199 m_alarmActionsHasBeenSet = true;
200 m_alarmActions.emplace_back(std::forward<AlarmActionsT>(value));
201 return *this;
202 }
204
206
239 inline const Aws::Vector<Aws::String>& GetInsufficientDataActions() const { return m_insufficientDataActions; }
240 inline bool InsufficientDataActionsHasBeenSet() const { return m_insufficientDataActionsHasBeenSet; }
241 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
242 void SetInsufficientDataActions(InsufficientDataActionsT&& value) {
243 m_insufficientDataActionsHasBeenSet = true;
244 m_insufficientDataActions = std::forward<InsufficientDataActionsT>(value);
245 }
246 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
247 PutMetricAlarmRequest& WithInsufficientDataActions(InsufficientDataActionsT&& value) {
248 SetInsufficientDataActions(std::forward<InsufficientDataActionsT>(value));
249 return *this;
250 }
251 template <typename InsufficientDataActionsT = Aws::String>
252 PutMetricAlarmRequest& AddInsufficientDataActions(InsufficientDataActionsT&& value) {
253 m_insufficientDataActionsHasBeenSet = true;
254 m_insufficientDataActions.emplace_back(std::forward<InsufficientDataActionsT>(value));
255 return *this;
256 }
258
260
271 inline const Aws::String& GetMetricName() const { return m_metricName; }
272 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
273 template <typename MetricNameT = Aws::String>
274 void SetMetricName(MetricNameT&& value) {
275 m_metricNameHasBeenSet = true;
276 m_metricName = std::forward<MetricNameT>(value);
277 }
278 template <typename MetricNameT = Aws::String>
279 PutMetricAlarmRequest& WithMetricName(MetricNameT&& value) {
280 SetMetricName(std::forward<MetricNameT>(value));
281 return *this;
282 }
284
286
290 inline const Aws::String& GetNamespace() const { return m_namespace; }
291 inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
292 template <typename NamespaceT = Aws::String>
293 void SetNamespace(NamespaceT&& value) {
294 m_namespaceHasBeenSet = true;
295 m_namespace = std::forward<NamespaceT>(value);
296 }
297 template <typename NamespaceT = Aws::String>
299 SetNamespace(std::forward<NamespaceT>(value));
300 return *this;
301 }
303
305
312 inline Statistic GetStatistic() const { return m_statistic; }
313 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
314 inline void SetStatistic(Statistic value) {
315 m_statisticHasBeenSet = true;
316 m_statistic = value;
317 }
319 SetStatistic(value);
320 return *this;
321 }
323
325
344 inline const Aws::String& GetExtendedStatistic() const { return m_extendedStatistic; }
345 inline bool ExtendedStatisticHasBeenSet() const { return m_extendedStatisticHasBeenSet; }
346 template <typename ExtendedStatisticT = Aws::String>
347 void SetExtendedStatistic(ExtendedStatisticT&& value) {
348 m_extendedStatisticHasBeenSet = true;
349 m_extendedStatistic = std::forward<ExtendedStatisticT>(value);
350 }
351 template <typename ExtendedStatisticT = Aws::String>
352 PutMetricAlarmRequest& WithExtendedStatistic(ExtendedStatisticT&& value) {
353 SetExtendedStatistic(std::forward<ExtendedStatisticT>(value));
354 return *this;
355 }
357
359
362 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
363 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
364 template <typename DimensionsT = Aws::Vector<Dimension>>
365 void SetDimensions(DimensionsT&& value) {
366 m_dimensionsHasBeenSet = true;
367 m_dimensions = std::forward<DimensionsT>(value);
368 }
369 template <typename DimensionsT = Aws::Vector<Dimension>>
370 PutMetricAlarmRequest& WithDimensions(DimensionsT&& value) {
371 SetDimensions(std::forward<DimensionsT>(value));
372 return *this;
373 }
374 template <typename DimensionsT = Dimension>
375 PutMetricAlarmRequest& AddDimensions(DimensionsT&& value) {
376 m_dimensionsHasBeenSet = true;
377 m_dimensions.emplace_back(std::forward<DimensionsT>(value));
378 return *this;
379 }
381
383
405 inline int GetPeriod() const { return m_period; }
406 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
407 inline void SetPeriod(int value) {
408 m_periodHasBeenSet = true;
409 m_period = value;
410 }
412 SetPeriod(value);
413 return *this;
414 }
416
418
436 inline StandardUnit GetUnit() const { return m_unit; }
437 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
438 inline void SetUnit(StandardUnit value) {
439 m_unitHasBeenSet = true;
440 m_unit = value;
441 }
443 SetUnit(value);
444 return *this;
445 }
447
449
455 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
456 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
457 inline void SetEvaluationPeriods(int value) {
458 m_evaluationPeriodsHasBeenSet = true;
459 m_evaluationPeriods = value;
460 }
463 return *this;
464 }
466
468
475 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
476 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
477 inline void SetDatapointsToAlarm(int value) {
478 m_datapointsToAlarmHasBeenSet = true;
479 m_datapointsToAlarm = value;
480 }
483 return *this;
484 }
486
488
493 inline double GetThreshold() const { return m_threshold; }
494 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
495 inline void SetThreshold(double value) {
496 m_thresholdHasBeenSet = true;
497 m_threshold = value;
498 }
499 inline PutMetricAlarmRequest& WithThreshold(double value) {
500 SetThreshold(value);
501 return *this;
502 }
504
506
513 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
514 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
516 m_comparisonOperatorHasBeenSet = true;
517 m_comparisonOperator = value;
518 }
521 return *this;
522 }
524
526
540 inline const Aws::String& GetTreatMissingData() const { return m_treatMissingData; }
541 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
542 template <typename TreatMissingDataT = Aws::String>
543 void SetTreatMissingData(TreatMissingDataT&& value) {
544 m_treatMissingDataHasBeenSet = true;
545 m_treatMissingData = std::forward<TreatMissingDataT>(value);
546 }
547 template <typename TreatMissingDataT = Aws::String>
548 PutMetricAlarmRequest& WithTreatMissingData(TreatMissingDataT&& value) {
549 SetTreatMissingData(std::forward<TreatMissingDataT>(value));
550 return *this;
551 }
553
555
566 inline const Aws::String& GetEvaluateLowSampleCountPercentile() const { return m_evaluateLowSampleCountPercentile; }
567 inline bool EvaluateLowSampleCountPercentileHasBeenSet() const { return m_evaluateLowSampleCountPercentileHasBeenSet; }
568 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
569 void SetEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
570 m_evaluateLowSampleCountPercentileHasBeenSet = true;
571 m_evaluateLowSampleCountPercentile = std::forward<EvaluateLowSampleCountPercentileT>(value);
572 }
573 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
574 PutMetricAlarmRequest& WithEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
575 SetEvaluateLowSampleCountPercentile(std::forward<EvaluateLowSampleCountPercentileT>(value));
576 return *this;
577 }
579
581
599 inline const Aws::Vector<MetricDataQuery>& GetMetrics() const { return m_metrics; }
600 inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; }
601 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
602 void SetMetrics(MetricsT&& value) {
603 m_metricsHasBeenSet = true;
604 m_metrics = std::forward<MetricsT>(value);
605 }
606 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
608 SetMetrics(std::forward<MetricsT>(value));
609 return *this;
610 }
611 template <typename MetricsT = MetricDataQuery>
613 m_metricsHasBeenSet = true;
614 m_metrics.emplace_back(std::forward<MetricsT>(value));
615 return *this;
616 }
618
620
636 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
637 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
638 template <typename TagsT = Aws::Vector<Tag>>
639 void SetTags(TagsT&& value) {
640 m_tagsHasBeenSet = true;
641 m_tags = std::forward<TagsT>(value);
642 }
643 template <typename TagsT = Aws::Vector<Tag>>
645 SetTags(std::forward<TagsT>(value));
646 return *this;
647 }
648 template <typename TagsT = Tag>
650 m_tagsHasBeenSet = true;
651 m_tags.emplace_back(std::forward<TagsT>(value));
652 return *this;
653 }
655
657
664 inline const Aws::String& GetThresholdMetricId() const { return m_thresholdMetricId; }
665 inline bool ThresholdMetricIdHasBeenSet() const { return m_thresholdMetricIdHasBeenSet; }
666 template <typename ThresholdMetricIdT = Aws::String>
667 void SetThresholdMetricId(ThresholdMetricIdT&& value) {
668 m_thresholdMetricIdHasBeenSet = true;
669 m_thresholdMetricId = std::forward<ThresholdMetricIdT>(value);
670 }
671 template <typename ThresholdMetricIdT = Aws::String>
672 PutMetricAlarmRequest& WithThresholdMetricId(ThresholdMetricIdT&& value) {
673 SetThresholdMetricId(std::forward<ThresholdMetricIdT>(value));
674 return *this;
675 }
677
679
693 inline const EvaluationCriteria& GetEvaluationCriteria() const { return m_evaluationCriteria; }
694 inline bool EvaluationCriteriaHasBeenSet() const { return m_evaluationCriteriaHasBeenSet; }
695 template <typename EvaluationCriteriaT = EvaluationCriteria>
696 void SetEvaluationCriteria(EvaluationCriteriaT&& value) {
697 m_evaluationCriteriaHasBeenSet = true;
698 m_evaluationCriteria = std::forward<EvaluationCriteriaT>(value);
699 }
700 template <typename EvaluationCriteriaT = EvaluationCriteria>
701 PutMetricAlarmRequest& WithEvaluationCriteria(EvaluationCriteriaT&& value) {
702 SetEvaluationCriteria(std::forward<EvaluationCriteriaT>(value));
703 return *this;
704 }
706
708
714 inline int GetEvaluationInterval() const { return m_evaluationInterval; }
715 inline bool EvaluationIntervalHasBeenSet() const { return m_evaluationIntervalHasBeenSet; }
716 inline void SetEvaluationInterval(int value) {
717 m_evaluationIntervalHasBeenSet = true;
718 m_evaluationInterval = value;
719 }
722 return *this;
723 }
725 private:
726 Aws::String m_alarmName;
727
728 Aws::String m_alarmDescription;
729
730 bool m_actionsEnabled{false};
731
732 Aws::Vector<Aws::String> m_oKActions;
733
734 Aws::Vector<Aws::String> m_alarmActions;
735
736 Aws::Vector<Aws::String> m_insufficientDataActions;
737
738 Aws::String m_metricName;
739
740 Aws::String m_namespace;
741
742 Statistic m_statistic{Statistic::NOT_SET};
743
744 Aws::String m_extendedStatistic;
745
746 Aws::Vector<Dimension> m_dimensions;
747
748 int m_period{0};
749
751
752 int m_evaluationPeriods{0};
753
754 int m_datapointsToAlarm{0};
755
756 double m_threshold{0.0};
757
759
760 Aws::String m_treatMissingData;
761
762 Aws::String m_evaluateLowSampleCountPercentile;
763
765
766 Aws::Vector<Tag> m_tags;
767
768 Aws::String m_thresholdMetricId;
769
770 EvaluationCriteria m_evaluationCriteria;
771
772 int m_evaluationInterval{0};
773 bool m_alarmNameHasBeenSet = false;
774 bool m_alarmDescriptionHasBeenSet = false;
775 bool m_actionsEnabledHasBeenSet = false;
776 bool m_oKActionsHasBeenSet = false;
777 bool m_alarmActionsHasBeenSet = false;
778 bool m_insufficientDataActionsHasBeenSet = false;
779 bool m_metricNameHasBeenSet = false;
780 bool m_namespaceHasBeenSet = false;
781 bool m_statisticHasBeenSet = false;
782 bool m_extendedStatisticHasBeenSet = false;
783 bool m_dimensionsHasBeenSet = false;
784 bool m_periodHasBeenSet = false;
785 bool m_unitHasBeenSet = false;
786 bool m_evaluationPeriodsHasBeenSet = false;
787 bool m_datapointsToAlarmHasBeenSet = false;
788 bool m_thresholdHasBeenSet = false;
789 bool m_comparisonOperatorHasBeenSet = false;
790 bool m_treatMissingDataHasBeenSet = false;
791 bool m_evaluateLowSampleCountPercentileHasBeenSet = false;
792 bool m_metricsHasBeenSet = false;
793 bool m_tagsHasBeenSet = false;
794 bool m_thresholdMetricIdHasBeenSet = false;
795 bool m_evaluationCriteriaHasBeenSet = false;
796 bool m_evaluationIntervalHasBeenSet = false;
797};
798
799} // namespace Model
800} // namespace CloudWatch
801} // namespace Aws
void SetExtendedStatistic(ExtendedStatisticT &&value)
PutMetricAlarmRequest & WithExtendedStatistic(ExtendedStatisticT &&value)
PutMetricAlarmRequest & AddDimensions(DimensionsT &&value)
PutMetricAlarmRequest & WithThreshold(double value)
void SetEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT &&value)
PutMetricAlarmRequest & WithEvaluationPeriods(int value)
PutMetricAlarmRequest & WithMetrics(MetricsT &&value)
PutMetricAlarmRequest & WithDatapointsToAlarm(int value)
PutMetricAlarmRequest & WithAlarmName(AlarmNameT &&value)
PutMetricAlarmRequest & WithEvaluationCriteria(EvaluationCriteriaT &&value)
AWS_CLOUDWATCH_API PutMetricAlarmRequest()=default
PutMetricAlarmRequest & WithOKActions(OKActionsT &&value)
void SetThresholdMetricId(ThresholdMetricIdT &&value)
const Aws::Vector< Dimension > & GetDimensions() const
PutMetricAlarmRequest & AddMetrics(MetricsT &&value)
const EvaluationCriteria & GetEvaluationCriteria() const
PutMetricAlarmRequest & WithStatistic(Statistic value)
PutMetricAlarmRequest & WithEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT &&value)
const Aws::Vector< MetricDataQuery > & GetMetrics() const
const Aws::Vector< Aws::String > & GetAlarmActions() const
PutMetricAlarmRequest & WithActionsEnabled(bool value)
PutMetricAlarmRequest & WithDimensions(DimensionsT &&value)
const Aws::String & GetEvaluateLowSampleCountPercentile() const
PutMetricAlarmRequest & WithPeriod(int value)
const Aws::Vector< Aws::String > & GetOKActions() const
void SetInsufficientDataActions(InsufficientDataActionsT &&value)
PutMetricAlarmRequest & WithThresholdMetricId(ThresholdMetricIdT &&value)
PutMetricAlarmRequest & WithUnit(StandardUnit value)
AWS_CLOUDWATCH_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
PutMetricAlarmRequest & WithInsufficientDataActions(InsufficientDataActionsT &&value)
void SetTreatMissingData(TreatMissingDataT &&value)
const Aws::Vector< Aws::String > & GetInsufficientDataActions() const
AWS_CLOUDWATCH_API Aws::String SerializePayload() const override
PutMetricAlarmRequest & AddTags(TagsT &&value)
void SetAlarmDescription(AlarmDescriptionT &&value)
PutMetricAlarmRequest & AddInsufficientDataActions(InsufficientDataActionsT &&value)
PutMetricAlarmRequest & WithAlarmDescription(AlarmDescriptionT &&value)
PutMetricAlarmRequest & WithAlarmActions(AlarmActionsT &&value)
PutMetricAlarmRequest & WithMetricName(MetricNameT &&value)
PutMetricAlarmRequest & WithComparisonOperator(ComparisonOperator value)
PutMetricAlarmRequest & WithTags(TagsT &&value)
virtual const char * GetServiceRequestName() const override
void SetEvaluationCriteria(EvaluationCriteriaT &&value)
PutMetricAlarmRequest & WithEvaluationInterval(int value)
PutMetricAlarmRequest & AddAlarmActions(AlarmActionsT &&value)
PutMetricAlarmRequest & WithNamespace(NamespaceT &&value)
PutMetricAlarmRequest & AddOKActions(OKActionsT &&value)
PutMetricAlarmRequest & WithTreatMissingData(TreatMissingDataT &&value)
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector