aws_sdk_mq/types/
_user.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A user associated with the broker. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct User {
7    /// <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers.</p>
8    pub console_access: ::std::option::Option<bool>,
9    /// <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. Does not apply to RabbitMQ brokers.</p>
10    pub groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>Required. 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>
12    pub password: ::std::option::Option<::std::string::String>,
13    /// <p>The username of the broker user. The following restrictions apply to broker usernames:</p>
14    /// <ul>
15    /// <li>
16    /// <p>For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p></li>
17    /// <li>
18    /// <p>para&gt;For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long.</p></li>
19    /// </ul><important>
20    /// <p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p>
21    /// </important>
22    pub username: ::std::option::Option<::std::string::String>,
23    /// <p>Defines if this user is intended for CRDR replication purposes.</p>
24    pub replication_user: ::std::option::Option<bool>,
25}
26impl User {
27    /// <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers.</p>
28    pub fn console_access(&self) -> ::std::option::Option<bool> {
29        self.console_access
30    }
31    /// <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. Does not apply to RabbitMQ brokers.</p>
32    ///
33    /// 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()`.
34    pub fn groups(&self) -> &[::std::string::String] {
35        self.groups.as_deref().unwrap_or_default()
36    }
37    /// <p>Required. 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>
38    pub fn password(&self) -> ::std::option::Option<&str> {
39        self.password.as_deref()
40    }
41    /// <p>The username of the broker user. The following restrictions apply to broker usernames:</p>
42    /// <ul>
43    /// <li>
44    /// <p>For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p></li>
45    /// <li>
46    /// <p>para&gt;For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long.</p></li>
47    /// </ul><important>
48    /// <p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p>
49    /// </important>
50    pub fn username(&self) -> ::std::option::Option<&str> {
51        self.username.as_deref()
52    }
53    /// <p>Defines if this user is intended for CRDR replication purposes.</p>
54    pub fn replication_user(&self) -> ::std::option::Option<bool> {
55        self.replication_user
56    }
57}
58impl User {
59    /// Creates a new builder-style object to manufacture [`User`](crate::types::User).
60    pub fn builder() -> crate::types::builders::UserBuilder {
61        crate::types::builders::UserBuilder::default()
62    }
63}
64
65/// A builder for [`User`](crate::types::User).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct UserBuilder {
69    pub(crate) console_access: ::std::option::Option<bool>,
70    pub(crate) groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71    pub(crate) password: ::std::option::Option<::std::string::String>,
72    pub(crate) username: ::std::option::Option<::std::string::String>,
73    pub(crate) replication_user: ::std::option::Option<bool>,
74}
75impl UserBuilder {
76    /// <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers.</p>
77    pub fn console_access(mut self, input: bool) -> Self {
78        self.console_access = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers.</p>
82    pub fn set_console_access(mut self, input: ::std::option::Option<bool>) -> Self {
83        self.console_access = input;
84        self
85    }
86    /// <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers.</p>
87    pub fn get_console_access(&self) -> &::std::option::Option<bool> {
88        &self.console_access
89    }
90    /// Appends an item to `groups`.
91    ///
92    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
93    ///
94    /// <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. Does not apply to RabbitMQ brokers.</p>
95    pub fn groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        let mut v = self.groups.unwrap_or_default();
97        v.push(input.into());
98        self.groups = ::std::option::Option::Some(v);
99        self
100    }
101    /// <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. Does not apply to RabbitMQ brokers.</p>
102    pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
103        self.groups = input;
104        self
105    }
106    /// <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. Does not apply to RabbitMQ brokers.</p>
107    pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
108        &self.groups
109    }
110    /// <p>Required. 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>
111    /// This field is required.
112    pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.password = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>Required. 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 set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.password = input;
119        self
120    }
121    /// <p>Required. 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 get_password(&self) -> &::std::option::Option<::std::string::String> {
123        &self.password
124    }
125    /// <p>The username of the broker user. The following restrictions apply to broker usernames:</p>
126    /// <ul>
127    /// <li>
128    /// <p>For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p></li>
129    /// <li>
130    /// <p>para&gt;For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long.</p></li>
131    /// </ul><important>
132    /// <p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p>
133    /// </important>
134    /// This field is required.
135    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.username = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The username of the broker user. The following restrictions apply to broker usernames:</p>
140    /// <ul>
141    /// <li>
142    /// <p>For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p></li>
143    /// <li>
144    /// <p>para&gt;For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long.</p></li>
145    /// </ul><important>
146    /// <p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p>
147    /// </important>
148    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.username = input;
150        self
151    }
152    /// <p>The username of the broker user. The following restrictions apply to broker usernames:</p>
153    /// <ul>
154    /// <li>
155    /// <p>For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p></li>
156    /// <li>
157    /// <p>para&gt;For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid usename. This value must be 2-100 characters long.</p></li>
158    /// </ul><important>
159    /// <p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p>
160    /// </important>
161    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
162        &self.username
163    }
164    /// <p>Defines if this user is intended for CRDR replication purposes.</p>
165    pub fn replication_user(mut self, input: bool) -> Self {
166        self.replication_user = ::std::option::Option::Some(input);
167        self
168    }
169    /// <p>Defines if this user is intended for CRDR replication purposes.</p>
170    pub fn set_replication_user(mut self, input: ::std::option::Option<bool>) -> Self {
171        self.replication_user = input;
172        self
173    }
174    /// <p>Defines if this user is intended for CRDR replication purposes.</p>
175    pub fn get_replication_user(&self) -> &::std::option::Option<bool> {
176        &self.replication_user
177    }
178    /// Consumes the builder and constructs a [`User`](crate::types::User).
179    pub fn build(self) -> crate::types::User {
180        crate::types::User {
181            console_access: self.console_access,
182            groups: self.groups,
183            password: self.password,
184            username: self.username,
185            replication_user: self.replication_user,
186        }
187    }
188}