Skip to main content

aws_sdk_amp/operation/put_rule_groups_namespace/
_put_rule_groups_namespace_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>PutRuleGroupsNamespace</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutRuleGroupsNamespaceOutput {
7    /// <p>The name of the rule groups namespace that was updated.</p>
8    pub name: ::std::string::String,
9    /// <p>The ARN of the rule groups namespace.</p>
10    pub arn: ::std::string::String,
11    /// <p>A structure that includes the current status of the rule groups namespace.</p>
12    pub status: ::std::option::Option<crate::types::RuleGroupsNamespaceStatus>,
13    /// <p>The list of tag keys and values that are associated with the namespace.</p>
14    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
15    _request_id: Option<String>,
16}
17impl PutRuleGroupsNamespaceOutput {
18    /// <p>The name of the rule groups namespace that was updated.</p>
19    pub fn name(&self) -> &str {
20        use std::ops::Deref;
21        self.name.deref()
22    }
23    /// <p>The ARN of the rule groups namespace.</p>
24    pub fn arn(&self) -> &str {
25        use std::ops::Deref;
26        self.arn.deref()
27    }
28    /// <p>A structure that includes the current status of the rule groups namespace.</p>
29    pub fn status(&self) -> ::std::option::Option<&crate::types::RuleGroupsNamespaceStatus> {
30        self.status.as_ref()
31    }
32    /// <p>The list of tag keys and values that are associated with the namespace.</p>
33    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    /// Creates a new builder-style object to manufacture [`PutRuleGroupsNamespaceOutput`](crate::operation::put_rule_groups_namespace::PutRuleGroupsNamespaceOutput).
44    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/// A builder for [`PutRuleGroupsNamespaceOutput`](crate::operation::put_rule_groups_namespace::PutRuleGroupsNamespaceOutput).
50#[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    /// <p>The name of the rule groups namespace that was updated.</p>
61    /// This field is required.
62    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    /// <p>The name of the rule groups namespace that was updated.</p>
67    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.name = input;
69        self
70    }
71    /// <p>The name of the rule groups namespace that was updated.</p>
72    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.name
74    }
75    /// <p>The ARN of the rule groups namespace.</p>
76    /// This field is required.
77    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    /// <p>The ARN of the rule groups namespace.</p>
82    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.arn = input;
84        self
85    }
86    /// <p>The ARN of the rule groups namespace.</p>
87    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
88        &self.arn
89    }
90    /// <p>A structure that includes the current status of the rule groups namespace.</p>
91    /// This field is required.
92    pub fn status(mut self, input: crate::types::RuleGroupsNamespaceStatus) -> Self {
93        self.status = ::std::option::Option::Some(input);
94        self
95    }
96    /// <p>A structure that includes the current status of the rule groups namespace.</p>
97    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RuleGroupsNamespaceStatus>) -> Self {
98        self.status = input;
99        self
100    }
101    /// <p>A structure that includes the current status of the rule groups namespace.</p>
102    pub fn get_status(&self) -> &::std::option::Option<crate::types::RuleGroupsNamespaceStatus> {
103        &self.status
104    }
105    /// Adds a key-value pair to `tags`.
106    ///
107    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
108    ///
109    /// <p>The list of tag keys and values that are associated with the namespace.</p>
110    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    /// <p>The list of tag keys and values that are associated with the namespace.</p>
117    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    /// <p>The list of tag keys and values that are associated with the namespace.</p>
122    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    /// Consumes the builder and constructs a [`PutRuleGroupsNamespaceOutput`](crate::operation::put_rule_groups_namespace::PutRuleGroupsNamespaceOutput).
135    /// This method will fail if any of the following fields are not set:
136    /// - [`name`](crate::operation::put_rule_groups_namespace::builders::PutRuleGroupsNamespaceOutputBuilder::name)
137    /// - [`arn`](crate::operation::put_rule_groups_namespace::builders::PutRuleGroupsNamespaceOutputBuilder::arn)
138    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}