AWS SDK for C++

AWS SDK for C++ Version 1.11.787

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/Tag.h>
16#include <aws/lightsail/model/TreatMissingData.h>
17
18#include <utility>
19
20namespace Aws {
21namespace Lightsail {
22namespace Model {
23
27 public:
28 AWS_LIGHTSAIL_API PutAlarmRequest() = 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 "PutAlarm"; }
35
36 AWS_LIGHTSAIL_API Aws::String SerializePayload() const override;
37
39
41
45 inline const Aws::String& GetAlarmName() const { return m_alarmName; }
46 inline bool AlarmNameHasBeenSet() const { return m_alarmNameHasBeenSet; }
47 template <typename AlarmNameT = Aws::String>
48 void SetAlarmName(AlarmNameT&& value) {
49 m_alarmNameHasBeenSet = true;
50 m_alarmName = std::forward<AlarmNameT>(value);
51 }
52 template <typename AlarmNameT = Aws::String>
53 PutAlarmRequest& WithAlarmName(AlarmNameT&& value) {
54 SetAlarmName(std::forward<AlarmNameT>(value));
55 return *this;
56 }
58
60
83 inline MetricName GetMetricName() const { return m_metricName; }
84 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
85 inline void SetMetricName(MetricName value) {
86 m_metricNameHasBeenSet = true;
87 m_metricName = value;
88 }
90 SetMetricName(value);
91 return *this;
92 }
94
96
101 inline const Aws::String& GetMonitoredResourceName() const { return m_monitoredResourceName; }
102 inline bool MonitoredResourceNameHasBeenSet() const { return m_monitoredResourceNameHasBeenSet; }
103 template <typename MonitoredResourceNameT = Aws::String>
104 void SetMonitoredResourceName(MonitoredResourceNameT&& value) {
105 m_monitoredResourceNameHasBeenSet = true;
106 m_monitoredResourceName = std::forward<MonitoredResourceNameT>(value);
107 }
108 template <typename MonitoredResourceNameT = Aws::String>
109 PutAlarmRequest& WithMonitoredResourceName(MonitoredResourceNameT&& value) {
110 SetMonitoredResourceName(std::forward<MonitoredResourceNameT>(value));
111 return *this;
112 }
114
116
120 inline ComparisonOperator GetComparisonOperator() const { return m_comparisonOperator; }
121 inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; }
123 m_comparisonOperatorHasBeenSet = true;
124 m_comparisonOperator = value;
125 }
128 return *this;
129 }
131
133
136 inline double GetThreshold() const { return m_threshold; }
137 inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; }
138 inline void SetThreshold(double value) {
139 m_thresholdHasBeenSet = true;
140 m_threshold = value;
141 }
142 inline PutAlarmRequest& WithThreshold(double value) {
143 SetThreshold(value);
144 return *this;
145 }
147
149
160 inline int GetEvaluationPeriods() const { return m_evaluationPeriods; }
161 inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; }
162 inline void SetEvaluationPeriods(int value) {
163 m_evaluationPeriodsHasBeenSet = true;
164 m_evaluationPeriods = value;
165 }
168 return *this;
169 }
171
173
178 inline int GetDatapointsToAlarm() const { return m_datapointsToAlarm; }
179 inline bool DatapointsToAlarmHasBeenSet() const { return m_datapointsToAlarmHasBeenSet; }
180 inline void SetDatapointsToAlarm(int value) {
181 m_datapointsToAlarmHasBeenSet = true;
182 m_datapointsToAlarm = value;
183 }
186 return *this;
187 }
189
191
204 inline TreatMissingData GetTreatMissingData() const { return m_treatMissingData; }
205 inline bool TreatMissingDataHasBeenSet() const { return m_treatMissingDataHasBeenSet; }
207 m_treatMissingDataHasBeenSet = true;
208 m_treatMissingData = value;
209 }
211 SetTreatMissingData(value);
212 return *this;
213 }
215
217
228 inline const Aws::Vector<ContactProtocol>& GetContactProtocols() const { return m_contactProtocols; }
229 inline bool ContactProtocolsHasBeenSet() const { return m_contactProtocolsHasBeenSet; }
230 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
231 void SetContactProtocols(ContactProtocolsT&& value) {
232 m_contactProtocolsHasBeenSet = true;
233 m_contactProtocols = std::forward<ContactProtocolsT>(value);
234 }
235 template <typename ContactProtocolsT = Aws::Vector<ContactProtocol>>
236 PutAlarmRequest& WithContactProtocols(ContactProtocolsT&& value) {
237 SetContactProtocols(std::forward<ContactProtocolsT>(value));
238 return *this;
239 }
241 m_contactProtocolsHasBeenSet = true;
242 m_contactProtocols.push_back(value);
243 return *this;
244 }
246
248
268 inline const Aws::Vector<AlarmState>& GetNotificationTriggers() const { return m_notificationTriggers; }
269 inline bool NotificationTriggersHasBeenSet() const { return m_notificationTriggersHasBeenSet; }
270 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
271 void SetNotificationTriggers(NotificationTriggersT&& value) {
272 m_notificationTriggersHasBeenSet = true;
273 m_notificationTriggers = std::forward<NotificationTriggersT>(value);
274 }
275 template <typename NotificationTriggersT = Aws::Vector<AlarmState>>
276 PutAlarmRequest& WithNotificationTriggers(NotificationTriggersT&& value) {
277 SetNotificationTriggers(std::forward<NotificationTriggersT>(value));
278 return *this;
279 }
281 m_notificationTriggersHasBeenSet = true;
282 m_notificationTriggers.push_back(value);
283 return *this;
284 }
286
288
292 inline bool GetNotificationEnabled() const { return m_notificationEnabled; }
293 inline bool NotificationEnabledHasBeenSet() const { return m_notificationEnabledHasBeenSet; }
294 inline void SetNotificationEnabled(bool value) {
295 m_notificationEnabledHasBeenSet = true;
296 m_notificationEnabled = value;
297 }
300 return *this;
301 }
303
305
310 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
311 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
312 template <typename TagsT = Aws::Vector<Tag>>
313 void SetTags(TagsT&& value) {
314 m_tagsHasBeenSet = true;
315 m_tags = std::forward<TagsT>(value);
316 }
317 template <typename TagsT = Aws::Vector<Tag>>
318 PutAlarmRequest& WithTags(TagsT&& value) {
319 SetTags(std::forward<TagsT>(value));
320 return *this;
321 }
322 template <typename TagsT = Tag>
323 PutAlarmRequest& AddTags(TagsT&& value) {
324 m_tagsHasBeenSet = true;
325 m_tags.emplace_back(std::forward<TagsT>(value));
326 return *this;
327 }
329 private:
330 Aws::String m_alarmName;
331
332 MetricName m_metricName{MetricName::NOT_SET};
333
334 Aws::String m_monitoredResourceName;
335
337
338 double m_threshold{0.0};
339
340 int m_evaluationPeriods{0};
341
342 int m_datapointsToAlarm{0};
343
345
346 Aws::Vector<ContactProtocol> m_contactProtocols;
347
348 Aws::Vector<AlarmState> m_notificationTriggers;
349
350 bool m_notificationEnabled{false};
351
352 Aws::Vector<Tag> m_tags;
353 bool m_alarmNameHasBeenSet = false;
354 bool m_metricNameHasBeenSet = false;
355 bool m_monitoredResourceNameHasBeenSet = false;
356 bool m_comparisonOperatorHasBeenSet = false;
357 bool m_thresholdHasBeenSet = false;
358 bool m_evaluationPeriodsHasBeenSet = false;
359 bool m_datapointsToAlarmHasBeenSet = false;
360 bool m_treatMissingDataHasBeenSet = false;
361 bool m_contactProtocolsHasBeenSet = false;
362 bool m_notificationTriggersHasBeenSet = false;
363 bool m_notificationEnabledHasBeenSet = false;
364 bool m_tagsHasBeenSet = false;
365};
366
367} // namespace Model
368} // namespace Lightsail
369} // 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)
PutAlarmRequest & WithTags(TagsT &&value)
void SetNotificationTriggers(NotificationTriggersT &&value)
const Aws::Vector< ContactProtocol > & GetContactProtocols() const
PutAlarmRequest & WithNotificationEnabled(bool value)
void SetTreatMissingData(TreatMissingData value)
PutAlarmRequest & AddTags(TagsT &&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)
const Aws::Vector< Tag > & GetTags() const
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