AWS SDK for C++

AWS SDK for C++ Version 1.11.612

Loading...
Searching...
No Matches
PutMetricAlarmRequest.h
1
6#pragma once
7#include <aws/monitoring/CloudWatch_EXPORTS.h>
8#include <aws/monitoring/CloudWatchRequest.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/monitoring/model/Statistic.h>
12#include <aws/monitoring/model/StandardUnit.h>
13#include <aws/monitoring/model/ComparisonOperator.h>
14#include <aws/monitoring/model/Dimension.h>
15#include <aws/monitoring/model/MetricDataQuery.h>
16#include <aws/monitoring/model/Tag.h>
17#include <utility>
18
19namespace Aws
20{
21namespace CloudWatch
22{
23namespace Model
24{
25
29 {
30 public:
31 AWS_CLOUDWATCH_API PutMetricAlarmRequest() = default;
32
33 // Service request name is the Operation name which will send this request out,
34 // each operation should has unique request name, so that we can get operation's name from this request.
35 // Note: this is not true for response, multiple operations may have the same response name,
36 // so we can not get operation's name from response.
37 inline virtual const char* GetServiceRequestName() const override { return "PutMetricAlarm"; }
38
39 AWS_CLOUDWATCH_API Aws::String SerializePayload() const override;
40
41 protected:
42 AWS_CLOUDWATCH_API void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
43
44 public:
45
47
52 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
53 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
54 template<typename AlarmNameT = Aws::String>
55 void SetAlarmName(AlarmNameT&& value) { m_alarmNameHasBeenSet = true; m_alarmName = std::forward<AlarmNameT>(value); }
56 template<typename AlarmNameT = Aws::String>
57 PutMetricAlarmRequest& WithAlarmName(AlarmNameT&& value) { SetAlarmName(std::forward<AlarmNameT>(value)); return *this;}
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) { m_alarmDescriptionHasBeenSet = true; m_alarmDescription = std::forward<AlarmDescriptionT>(value); }
68 template<typename AlarmDescriptionT = Aws::String>
69 PutMetricAlarmRequest& WithAlarmDescription(AlarmDescriptionT&& value) { SetAlarmDescription(std::forward<AlarmDescriptionT>(value)); return *this;}
71
73
77 inline bool GetActionsEnabled() const { return m_actionsEnabled; }
78 inline bool ActionsEnabledHasBeenSet() const { return m_actionsEnabledHasBeenSet; }
79 inline void SetActionsEnabled(bool value) { m_actionsEnabledHasBeenSet = true; m_actionsEnabled = value; }
80 inline PutMetricAlarmRequest& WithActionsEnabled(bool value) { SetActionsEnabled(value); return *this;}
82
84
116 inline const Aws::Vector<Aws::String>& GetOKActions() const { return m_oKActions; }
117 inline bool OKActionsHasBeenSet() const { return m_oKActionsHasBeenSet; }
118 template<typename OKActionsT = Aws::Vector<Aws::String>>
119 void SetOKActions(OKActionsT&& value) { m_oKActionsHasBeenSet = true; m_oKActions = std::forward<OKActionsT>(value); }
120 template<typename OKActionsT = Aws::Vector<Aws::String>>
121 PutMetricAlarmRequest& WithOKActions(OKActionsT&& value) { SetOKActions(std::forward<OKActionsT>(value)); return *this;}
122 template<typename OKActionsT = Aws::String>
123 PutMetricAlarmRequest& AddOKActions(OKActionsT&& value) { m_oKActionsHasBeenSet = true; m_oKActions.emplace_back(std::forward<OKActionsT>(value)); return *this; }
125
127
162 inline const Aws::Vector<Aws::String>& GetAlarmActions() const { return m_alarmActions; }
163 inline bool AlarmActionsHasBeenSet() const { return m_alarmActionsHasBeenSet; }
164 template<typename AlarmActionsT = Aws::Vector<Aws::String>>
165 void SetAlarmActions(AlarmActionsT&& value) { m_alarmActionsHasBeenSet = true; m_alarmActions = std::forward<AlarmActionsT>(value); }
166 template<typename AlarmActionsT = Aws::Vector<Aws::String>>
167 PutMetricAlarmRequest& WithAlarmActions(AlarmActionsT&& value) { SetAlarmActions(std::forward<AlarmActionsT>(value)); return *this;}
168 template<typename AlarmActionsT = Aws::String>
169 PutMetricAlarmRequest& AddAlarmActions(AlarmActionsT&& value) { m_alarmActionsHasBeenSet = true; m_alarmActions.emplace_back(std::forward<AlarmActionsT>(value)); return *this; }
171
173
206 inline const Aws::Vector<Aws::String>& GetInsufficientDataActions() const { return m_insufficientDataActions; }
207 inline bool InsufficientDataActionsHasBeenSet() const { return m_insufficientDataActionsHasBeenSet; }
208 template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
209 void SetInsufficientDataActions(InsufficientDataActionsT&& value) { m_insufficientDataActionsHasBeenSet = true; m_insufficientDataActions = std::forward<InsufficientDataActionsT>(value); }
210 template<typename InsufficientDataActionsT = Aws::Vector<Aws::String>>
211 PutMetricAlarmRequest& WithInsufficientDataActions(InsufficientDataActionsT&& value) { SetInsufficientDataActions(std::forward<InsufficientDataActionsT>(value)); return *this;}
212 template<typename InsufficientDataActionsT = Aws::String>
213 PutMetricAlarmRequest& AddInsufficientDataActions(InsufficientDataActionsT&& value) { m_insufficientDataActionsHasBeenSet = true; m_insufficientDataActions.emplace_back(std::forward<InsufficientDataActionsT>(value)); return *this; }
215
217
227 inline const Aws::String& GetMetricName() const { return m_metricName; }
228 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
229 template<typename MetricNameT = Aws::String>
230 void SetMetricName(MetricNameT&& value) { m_metricNameHasBeenSet = true; m_metricName = std::forward<MetricNameT>(value); }
231 template<typename MetricNameT = Aws::String>
232 PutMetricAlarmRequest& WithMetricName(MetricNameT&& value) { SetMetricName(std::forward<MetricNameT>(value)); return *this;}
234
236
240 inline const Aws::String& GetNamespace() const { return m_namespace; }
241 inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
242 template<typename NamespaceT = Aws::String>
243 void SetNamespace(NamespaceT&& value) { m_namespaceHasBeenSet = true; m_namespace = std::forward<NamespaceT>(value); }
244 template<typename NamespaceT = Aws::String>
245 PutMetricAlarmRequest& WithNamespace(NamespaceT&& value) { SetNamespace(std::forward<NamespaceT>(value)); return *this;}
247
249
256 inline Statistic GetStatistic() const { return m_statistic; }
257 inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; }
258 inline void SetStatistic(Statistic value) { m_statisticHasBeenSet = true; m_statistic = value; }
259 inline PutMetricAlarmRequest& WithStatistic(Statistic value) { SetStatistic(value); return *this;}
261
263
282 inline const Aws::String& GetExtendedStatistic() const { return m_extendedStatistic; }
283 inline bool ExtendedStatisticHasBeenSet() const { return m_extendedStatisticHasBeenSet; }
284 template<typename ExtendedStatisticT = Aws::String>
285 void SetExtendedStatistic(ExtendedStatisticT&& value) { m_extendedStatisticHasBeenSet = true; m_extendedStatistic = std::forward<ExtendedStatisticT>(value); }
286 template<typename ExtendedStatisticT = Aws::String>
287 PutMetricAlarmRequest& WithExtendedStatistic(ExtendedStatisticT&& value) { SetExtendedStatistic(std::forward<ExtendedStatisticT>(value)); return *this;}
289
291
294 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
295 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
296 template<typename DimensionsT = Aws::Vector<Dimension>>
297 void SetDimensions(DimensionsT&& value) { m_dimensionsHasBeenSet = true; m_dimensions = std::forward<DimensionsT>(value); }
298 template<typename DimensionsT = Aws::Vector<Dimension>>
299 PutMetricAlarmRequest& WithDimensions(DimensionsT&& value) { SetDimensions(std::forward<DimensionsT>(value)); return *this;}
300 template<typename DimensionsT = Dimension>
301 PutMetricAlarmRequest& AddDimensions(DimensionsT&& value) { m_dimensionsHasBeenSet = true; m_dimensions.emplace_back(std::forward<DimensionsT>(value)); return *this; }
303
305
327 inline int GetPeriod() const { return m_period; }
328 inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; }
329 inline void SetPeriod(int value) { m_periodHasBeenSet = true; m_period = value; }
330 inline PutMetricAlarmRequest& WithPeriod(int value) { SetPeriod(value); return *this;}
332
334
352 inline StandardUnit GetUnit() const { return m_unit; }
353 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
354 inline void SetUnit(StandardUnit value) { m_unitHasBeenSet = true; m_unit = value; }
355 inline PutMetricAlarmRequest& WithUnit(StandardUnit value) { SetUnit(value); return *this;}
357
359
365 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
366 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
367 inline void SetEvaluationPeriods(int value) { m_evaluationPeriodsHasBeenSet = true; m_evaluationPeriods = value; }
368 inline PutMetricAlarmRequest& WithEvaluationPeriods(int value) { SetEvaluationPeriods(value); return *this;}
370
372
379 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
380 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
381 inline void SetDatapointsToAlarm(int value) { m_datapointsToAlarmHasBeenSet = true; m_datapointsToAlarm = value; }
382 inline PutMetricAlarmRequest& WithDatapointsToAlarm(int value) { SetDatapointsToAlarm(value); return *this;}
384
386
391 inline double GetThreshold() const { return m_threshold; }
392 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
393 inline void SetThreshold(double value) { m_thresholdHasBeenSet = true; m_threshold = value; }
394 inline PutMetricAlarmRequest& WithThreshold(double value) { SetThreshold(value); return *this;}
396
398
405 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
406 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
407 inline void SetComparisonOperator(ComparisonOperator value) { m_comparisonOperatorHasBeenSet = true; m_comparisonOperator = value; }
410
412
425 inline const Aws::String& GetTreatMissingData() const { return m_treatMissingData; }
426 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
427 template<typename TreatMissingDataT = Aws::String>
428 void SetTreatMissingData(TreatMissingDataT&& value) { m_treatMissingDataHasBeenSet = true; m_treatMissingData = std::forward<TreatMissingDataT>(value); }
429 template<typename TreatMissingDataT = Aws::String>
430 PutMetricAlarmRequest& WithTreatMissingData(TreatMissingDataT&& value) { SetTreatMissingData(std::forward<TreatMissingDataT>(value)); return *this;}
432
434
445 inline const Aws::String& GetEvaluateLowSampleCountPercentile() const { return m_evaluateLowSampleCountPercentile; }
446 inline bool EvaluateLowSampleCountPercentileHasBeenSet() const { return m_evaluateLowSampleCountPercentileHasBeenSet; }
447 template<typename EvaluateLowSampleCountPercentileT = Aws::String>
448 void SetEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) { m_evaluateLowSampleCountPercentileHasBeenSet = true; m_evaluateLowSampleCountPercentile = std::forward<EvaluateLowSampleCountPercentileT>(value); }
449 template<typename EvaluateLowSampleCountPercentileT = Aws::String>
450 PutMetricAlarmRequest& WithEvaluateLowSampleCountPercentile(EvaluateLowSampleCountPercentileT&& value) { SetEvaluateLowSampleCountPercentile(std::forward<EvaluateLowSampleCountPercentileT>(value)); return *this;}
452
454
472 inline const Aws::Vector<MetricDataQuery>& GetMetrics() const { return m_metrics; }
473 inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; }
474 template<typename MetricsT = Aws::Vector<MetricDataQuery>>
475 void SetMetrics(MetricsT&& value) { m_metricsHasBeenSet = true; m_metrics = std::forward<MetricsT>(value); }
476 template<typename MetricsT = Aws::Vector<MetricDataQuery>>
477 PutMetricAlarmRequest& WithMetrics(MetricsT&& value) { SetMetrics(std::forward<MetricsT>(value)); return *this;}
478 template<typename MetricsT = MetricDataQuery>
479 PutMetricAlarmRequest& AddMetrics(MetricsT&& value) { m_metricsHasBeenSet = true; m_metrics.emplace_back(std::forward<MetricsT>(value)); return *this; }
481
483
499 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
500 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
501 template<typename TagsT = Aws::Vector<Tag>>
502 void SetTags(TagsT&& value) { m_tagsHasBeenSet = true; m_tags = std::forward<TagsT>(value); }
503 template<typename TagsT = Aws::Vector<Tag>>
504 PutMetricAlarmRequest& WithTags(TagsT&& value) { SetTags(std::forward<TagsT>(value)); return *this;}
505 template<typename TagsT = Tag>
506 PutMetricAlarmRequest& AddTags(TagsT&& value) { m_tagsHasBeenSet = true; m_tags.emplace_back(std::forward<TagsT>(value)); return *this; }
508
510
517 inline const Aws::String& GetThresholdMetricId() const { return m_thresholdMetricId; }
518 inline bool ThresholdMetricIdHasBeenSet() const { return m_thresholdMetricIdHasBeenSet; }
519 template<typename ThresholdMetricIdT = Aws::String>
520 void SetThresholdMetricId(ThresholdMetricIdT&& value) { m_thresholdMetricIdHasBeenSet = true; m_thresholdMetricId = std::forward<ThresholdMetricIdT>(value); }
521 template<typename ThresholdMetricIdT = Aws::String>
522 PutMetricAlarmRequest& WithThresholdMetricId(ThresholdMetricIdT&& value) { SetThresholdMetricId(std::forward<ThresholdMetricIdT>(value)); return *this;}
524 private:
525
526 Aws::String m_alarmName;
527 bool m_alarmNameHasBeenSet = false;
528
529 Aws::String m_alarmDescription;
530 bool m_alarmDescriptionHasBeenSet = false;
531
532 bool m_actionsEnabled{false};
533 bool m_actionsEnabledHasBeenSet = false;
534
535 Aws::Vector<Aws::String> m_oKActions;
536 bool m_oKActionsHasBeenSet = false;
537
538 Aws::Vector<Aws::String> m_alarmActions;
539 bool m_alarmActionsHasBeenSet = false;
540
541 Aws::Vector<Aws::String> m_insufficientDataActions;
542 bool m_insufficientDataActionsHasBeenSet = false;
543
544 Aws::String m_metricName;
545 bool m_metricNameHasBeenSet = false;
546
547 Aws::String m_namespace;
548 bool m_namespaceHasBeenSet = false;
549
550 Statistic m_statistic{Statistic::NOT_SET};
551 bool m_statisticHasBeenSet = false;
552
553 Aws::String m_extendedStatistic;
554 bool m_extendedStatisticHasBeenSet = false;
555
556 Aws::Vector<Dimension> m_dimensions;
557 bool m_dimensionsHasBeenSet = false;
558
559 int m_period{0};
560 bool m_periodHasBeenSet = false;
561
563 bool m_unitHasBeenSet = false;
564
565 int m_evaluationPeriods{0};
566 bool m_evaluationPeriodsHasBeenSet = false;
567
568 int m_datapointsToAlarm{0};
569 bool m_datapointsToAlarmHasBeenSet = false;
570
571 double m_threshold{0.0};
572 bool m_thresholdHasBeenSet = false;
573
575 bool m_comparisonOperatorHasBeenSet = false;
576
577 Aws::String m_treatMissingData;
578 bool m_treatMissingDataHasBeenSet = false;
579
580 Aws::String m_evaluateLowSampleCountPercentile;
581 bool m_evaluateLowSampleCountPercentileHasBeenSet = false;
582
584 bool m_metricsHasBeenSet = false;
585
586 Aws::Vector<Tag> m_tags;
587 bool m_tagsHasBeenSet = false;
588
589 Aws::String m_thresholdMetricId;
590 bool m_thresholdMetricIdHasBeenSet = false;
591 };
592
593} // namespace Model
594} // namespace CloudWatch
595} // 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)
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)
AWS_CLOUDWATCH_API void DumpBodyToUrl(Aws::Http::URI &uri) const override
PutMetricAlarmRequest & WithTreatMissingData(TreatMissingDataT &&value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector