AWS SDK for C++

AWS SDK for C++ Version 1.11.719

Loading...
Searching...
No Matches
Metric.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/crt/cbor/Cbor.h>
10#include <aws/monitoring/CloudWatch_EXPORTS.h>
11#include <aws/monitoring/model/Dimension.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Utils {
17namespace Cbor {
18class CborValue;
19} // namespace Cbor
20} // namespace Utils
21namespace CloudWatch {
22namespace Model {
23
29class Metric {
30 public:
31 AWS_CLOUDWATCH_API Metric() = default;
32 AWS_CLOUDWATCH_API Metric(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
33 AWS_CLOUDWATCH_API Metric& operator=(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
34 AWS_CLOUDWATCH_API void CborEncode(Aws::Crt::Cbor::CborEncoder& encoder) const;
35
37
40 inline const Aws::String& GetNamespace() const { return m_namespace; }
41 inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; }
42 template <typename NamespaceT = Aws::String>
43 void SetNamespace(NamespaceT&& value) {
44 m_namespaceHasBeenSet = true;
45 m_namespace = std::forward<NamespaceT>(value);
46 }
47 template <typename NamespaceT = Aws::String>
48 Metric& WithNamespace(NamespaceT&& value) {
49 SetNamespace(std::forward<NamespaceT>(value));
50 return *this;
51 }
53
55
58 inline const Aws::String& GetMetricName() const { return m_metricName; }
59 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
60 template <typename MetricNameT = Aws::String>
61 void SetMetricName(MetricNameT&& value) {
62 m_metricNameHasBeenSet = true;
63 m_metricName = std::forward<MetricNameT>(value);
64 }
65 template <typename MetricNameT = Aws::String>
66 Metric& WithMetricName(MetricNameT&& value) {
67 SetMetricName(std::forward<MetricNameT>(value));
68 return *this;
69 }
71
73
76 inline const Aws::Vector<Dimension>& GetDimensions() const { return m_dimensions; }
77 inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; }
78 template <typename DimensionsT = Aws::Vector<Dimension>>
79 void SetDimensions(DimensionsT&& value) {
80 m_dimensionsHasBeenSet = true;
81 m_dimensions = std::forward<DimensionsT>(value);
82 }
83 template <typename DimensionsT = Aws::Vector<Dimension>>
84 Metric& WithDimensions(DimensionsT&& value) {
85 SetDimensions(std::forward<DimensionsT>(value));
86 return *this;
87 }
88 template <typename DimensionsT = Dimension>
89 Metric& AddDimensions(DimensionsT&& value) {
90 m_dimensionsHasBeenSet = true;
91 m_dimensions.emplace_back(std::forward<DimensionsT>(value));
92 return *this;
93 }
95 private:
96 Aws::String m_namespace;
97
98 Aws::String m_metricName;
99
100 Aws::Vector<Dimension> m_dimensions;
101 bool m_namespaceHasBeenSet = false;
102 bool m_metricNameHasBeenSet = false;
103 bool m_dimensionsHasBeenSet = false;
104};
105
106} // namespace Model
107} // namespace CloudWatch
108} // namespace Aws
void SetMetricName(MetricNameT &&value)
Definition Metric.h:61
bool MetricNameHasBeenSet() const
Definition Metric.h:59
AWS_CLOUDWATCH_API Metric()=default
void SetNamespace(NamespaceT &&value)
Definition Metric.h:43
AWS_CLOUDWATCH_API Metric & operator=(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
const Aws::Vector< Dimension > & GetDimensions() const
Definition Metric.h:76
bool NamespaceHasBeenSet() const
Definition Metric.h:41
void SetDimensions(DimensionsT &&value)
Definition Metric.h:79
const Aws::String & GetNamespace() const
Definition Metric.h:40
Metric & WithNamespace(NamespaceT &&value)
Definition Metric.h:48
AWS_CLOUDWATCH_API Metric(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
Metric & WithMetricName(MetricNameT &&value)
Definition Metric.h:66
AWS_CLOUDWATCH_API void CborEncode(Aws::Crt::Cbor::CborEncoder &encoder) const
Metric & AddDimensions(DimensionsT &&value)
Definition Metric.h:89
Metric & WithDimensions(DimensionsT &&value)
Definition Metric.h:84
bool DimensionsHasBeenSet() const
Definition Metric.h:77
const Aws::String & GetMetricName() const
Definition Metric.h:58
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector