AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
PutAlarmRequest.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/lightsail/LightsailRequest.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/TreatMissingData.h>
16
17#include <utility>
18
19namespace Aws {
20namespace Lightsail {
21namespace Model {
22
26 public:
27 AWS_LIGHTSAIL_API PutAlarmRequest() = default;
28
29 // Service request name is the Operation name which will send this request out,
30 // each operation should has unique request name, so that we can get operation's name from this request.
31 // Note: this is not true for response, multiple operations may have the same response name,
32 // so we can not get operation's name from response.
33 inline virtual const char* GetServiceRequestName() const override { return "PutAlarm"; }
34
35 AWS_LIGHTSAIL_API Aws::String SerializePayload() const override;
36
38
40
44 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
45 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
46 template <typename AlarmNameT = Aws::String>
47 void SetAlarmName(AlarmNameT&& value) {
48 m_alarmNameHasBeenSet = true;
49 m_alarmName = std::forward<AlarmNameT>(value);
50 }
51 template <typename AlarmNameT = Aws::String>
52 PutAlarmRequest& WithAlarmName(AlarmNameT&& value) {
53 SetAlarmName(std::forward<AlarmNameT>(value));
54 return *this;
55 }
57
59
82 inline MetricName GetMetricName() const { return m_metricName; }
83 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
84 inline void SetMetricName(MetricName value) {
85 m_metricNameHasBeenSet = true;
86 m_metricName = value;
87 }
89 SetMetricName(value);
90 return *this;
91 }
93
95
100 inline const Aws::String& GetMonitoredResourceName() const { return m_monitoredResourceName; }
101 inline bool MonitoredResourceNameHasBeenSet() const { return m_monitoredResourceNameHasBeenSet; }
102 template <typename MonitoredResourceNameT = Aws::String>
103 void SetMonitoredResourceName(MonitoredResourceNameT&& value) {
104 m_monitoredResourceNameHasBeenSet = true;
105 m_monitoredResourceName = std::forward<MonitoredResourceNameT>(value);
106 }
107 template <typename MonitoredResourceNameT = Aws::String>
108 PutAlarmRequest& WithMonitoredResourceName(MonitoredResourceNameT&& value) {
109 SetMonitoredResourceName(std::forward<MonitoredResourceNameT>(value));
110 return *this;
111 }
113
115
119 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
120 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
122 m_comparisonOperatorHasBeenSet = true;
123 m_comparisonOperator = value;
124 }
127 return *this;
128 }
130
132
135 inline double GetThreshold() const { return m_threshold; }
136 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
137 inline void SetThreshold(double value) {
138 m_thresholdHasBeenSet = true;
139 m_threshold = value;
140 }
141 inline PutAlarmRequest& WithThreshold(double value) {
142 SetThreshold(value);
143 return *this;
144 }
146
148
159 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
160 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
161 inline void SetEvaluationPeriods(int value) {
162 m_evaluationPeriodsHasBeenSet = true;
163 m_evaluationPeriods = value;
164 }
167 return *this;
168 }
170
172
177 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
178 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
179 inline void SetDatapointsToAlarm(int value) {
180 m_datapointsToAlarmHasBeenSet = true;
181 m_datapointsToAlarm = value;
182 }
185 return *this;
186 }
188
190
203 inline TreatMissingData GetTreatMissingData() const { return m_treatMissingData; }
204 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
206 m_treatMissingDataHasBeenSet = true;
207 m_treatMissingData = value;
208 }
210 SetTreatMissingData(value);
211 return *this;
212 }
214
216
227 inline const Aws::Vector<ContactProtocol>& GetContactProtocols() const { return m_contactProtocols; }
228 inline bool ContactProtocolsHasBeenSet() const { return m_contactProtocolsHasBeenSet; }
229 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
230 void SetContactProtocols(ContactProtocolsT&& value) {
231 m_contactProtocolsHasBeenSet = true;
232 m_contactProtocols = std::forward<ContactProtocolsT>(value);
233 }
234 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
235 PutAlarmRequest& WithContactProtocols(ContactProtocolsT&& value) {
236 SetContactProtocols(std::forward<ContactProtocolsT>(value));
237 return *this;
238 }
240 m_contactProtocolsHasBeenSet = true;
241 m_contactProtocols.push_back(value);
242 return *this;
243 }
245
247
267 inline const Aws::Vector<AlarmState>& GetNotificationTriggers() const { return m_notificationTriggers; }
268 inline bool NotificationTriggersHasBeenSet() const { return m_notificationTriggersHasBeenSet; }
269 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
270 void SetNotificationTriggers(NotificationTriggersT&& value) {
271 m_notificationTriggersHasBeenSet = true;
272 m_notificationTriggers = std::forward<NotificationTriggersT>(value);
273 }
274 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
275 PutAlarmRequest& WithNotificationTriggers(NotificationTriggersT&& value) {
276 SetNotificationTriggers(std::forward<NotificationTriggersT>(value));
277 return *this;
278 }
280 m_notificationTriggersHasBeenSet = true;
281 m_notificationTriggers.push_back(value);
282 return *this;
283 }
285
287
291 inline bool GetNotificationEnabled() const { return m_notificationEnabled; }
292 inline bool NotificationEnabledHasBeenSet() const { return m_notificationEnabledHasBeenSet; }
293 inline void SetNotificationEnabled(bool value) {
294 m_notificationEnabledHasBeenSet = true;
295 m_notificationEnabled = value;
296 }
299 return *this;
300 }
302 private:
303 Aws::String m_alarmName;
304
305 MetricName m_metricName{MetricName::NOT_SET};
306
307 Aws::String m_monitoredResourceName;
308
310
311 double m_threshold{0.0};
312
313 int m_evaluationPeriods{0};
314
315 int m_datapointsToAlarm{0};
316
318
319 Aws::Vector<ContactProtocol> m_contactProtocols;
320
321 Aws::Vector<AlarmState> m_notificationTriggers;
322
323 bool m_notificationEnabled{false};
324 bool m_alarmNameHasBeenSet = false;
325 bool m_metricNameHasBeenSet = false;
326 bool m_monitoredResourceNameHasBeenSet = false;
327 bool m_comparisonOperatorHasBeenSet = false;
328 bool m_thresholdHasBeenSet = false;
329 bool m_evaluationPeriodsHasBeenSet = false;
330 bool m_datapointsToAlarmHasBeenSet = false;
331 bool m_treatMissingDataHasBeenSet = false;
332 bool m_contactProtocolsHasBeenSet = false;
333 bool m_notificationTriggersHasBeenSet = false;
334 bool m_notificationEnabledHasBeenSet = false;
335};
336
337} // namespace Model
338} // namespace Lightsail
339} // namespace Aws
PutAlarmRequest & AddNotificationTriggers(AlarmState value)
const Aws::Vector< AlarmState > & GetNotificationTriggers() const
void SetMonitoredResourceName(MonitoredResourceNameT &&value)
PutAlarmRequest & WithContactProtocols(ContactProtocolsT &&value)
void SetAlarmName(AlarmNameT &&value)
AWS_LIGHTSAIL_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
PutAlarmRequest & WithAlarmName(AlarmNameT &&value)
const Aws::String & GetAlarmName() const
PutAlarmRequest & WithMonitoredResourceName(MonitoredResourceNameT &&value)
void SetComparisonOperator(ComparisonOperator value)
void SetNotificationTriggers(NotificationTriggersT &&value)
const Aws::Vector< ContactProtocol > & GetContactProtocols() const
PutAlarmRequest & WithNotificationEnabled(bool value)
void SetTreatMissingData(TreatMissingData value)
PutAlarmRequest & WithComparisonOperator(ComparisonOperator value)
virtual const char * GetServiceRequestName() const override
PutAlarmRequest & WithEvaluationPeriods(int value)
PutAlarmRequest & WithThreshold(double value)
void SetContactProtocols(ContactProtocolsT &&value)
ComparisonOperator GetComparisonOperator() const
AWS_LIGHTSAIL_API Aws::String SerializePayload() const override
const Aws::String & GetMonitoredResourceName() const
PutAlarmRequest & WithMetricName(MetricName value)
AWS_LIGHTSAIL_API PutAlarmRequest()=default
PutAlarmRequest & WithDatapointsToAlarm(int value)
PutAlarmRequest & AddContactProtocols(ContactProtocol value)
PutAlarmRequest & WithTreatMissingData(TreatMissingData value)
PutAlarmRequest & WithNotificationTriggers(NotificationTriggersT &&value)
TreatMissingData GetTreatMissingData() const
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