AWS SDK for C++

AWS SDK for C++ Version 1.11.719

Loading...
Searching...
No Matches
MetricDatum.h
1
6#pragma once
7#include <aws/core/utils/DateTime.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/crt/cbor/Cbor.h>
11#include <aws/monitoring/CloudWatch_EXPORTS.h>
12#include <aws/monitoring/model/Dimension.h>
13#include <aws/monitoring/model/StandardUnit.h>
14#include <aws/monitoring/model/StatisticSet.h>
15
16#include <utility>
17
18namespace Aws {
19namespace Utils {
20namespace Cbor {
21class CborValue;
22} // namespace Cbor
23} // namespace Utils
24namespace CloudWatch {
25namespace Model {
26
34 public:
35 AWS_CLOUDWATCH_API MetricDatum() = default;
36 AWS_CLOUDWATCH_API MetricDatum(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
37 AWS_CLOUDWATCH_API MetricDatum& operator=(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
38 AWS_CLOUDWATCH_API void CborEncode(Aws::Crt::Cbor::CborEncoder& encoder) const;
39
41
44 inline const Aws::String& GetMetricName() const { return m_metricName; }
45 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
46 template <typename MetricNameT = Aws::String>
47 void SetMetricName(MetricNameT&& value) {
48 m_metricNameHasBeenSet = true;
49 m_metricName = std::forward<MetricNameT>(value);
50 }
51 template <typename MetricNameT = Aws::String>
52 MetricDatum& WithMetricName(MetricNameT&& value) {
53 SetMetricName(std::forward<MetricNameT>(value));
54 return *this;
55 }
57
59
62 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
63 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
64 template <typename DimensionsT = Aws::Vector<Dimension>>
65 void SetDimensions(DimensionsT&& value) {
66 m_dimensionsHasBeenSet = true;
67 m_dimensions = std::forward<DimensionsT>(value);
68 }
69 template <typename DimensionsT = Aws::Vector<Dimension>>
70 MetricDatum& WithDimensions(DimensionsT&& value) {
71 SetDimensions(std::forward<DimensionsT>(value));
72 return *this;
73 }
74 template <typename DimensionsT = Dimension>
75 MetricDatum& AddDimensions(DimensionsT&& value) {
76 m_dimensionsHasBeenSet = true;
77 m_dimensions.emplace_back(std::forward<DimensionsT>(value));
78 return *this;
79 }
81
83
87 inline const Aws::Utils::DateTime& GetTimestamp() const { return m_timestamp; }
88 inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
89 template <typename TimestampT = Aws::Utils::DateTime>
90 void SetTimestamp(TimestampT&& value) {
91 m_timestampHasBeenSet = true;
92 m_timestamp = std::forward<TimestampT>(value);
93 }
94 template <typename TimestampT = Aws::Utils::DateTime>
95 MetricDatum& WithTimestamp(TimestampT&& value) {
96 SetTimestamp(std::forward<TimestampT>(value));
97 return *this;
98 }
100
102
108 inline double GetValue() const { return m_value; }
109 inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
110 inline void SetValue(double value) {
111 m_valueHasBeenSet = true;
112 m_value = value;
113 }
114 inline MetricDatum& WithValue(double value) {
115 SetValue(value);
116 return *this;
117 }
119
121
124 inline const StatisticSet& GetStatisticValues() const { return m_statisticValues; }
125 inline bool StatisticValuesHasBeenSet() const { return m_statisticValuesHasBeenSet; }
126 template <typename StatisticValuesT = StatisticSet>
127 void SetStatisticValues(StatisticValuesT&& value) {
128 m_statisticValuesHasBeenSet = true;
129 m_statisticValues = std::forward<StatisticValuesT>(value);
130 }
131 template <typename StatisticValuesT = StatisticSet>
132 MetricDatum& WithStatisticValues(StatisticValuesT&& value) {
133 SetStatisticValues(std::forward<StatisticValuesT>(value));
134 return *this;
135 }
137
139
150 inline const Aws::Vector<double>& GetValues() const { return m_values; }
151 inline bool ValuesHasBeenSet() const { return m_valuesHasBeenSet; }
152 template <typename ValuesT = Aws::Vector<double>>
153 void SetValues(ValuesT&& value) {
154 m_valuesHasBeenSet = true;
155 m_values = std::forward<ValuesT>(value);
156 }
157 template <typename ValuesT = Aws::Vector<double>>
158 MetricDatum& WithValues(ValuesT&& value) {
159 SetValues(std::forward<ValuesT>(value));
160 return *this;
161 }
162 inline MetricDatum& AddValues(double value) {
163 m_valuesHasBeenSet = true;
164 m_values.push_back(value);
165 return *this;
166 }
168
170
178 inline const Aws::Vector<double>& GetCounts() const { return m_counts; }
179 inline bool CountsHasBeenSet() const { return m_countsHasBeenSet; }
180 template <typename CountsT = Aws::Vector<double>>
181 void SetCounts(CountsT&& value) {
182 m_countsHasBeenSet = true;
183 m_counts = std::forward<CountsT>(value);
184 }
185 template <typename CountsT = Aws::Vector<double>>
186 MetricDatum& WithCounts(CountsT&& value) {
187 SetCounts(std::forward<CountsT>(value));
188 return *this;
189 }
190 inline MetricDatum& AddCounts(double value) {
191 m_countsHasBeenSet = true;
192 m_counts.push_back(value);
193 return *this;
194 }
196
198
203 inline StandardUnit GetUnit() const { return m_unit; }
204 inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; }
205 inline void SetUnit(StandardUnit value) {
206 m_unitHasBeenSet = true;
207 m_unit = value;
208 }
210 SetUnit(value);
211 return *this;
212 }
214
216
227 inline int64_t GetStorageResolution() const { return m_storageResolution; }
228 inline bool StorageResolutionHasBeenSet() const { return m_storageResolutionHasBeenSet; }
229 inline void SetStorageResolution(int64_t value) {
230 m_storageResolutionHasBeenSet = true;
231 m_storageResolution = value;
232 }
233 inline MetricDatum& WithStorageResolution(int64_t value) {
235 return *this;
236 }
238 private:
239 Aws::String m_metricName;
240
241 Aws::Vector<Dimension> m_dimensions;
242
243 Aws::Utils::DateTime m_timestamp{};
244
245 double m_value{0.0};
246
247 StatisticSet m_statisticValues;
248
249 Aws::Vector<double> m_values;
250
251 Aws::Vector<double> m_counts;
252
254
255 int64_t m_storageResolution{0};
256 bool m_metricNameHasBeenSet = false;
257 bool m_dimensionsHasBeenSet = false;
258 bool m_timestampHasBeenSet = false;
259 bool m_valueHasBeenSet = false;
260 bool m_statisticValuesHasBeenSet = false;
261 bool m_valuesHasBeenSet = false;
262 bool m_countsHasBeenSet = false;
263 bool m_unitHasBeenSet = false;
264 bool m_storageResolutionHasBeenSet = false;
265};
266
267} // namespace Model
268} // namespace CloudWatch
269} // namespace Aws
void SetCounts(CountsT &&value)
AWS_CLOUDWATCH_API void CborEncode(Aws::Crt::Cbor::CborEncoder &encoder) const
void SetDimensions(DimensionsT &&value)
Definition MetricDatum.h:65
MetricDatum & WithStorageResolution(int64_t value)
const Aws::Vector< Dimension > & GetDimensions() const
Definition MetricDatum.h:62
void SetStatisticValues(StatisticValuesT &&value)
AWS_CLOUDWATCH_API MetricDatum(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
void SetTimestamp(TimestampT &&value)
Definition MetricDatum.h:90
const Aws::Vector< double > & GetCounts() const
MetricDatum & WithValue(double value)
void SetStorageResolution(int64_t value)
MetricDatum & WithStatisticValues(StatisticValuesT &&value)
MetricDatum & WithValues(ValuesT &&value)
MetricDatum & WithUnit(StandardUnit value)
const Aws::Vector< double > & GetValues() const
AWS_CLOUDWATCH_API MetricDatum & operator=(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
MetricDatum & WithTimestamp(TimestampT &&value)
Definition MetricDatum.h:95
const StatisticSet & GetStatisticValues() const
const Aws::String & GetMetricName() const
Definition MetricDatum.h:44
MetricDatum & AddDimensions(DimensionsT &&value)
Definition MetricDatum.h:75
MetricDatum & AddCounts(double value)
const Aws::Utils::DateTime & GetTimestamp() const
Definition MetricDatum.h:87
void SetMetricName(MetricNameT &&value)
Definition MetricDatum.h:47
AWS_CLOUDWATCH_API MetricDatum()=default
MetricDatum & WithDimensions(DimensionsT &&value)
Definition MetricDatum.h:70
MetricDatum & WithMetricName(MetricNameT &&value)
Definition MetricDatum.h:52
MetricDatum & AddValues(double value)
MetricDatum & WithCounts(CountsT &&value)
void SetValues(ValuesT &&value)
void SetUnit(StandardUnit value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector