AWS SDK for C++

AWS SDK for C++ Version 1.11.719

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/MetricDataQuery.h>
14#include <aws/monitoring/model/StandardUnit.h>
15#include <aws/monitoring/model/Statistic.h>
16#include <aws/monitoring/model/Tag.h>
17
18#include <utility>
19
20namespace Aws {
21namespace CloudWatch {
22namespace Model {
23
27 public:
28 AWS_CLOUDWATCH_API PutMetricAlarmRequest() = default;
29
30 // Service request name is the Operation name which will send this request out,
31 // each operation should has unique request name, so that we can get operation's name from this request.
32 // Note: this is not true for response, multiple operations may have the same response name,
33 // so we can not get operation's name from response.
34 inline virtual const char* GetServiceRequestName() const override { return "PutMetricAlarm"; }
35
36 AWS_CLOUDWATCH_API Aws::String SerializePayload() const override;
37
39
41
46 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
47 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
48 template <typename AlarmNameT = Aws::String>
49 void SetAlarmName(AlarmNameT&& value) {
50 m_alarmNameHasBeenSet = true;
51 m_alarmName = std::forward<AlarmNameT>(value);
52 }
53 template <typename AlarmNameT = Aws::String>
54 PutMetricAlarmRequest& WithAlarmName(AlarmNameT&& value) {
55 SetAlarmName(std::forward<AlarmNameT>(value));
56 return *this;
57 }
59
61
64 inline const Aws::String& GetAlarmDescription() const { return m_alarmDescription; }
65 inline bool AlarmDescriptionHasBeenSet() const { return m_alarmDescriptionHasBeenSet; }
66 template <typename AlarmDescriptionT = Aws::String>
67 void SetAlarmDescription(AlarmDescriptionT&& value) {
68 m_alarmDescriptionHasBeenSet = true;
69 m_alarmDescription = std::forward<AlarmDescriptionT>(value);
70 }
71 template <typename AlarmDescriptionT = Aws::String>
72 PutMetricAlarmRequest& WithAlarmDescription(AlarmDescriptionT&& value) {
73 SetAlarmDescription(std::forward<AlarmDescriptionT>(value));
74 return *this;
75 }
77
79
83 inline bool GetActionsEnabled() const { return m_actionsEnabled; }
84 inline bool ActionsEnabledHasBeenSet() const { return m_actionsEnabledHasBeenSet; }
85 inline void SetActionsEnabled(bool value) {
86 m_actionsEnabledHasBeenSet = true;
87 m_actionsEnabled = value;
88 }
90 SetActionsEnabled(value);
91 return *this;
92 }
94
96
128 inline const Aws::Vector<Aws::String>& GetOKActions() const { return m_oKActions; }
129 inline bool OKActionsHasBeenSet() const { return m_oKActionsHasBeenSet; }
130 template <typename OKActionsT = Aws::Vector<Aws::String>>
131 void SetOKActions(OKActionsT&& value) {
132 m_oKActionsHasBeenSet = true;
133 m_oKActions = std::forward<OKActionsT>(value);
134 }
135 template <typename OKActionsT = Aws::Vector<Aws::String>>
137 SetOKActions(std::forward<OKActionsT>(value));
138 return *this;
139 }
140 template <typename OKActionsT = Aws::String>
141 PutMetricAlarmRequest& AddOKActions(OKActionsT&& value) {
142 m_oKActionsHasBeenSet = true;
143 m_oKActions.emplace_back(std::forward<OKActionsT>(value));
144 return *this;
145 }
147
149
184 inline const Aws::Vector<Aws::String>& GetAlarmActions() const { return m_alarmActions; }
185 inline bool AlarmActionsHasBeenSet() const { return m_alarmActionsHasBeenSet; }
186 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
187 void SetAlarmActions(AlarmActionsT&& value) {
188 m_alarmActionsHasBeenSet = true;
189 m_alarmActions = std::forward<AlarmActionsT>(value);
190 }
191 template <typename AlarmActionsT = Aws::Vector<Aws::String>>
192 PutMetricAlarmRequest& WithAlarmActions(AlarmActionsT&& value) {
193 SetAlarmActions(std::forward<AlarmActionsT>(value));
194 return *this;
195 }
196 template <typename AlarmActionsT = Aws::String>
197 PutMetricAlarmRequest& AddAlarmActions(AlarmActionsT&& value) {
198 m_alarmActionsHasBeenSet = true;
199 m_alarmActions.emplace_back(std::forward<AlarmActionsT>(value));
200 return *this;
201 }
203
205
238 inline const Aws::Vector<Aws::String>& GetInsufficientDataActions() const { return m_insufficientDataActions; }
239 inline bool InsufficientDataActionsHasBeenSet() const { return m_insufficientDataActionsHasBeenSet; }
240 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
241 void SetInsufficientDataActions(InsufficientDataActionsT&& value) {
242 m_insufficientDataActionsHasBeenSet = true;
243 m_insufficientDataActions = std::forward<InsufficientDataActionsT>(value);
244 }
245 template <typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
246 PutMetricAlarmRequest& WithInsufficientDataActions(InsufficientDataActionsT&& value) {
247 SetInsufficientDataActions(std::forward<InsufficientDataActionsT>(value));
248 return *this;
249 }
250 template <typename InsufficientDataActionsT = Aws::String>
251 PutMetricAlarmRequest& AddInsufficientDataActions(InsufficientDataActionsT&& value) {
252 m_insufficientDataActionsHasBeenSet = true;
253 m_insufficientDataActions.emplace_back(std::forward<InsufficientDataActionsT>(value));
254 return *this;
255 }
257
259
269 inline const Aws::String& GetMetricName() const { return m_metricName; }
270 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
271 template <typename MetricNameT = Aws::String>
272 void SetMetricName(MetricNameT&& value) {
273 m_metricNameHasBeenSet = true;
274 m_metricName = std::forward<MetricNameT>(value);
275 }
276 template <typename MetricNameT = Aws::String>
277 PutMetricAlarmRequest& WithMetricName(MetricNameT&& value) {
278 SetMetricName(std::forward<MetricNameT>(value));
279 return *this;
280 }
282
284
288 inline const Aws::String& GetNamespace() const { return m_namespace; }
289 inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
290 template <typename NamespaceT = Aws::String>
291 void SetNamespace(NamespaceT&& value) {
292 m_namespaceHasBeenSet = true;
293 m_namespace = std::forward<NamespaceT>(value);
294 }
295 template <typename NamespaceT = Aws::String>
297 SetNamespace(std::forward<NamespaceT>(value));
298 return *this;
299 }
301
303
310 inline Statistic GetStatistic() const { return m_statistic; }
311 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
312 inline void SetStatistic(Statistic value) {
313 m_statisticHasBeenSet = true;
314 m_statistic = value;
315 }
317 SetStatistic(value);
318 return *this;
319 }
321
323
342 inline const Aws::String& GetExtendedStatistic() const { return m_extendedStatistic; }
343 inline bool ExtendedStatisticHasBeenSet() const { return m_extendedStatisticHasBeenSet; }
344 template <typename ExtendedStatisticT = Aws::String>
345 void SetExtendedStatistic(ExtendedStatisticT&& value) {
346 m_extendedStatisticHasBeenSet = true;
347 m_extendedStatistic = std::forward<ExtendedStatisticT>(value);
348 }
349 template <typename ExtendedStatisticT = Aws::String>
350 PutMetricAlarmRequest& WithExtendedStatistic(ExtendedStatisticT&& value) {
351 SetExtendedStatistic(std::forward<ExtendedStatisticT>(value));
352 return *this;
353 }
355
357
360 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
361 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
362 template <typename DimensionsT = Aws::Vector<Dimension>>
363 void SetDimensions(DimensionsT&& value) {
364 m_dimensionsHasBeenSet = true;
365 m_dimensions = std::forward<DimensionsT>(value);
366 }
367 template <typename DimensionsT = Aws::Vector<Dimension>>
368 PutMetricAlarmRequest& WithDimensions(DimensionsT&& value) {
369 SetDimensions(std::forward<DimensionsT>(value));
370 return *this;
371 }
372 template <typename DimensionsT = Dimension>
373 PutMetricAlarmRequest& AddDimensions(DimensionsT&& value) {
374 m_dimensionsHasBeenSet = true;
375 m_dimensions.emplace_back(std::forward<DimensionsT>(value));
376 return *this;
377 }
379
381
403 inline int GetPeriod() const { return m_period; }
404 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
405 inline void SetPeriod(int value) {
406 m_periodHasBeenSet = true;
407 m_period = value;
408 }
410 SetPeriod(value);
411 return *this;
412 }
414
416
434 inline StandardUnit GetUnit() const { return m_unit; }
435 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
436 inline void SetUnit(StandardUnit value) {
437 m_unitHasBeenSet = true;
438 m_unit = value;
439 }
441 SetUnit(value);
442 return *this;
443 }
445
447
453 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
454 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
455 inline void SetEvaluationPeriods(int value) {
456 m_evaluationPeriodsHasBeenSet = true;
457 m_evaluationPeriods = value;
458 }
461 return *this;
462 }
464
466
473 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
474 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
475 inline void SetDatapointsToAlarm(int value) {
476 m_datapointsToAlarmHasBeenSet = true;
477 m_datapointsToAlarm = value;
478 }
481 return *this;
482 }
484
486
491 inline double GetThreshold() const { return m_threshold; }
492 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
493 inline void SetThreshold(double value) {
494 m_thresholdHasBeenSet = true;
495 m_threshold = value;
496 }
497 inline PutMetricAlarmRequest& WithThreshold(double value) {
498 SetThreshold(value);
499 return *this;
500 }
502
504
511 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
512 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
514 m_comparisonOperatorHasBeenSet = true;
515 m_comparisonOperator = value;
516 }
519 return *this;
520 }
522
524
537 inline const Aws::String& GetTreatMissingData() const { return m_treatMissingData; }
538 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
539 template <typename TreatMissingDataT = Aws::String>
540 void SetTreatMissingData(TreatMissingDataT&& value) {
541 m_treatMissingDataHasBeenSet = true;
542 m_treatMissingData = std::forward<TreatMissingDataT>(value);
543 }
544 template <typename TreatMissingDataT = Aws::String>
545 PutMetricAlarmRequest& WithTreatMissingData(TreatMissingDataT&& value) {
546 SetTreatMissingData(std::forward<TreatMissingDataT>(value));
547 return *this;
548 }
550
552
563 inline const Aws::String& GetEvaluateLowSampleCountPercentile() const { return m_evaluateLowSampleCountPercentile; }
564 inline bool EvaluateLowSampleCountPercentileHasBeenSet() const { return m_evaluateLowSampleCountPercentileHasBeenSet; }
565 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
566 void SetEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
567 m_evaluateLowSampleCountPercentileHasBeenSet = true;
568 m_evaluateLowSampleCountPercentile = std::forward<EvaluateLowSampleCountPercentileT>(value);
569 }
570 template <typename EvaluateLowSampleCountPercentileT = Aws::String>
571 PutMetricAlarmRequest& WithEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) {
572 SetEvaluateLowSampleCountPercentile(std::forward<EvaluateLowSampleCountPercentileT>(value));
573 return *this;
574 }
576
578
596 inline const Aws::Vector<MetricDataQuery>& GetMetrics() const { return m_metrics; }
597 inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; }
598 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
599 void SetMetrics(MetricsT&& value) {
600 m_metricsHasBeenSet = true;
601 m_metrics = std::forward<MetricsT>(value);
602 }
603 template <typename MetricsT = Aws::Vector<MetricDataQuery>>
605 SetMetrics(std::forward<MetricsT>(value));
606 return *this;
607 }
608 template <typename MetricsT = MetricDataQuery>
610 m_metricsHasBeenSet = true;
611 m_metrics.emplace_back(std::forward<MetricsT>(value));
612 return *this;
613 }
615
617
633 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
634 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
635 template <typename TagsT = Aws::Vector<Tag>>
636 void SetTags(TagsT&& value) {
637 m_tagsHasBeenSet = true;
638 m_tags = std::forward<TagsT>(value);
639 }
640 template <typename TagsT = Aws::Vector<Tag>>
642 SetTags(std::forward<TagsT>(value));
643 return *this;
644 }
645 template <typename TagsT = Tag>
647 m_tagsHasBeenSet = true;
648 m_tags.emplace_back(std::forward<TagsT>(value));
649 return *this;
650 }
652
654
661 inline const Aws::String& GetThresholdMetricId() const { return m_thresholdMetricId; }
662 inline bool ThresholdMetricIdHasBeenSet() const { return m_thresholdMetricIdHasBeenSet; }
663 template <typename ThresholdMetricIdT = Aws::String>
664 void SetThresholdMetricId(ThresholdMetricIdT&& value) {
665 m_thresholdMetricIdHasBeenSet = true;
666 m_thresholdMetricId = std::forward<ThresholdMetricIdT>(value);
667 }
668 template <typename ThresholdMetricIdT = Aws::String>
669 PutMetricAlarmRequest& WithThresholdMetricId(ThresholdMetricIdT&& value) {
670 SetThresholdMetricId(std::forward<ThresholdMetricIdT>(value));
671 return *this;
672 }
674 private:
675 Aws::String m_alarmName;
676
677 Aws::String m_alarmDescription;
678
679 bool m_actionsEnabled{false};
680
681 Aws::Vector<Aws::String> m_oKActions;
682
683 Aws::Vector<Aws::String> m_alarmActions;
684
685 Aws::Vector<Aws::String> m_insufficientDataActions;
686
687 Aws::String m_metricName;
688
689 Aws::String m_namespace;
690
691 Statistic m_statistic{Statistic::NOT_SET};
692
693 Aws::String m_extendedStatistic;
694
695 Aws::Vector<Dimension> m_dimensions;
696
697 int m_period{0};
698
700
701 int m_evaluationPeriods{0};
702
703 int m_datapointsToAlarm{0};
704
705 double m_threshold{0.0};
706
708
709 Aws::String m_treatMissingData;
710
711 Aws::String m_evaluateLowSampleCountPercentile;
712
714
715 Aws::Vector<Tag> m_tags;
716
717 Aws::String m_thresholdMetricId;
718 bool m_alarmNameHasBeenSet = false;
719 bool m_alarmDescriptionHasBeenSet = false;
720 bool m_actionsEnabledHasBeenSet = false;
721 bool m_oKActionsHasBeenSet = false;
722 bool m_alarmActionsHasBeenSet = false;
723 bool m_insufficientDataActionsHasBeenSet = false;
724 bool m_metricNameHasBeenSet = false;
725 bool m_namespaceHasBeenSet = false;
726 bool m_statisticHasBeenSet = false;
727 bool m_extendedStatisticHasBeenSet = false;
728 bool m_dimensionsHasBeenSet = false;
729 bool m_periodHasBeenSet = false;
730 bool m_unitHasBeenSet = false;
731 bool m_evaluationPeriodsHasBeenSet = false;
732 bool m_datapointsToAlarmHasBeenSet = false;
733 bool m_thresholdHasBeenSet = false;
734 bool m_comparisonOperatorHasBeenSet = false;
735 bool m_treatMissingDataHasBeenSet = false;
736 bool m_evaluateLowSampleCountPercentileHasBeenSet = false;
737 bool m_metricsHasBeenSet = false;
738 bool m_tagsHasBeenSet = false;
739 bool m_thresholdMetricIdHasBeenSet = false;
740};
741
742} // namespace Model
743} // namespace CloudWatch
744} // 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)
AWS_CLOUDWATCH_API PutMetricAlarmRequest()=default
PutMetricAlarmRequest & WithOKActions(OKActionsT &&value)
void SetThresholdMetricId(ThresholdMetricIdT &&value)
const Aws::Vector< Dimension > & GetDimensions() const
PutMetricAlarmRequest & AddMetrics(MetricsT &&value)
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
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