AWS SDK for C++

AWS SDK for C++ Version 1.11.853

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/EvaluationWindow.h>
15#include <aws/monitoring/model/MetricDataQuery.h>
16#include <aws/monitoring/model/StandardUnit.h>
17#include <aws/monitoring/model/Statistic.h>
18#include <aws/monitoring/model/Tag.h>
19
20#include <utility>
21
22namespace Aws {
23namespace CloudWatch {
24namespace Model {
25
29 public:
30 AWS_CLOUDWATCH_API PutMetricAlarmRequest() = default;
31
32 // Service request name is the Operation name which will send this request out,
33 // each operation should has unique request name, so that we can get operation's name from this request.
34 // Note: this is not true for response, multiple operations may have the same response name,
35 // so we can not get operation's name from response.
36 inline virtual const char* GetServiceRequestName() const override { return "PutMetricAlarm"; }
37
38 AWS_CLOUDWATCH_API Aws::String SerializePayload() const override;
39
41
43
48 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
49 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
50 template <typename AlarmNameT = Aws::String>
51 void SetAlarmName(AlarmNameT&& value) {
52 m_alarmNameHasBeenSet = true;
53 m_alarmName = std::forward<AlarmNameT>(value);
54 }
55 template <typename AlarmNameT = Aws::String>
56 PutMetricAlarmRequest& WithAlarmName(AlarmNameT&& value) {
57 SetAlarmName(std::forward<AlarmNameT>(value));
58 return *this;
59 }
61
63
66 inline const Aws::String& GetAlarmDescription() const { return m_alarmDescription; }
67 inline bool AlarmDescriptionHasBeenSet() const { return m_alarmDescriptionHasBeenSet; }
68 template <typename AlarmDescriptionT = Aws::String>
69 void SetAlarmDescription(AlarmDescriptionT&& value) {
70 m_alarmDescriptionHasBeenSet = true;
71 m_alarmDescription = std::forward<AlarmDescriptionT>(value);
72 }
73 template <typename AlarmDescriptionT = Aws::String>
74 PutMetricAlarmRequest& WithAlarmDescription(AlarmDescriptionT&& value) {
75 SetAlarmDescription(std::forward<AlarmDescriptionT>(value));
76 return *this;
77 }
79
81
85 inline bool GetActionsEnabled() const { return m_actionsEnabled; }
86 inline bool ActionsEnabledHasBeenSet() const { return m_actionsEnabledHasBeenSet; }
87 inline void SetActionsEnabled(bool value) {
88 m_actionsEnabledHasBeenSet = true;
89 m_actionsEnabled = value;
90 }
92 SetActionsEnabled(value);
93 return *this;
94 }
96
98
130 inline const Aws::Vector<Aws::String>& GetOKActions() const { return m_oKActions; }
131 inline bool OKActionsHasBeenSet() const { return m_oKActionsHasBeenSet; }
132 template <typename OKActionsT = Aws::Vector<Aws::String>>
133 void SetOKActions(OKActionsT&& value) {
134 m_oKActionsHasBeenSet = true;
135 m_oKActions = std::forward<OKActionsT>(value);
136 }
137 template <typename OKActionsT = Aws::Vector<Aws::String>>
139 SetOKActions(std::forward<OKActionsT>(value));
140 return *this;
141 }
142 template <typename OKActionsT = Aws::String>
143 PutMetricAlarmRequest& AddOKActions(OKActionsT&& value) {
144 m_oKActionsHasBeenSet = true;
145 m_oKActions.emplace_back(std::forward<OKActionsT>(value));
146 return *this;
147 }
149
151
186 inline const Aws::Vector<Aws::String>& GetAlarmActions() const { return m_alarmActions; }
187 inline bool AlarmActionsHasBeenSet() const { return m_alarmActionsHasBeenSet; }
188 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
189 void SetAlarmActions(AlarmActionsT&& value) {
190 m_alarmActionsHasBeenSet = true;
191 m_alarmActions = std::forward<AlarmActionsT>(value);
192 }
193 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
194 PutMetricAlarmRequest& WithAlarmActions(AlarmActionsT&& value) {
195 SetAlarmActions(std::forward<AlarmActionsT>(value));
196 return *this;
197 }
198 template <typename AlarmActionsT = Aws::String>
199 PutMetricAlarmRequest& AddAlarmActions(AlarmActionsT&& value) {
200 m_alarmActionsHasBeenSet = true;
201 m_alarmActions.emplace_back(std::forward<AlarmActionsT>(value));
202 return *this;
203 }
205
207
240 inline const Aws::Vector<Aws::String>& GetInsufficientDataActions() const { return m_insufficientDataActions; }
241 inline bool InsufficientDataActionsHasBeenSet() const { return m_insufficientDataActionsHasBeenSet; }
242 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
243 void SetInsufficientDataActions(InsufficientDataActionsT&& value) {
244 m_insufficientDataActionsHasBeenSet = true;
245 m_insufficientDataActions = std::forward<InsufficientDataActionsT>(value);
246 }
247 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
248 PutMetricAlarmRequest& WithInsufficientDataActions(InsufficientDataActionsT&& value) {
249 SetInsufficientDataActions(std::forward<InsufficientDataActionsT>(value));
250 return *this;
251 }
252 template <typename InsufficientDataActionsT = Aws::String>
253 PutMetricAlarmRequest& AddInsufficientDataActions(InsufficientDataActionsT&& value) {
254 m_insufficientDataActionsHasBeenSet = true;
255 m_insufficientDataActions.emplace_back(std::forward<InsufficientDataActionsT>(value));
256 return *this;
257 }
259
261
272 inline const Aws::String& GetMetricName() const { return m_metricName; }
273 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
274 template <typename MetricNameT = Aws::String>
275 void SetMetricName(MetricNameT&& value) {
276 m_metricNameHasBeenSet = true;
277 m_metricName = std::forward<MetricNameT>(value);
278 }
279 template <typename MetricNameT = Aws::String>
280 PutMetricAlarmRequest& WithMetricName(MetricNameT&& value) {
281 SetMetricName(std::forward<MetricNameT>(value));
282 return *this;
283 }
285
287
291 inline const Aws::String& GetNamespace() const { return m_namespace; }
292 inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
293 template <typename NamespaceT = Aws::String>
294 void SetNamespace(NamespaceT&& value) {
295 m_namespaceHasBeenSet = true;
296 m_namespace = std::forward<NamespaceT>(value);
297 }
298 template <typename NamespaceT = Aws::String>
300 SetNamespace(std::forward<NamespaceT>(value));
301 return *this;
302 }
304
306
313 inline Statistic GetStatistic() const { return m_statistic; }
314 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
315 inline void SetStatistic(Statistic value) {
316 m_statisticHasBeenSet = true;
317 m_statistic = value;
318 }
320 SetStatistic(value);
321 return *this;
322 }
324
326
345 inline const Aws::String& GetExtendedStatistic() const { return m_extendedStatistic; }
346 inline bool ExtendedStatisticHasBeenSet() const { return m_extendedStatisticHasBeenSet; }
347 template <typename ExtendedStatisticT = Aws::String>
348 void SetExtendedStatistic(ExtendedStatisticT&& value) {
349 m_extendedStatisticHasBeenSet = true;
350 m_extendedStatistic = std::forward<ExtendedStatisticT>(value);
351 }
352 template <typename ExtendedStatisticT = Aws::String>
353 PutMetricAlarmRequest& WithExtendedStatistic(ExtendedStatisticT&& value) {
354 SetExtendedStatistic(std::forward<ExtendedStatisticT>(value));
355 return *this;
356 }
358
360
363 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
364 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
365 template <typename DimensionsT = Aws::Vector<Dimension>>
366 void SetDimensions(DimensionsT&& value) {
367 m_dimensionsHasBeenSet = true;
368 m_dimensions = std::forward<DimensionsT>(value);
369 }
370 template <typename DimensionsT = Aws::Vector<Dimension>>
371 PutMetricAlarmRequest& WithDimensions(DimensionsT&& value) {
372 SetDimensions(std::forward<DimensionsT>(value));
373 return *this;
374 }
375 template <typename DimensionsT = Dimension>
376 PutMetricAlarmRequest& AddDimensions(DimensionsT&& value) {
377 m_dimensionsHasBeenSet = true;
378 m_dimensions.emplace_back(std::forward<DimensionsT>(value));
379 return *this;
380 }
382
384
406 inline int GetPeriod() const { return m_period; }
407 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
408 inline void SetPeriod(int value) {
409 m_periodHasBeenSet = true;
410 m_period = value;
411 }
413 SetPeriod(value);
414 return *this;
415 }
417
419
437 inline StandardUnit GetUnit() const { return m_unit; }
438 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
439 inline void SetUnit(StandardUnit value) {
440 m_unitHasBeenSet = true;
441 m_unit = value;
442 }
444 SetUnit(value);
445 return *this;
446 }
448
450
456 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
457 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
458 inline void SetEvaluationPeriods(int value) {
459 m_evaluationPeriodsHasBeenSet = true;
460 m_evaluationPeriods = value;
461 }
464 return *this;
465 }
467
469
476 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
477 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
478 inline void SetDatapointsToAlarm(int value) {
479 m_datapointsToAlarmHasBeenSet = true;
480 m_datapointsToAlarm = value;
481 }
484 return *this;
485 }
487
489
494 inline double GetThreshold() const { return m_threshold; }
495 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
496 inline void SetThreshold(double value) {
497 m_thresholdHasBeenSet = true;
498 m_threshold = value;
499 }
500 inline PutMetricAlarmRequest& WithThreshold(double value) {
501 SetThreshold(value);
502 return *this;
503 }
505
507
514 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
515 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
517 m_comparisonOperatorHasBeenSet = true;
518 m_comparisonOperator = value;
519 }
522 return *this;
523 }
525
527
541 inline const Aws::String& GetTreatMissingData() const { return m_treatMissingData; }
542 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
543 template <typename TreatMissingDataT = Aws::String>
544 void SetTreatMissingData(TreatMissingDataT&& value) {
545 m_treatMissingDataHasBeenSet = true;
546 m_treatMissingData = std::forward<TreatMissingDataT>(value);
547 }
548 template <typename TreatMissingDataT = Aws::String>
549 PutMetricAlarmRequest& WithTreatMissingData(TreatMissingDataT&& value) {
550 SetTreatMissingData(std::forward<TreatMissingDataT>(value));
551 return *this;
552 }
554
556
567 inline const Aws::String& GetEvaluateLowSampleCountPercentile() const { return m_evaluateLowSampleCountPercentile; }
568 inline bool EvaluateLowSampleCountPercentileHasBeenSet() const { return m_evaluateLowSampleCountPercentileHasBeenSet; }
569 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
570 void SetEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
571 m_evaluateLowSampleCountPercentileHasBeenSet = true;
572 m_evaluateLowSampleCountPercentile = std::forward<EvaluateLowSampleCountPercentileT>(value);
573 }
574 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
575 PutMetricAlarmRequest& WithEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
576 SetEvaluateLowSampleCountPercentile(std::forward<EvaluateLowSampleCountPercentileT>(value));
577 return *this;
578 }
580
582
600 inline const Aws::Vector<MetricDataQuery>& GetMetrics() const { return m_metrics; }
601 inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; }
602 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
603 void SetMetrics(MetricsT&& value) {
604 m_metricsHasBeenSet = true;
605 m_metrics = std::forward<MetricsT>(value);
606 }
607 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
609 SetMetrics(std::forward<MetricsT>(value));
610 return *this;
611 }
612 template <typename MetricsT = MetricDataQuery>
614 m_metricsHasBeenSet = true;
615 m_metrics.emplace_back(std::forward<MetricsT>(value));
616 return *this;
617 }
619
621
637 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
638 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
639 template <typename TagsT = Aws::Vector<Tag>>
640 void SetTags(TagsT&& value) {
641 m_tagsHasBeenSet = true;
642 m_tags = std::forward<TagsT>(value);
643 }
644 template <typename TagsT = Aws::Vector<Tag>>
646 SetTags(std::forward<TagsT>(value));
647 return *this;
648 }
649 template <typename TagsT = Tag>
651 m_tagsHasBeenSet = true;
652 m_tags.emplace_back(std::forward<TagsT>(value));
653 return *this;
654 }
656
658
665 inline const Aws::String& GetThresholdMetricId() const { return m_thresholdMetricId; }
666 inline bool ThresholdMetricIdHasBeenSet() const { return m_thresholdMetricIdHasBeenSet; }
667 template <typename ThresholdMetricIdT = Aws::String>
668 void SetThresholdMetricId(ThresholdMetricIdT&& value) {
669 m_thresholdMetricIdHasBeenSet = true;
670 m_thresholdMetricId = std::forward<ThresholdMetricIdT>(value);
671 }
672 template <typename ThresholdMetricIdT = Aws::String>
673 PutMetricAlarmRequest& WithThresholdMetricId(ThresholdMetricIdT&& value) {
674 SetThresholdMetricId(std::forward<ThresholdMetricIdT>(value));
675 return *this;
676 }
678
680
692 inline const EvaluationWindow& GetEvaluationWindow() const { return m_evaluationWindow; }
693 inline bool EvaluationWindowHasBeenSet() const { return m_evaluationWindowHasBeenSet; }
694 template <typename EvaluationWindowT = EvaluationWindow>
695 void SetEvaluationWindow(EvaluationWindowT&& value) {
696 m_evaluationWindowHasBeenSet = true;
697 m_evaluationWindow = std::forward<EvaluationWindowT>(value);
698 }
699 template <typename EvaluationWindowT = EvaluationWindow>
700 PutMetricAlarmRequest& WithEvaluationWindow(EvaluationWindowT&& value) {
701 SetEvaluationWindow(std::forward<EvaluationWindowT>(value));
702 return *this;
703 }
705
707
721 inline const EvaluationCriteria& GetEvaluationCriteria() const { return m_evaluationCriteria; }
722 inline bool EvaluationCriteriaHasBeenSet() const { return m_evaluationCriteriaHasBeenSet; }
723 template <typename EvaluationCriteriaT = EvaluationCriteria>
724 void SetEvaluationCriteria(EvaluationCriteriaT&& value) {
725 m_evaluationCriteriaHasBeenSet = true;
726 m_evaluationCriteria = std::forward<EvaluationCriteriaT>(value);
727 }
728 template <typename EvaluationCriteriaT = EvaluationCriteria>
729 PutMetricAlarmRequest& WithEvaluationCriteria(EvaluationCriteriaT&& value) {
730 SetEvaluationCriteria(std::forward<EvaluationCriteriaT>(value));
731 return *this;
732 }
734
736
742 inline int GetEvaluationInterval() const { return m_evaluationInterval; }
743 inline bool EvaluationIntervalHasBeenSet() const { return m_evaluationIntervalHasBeenSet; }
744 inline void SetEvaluationInterval(int value) {
745 m_evaluationIntervalHasBeenSet = true;
746 m_evaluationInterval = value;
747 }
750 return *this;
751 }
753 private:
754 Aws::String m_alarmName;
755
756 Aws::String m_alarmDescription;
757
758 bool m_actionsEnabled{false};
759
760 Aws::Vector<Aws::String> m_oKActions;
761
762 Aws::Vector<Aws::String> m_alarmActions;
763
764 Aws::Vector<Aws::String> m_insufficientDataActions;
765
766 Aws::String m_metricName;
767
768 Aws::String m_namespace;
769
770 Statistic m_statistic{Statistic::NOT_SET};
771
772 Aws::String m_extendedStatistic;
773
774 Aws::Vector<Dimension> m_dimensions;
775
776 int m_period{0};
777
779
780 int m_evaluationPeriods{0};
781
782 int m_datapointsToAlarm{0};
783
784 double m_threshold{0.0};
785
787
788 Aws::String m_treatMissingData;
789
790 Aws::String m_evaluateLowSampleCountPercentile;
791
793
794 Aws::Vector<Tag> m_tags;
795
796 Aws::String m_thresholdMetricId;
797
798 EvaluationWindow m_evaluationWindow;
799
800 EvaluationCriteria m_evaluationCriteria;
801
802 int m_evaluationInterval{0};
803 bool m_alarmNameHasBeenSet = false;
804 bool m_alarmDescriptionHasBeenSet = false;
805 bool m_actionsEnabledHasBeenSet = false;
806 bool m_oKActionsHasBeenSet = false;
807 bool m_alarmActionsHasBeenSet = false;
808 bool m_insufficientDataActionsHasBeenSet = false;
809 bool m_metricNameHasBeenSet = false;
810 bool m_namespaceHasBeenSet = false;
811 bool m_statisticHasBeenSet = false;
812 bool m_extendedStatisticHasBeenSet = false;
813 bool m_dimensionsHasBeenSet = false;
814 bool m_periodHasBeenSet = false;
815 bool m_unitHasBeenSet = false;
816 bool m_evaluationPeriodsHasBeenSet = false;
817 bool m_datapointsToAlarmHasBeenSet = false;
818 bool m_thresholdHasBeenSet = false;
819 bool m_comparisonOperatorHasBeenSet = false;
820 bool m_treatMissingDataHasBeenSet = false;
821 bool m_evaluateLowSampleCountPercentileHasBeenSet = false;
822 bool m_metricsHasBeenSet = false;
823 bool m_tagsHasBeenSet = false;
824 bool m_thresholdMetricIdHasBeenSet = false;
825 bool m_evaluationWindowHasBeenSet = false;
826 bool m_evaluationCriteriaHasBeenSet = false;
827 bool m_evaluationIntervalHasBeenSet = false;
828};
829
830} // namespace Model
831} // namespace CloudWatch
832} // 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)
PutMetricAlarmRequest & WithEvaluationWindow(EvaluationWindowT &&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)
void SetEvaluationWindow(EvaluationWindowT &&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)
const EvaluationWindow & GetEvaluationWindow() const
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