aws_sdk_amp/operation/put_rule_groups_namespace/
_put_rule_groups_namespace_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutRuleGroupsNamespaceOutput {
7 pub name: ::std::string::String,
9 pub arn: ::std::string::String,
11 pub status: ::std::option::Option<crate::types::RuleGroupsNamespaceStatus>,
13 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
15 _request_id: Option<String>,
16}
17impl PutRuleGroupsNamespaceOutput {
18 pub fn name(&self) -> &str {
20 use std::ops::Deref;
21 self.name.deref()
22 }
23 pub fn arn(&self) -> &str {
25 use std::ops::Deref;
26 self.arn.deref()
27 }
28 pub fn status(&self) -> ::std::option::Option<&crate::types::RuleGroupsNamespaceStatus> {
30 self.status.as_ref()
31 }
32 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34 self.tags.as_ref()
35 }
36}
37impl ::aws_types::request_id::RequestId for PutRuleGroupsNamespaceOutput {
38 fn request_id(&self) -> Option<&str> {
39 self._request_id.as_deref()
40 }
41}
42impl PutRuleGroupsNamespaceOutput {
43 pub fn builder() -> crate::operation::put_rule_groups_namespace::builders::PutRuleGroupsNamespaceOutputBuilder {
45 crate::operation::put_rule_groups_namespace::builders::PutRuleGroupsNamespaceOutputBuilder::default()
46 }
47}
48
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct PutRuleGroupsNamespaceOutputBuilder {
53 pub(crate) name: ::std::option::Option<::std::string::String>,
54 pub(crate) arn: ::std::option::Option<::std::string::String>,
55 pub(crate) status: ::std::option::Option<crate::types::RuleGroupsNamespaceStatus>,
56 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57 _request_id: Option<String>,
58}
59impl PutRuleGroupsNamespaceOutputBuilder {
60 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.name = ::std::option::Option::Some(input.into());
64 self
65 }
66 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.name = input;
69 self
70 }
71 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
73 &self.name
74 }
75 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78 self.arn = ::std::option::Option::Some(input.into());
79 self
80 }
81 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.arn = input;
84 self
85 }
86 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
88 &self.arn
89 }
90 pub fn status(mut self, input: crate::types::RuleGroupsNamespaceStatus) -> Self {
93 self.status = ::std::option::Option::Some(input);
94 self
95 }
96 pub fn set_status(mut self, input: ::std::option::Option<crate::types::RuleGroupsNamespaceStatus>) -> Self {
98 self.status = input;
99 self
100 }
101 pub fn get_status(&self) -> &::std::option::Option<crate::types::RuleGroupsNamespaceStatus> {
103 &self.status
104 }
105 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
111 let mut hash_map = self.tags.unwrap_or_default();
112 hash_map.insert(k.into(), v.into());
113 self.tags = ::std::option::Option::Some(hash_map);
114 self
115 }
116 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
118 self.tags = input;
119 self
120 }
121 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
123 &self.tags
124 }
125 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
126 self._request_id = Some(request_id.into());
127 self
128 }
129
130 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
131 self._request_id = request_id;
132 self
133 }
134 pub fn build(
139 self,
140 ) -> ::std::result::Result<
141 crate::operation::put_rule_groups_namespace::PutRuleGroupsNamespaceOutput,
142 ::aws_smithy_types::error::operation::BuildError,
143 > {
144 ::std::result::Result::Ok(crate::operation::put_rule_groups_namespace::PutRuleGroupsNamespaceOutput {
145 name: self.name.ok_or_else(|| {
146 ::aws_smithy_types::error::operation::BuildError::missing_field(
147 "name",
148 "name was not specified but it is required when building PutRuleGroupsNamespaceOutput",
149 )
150 })?,
151 arn: self.arn.ok_or_else(|| {
152 ::aws_smithy_types::error::operation::BuildError::missing_field(
153 "arn",
154 "arn was not specified but it is required when building PutRuleGroupsNamespaceOutput",
155 )
156 })?,
157 status: self.status,
158 tags: self.tags,
159 _request_id: self._request_id,
160 })
161 }
162}