aws_sdk_amp/operation/list_rule_groups_namespaces/
_list_rule_groups_namespaces_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListRuleGroupsNamespacesOutput {
7 pub rule_groups_namespaces: ::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>,
9 pub next_token: ::std::option::Option<::std::string::String>,
11 _request_id: Option<String>,
12}
13impl ListRuleGroupsNamespacesOutput {
14 pub fn rule_groups_namespaces(&self) -> &[crate::types::RuleGroupsNamespaceSummary] {
16 use std::ops::Deref;
17 self.rule_groups_namespaces.deref()
18 }
19 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 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#[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 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 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 pub fn get_rule_groups_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleGroupsNamespaceSummary>> {
63 &self.rule_groups_namespaces
64 }
65 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 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.next_token = input;
73 self
74 }
75 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 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}