aws_sdk_elasticache/operation/modify_user/
_modify_user_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyUserInput {
6 pub user_id: ::std::option::Option<::std::string::String>,
8 pub access_string: ::std::option::Option<::std::string::String>,
10 pub append_access_string: ::std::option::Option<::std::string::String>,
12 pub passwords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14 pub no_password_required: ::std::option::Option<bool>,
16 pub authentication_mode: ::std::option::Option<crate::types::AuthenticationMode>,
18 pub engine: ::std::option::Option<::std::string::String>,
20}
21impl ModifyUserInput {
22 pub fn user_id(&self) -> ::std::option::Option<&str> {
24 self.user_id.as_deref()
25 }
26 pub fn access_string(&self) -> ::std::option::Option<&str> {
28 self.access_string.as_deref()
29 }
30 pub fn append_access_string(&self) -> ::std::option::Option<&str> {
32 self.append_access_string.as_deref()
33 }
34 pub fn passwords(&self) -> &[::std::string::String] {
38 self.passwords.as_deref().unwrap_or_default()
39 }
40 pub fn no_password_required(&self) -> ::std::option::Option<bool> {
42 self.no_password_required
43 }
44 pub fn authentication_mode(&self) -> ::std::option::Option<&crate::types::AuthenticationMode> {
46 self.authentication_mode.as_ref()
47 }
48 pub fn engine(&self) -> ::std::option::Option<&str> {
50 self.engine.as_deref()
51 }
52}
53impl ModifyUserInput {
54 pub fn builder() -> crate::operation::modify_user::builders::ModifyUserInputBuilder {
56 crate::operation::modify_user::builders::ModifyUserInputBuilder::default()
57 }
58}
59
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct ModifyUserInputBuilder {
64 pub(crate) user_id: ::std::option::Option<::std::string::String>,
65 pub(crate) access_string: ::std::option::Option<::std::string::String>,
66 pub(crate) append_access_string: ::std::option::Option<::std::string::String>,
67 pub(crate) passwords: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
68 pub(crate) no_password_required: ::std::option::Option<bool>,
69 pub(crate) authentication_mode: ::std::option::Option<crate::types::AuthenticationMode>,
70 pub(crate) engine: ::std::option::Option<::std::string::String>,
71}
72impl ModifyUserInputBuilder {
73 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.user_id = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.user_id = input;
82 self
83 }
84 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
86 &self.user_id
87 }
88 pub fn access_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.access_string = ::std::option::Option::Some(input.into());
91 self
92 }
93 pub fn set_access_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.access_string = input;
96 self
97 }
98 pub fn get_access_string(&self) -> &::std::option::Option<::std::string::String> {
100 &self.access_string
101 }
102 pub fn append_access_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.append_access_string = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_append_access_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.append_access_string = input;
110 self
111 }
112 pub fn get_append_access_string(&self) -> &::std::option::Option<::std::string::String> {
114 &self.append_access_string
115 }
116 pub fn passwords(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 let mut v = self.passwords.unwrap_or_default();
123 v.push(input.into());
124 self.passwords = ::std::option::Option::Some(v);
125 self
126 }
127 pub fn set_passwords(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
129 self.passwords = input;
130 self
131 }
132 pub fn get_passwords(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
134 &self.passwords
135 }
136 pub fn no_password_required(mut self, input: bool) -> Self {
138 self.no_password_required = ::std::option::Option::Some(input);
139 self
140 }
141 pub fn set_no_password_required(mut self, input: ::std::option::Option<bool>) -> Self {
143 self.no_password_required = input;
144 self
145 }
146 pub fn get_no_password_required(&self) -> &::std::option::Option<bool> {
148 &self.no_password_required
149 }
150 pub fn authentication_mode(mut self, input: crate::types::AuthenticationMode) -> Self {
152 self.authentication_mode = ::std::option::Option::Some(input);
153 self
154 }
155 pub fn set_authentication_mode(mut self, input: ::std::option::Option<crate::types::AuthenticationMode>) -> Self {
157 self.authentication_mode = input;
158 self
159 }
160 pub fn get_authentication_mode(&self) -> &::std::option::Option<crate::types::AuthenticationMode> {
162 &self.authentication_mode
163 }
164 pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.engine = ::std::option::Option::Some(input.into());
167 self
168 }
169 pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.engine = input;
172 self
173 }
174 pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
176 &self.engine
177 }
178 pub fn build(self) -> ::std::result::Result<crate::operation::modify_user::ModifyUserInput, ::aws_smithy_types::error::operation::BuildError> {
180 ::std::result::Result::Ok(crate::operation::modify_user::ModifyUserInput {
181 user_id: self.user_id,
182 access_string: self.access_string,
183 append_access_string: self.append_access_string,
184 passwords: self.passwords,
185 no_password_required: self.no_password_required,
186 authentication_mode: self.authentication_mode,
187 engine: self.engine,
188 })
189 }
190}