aws_sdk_waf/operation/list_rules/
_list_rules_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 ListRulesOutput {
6    /// <p>If you have more <code>Rules</code> than the number that you specified for <code>Limit</code> in the request, the response includes a <code>NextMarker</code> value. To list more <code>Rules</code>, submit another <code>ListRules</code> request, and specify the <code>NextMarker</code> value from the response in the <code>NextMarker</code> value in the next request.</p>
7    pub next_marker: ::std::option::Option<::std::string::String>,
8    /// <p>An array of <code>RuleSummary</code> objects.</p>
9    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::RuleSummary>>,
10    _request_id: Option<String>,
11}
12impl ListRulesOutput {
13    /// <p>If you have more <code>Rules</code> than the number that you specified for <code>Limit</code> in the request, the response includes a <code>NextMarker</code> value. To list more <code>Rules</code>, submit another <code>ListRules</code> request, and specify the <code>NextMarker</code> value from the response in the <code>NextMarker</code> value in the next request.</p>
14    pub fn next_marker(&self) -> ::std::option::Option<&str> {
15        self.next_marker.as_deref()
16    }
17    /// <p>An array of <code>RuleSummary</code> objects.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rules.is_none()`.
20    pub fn rules(&self) -> &[crate::types::RuleSummary] {
21        self.rules.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for ListRulesOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl ListRulesOutput {
30    /// Creates a new builder-style object to manufacture [`ListRulesOutput`](crate::operation::list_rules::ListRulesOutput).
31    pub fn builder() -> crate::operation::list_rules::builders::ListRulesOutputBuilder {
32        crate::operation::list_rules::builders::ListRulesOutputBuilder::default()
33    }
34}
35
36/// A builder for [`ListRulesOutput`](crate::operation::list_rules::ListRulesOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ListRulesOutputBuilder {
40    pub(crate) next_marker: ::std::option::Option<::std::string::String>,
41    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::RuleSummary>>,
42    _request_id: Option<String>,
43}
44impl ListRulesOutputBuilder {
45    /// <p>If you have more <code>Rules</code> than the number that you specified for <code>Limit</code> in the request, the response includes a <code>NextMarker</code> value. To list more <code>Rules</code>, submit another <code>ListRules</code> request, and specify the <code>NextMarker</code> value from the response in the <code>NextMarker</code> value in the next request.</p>
46    pub fn next_marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.next_marker = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>If you have more <code>Rules</code> than the number that you specified for <code>Limit</code> in the request, the response includes a <code>NextMarker</code> value. To list more <code>Rules</code>, submit another <code>ListRules</code> request, and specify the <code>NextMarker</code> value from the response in the <code>NextMarker</code> value in the next request.</p>
51    pub fn set_next_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.next_marker = input;
53        self
54    }
55    /// <p>If you have more <code>Rules</code> than the number that you specified for <code>Limit</code> in the request, the response includes a <code>NextMarker</code> value. To list more <code>Rules</code>, submit another <code>ListRules</code> request, and specify the <code>NextMarker</code> value from the response in the <code>NextMarker</code> value in the next request.</p>
56    pub fn get_next_marker(&self) -> &::std::option::Option<::std::string::String> {
57        &self.next_marker
58    }
59    /// Appends an item to `rules`.
60    ///
61    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
62    ///
63    /// <p>An array of <code>RuleSummary</code> objects.</p>
64    pub fn rules(mut self, input: crate::types::RuleSummary) -> Self {
65        let mut v = self.rules.unwrap_or_default();
66        v.push(input);
67        self.rules = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>An array of <code>RuleSummary</code> objects.</p>
71    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleSummary>>) -> Self {
72        self.rules = input;
73        self
74    }
75    /// <p>An array of <code>RuleSummary</code> objects.</p>
76    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleSummary>> {
77        &self.rules
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`ListRulesOutput`](crate::operation::list_rules::ListRulesOutput).
89    pub fn build(self) -> crate::operation::list_rules::ListRulesOutput {
90        crate::operation::list_rules::ListRulesOutput {
91            next_marker: self.next_marker,
92            rules: self.rules,
93            _request_id: self._request_id,
94        }
95    }
96}