aws_sdk_mq/operation/describe_user/
_describe_user_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 DescribeUserOutput {
6    /// <p>Required. The unique ID that Amazon MQ generates for the broker.</p>
7    pub broker_id: ::std::option::Option<::std::string::String>,
8    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
9    pub console_access: ::std::option::Option<bool>,
10    /// <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
11    pub groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The status of the changes pending for the ActiveMQ user.</p>
13    pub pending: ::std::option::Option<crate::types::UserPendingChanges>,
14    /// <p>Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
15    pub username: ::std::option::Option<::std::string::String>,
16    /// <p>Describes whether the user is intended for data replication</p>
17    pub replication_user: ::std::option::Option<bool>,
18    _request_id: Option<String>,
19}
20impl DescribeUserOutput {
21    /// <p>Required. The unique ID that Amazon MQ generates for the broker.</p>
22    pub fn broker_id(&self) -> ::std::option::Option<&str> {
23        self.broker_id.as_deref()
24    }
25    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
26    pub fn console_access(&self) -> ::std::option::Option<bool> {
27        self.console_access
28    }
29    /// <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`.
32    pub fn groups(&self) -> &[::std::string::String] {
33        self.groups.as_deref().unwrap_or_default()
34    }
35    /// <p>The status of the changes pending for the ActiveMQ user.</p>
36    pub fn pending(&self) -> ::std::option::Option<&crate::types::UserPendingChanges> {
37        self.pending.as_ref()
38    }
39    /// <p>Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
40    pub fn username(&self) -> ::std::option::Option<&str> {
41        self.username.as_deref()
42    }
43    /// <p>Describes whether the user is intended for data replication</p>
44    pub fn replication_user(&self) -> ::std::option::Option<bool> {
45        self.replication_user
46    }
47}
48impl ::aws_types::request_id::RequestId for DescribeUserOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl DescribeUserOutput {
54    /// Creates a new builder-style object to manufacture [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput).
55    pub fn builder() -> crate::operation::describe_user::builders::DescribeUserOutputBuilder {
56        crate::operation::describe_user::builders::DescribeUserOutputBuilder::default()
57    }
58}
59
60/// A builder for [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct DescribeUserOutputBuilder {
64    pub(crate) broker_id: ::std::option::Option<::std::string::String>,
65    pub(crate) console_access: ::std::option::Option<bool>,
66    pub(crate) groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
67    pub(crate) pending: ::std::option::Option<crate::types::UserPendingChanges>,
68    pub(crate) username: ::std::option::Option<::std::string::String>,
69    pub(crate) replication_user: ::std::option::Option<bool>,
70    _request_id: Option<String>,
71}
72impl DescribeUserOutputBuilder {
73    /// <p>Required. The unique ID that Amazon MQ generates for the broker.</p>
74    pub fn broker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.broker_id = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>Required. The unique ID that Amazon MQ generates for the broker.</p>
79    pub fn set_broker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.broker_id = input;
81        self
82    }
83    /// <p>Required. The unique ID that Amazon MQ generates for the broker.</p>
84    pub fn get_broker_id(&self) -> &::std::option::Option<::std::string::String> {
85        &self.broker_id
86    }
87    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
88    pub fn console_access(mut self, input: bool) -> Self {
89        self.console_access = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
93    pub fn set_console_access(mut self, input: ::std::option::Option<bool>) -> Self {
94        self.console_access = input;
95        self
96    }
97    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
98    pub fn get_console_access(&self) -> &::std::option::Option<bool> {
99        &self.console_access
100    }
101    /// Appends an item to `groups`.
102    ///
103    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
104    ///
105    /// <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
106    pub fn groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        let mut v = self.groups.unwrap_or_default();
108        v.push(input.into());
109        self.groups = ::std::option::Option::Some(v);
110        self
111    }
112    /// <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
113    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
114        self.groups = input;
115        self
116    }
117    /// <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
118    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
119        &self.groups
120    }
121    /// <p>The status of the changes pending for the ActiveMQ user.</p>
122    pub fn pending(mut self, input: crate::types::UserPendingChanges) -> Self {
123        self.pending = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The status of the changes pending for the ActiveMQ user.</p>
127    pub fn set_pending(mut self, input: ::std::option::Option<crate::types::UserPendingChanges>) -> Self {
128        self.pending = input;
129        self
130    }
131    /// <p>The status of the changes pending for the ActiveMQ user.</p>
132    pub fn get_pending(&self) -> &::std::option::Option<crate::types::UserPendingChanges> {
133        &self.pending
134    }
135    /// <p>Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
136    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.username = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
141    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.username = input;
143        self
144    }
145    /// <p>Required. The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
146    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
147        &self.username
148    }
149    /// <p>Describes whether the user is intended for data replication</p>
150    pub fn replication_user(mut self, input: bool) -> Self {
151        self.replication_user = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>Describes whether the user is intended for data replication</p>
155    pub fn set_replication_user(mut self, input: ::std::option::Option<bool>) -> Self {
156        self.replication_user = input;
157        self
158    }
159    /// <p>Describes whether the user is intended for data replication</p>
160    pub fn get_replication_user(&self) -> &::std::option::Option<bool> {
161        &self.replication_user
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    /// Consumes the builder and constructs a [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput).
173    pub fn build(self) -> crate::operation::describe_user::DescribeUserOutput {
174        crate::operation::describe_user::DescribeUserOutput {
175            broker_id: self.broker_id,
176            console_access: self.console_access,
177            groups: self.groups,
178            pending: self.pending,
179            username: self.username,
180            replication_user: self.replication_user,
181            _request_id: self._request_id,
182        }
183    }
184}