aws_sdk_workmail/operation/update_user/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_user::_update_user_output::UpdateUserOutputBuilder;
3
4pub use crate::operation::update_user::_update_user_input::UpdateUserInputBuilder;
5
6impl crate::operation::update_user::builders::UpdateUserInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_user::UpdateUserOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_user::UpdateUserError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_user();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateUser`.
24///
25/// <p>Updates data for the user. To have the latest information, it must be preceded by a <code>DescribeUser</code> call. The dataset in the request should be the one expected when performing another <code>DescribeUser</code> call.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateUserFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_user::builders::UpdateUserInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_user::UpdateUserOutput,
35        crate::operation::update_user::UpdateUserError,
36    > for UpdateUserFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_user::UpdateUserOutput,
44            crate::operation::update_user::UpdateUserError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateUserFluentBuilder {
51    /// Creates a new `UpdateUserFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateUser as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_user::builders::UpdateUserInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_user::UpdateUserOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_user::UpdateUserError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_user::UpdateUser::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_user::UpdateUser::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_user::UpdateUserOutput,
97        crate::operation::update_user::UpdateUserError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The identifier for the organization under which the user exists.</p>
112    pub fn organization_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.organization_id(input.into());
114        self
115    }
116    /// <p>The identifier for the organization under which the user exists.</p>
117    pub fn set_organization_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_organization_id(input);
119        self
120    }
121    /// <p>The identifier for the organization under which the user exists.</p>
122    pub fn get_organization_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_organization_id()
124    }
125    /// <p>The identifier for the user to be updated.</p>
126    /// <p>The identifier can be the <i>UserId</i>, <i>Username</i>, or <i>email</i>. The following identity formats are available:</p>
127    /// <ul>
128    /// <li>
129    /// <p>User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234</p></li>
130    /// <li>
131    /// <p>Email address: user@domain.tld</p></li>
132    /// <li>
133    /// <p>User name: user</p></li>
134    /// </ul>
135    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.user_id(input.into());
137        self
138    }
139    /// <p>The identifier for the user to be updated.</p>
140    /// <p>The identifier can be the <i>UserId</i>, <i>Username</i>, or <i>email</i>. The following identity formats are available:</p>
141    /// <ul>
142    /// <li>
143    /// <p>User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234</p></li>
144    /// <li>
145    /// <p>Email address: user@domain.tld</p></li>
146    /// <li>
147    /// <p>User name: user</p></li>
148    /// </ul>
149    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_user_id(input);
151        self
152    }
153    /// <p>The identifier for the user to be updated.</p>
154    /// <p>The identifier can be the <i>UserId</i>, <i>Username</i>, or <i>email</i>. The following identity formats are available:</p>
155    /// <ul>
156    /// <li>
157    /// <p>User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234</p></li>
158    /// <li>
159    /// <p>Email address: user@domain.tld</p></li>
160    /// <li>
161    /// <p>User name: user</p></li>
162    /// </ul>
163    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_user_id()
165    }
166    /// <p>Updates the user role.</p>
167    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i>.</p>
168    pub fn role(mut self, input: crate::types::UserRole) -> Self {
169        self.inner = self.inner.role(input);
170        self
171    }
172    /// <p>Updates the user role.</p>
173    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i>.</p>
174    pub fn set_role(mut self, input: ::std::option::Option<crate::types::UserRole>) -> Self {
175        self.inner = self.inner.set_role(input);
176        self
177    }
178    /// <p>Updates the user role.</p>
179    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i>.</p>
180    pub fn get_role(&self) -> &::std::option::Option<crate::types::UserRole> {
181        self.inner.get_role()
182    }
183    /// <p>Updates the display name of the user.</p>
184    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.display_name(input.into());
186        self
187    }
188    /// <p>Updates the display name of the user.</p>
189    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_display_name(input);
191        self
192    }
193    /// <p>Updates the display name of the user.</p>
194    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_display_name()
196    }
197    /// <p>Updates the user's first name.</p>
198    pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.first_name(input.into());
200        self
201    }
202    /// <p>Updates the user's first name.</p>
203    pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_first_name(input);
205        self
206    }
207    /// <p>Updates the user's first name.</p>
208    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_first_name()
210    }
211    /// <p>Updates the user's last name.</p>
212    pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.last_name(input.into());
214        self
215    }
216    /// <p>Updates the user's last name.</p>
217    pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_last_name(input);
219        self
220    }
221    /// <p>Updates the user's last name.</p>
222    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_last_name()
224    }
225    /// <p>If enabled, the user is hidden from the global address list.</p>
226    pub fn hidden_from_global_address_list(mut self, input: bool) -> Self {
227        self.inner = self.inner.hidden_from_global_address_list(input);
228        self
229    }
230    /// <p>If enabled, the user is hidden from the global address list.</p>
231    pub fn set_hidden_from_global_address_list(mut self, input: ::std::option::Option<bool>) -> Self {
232        self.inner = self.inner.set_hidden_from_global_address_list(input);
233        self
234    }
235    /// <p>If enabled, the user is hidden from the global address list.</p>
236    pub fn get_hidden_from_global_address_list(&self) -> &::std::option::Option<bool> {
237        self.inner.get_hidden_from_global_address_list()
238    }
239    /// <p>Updates the user's initials.</p>
240    pub fn initials(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241        self.inner = self.inner.initials(input.into());
242        self
243    }
244    /// <p>Updates the user's initials.</p>
245    pub fn set_initials(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_initials(input);
247        self
248    }
249    /// <p>Updates the user's initials.</p>
250    pub fn get_initials(&self) -> &::std::option::Option<::std::string::String> {
251        self.inner.get_initials()
252    }
253    /// <p>Updates the user's contact details.</p>
254    pub fn telephone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.inner = self.inner.telephone(input.into());
256        self
257    }
258    /// <p>Updates the user's contact details.</p>
259    pub fn set_telephone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260        self.inner = self.inner.set_telephone(input);
261        self
262    }
263    /// <p>Updates the user's contact details.</p>
264    pub fn get_telephone(&self) -> &::std::option::Option<::std::string::String> {
265        self.inner.get_telephone()
266    }
267    /// <p>Updates the user's street address.</p>
268    pub fn street(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.inner = self.inner.street(input.into());
270        self
271    }
272    /// <p>Updates the user's street address.</p>
273    pub fn set_street(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.inner = self.inner.set_street(input);
275        self
276    }
277    /// <p>Updates the user's street address.</p>
278    pub fn get_street(&self) -> &::std::option::Option<::std::string::String> {
279        self.inner.get_street()
280    }
281    /// <p>Updates the user's job title.</p>
282    pub fn job_title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
283        self.inner = self.inner.job_title(input.into());
284        self
285    }
286    /// <p>Updates the user's job title.</p>
287    pub fn set_job_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.inner = self.inner.set_job_title(input);
289        self
290    }
291    /// <p>Updates the user's job title.</p>
292    pub fn get_job_title(&self) -> &::std::option::Option<::std::string::String> {
293        self.inner.get_job_title()
294    }
295    /// <p>Updates the user's city.</p>
296    pub fn city(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297        self.inner = self.inner.city(input.into());
298        self
299    }
300    /// <p>Updates the user's city.</p>
301    pub fn set_city(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302        self.inner = self.inner.set_city(input);
303        self
304    }
305    /// <p>Updates the user's city.</p>
306    pub fn get_city(&self) -> &::std::option::Option<::std::string::String> {
307        self.inner.get_city()
308    }
309    /// <p>Updates the user's company.</p>
310    pub fn company(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311        self.inner = self.inner.company(input.into());
312        self
313    }
314    /// <p>Updates the user's company.</p>
315    pub fn set_company(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316        self.inner = self.inner.set_company(input);
317        self
318    }
319    /// <p>Updates the user's company.</p>
320    pub fn get_company(&self) -> &::std::option::Option<::std::string::String> {
321        self.inner.get_company()
322    }
323    /// <p>Updates the user's zip code.</p>
324    pub fn zip_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
325        self.inner = self.inner.zip_code(input.into());
326        self
327    }
328    /// <p>Updates the user's zip code.</p>
329    pub fn set_zip_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
330        self.inner = self.inner.set_zip_code(input);
331        self
332    }
333    /// <p>Updates the user's zip code.</p>
334    pub fn get_zip_code(&self) -> &::std::option::Option<::std::string::String> {
335        self.inner.get_zip_code()
336    }
337    /// <p>Updates the user's department.</p>
338    pub fn department(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339        self.inner = self.inner.department(input.into());
340        self
341    }
342    /// <p>Updates the user's department.</p>
343    pub fn set_department(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344        self.inner = self.inner.set_department(input);
345        self
346    }
347    /// <p>Updates the user's department.</p>
348    pub fn get_department(&self) -> &::std::option::Option<::std::string::String> {
349        self.inner.get_department()
350    }
351    /// <p>Updates the user's country.</p>
352    pub fn country(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
353        self.inner = self.inner.country(input.into());
354        self
355    }
356    /// <p>Updates the user's country.</p>
357    pub fn set_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
358        self.inner = self.inner.set_country(input);
359        self
360    }
361    /// <p>Updates the user's country.</p>
362    pub fn get_country(&self) -> &::std::option::Option<::std::string::String> {
363        self.inner.get_country()
364    }
365    /// <p>Updates the user's office.</p>
366    pub fn office(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
367        self.inner = self.inner.office(input.into());
368        self
369    }
370    /// <p>Updates the user's office.</p>
371    pub fn set_office(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
372        self.inner = self.inner.set_office(input);
373        self
374    }
375    /// <p>Updates the user's office.</p>
376    pub fn get_office(&self) -> &::std::option::Option<::std::string::String> {
377        self.inner.get_office()
378    }
379    /// <p>User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.</p>
380    pub fn identity_provider_user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
381        self.inner = self.inner.identity_provider_user_id(input.into());
382        self
383    }
384    /// <p>User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.</p>
385    pub fn set_identity_provider_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
386        self.inner = self.inner.set_identity_provider_user_id(input);
387        self
388    }
389    /// <p>User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.</p>
390    pub fn get_identity_provider_user_id(&self) -> &::std::option::Option<::std::string::String> {
391        self.inner.get_identity_provider_user_id()
392    }
393}