AWS SDK for C++

AWS SDK for C++ Version 1.11.744

Loading...
Searching...
No Matches
Rule.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/waf/WAF_EXPORTS.h>
10#include <aws/waf/model/Predicate.h>
11
12#include <utility>
13
14namespace Aws {
15namespace Utils {
16namespace Json {
17class JsonValue;
18class JsonView;
19} // namespace Json
20} // namespace Utils
21namespace WAF {
22namespace Model {
23
47class Rule {
48 public:
49 AWS_WAF_API Rule() = default;
50 AWS_WAF_API Rule(Aws::Utils::Json::JsonView jsonValue);
51 AWS_WAF_API Rule& operator=(Aws::Utils::Json::JsonView jsonValue);
53
55
64 inline const Aws::String& GetRuleId() const { return m_ruleId; }
65 inline bool RuleIdHasBeenSet() const { return m_ruleIdHasBeenSet; }
66 template <typename RuleIdT = Aws::String>
67 void SetRuleId(RuleIdT&& value) {
68 m_ruleIdHasBeenSet = true;
69 m_ruleId = std::forward<RuleIdT>(value);
70 }
71 template <typename RuleIdT = Aws::String>
72 Rule& WithRuleId(RuleIdT&& value) {
73 SetRuleId(std::forward<RuleIdT>(value));
74 return *this;
75 }
77
79
83 inline const Aws::String& GetName() const { return m_name; }
84 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
85 template <typename NameT = Aws::String>
86 void SetName(NameT&& value) {
87 m_nameHasBeenSet = true;
88 m_name = std::forward<NameT>(value);
89 }
90 template <typename NameT = Aws::String>
91 Rule& WithName(NameT&& value) {
92 SetName(std::forward<NameT>(value));
93 return *this;
94 }
96
98
105 inline const Aws::String& GetMetricName() const { return m_metricName; }
106 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
107 template <typename MetricNameT = Aws::String>
108 void SetMetricName(MetricNameT&& value) {
109 m_metricNameHasBeenSet = true;
110 m_metricName = std::forward<MetricNameT>(value);
111 }
112 template <typename MetricNameT = Aws::String>
113 Rule& WithMetricName(MetricNameT&& value) {
114 SetMetricName(std::forward<MetricNameT>(value));
115 return *this;
116 }
118
120
126 inline const Aws::Vector<Predicate>& GetPredicates() const { return m_predicates; }
127 inline bool PredicatesHasBeenSet() const { return m_predicatesHasBeenSet; }
128 template <typename PredicatesT = Aws::Vector<Predicate>>
129 void SetPredicates(PredicatesT&& value) {
130 m_predicatesHasBeenSet = true;
131 m_predicates = std::forward<PredicatesT>(value);
132 }
133 template <typename PredicatesT = Aws::Vector<Predicate>>
134 Rule& WithPredicates(PredicatesT&& value) {
135 SetPredicates(std::forward<PredicatesT>(value));
136 return *this;
137 }
138 template <typename PredicatesT = Predicate>
139 Rule& AddPredicates(PredicatesT&& value) {
140 m_predicatesHasBeenSet = true;
141 m_predicates.emplace_back(std::forward<PredicatesT>(value));
142 return *this;
143 }
145 private:
146 Aws::String m_ruleId;
147
148 Aws::String m_name;
149
150 Aws::String m_metricName;
151
152 Aws::Vector<Predicate> m_predicates;
153 bool m_ruleIdHasBeenSet = false;
154 bool m_nameHasBeenSet = false;
155 bool m_metricNameHasBeenSet = false;
156 bool m_predicatesHasBeenSet = false;
157};
158
159} // namespace Model
160} // namespace WAF
161} // namespace Aws
Rule & WithRuleId(RuleIdT &&value)
Definition Rule.h:72
AWS_WAF_API Rule()=default
bool RuleIdHasBeenSet() const
Definition Rule.h:65
bool NameHasBeenSet() const
Definition Rule.h:84
const Aws::String & GetRuleId() const
Definition Rule.h:64
void SetPredicates(PredicatesT &&value)
Definition Rule.h:129
AWS_WAF_API Rule & operator=(Aws::Utils::Json::JsonView jsonValue)
bool PredicatesHasBeenSet() const
Definition Rule.h:127
const Aws::String & GetMetricName() const
Definition Rule.h:105
void SetRuleId(RuleIdT &&value)
Definition Rule.h:67
const Aws::Vector< Predicate > & GetPredicates() const
Definition Rule.h:126
AWS_WAF_API Rule(Aws::Utils::Json::JsonView jsonValue)
void SetName(NameT &&value)
Definition Rule.h:86
AWS_WAF_API Aws::Utils::Json::JsonValue Jsonize() const
Rule & WithName(NameT &&value)
Definition Rule.h:91
Rule & AddPredicates(PredicatesT &&value)
Definition Rule.h:139
void SetMetricName(MetricNameT &&value)
Definition Rule.h:108
bool MetricNameHasBeenSet() const
Definition Rule.h:106
Rule & WithMetricName(MetricNameT &&value)
Definition Rule.h:113
Rule & WithPredicates(PredicatesT &&value)
Definition Rule.h:134
const Aws::String & GetName() const
Definition Rule.h:83
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue