AWS SDK for C++  0.14.3
AWS SDK for C++
Metric.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
21 
22 namespace Aws
23 {
24 namespace Utils
25 {
26 namespace Xml
27 {
28  class XmlNode;
29 } // namespace Xml
30 } // namespace Utils
31 namespace CloudWatch
32 {
33 namespace Model
34 {
35 
45  {
46  public:
47  Metric();
48  Metric(const Aws::Utils::Xml::XmlNode& xmlNode);
49  Metric& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
50 
51  void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
52  void OutputToStream(Aws::OStream& oStream, const char* location) const;
53 
57  inline const Aws::String& GetNamespace() const{ return m_namespace; }
58 
62  inline void SetNamespace(const Aws::String& value) { m_namespaceHasBeenSet = true; m_namespace = value; }
63 
67  inline void SetNamespace(Aws::String&& value) { m_namespaceHasBeenSet = true; m_namespace = value; }
68 
72  inline void SetNamespace(const char* value) { m_namespaceHasBeenSet = true; m_namespace.assign(value); }
73 
77  inline Metric& WithNamespace(const Aws::String& value) { SetNamespace(value); return *this;}
78 
82  inline Metric& WithNamespace(Aws::String&& value) { SetNamespace(value); return *this;}
83 
87  inline Metric& WithNamespace(const char* value) { SetNamespace(value); return *this;}
88 
92  inline const Aws::String& GetMetricName() const{ return m_metricName; }
93 
97  inline void SetMetricName(const Aws::String& value) { m_metricNameHasBeenSet = true; m_metricName = value; }
98 
102  inline void SetMetricName(Aws::String&& value) { m_metricNameHasBeenSet = true; m_metricName = value; }
103 
107  inline void SetMetricName(const char* value) { m_metricNameHasBeenSet = true; m_metricName.assign(value); }
108 
112  inline Metric& WithMetricName(const Aws::String& value) { SetMetricName(value); return *this;}
113 
117  inline Metric& WithMetricName(Aws::String&& value) { SetMetricName(value); return *this;}
118 
122  inline Metric& WithMetricName(const char* value) { SetMetricName(value); return *this;}
123 
127  inline const Aws::Vector<Dimension>& GetDimensions() const{ return m_dimensions; }
128 
132  inline void SetDimensions(const Aws::Vector<Dimension>& value) { m_dimensionsHasBeenSet = true; m_dimensions = value; }
133 
137  inline void SetDimensions(Aws::Vector<Dimension>&& value) { m_dimensionsHasBeenSet = true; m_dimensions = value; }
138 
142  inline Metric& WithDimensions(const Aws::Vector<Dimension>& value) { SetDimensions(value); return *this;}
143 
147  inline Metric& WithDimensions(Aws::Vector<Dimension>&& value) { SetDimensions(value); return *this;}
148 
152  inline Metric& AddDimensions(const Dimension& value) { m_dimensionsHasBeenSet = true; m_dimensions.push_back(value); return *this; }
153 
157  inline Metric& AddDimensions(Dimension&& value) { m_dimensionsHasBeenSet = true; m_dimensions.push_back(value); return *this; }
158 
159  private:
160  Aws::String m_namespace;
161  bool m_namespaceHasBeenSet;
162  Aws::String m_metricName;
163  bool m_metricNameHasBeenSet;
164  Aws::Vector<Dimension> m_dimensions;
165  bool m_dimensionsHasBeenSet;
166  };
167 
168 } // namespace Model
169 } // namespace CloudWatch
170 } // namespace Aws
Metric & WithDimensions(const Aws::Vector< Dimension > &value)
Definition: Metric.h:142
Metric & WithMetricName(const Aws::String &value)
Definition: Metric.h:112
const Aws::String & GetNamespace() const
Definition: Metric.h:57
Metric & WithMetricName(Aws::String &&value)
Definition: Metric.h:117
void SetNamespace(const char *value)
Definition: Metric.h:72
Metric & AddDimensions(const Dimension &value)
Definition: Metric.h:152
Metric & WithDimensions(Aws::Vector< Dimension > &&value)
Definition: Metric.h:147
void SetMetricName(const Aws::String &value)
Definition: Metric.h:97
#define AWS_CLOUDWATCH_API
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
Metric & WithNamespace(const char *value)
Definition: Metric.h:87
Metric & WithNamespace(const Aws::String &value)
Definition: Metric.h:77
Metric & AddDimensions(Dimension &&value)
Definition: Metric.h:157
void SetDimensions(const Aws::Vector< Dimension > &value)
Definition: Metric.h:132
const Aws::String & GetMetricName() const
Definition: Metric.h:92
Metric & WithMetricName(const char *value)
Definition: Metric.h:122
std::basic_ostream< char, std::char_traits< char > > OStream
Definition: AWSStreamFwd.h:31
void SetMetricName(Aws::String &&value)
Definition: Metric.h:102
const Aws::Vector< Dimension > & GetDimensions() const
Definition: Metric.h:127
Metric & WithNamespace(Aws::String &&value)
Definition: Metric.h:82
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
void SetNamespace(const Aws::String &value)
Definition: Metric.h:62
void SetNamespace(Aws::String &&value)
Definition: Metric.h:67
void SetDimensions(Aws::Vector< Dimension > &&value)
Definition: Metric.h:137
void SetMetricName(const char *value)
Definition: Metric.h:107
JSON (JavaScript Object Notation).