aws_sdk_waf/operation/get_rule/_get_rule_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetRuleOutput {
6 /// <p>Information about the <code>Rule</code> that you specified in the <code>GetRule</code> request. For more information, see the following topics:</p>
7 /// <ul>
8 /// <li>
9 /// <p><code>Rule</code>: Contains <code>MetricName</code>, <code>Name</code>, an array of <code>Predicate</code> objects, and <code>RuleId</code></p></li>
10 /// <li>
11 /// <p><code>Predicate</code>: Each <code>Predicate</code> object contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code></p></li>
12 /// </ul>
13 pub rule: ::std::option::Option<crate::types::Rule>,
14 _request_id: Option<String>,
15}
16impl GetRuleOutput {
17 /// <p>Information about the <code>Rule</code> that you specified in the <code>GetRule</code> request. For more information, see the following topics:</p>
18 /// <ul>
19 /// <li>
20 /// <p><code>Rule</code>: Contains <code>MetricName</code>, <code>Name</code>, an array of <code>Predicate</code> objects, and <code>RuleId</code></p></li>
21 /// <li>
22 /// <p><code>Predicate</code>: Each <code>Predicate</code> object contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code></p></li>
23 /// </ul>
24 pub fn rule(&self) -> ::std::option::Option<&crate::types::Rule> {
25 self.rule.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for GetRuleOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetRuleOutput {
34 /// Creates a new builder-style object to manufacture [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
35 pub fn builder() -> crate::operation::get_rule::builders::GetRuleOutputBuilder {
36 crate::operation::get_rule::builders::GetRuleOutputBuilder::default()
37 }
38}
39
40/// A builder for [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetRuleOutputBuilder {
44 pub(crate) rule: ::std::option::Option<crate::types::Rule>,
45 _request_id: Option<String>,
46}
47impl GetRuleOutputBuilder {
48 /// <p>Information about the <code>Rule</code> that you specified in the <code>GetRule</code> request. For more information, see the following topics:</p>
49 /// <ul>
50 /// <li>
51 /// <p><code>Rule</code>: Contains <code>MetricName</code>, <code>Name</code>, an array of <code>Predicate</code> objects, and <code>RuleId</code></p></li>
52 /// <li>
53 /// <p><code>Predicate</code>: Each <code>Predicate</code> object contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code></p></li>
54 /// </ul>
55 pub fn rule(mut self, input: crate::types::Rule) -> Self {
56 self.rule = ::std::option::Option::Some(input);
57 self
58 }
59 /// <p>Information about the <code>Rule</code> that you specified in the <code>GetRule</code> request. For more information, see the following topics:</p>
60 /// <ul>
61 /// <li>
62 /// <p><code>Rule</code>: Contains <code>MetricName</code>, <code>Name</code>, an array of <code>Predicate</code> objects, and <code>RuleId</code></p></li>
63 /// <li>
64 /// <p><code>Predicate</code>: Each <code>Predicate</code> object contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code></p></li>
65 /// </ul>
66 pub fn set_rule(mut self, input: ::std::option::Option<crate::types::Rule>) -> Self {
67 self.rule = input;
68 self
69 }
70 /// <p>Information about the <code>Rule</code> that you specified in the <code>GetRule</code> request. For more information, see the following topics:</p>
71 /// <ul>
72 /// <li>
73 /// <p><code>Rule</code>: Contains <code>MetricName</code>, <code>Name</code>, an array of <code>Predicate</code> objects, and <code>RuleId</code></p></li>
74 /// <li>
75 /// <p><code>Predicate</code>: Each <code>Predicate</code> object contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code></p></li>
76 /// </ul>
77 pub fn get_rule(&self) -> &::std::option::Option<crate::types::Rule> {
78 &self.rule
79 }
80 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81 self._request_id = Some(request_id.into());
82 self
83 }
84
85 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86 self._request_id = request_id;
87 self
88 }
89 /// Consumes the builder and constructs a [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
90 pub fn build(self) -> crate::operation::get_rule::GetRuleOutput {
91 crate::operation::get_rule::GetRuleOutput {
92 rule: self.rule,
93 _request_id: self._request_id,
94 }
95 }
96}