aws_sdk_elasticache/operation/create_user/
_create_user_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateUserInput {
6    pub user_id: ::std::option::Option<::std::string::String>,
8    pub user_name: ::std::option::Option<::std::string::String>,
10    pub engine: ::std::option::Option<::std::string::String>,
12    pub passwords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    pub access_string: ::std::option::Option<::std::string::String>,
16    pub no_password_required: ::std::option::Option<bool>,
18    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20    pub authentication_mode: ::std::option::Option<crate::types::AuthenticationMode>,
22}
23impl CreateUserInput {
24    pub fn user_id(&self) -> ::std::option::Option<&str> {
26        self.user_id.as_deref()
27    }
28    pub fn user_name(&self) -> ::std::option::Option<&str> {
30        self.user_name.as_deref()
31    }
32    pub fn engine(&self) -> ::std::option::Option<&str> {
34        self.engine.as_deref()
35    }
36    pub fn passwords(&self) -> &[::std::string::String] {
40        self.passwords.as_deref().unwrap_or_default()
41    }
42    pub fn access_string(&self) -> ::std::option::Option<&str> {
44        self.access_string.as_deref()
45    }
46    pub fn no_password_required(&self) -> ::std::option::Option<bool> {
48        self.no_password_required
49    }
50    pub fn tags(&self) -> &[crate::types::Tag] {
54        self.tags.as_deref().unwrap_or_default()
55    }
56    pub fn authentication_mode(&self) -> ::std::option::Option<&crate::types::AuthenticationMode> {
58        self.authentication_mode.as_ref()
59    }
60}
61impl CreateUserInput {
62    pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
64        crate::operation::create_user::builders::CreateUserInputBuilder::default()
65    }
66}
67
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct CreateUserInputBuilder {
72    pub(crate) user_id: ::std::option::Option<::std::string::String>,
73    pub(crate) user_name: ::std::option::Option<::std::string::String>,
74    pub(crate) engine: ::std::option::Option<::std::string::String>,
75    pub(crate) passwords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
76    pub(crate) access_string: ::std::option::Option<::std::string::String>,
77    pub(crate) no_password_required: ::std::option::Option<bool>,
78    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
79    pub(crate) authentication_mode: ::std::option::Option<crate::types::AuthenticationMode>,
80}
81impl CreateUserInputBuilder {
82    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.user_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.user_id = input;
91        self
92    }
93    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.user_id
96    }
97    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.user_name = ::std::option::Option::Some(input.into());
101        self
102    }
103    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.user_name = input;
106        self
107    }
108    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
110        &self.user_name
111    }
112    pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.engine = ::std::option::Option::Some(input.into());
116        self
117    }
118    pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.engine = input;
121        self
122    }
123    pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
125        &self.engine
126    }
127    pub fn passwords(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        let mut v = self.passwords.unwrap_or_default();
134        v.push(input.into());
135        self.passwords = ::std::option::Option::Some(v);
136        self
137    }
138    pub fn set_passwords(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
140        self.passwords = input;
141        self
142    }
143    pub fn get_passwords(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
145        &self.passwords
146    }
147    pub fn access_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.access_string = ::std::option::Option::Some(input.into());
151        self
152    }
153    pub fn set_access_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.access_string = input;
156        self
157    }
158    pub fn get_access_string(&self) -> &::std::option::Option<::std::string::String> {
160        &self.access_string
161    }
162    pub fn no_password_required(mut self, input: bool) -> Self {
164        self.no_password_required = ::std::option::Option::Some(input);
165        self
166    }
167    pub fn set_no_password_required(mut self, input: ::std::option::Option<bool>) -> Self {
169        self.no_password_required = input;
170        self
171    }
172    pub fn get_no_password_required(&self) -> &::std::option::Option<bool> {
174        &self.no_password_required
175    }
176    pub fn tags(mut self, input: crate::types::Tag) -> Self {
182        let mut v = self.tags.unwrap_or_default();
183        v.push(input);
184        self.tags = ::std::option::Option::Some(v);
185        self
186    }
187    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
189        self.tags = input;
190        self
191    }
192    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
194        &self.tags
195    }
196    pub fn authentication_mode(mut self, input: crate::types::AuthenticationMode) -> Self {
198        self.authentication_mode = ::std::option::Option::Some(input);
199        self
200    }
201    pub fn set_authentication_mode(mut self, input: ::std::option::Option<crate::types::AuthenticationMode>) -> Self {
203        self.authentication_mode = input;
204        self
205    }
206    pub fn get_authentication_mode(&self) -> &::std::option::Option<crate::types::AuthenticationMode> {
208        &self.authentication_mode
209    }
210    pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
212        ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
213            user_id: self.user_id,
214            user_name: self.user_name,
215            engine: self.engine,
216            passwords: self.passwords,
217            access_string: self.access_string,
218            no_password_required: self.no_password_required,
219            tags: self.tags,
220            authentication_mode: self.authentication_mode,
221        })
222    }
223}