AWS SDK for C++  0.14.3
AWS SDK for C++
Rule.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
16 #include <aws/waf/WAF_EXPORTS.h>
20 
21 namespace Aws
22 {
23 namespace Utils
24 {
25 namespace Json
26 {
27  class JsonValue;
28 } // namespace Json
29 } // namespace Utils
30 namespace WAF
31 {
32 namespace Model
33 {
34 
49  {
50  public:
51  Rule();
52  Rule(const Aws::Utils::Json::JsonValue& jsonValue);
53  Rule& operator=(const Aws::Utils::Json::JsonValue& jsonValue);
54  Aws::Utils::Json::JsonValue Jsonize() const;
55 
65  inline const Aws::String& GetRuleId() const{ return m_ruleId; }
66 
76  inline void SetRuleId(const Aws::String& value) { m_ruleIdHasBeenSet = true; m_ruleId = value; }
77 
87  inline void SetRuleId(Aws::String&& value) { m_ruleIdHasBeenSet = true; m_ruleId = value; }
88 
98  inline void SetRuleId(const char* value) { m_ruleIdHasBeenSet = true; m_ruleId.assign(value); }
99 
109  inline Rule& WithRuleId(const Aws::String& value) { SetRuleId(value); return *this;}
110 
120  inline Rule& WithRuleId(Aws::String&& value) { SetRuleId(value); return *this;}
121 
131  inline Rule& WithRuleId(const char* value) { SetRuleId(value); return *this;}
132 
137  inline const Aws::String& GetName() const{ return m_name; }
138 
143  inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
144 
149  inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = value; }
150 
155  inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
156 
161  inline Rule& WithName(const Aws::String& value) { SetName(value); return *this;}
162 
167  inline Rule& WithName(Aws::String&& value) { SetName(value); return *this;}
168 
173  inline Rule& WithName(const char* value) { SetName(value); return *this;}
174 
175 
176  inline const Aws::String& GetMetricName() const{ return m_metricName; }
177 
178 
179  inline void SetMetricName(const Aws::String& value) { m_metricNameHasBeenSet = true; m_metricName = value; }
180 
181 
182  inline void SetMetricName(Aws::String&& value) { m_metricNameHasBeenSet = true; m_metricName = value; }
183 
184 
185  inline void SetMetricName(const char* value) { m_metricNameHasBeenSet = true; m_metricName.assign(value); }
186 
187 
188  inline Rule& WithMetricName(const Aws::String& value) { SetMetricName(value); return *this;}
189 
190 
191  inline Rule& WithMetricName(Aws::String&& value) { SetMetricName(value); return *this;}
192 
193 
194  inline Rule& WithMetricName(const char* value) { SetMetricName(value); return *this;}
195 
202  inline const Aws::Vector<Predicate>& GetPredicates() const{ return m_predicates; }
203 
210  inline void SetPredicates(const Aws::Vector<Predicate>& value) { m_predicatesHasBeenSet = true; m_predicates = value; }
211 
218  inline void SetPredicates(Aws::Vector<Predicate>&& value) { m_predicatesHasBeenSet = true; m_predicates = value; }
219 
226  inline Rule& WithPredicates(const Aws::Vector<Predicate>& value) { SetPredicates(value); return *this;}
227 
234  inline Rule& WithPredicates(Aws::Vector<Predicate>&& value) { SetPredicates(value); return *this;}
235 
242  inline Rule& AddPredicates(const Predicate& value) { m_predicatesHasBeenSet = true; m_predicates.push_back(value); return *this; }
243 
250  inline Rule& AddPredicates(Predicate&& value) { m_predicatesHasBeenSet = true; m_predicates.push_back(value); return *this; }
251 
252  private:
253  Aws::String m_ruleId;
254  bool m_ruleIdHasBeenSet;
255  Aws::String m_name;
256  bool m_nameHasBeenSet;
257  Aws::String m_metricName;
258  bool m_metricNameHasBeenSet;
259  Aws::Vector<Predicate> m_predicates;
260  bool m_predicatesHasBeenSet;
261  };
262 
263 } // namespace Model
264 } // namespace WAF
265 } // namespace Aws
const Aws::String & GetMetricName() const
Definition: Rule.h:176
Rule & WithMetricName(Aws::String &&value)
Definition: Rule.h:191
const Aws::String & GetRuleId() const
Definition: Rule.h:65
const Aws::String & GetName() const
Definition: Rule.h:137
void SetMetricName(const Aws::String &value)
Definition: Rule.h:179
Rule & WithRuleId(Aws::String &&value)
Definition: Rule.h:120
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
Rule & WithMetricName(const Aws::String &value)
Definition: Rule.h:188
void SetRuleId(const Aws::String &value)
Definition: Rule.h:76
Rule & WithName(const char *value)
Definition: Rule.h:173
Rule & WithName(const Aws::String &value)
Definition: Rule.h:161
Rule & WithRuleId(const char *value)
Definition: Rule.h:131
void SetName(const char *value)
Definition: Rule.h:155
#define AWS_WAF_API
Definition: WAF_EXPORTS.h:37
Rule & AddPredicates(Predicate &&value)
Definition: Rule.h:250
Rule & WithName(Aws::String &&value)
Definition: Rule.h:167
Rule & WithMetricName(const char *value)
Definition: Rule.h:194
Rule & WithPredicates(const Aws::Vector< Predicate > &value)
Definition: Rule.h:226
void SetMetricName(const char *value)
Definition: Rule.h:185
void SetName(Aws::String &&value)
Definition: Rule.h:149
void SetRuleId(Aws::String &&value)
Definition: Rule.h:87
Rule & WithRuleId(const Aws::String &value)
Definition: Rule.h:109
void SetRuleId(const char *value)
Definition: Rule.h:98
const Aws::Vector< Predicate > & GetPredicates() const
Definition: Rule.h:202
Rule & AddPredicates(const Predicate &value)
Definition: Rule.h:242
Rule & WithPredicates(Aws::Vector< Predicate > &&value)
Definition: Rule.h:234
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
void SetName(const Aws::String &value)
Definition: Rule.h:143
void SetMetricName(Aws::String &&value)
Definition: Rule.h:182
void SetPredicates(const Aws::Vector< Predicate > &value)
Definition: Rule.h:210
void SetPredicates(Aws::Vector< Predicate > &&value)
Definition: Rule.h:218
JSON (JavaScript Object Notation).