aws_sdk_mq/operation/update_user/
_update_user_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates the information for an ActiveMQ user.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateUserInput {
7    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
8    pub broker_id: ::std::option::Option<::std::string::String>,
9    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
10    pub console_access: ::std::option::Option<bool>,
11    /// <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>
12    pub groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
14    pub password: ::std::option::Option<::std::string::String>,
15    /// <p>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>
16    pub username: ::std::option::Option<::std::string::String>,
17    /// <p>Defines whether the user is intended for data replication.</p>
18    pub replication_user: ::std::option::Option<bool>,
19}
20impl UpdateUserInput {
21    /// <p>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 password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
36    pub fn password(&self) -> ::std::option::Option<&str> {
37        self.password.as_deref()
38    }
39    /// <p>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>Defines 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 UpdateUserInput {
49    /// Creates a new builder-style object to manufacture [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
50    pub fn builder() -> crate::operation::update_user::builders::UpdateUserInputBuilder {
51        crate::operation::update_user::builders::UpdateUserInputBuilder::default()
52    }
53}
54
55/// A builder for [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct UpdateUserInputBuilder {
59    pub(crate) broker_id: ::std::option::Option<::std::string::String>,
60    pub(crate) console_access: ::std::option::Option<bool>,
61    pub(crate) groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
62    pub(crate) password: ::std::option::Option<::std::string::String>,
63    pub(crate) username: ::std::option::Option<::std::string::String>,
64    pub(crate) replication_user: ::std::option::Option<bool>,
65}
66impl UpdateUserInputBuilder {
67    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
68    /// This field is required.
69    pub fn broker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.broker_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
74    pub fn set_broker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.broker_id = input;
76        self
77    }
78    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
79    pub fn get_broker_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.broker_id
81    }
82    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
83    pub fn console_access(mut self, input: bool) -> Self {
84        self.console_access = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
88    pub fn set_console_access(mut self, input: ::std::option::Option<bool>) -> Self {
89        self.console_access = input;
90        self
91    }
92    /// <p>Enables access to the the ActiveMQ Web Console for the ActiveMQ user.</p>
93    pub fn get_console_access(&self) -> &::std::option::Option<bool> {
94        &self.console_access
95    }
96    /// Appends an item to `groups`.
97    ///
98    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
99    ///
100    /// <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>
101    pub fn groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        let mut v = self.groups.unwrap_or_default();
103        v.push(input.into());
104        self.groups = ::std::option::Option::Some(v);
105        self
106    }
107    /// <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>
108    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
109        self.groups = input;
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 get_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
114        &self.groups
115    }
116    /// <p>The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
117    pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.password = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
122    pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.password = input;
124        self
125    }
126    /// <p>The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
127    pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
128        &self.password
129    }
130    /// <p>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>
131    /// This field is required.
132    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.username = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>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>
137    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.username = input;
139        self
140    }
141    /// <p>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>
142    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
143        &self.username
144    }
145    /// <p>Defines whether the user is intended for data replication.</p>
146    pub fn replication_user(mut self, input: bool) -> Self {
147        self.replication_user = ::std::option::Option::Some(input);
148        self
149    }
150    /// <p>Defines whether the user is intended for data replication.</p>
151    pub fn set_replication_user(mut self, input: ::std::option::Option<bool>) -> Self {
152        self.replication_user = input;
153        self
154    }
155    /// <p>Defines whether the user is intended for data replication.</p>
156    pub fn get_replication_user(&self) -> &::std::option::Option<bool> {
157        &self.replication_user
158    }
159    /// Consumes the builder and constructs a [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
160    pub fn build(self) -> ::std::result::Result<crate::operation::update_user::UpdateUserInput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(crate::operation::update_user::UpdateUserInput {
162            broker_id: self.broker_id,
163            console_access: self.console_access,
164            groups: self.groups,
165            password: self.password,
166            username: self.username,
167            replication_user: self.replication_user,
168        })
169    }
170}