aws_sdk_amp/operation/list_rule_groups_namespaces/
_list_rule_groups_namespaces_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>ListRuleGroupsNamespaces</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListRuleGroupsNamespacesOutput {
7    /// <p>The returned list of rule groups namespaces.</p>
8    pub rule_groups_namespaces: ::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>,
9    /// <p>A token indicating that there are more results to retrieve. You can use this token as part of your next <code>ListRuleGroupsNamespaces</code> request to retrieve those results.</p>
10    pub next_token: ::std::option::Option<::std::string::String>,
11    _request_id: Option<String>,
12}
13impl ListRuleGroupsNamespacesOutput {
14    /// <p>The returned list of rule groups namespaces.</p>
15    pub fn rule_groups_namespaces(&self) -> &[crate::types::RuleGroupsNamespaceSummary] {
16        use std::ops::Deref;
17        self.rule_groups_namespaces.deref()
18    }
19    /// <p>A token indicating that there are more results to retrieve. You can use this token as part of your next <code>ListRuleGroupsNamespaces</code> request to retrieve those results.</p>
20    pub fn next_token(&self) -> ::std::option::Option<&str> {
21        self.next_token.as_deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for ListRuleGroupsNamespacesOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl ListRuleGroupsNamespacesOutput {
30    /// Creates a new builder-style object to manufacture [`ListRuleGroupsNamespacesOutput`](crate::operation::list_rule_groups_namespaces::ListRuleGroupsNamespacesOutput).
31    pub fn builder() -> crate::operation::list_rule_groups_namespaces::builders::ListRuleGroupsNamespacesOutputBuilder {
32        crate::operation::list_rule_groups_namespaces::builders::ListRuleGroupsNamespacesOutputBuilder::default()
33    }
34}
35
36/// A builder for [`ListRuleGroupsNamespacesOutput`](crate::operation::list_rule_groups_namespaces::ListRuleGroupsNamespacesOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ListRuleGroupsNamespacesOutputBuilder {
40    pub(crate) rule_groups_namespaces: ::std::option::Option<::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>>,
41    pub(crate) next_token: ::std::option::Option<::std::string::String>,
42    _request_id: Option<String>,
43}
44impl ListRuleGroupsNamespacesOutputBuilder {
45    /// Appends an item to `rule_groups_namespaces`.
46    ///
47    /// To override the contents of this collection use [`set_rule_groups_namespaces`](Self::set_rule_groups_namespaces).
48    ///
49    /// <p>The returned list of rule groups namespaces.</p>
50    pub fn rule_groups_namespaces(mut self, input: crate::types::RuleGroupsNamespaceSummary) -> Self {
51        let mut v = self.rule_groups_namespaces.unwrap_or_default();
52        v.push(input);
53        self.rule_groups_namespaces = ::std::option::Option::Some(v);
54        self
55    }
56    /// <p>The returned list of rule groups namespaces.</p>
57    pub fn set_rule_groups_namespaces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>>) -> Self {
58        self.rule_groups_namespaces = input;
59        self
60    }
61    /// <p>The returned list of rule groups namespaces.</p>
62    pub fn get_rule_groups_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>> {
63        &self.rule_groups_namespaces
64    }
65    /// <p>A token indicating that there are more results to retrieve. You can use this token as part of your next <code>ListRuleGroupsNamespaces</code> request to retrieve those results.</p>
66    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.next_token = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>A token indicating that there are more results to retrieve. You can use this token as part of your next <code>ListRuleGroupsNamespaces</code> request to retrieve those results.</p>
71    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.next_token = input;
73        self
74    }
75    /// <p>A token indicating that there are more results to retrieve. You can use this token as part of your next <code>ListRuleGroupsNamespaces</code> request to retrieve those results.</p>
76    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
77        &self.next_token
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 [`ListRuleGroupsNamespacesOutput`](crate::operation::list_rule_groups_namespaces::ListRuleGroupsNamespacesOutput).
89    /// This method will fail if any of the following fields are not set:
90    /// - [`rule_groups_namespaces`](crate::operation::list_rule_groups_namespaces::builders::ListRuleGroupsNamespacesOutputBuilder::rule_groups_namespaces)
91    pub fn build(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::list_rule_groups_namespaces::ListRuleGroupsNamespacesOutput,
95        ::aws_smithy_types::error::operation::BuildError,
96    > {
97        ::std::result::Result::Ok(crate::operation::list_rule_groups_namespaces::ListRuleGroupsNamespacesOutput {
98            rule_groups_namespaces: self.rule_groups_namespaces.ok_or_else(|| {
99                ::aws_smithy_types::error::operation::BuildError::missing_field(
100                    "rule_groups_namespaces",
101                    "rule_groups_namespaces was not specified but it is required when building ListRuleGroupsNamespacesOutput",
102                )
103            })?,
104            next_token: self.next_token,
105            _request_id: self._request_id,
106        })
107    }
108}