1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/waf/WAF_EXPORTS.h>
8 #include <aws/waf/model/HTTPRequest.h>
9 #include <aws/core/utils/DateTime.h>
10 #include <aws/core/utils/memory/stl/AWSString.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace WAF
24 {
25 namespace Model
26 {
27 
28   /**
29    *  <p>This is <b>AWS WAF Classic</b> documentation. For more information,
30    * see <a
31    * href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
32    * WAF Classic</a> in the developer guide.</p> <p> <b>For the latest version of AWS
33    * WAF</b>, use the AWS WAFV2 API and see the <a
34    * href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
35    * WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of
36    * endpoints for regional and global use. </p>  <p>The response from a
37    * <a>GetSampledRequests</a> request includes a <code>SampledHTTPRequests</code>
38    * complex type that appears as <code>SampledRequests</code> in the response
39    * syntax. <code>SampledHTTPRequests</code> contains one
40    * <code>SampledHTTPRequest</code> object for each web request that is returned by
41    * <code>GetSampledRequests</code>.</p><p><h3>See Also:</h3>   <a
42    * href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/SampledHTTPRequest">AWS
43    * API Reference</a></p>
44    */
45   class AWS_WAF_API SampledHTTPRequest
46   {
47   public:
48     SampledHTTPRequest();
49     SampledHTTPRequest(Aws::Utils::Json::JsonView jsonValue);
50     SampledHTTPRequest& operator=(Aws::Utils::Json::JsonView jsonValue);
51     Aws::Utils::Json::JsonValue Jsonize() const;
52 
53 
54     /**
55      * <p>A complex type that contains detailed information about the request.</p>
56      */
GetRequest()57     inline const HTTPRequest& GetRequest() const{ return m_request; }
58 
59     /**
60      * <p>A complex type that contains detailed information about the request.</p>
61      */
RequestHasBeenSet()62     inline bool RequestHasBeenSet() const { return m_requestHasBeenSet; }
63 
64     /**
65      * <p>A complex type that contains detailed information about the request.</p>
66      */
SetRequest(const HTTPRequest & value)67     inline void SetRequest(const HTTPRequest& value) { m_requestHasBeenSet = true; m_request = value; }
68 
69     /**
70      * <p>A complex type that contains detailed information about the request.</p>
71      */
SetRequest(HTTPRequest && value)72     inline void SetRequest(HTTPRequest&& value) { m_requestHasBeenSet = true; m_request = std::move(value); }
73 
74     /**
75      * <p>A complex type that contains detailed information about the request.</p>
76      */
WithRequest(const HTTPRequest & value)77     inline SampledHTTPRequest& WithRequest(const HTTPRequest& value) { SetRequest(value); return *this;}
78 
79     /**
80      * <p>A complex type that contains detailed information about the request.</p>
81      */
WithRequest(HTTPRequest && value)82     inline SampledHTTPRequest& WithRequest(HTTPRequest&& value) { SetRequest(std::move(value)); return *this;}
83 
84 
85     /**
86      * <p>A value that indicates how one result in the response relates proportionally
87      * to other results in the response. A result that has a weight of <code>2</code>
88      * represents roughly twice as many CloudFront web requests as a result that has a
89      * weight of <code>1</code>.</p>
90      */
GetWeight()91     inline long long GetWeight() const{ return m_weight; }
92 
93     /**
94      * <p>A value that indicates how one result in the response relates proportionally
95      * to other results in the response. A result that has a weight of <code>2</code>
96      * represents roughly twice as many CloudFront web requests as a result that has a
97      * weight of <code>1</code>.</p>
98      */
WeightHasBeenSet()99     inline bool WeightHasBeenSet() const { return m_weightHasBeenSet; }
100 
101     /**
102      * <p>A value that indicates how one result in the response relates proportionally
103      * to other results in the response. A result that has a weight of <code>2</code>
104      * represents roughly twice as many CloudFront web requests as a result that has a
105      * weight of <code>1</code>.</p>
106      */
SetWeight(long long value)107     inline void SetWeight(long long value) { m_weightHasBeenSet = true; m_weight = value; }
108 
109     /**
110      * <p>A value that indicates how one result in the response relates proportionally
111      * to other results in the response. A result that has a weight of <code>2</code>
112      * represents roughly twice as many CloudFront web requests as a result that has a
113      * weight of <code>1</code>.</p>
114      */
WithWeight(long long value)115     inline SampledHTTPRequest& WithWeight(long long value) { SetWeight(value); return *this;}
116 
117 
118     /**
119      * <p>The time at which AWS WAF received the request from your AWS resource, in
120      * Unix time format (in seconds).</p>
121      */
GetTimestamp()122     inline const Aws::Utils::DateTime& GetTimestamp() const{ return m_timestamp; }
123 
124     /**
125      * <p>The time at which AWS WAF received the request from your AWS resource, in
126      * Unix time format (in seconds).</p>
127      */
TimestampHasBeenSet()128     inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
129 
130     /**
131      * <p>The time at which AWS WAF received the request from your AWS resource, in
132      * Unix time format (in seconds).</p>
133      */
SetTimestamp(const Aws::Utils::DateTime & value)134     inline void SetTimestamp(const Aws::Utils::DateTime& value) { m_timestampHasBeenSet = true; m_timestamp = value; }
135 
136     /**
137      * <p>The time at which AWS WAF received the request from your AWS resource, in
138      * Unix time format (in seconds).</p>
139      */
SetTimestamp(Aws::Utils::DateTime && value)140     inline void SetTimestamp(Aws::Utils::DateTime&& value) { m_timestampHasBeenSet = true; m_timestamp = std::move(value); }
141 
142     /**
143      * <p>The time at which AWS WAF received the request from your AWS resource, in
144      * Unix time format (in seconds).</p>
145      */
WithTimestamp(const Aws::Utils::DateTime & value)146     inline SampledHTTPRequest& WithTimestamp(const Aws::Utils::DateTime& value) { SetTimestamp(value); return *this;}
147 
148     /**
149      * <p>The time at which AWS WAF received the request from your AWS resource, in
150      * Unix time format (in seconds).</p>
151      */
WithTimestamp(Aws::Utils::DateTime && value)152     inline SampledHTTPRequest& WithTimestamp(Aws::Utils::DateTime&& value) { SetTimestamp(std::move(value)); return *this;}
153 
154 
155     /**
156      * <p>The action for the <code>Rule</code> that the request matched:
157      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
158      */
GetAction()159     inline const Aws::String& GetAction() const{ return m_action; }
160 
161     /**
162      * <p>The action for the <code>Rule</code> that the request matched:
163      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
164      */
ActionHasBeenSet()165     inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }
166 
167     /**
168      * <p>The action for the <code>Rule</code> that the request matched:
169      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
170      */
SetAction(const Aws::String & value)171     inline void SetAction(const Aws::String& value) { m_actionHasBeenSet = true; m_action = value; }
172 
173     /**
174      * <p>The action for the <code>Rule</code> that the request matched:
175      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
176      */
SetAction(Aws::String && value)177     inline void SetAction(Aws::String&& value) { m_actionHasBeenSet = true; m_action = std::move(value); }
178 
179     /**
180      * <p>The action for the <code>Rule</code> that the request matched:
181      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
182      */
SetAction(const char * value)183     inline void SetAction(const char* value) { m_actionHasBeenSet = true; m_action.assign(value); }
184 
185     /**
186      * <p>The action for the <code>Rule</code> that the request matched:
187      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
188      */
WithAction(const Aws::String & value)189     inline SampledHTTPRequest& WithAction(const Aws::String& value) { SetAction(value); return *this;}
190 
191     /**
192      * <p>The action for the <code>Rule</code> that the request matched:
193      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
194      */
WithAction(Aws::String && value)195     inline SampledHTTPRequest& WithAction(Aws::String&& value) { SetAction(std::move(value)); return *this;}
196 
197     /**
198      * <p>The action for the <code>Rule</code> that the request matched:
199      * <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p>
200      */
WithAction(const char * value)201     inline SampledHTTPRequest& WithAction(const char* value) { SetAction(value); return *this;}
202 
203 
204     /**
205      * <p>This value is returned if the <code>GetSampledRequests</code> request
206      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
207      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
208      * <code>RuleGroup</code> that matched the request listed in the response.</p>
209      */
GetRuleWithinRuleGroup()210     inline const Aws::String& GetRuleWithinRuleGroup() const{ return m_ruleWithinRuleGroup; }
211 
212     /**
213      * <p>This value is returned if the <code>GetSampledRequests</code> request
214      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
215      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
216      * <code>RuleGroup</code> that matched the request listed in the response.</p>
217      */
RuleWithinRuleGroupHasBeenSet()218     inline bool RuleWithinRuleGroupHasBeenSet() const { return m_ruleWithinRuleGroupHasBeenSet; }
219 
220     /**
221      * <p>This value is returned if the <code>GetSampledRequests</code> request
222      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
223      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
224      * <code>RuleGroup</code> that matched the request listed in the response.</p>
225      */
SetRuleWithinRuleGroup(const Aws::String & value)226     inline void SetRuleWithinRuleGroup(const Aws::String& value) { m_ruleWithinRuleGroupHasBeenSet = true; m_ruleWithinRuleGroup = value; }
227 
228     /**
229      * <p>This value is returned if the <code>GetSampledRequests</code> request
230      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
231      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
232      * <code>RuleGroup</code> that matched the request listed in the response.</p>
233      */
SetRuleWithinRuleGroup(Aws::String && value)234     inline void SetRuleWithinRuleGroup(Aws::String&& value) { m_ruleWithinRuleGroupHasBeenSet = true; m_ruleWithinRuleGroup = std::move(value); }
235 
236     /**
237      * <p>This value is returned if the <code>GetSampledRequests</code> request
238      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
239      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
240      * <code>RuleGroup</code> that matched the request listed in the response.</p>
241      */
SetRuleWithinRuleGroup(const char * value)242     inline void SetRuleWithinRuleGroup(const char* value) { m_ruleWithinRuleGroupHasBeenSet = true; m_ruleWithinRuleGroup.assign(value); }
243 
244     /**
245      * <p>This value is returned if the <code>GetSampledRequests</code> request
246      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
247      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
248      * <code>RuleGroup</code> that matched the request listed in the response.</p>
249      */
WithRuleWithinRuleGroup(const Aws::String & value)250     inline SampledHTTPRequest& WithRuleWithinRuleGroup(const Aws::String& value) { SetRuleWithinRuleGroup(value); return *this;}
251 
252     /**
253      * <p>This value is returned if the <code>GetSampledRequests</code> request
254      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
255      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
256      * <code>RuleGroup</code> that matched the request listed in the response.</p>
257      */
WithRuleWithinRuleGroup(Aws::String && value)258     inline SampledHTTPRequest& WithRuleWithinRuleGroup(Aws::String&& value) { SetRuleWithinRuleGroup(std::move(value)); return *this;}
259 
260     /**
261      * <p>This value is returned if the <code>GetSampledRequests</code> request
262      * specifies the ID of a <code>RuleGroup</code> rather than the ID of an individual
263      * rule. <code>RuleWithinRuleGroup</code> is the rule within the specified
264      * <code>RuleGroup</code> that matched the request listed in the response.</p>
265      */
WithRuleWithinRuleGroup(const char * value)266     inline SampledHTTPRequest& WithRuleWithinRuleGroup(const char* value) { SetRuleWithinRuleGroup(value); return *this;}
267 
268   private:
269 
270     HTTPRequest m_request;
271     bool m_requestHasBeenSet;
272 
273     long long m_weight;
274     bool m_weightHasBeenSet;
275 
276     Aws::Utils::DateTime m_timestamp;
277     bool m_timestampHasBeenSet;
278 
279     Aws::String m_action;
280     bool m_actionHasBeenSet;
281 
282     Aws::String m_ruleWithinRuleGroup;
283     bool m_ruleWithinRuleGroupHasBeenSet;
284   };
285 
286 } // namespace Model
287 } // namespace WAF
288 } // namespace Aws
289