aws_sdk_mq/operation/create_user/_create_user_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Creates a new ActiveMQ user.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateUserInput {
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 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>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>
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 if this user is intended for CRDR replication purposes.</p>
18 pub replication_user: ::std::option::Option<bool>,
19}
20impl CreateUserInput {
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 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>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>
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 if this user is intended for CRDR replication purposes.</p>
44 pub fn replication_user(&self) -> ::std::option::Option<bool> {
45 self.replication_user
46 }
47}
48impl CreateUserInput {
49 /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
50 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
51 crate::operation::create_user::builders::CreateUserInputBuilder::default()
52 }
53}
54
55/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct CreateUserInputBuilder {
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 CreateUserInputBuilder {
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 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 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 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>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 /// This field is required.
118 pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.password = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <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>
123 pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.password = input;
125 self
126 }
127 /// <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>
128 pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
129 &self.password
130 }
131 /// <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>
132 /// This field is required.
133 pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.username = ::std::option::Option::Some(input.into());
135 self
136 }
137 /// <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>
138 pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.username = input;
140 self
141 }
142 /// <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>
143 pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
144 &self.username
145 }
146 /// <p>Defines if this user is intended for CRDR replication purposes.</p>
147 pub fn replication_user(mut self, input: bool) -> Self {
148 self.replication_user = ::std::option::Option::Some(input);
149 self
150 }
151 /// <p>Defines if this user is intended for CRDR replication purposes.</p>
152 pub fn set_replication_user(mut self, input: ::std::option::Option<bool>) -> Self {
153 self.replication_user = input;
154 self
155 }
156 /// <p>Defines if this user is intended for CRDR replication purposes.</p>
157 pub fn get_replication_user(&self) -> &::std::option::Option<bool> {
158 &self.replication_user
159 }
160 /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
161 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
162 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
163 broker_id: self.broker_id,
164 console_access: self.console_access,
165 groups: self.groups,
166 password: self.password,
167 username: self.username,
168 replication_user: self.replication_user,
169 })
170 }
171}