aws_sdk_qbusiness/operation/update_user/
_update_user_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateUserInput {
6    /// <p>The identifier of the application the user is attached to.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The email id attached to the user.</p>
9    pub user_id: ::std::option::Option<::std::string::String>,
10    /// <p>The user aliases attached to the user id that are to be updated.</p>
11    pub user_aliases_to_update: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>,
12    /// <p>The user aliases attached to the user id that are to be deleted.</p>
13    pub user_aliases_to_delete: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>,
14}
15impl UpdateUserInput {
16    /// <p>The identifier of the application the user is attached to.</p>
17    pub fn application_id(&self) -> ::std::option::Option<&str> {
18        self.application_id.as_deref()
19    }
20    /// <p>The email id attached to the user.</p>
21    pub fn user_id(&self) -> ::std::option::Option<&str> {
22        self.user_id.as_deref()
23    }
24    /// <p>The user aliases attached to the user id that are to be updated.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.user_aliases_to_update.is_none()`.
27    pub fn user_aliases_to_update(&self) -> &[crate::types::UserAlias] {
28        self.user_aliases_to_update.as_deref().unwrap_or_default()
29    }
30    /// <p>The user aliases attached to the user id that are to be deleted.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.user_aliases_to_delete.is_none()`.
33    pub fn user_aliases_to_delete(&self) -> &[crate::types::UserAlias] {
34        self.user_aliases_to_delete.as_deref().unwrap_or_default()
35    }
36}
37impl UpdateUserInput {
38    /// Creates a new builder-style object to manufacture [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
39    pub fn builder() -> crate::operation::update_user::builders::UpdateUserInputBuilder {
40        crate::operation::update_user::builders::UpdateUserInputBuilder::default()
41    }
42}
43
44/// A builder for [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct UpdateUserInputBuilder {
48    pub(crate) application_id: ::std::option::Option<::std::string::String>,
49    pub(crate) user_id: ::std::option::Option<::std::string::String>,
50    pub(crate) user_aliases_to_update: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>,
51    pub(crate) user_aliases_to_delete: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>,
52}
53impl UpdateUserInputBuilder {
54    /// <p>The identifier of the application the user is attached to.</p>
55    /// This field is required.
56    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.application_id = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The identifier of the application the user is attached to.</p>
61    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.application_id = input;
63        self
64    }
65    /// <p>The identifier of the application the user is attached to.</p>
66    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
67        &self.application_id
68    }
69    /// <p>The email id attached to the user.</p>
70    /// This field is required.
71    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.user_id = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The email id attached to the user.</p>
76    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.user_id = input;
78        self
79    }
80    /// <p>The email id attached to the user.</p>
81    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
82        &self.user_id
83    }
84    /// Appends an item to `user_aliases_to_update`.
85    ///
86    /// To override the contents of this collection use [`set_user_aliases_to_update`](Self::set_user_aliases_to_update).
87    ///
88    /// <p>The user aliases attached to the user id that are to be updated.</p>
89    pub fn user_aliases_to_update(mut self, input: crate::types::UserAlias) -> Self {
90        let mut v = self.user_aliases_to_update.unwrap_or_default();
91        v.push(input);
92        self.user_aliases_to_update = ::std::option::Option::Some(v);
93        self
94    }
95    /// <p>The user aliases attached to the user id that are to be updated.</p>
96    pub fn set_user_aliases_to_update(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>) -> Self {
97        self.user_aliases_to_update = input;
98        self
99    }
100    /// <p>The user aliases attached to the user id that are to be updated.</p>
101    pub fn get_user_aliases_to_update(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserAlias>> {
102        &self.user_aliases_to_update
103    }
104    /// Appends an item to `user_aliases_to_delete`.
105    ///
106    /// To override the contents of this collection use [`set_user_aliases_to_delete`](Self::set_user_aliases_to_delete).
107    ///
108    /// <p>The user aliases attached to the user id that are to be deleted.</p>
109    pub fn user_aliases_to_delete(mut self, input: crate::types::UserAlias) -> Self {
110        let mut v = self.user_aliases_to_delete.unwrap_or_default();
111        v.push(input);
112        self.user_aliases_to_delete = ::std::option::Option::Some(v);
113        self
114    }
115    /// <p>The user aliases attached to the user id that are to be deleted.</p>
116    pub fn set_user_aliases_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::UserAlias>>) -> Self {
117        self.user_aliases_to_delete = input;
118        self
119    }
120    /// <p>The user aliases attached to the user id that are to be deleted.</p>
121    pub fn get_user_aliases_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UserAlias>> {
122        &self.user_aliases_to_delete
123    }
124    /// Consumes the builder and constructs a [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
125    pub fn build(self) -> ::std::result::Result<crate::operation::update_user::UpdateUserInput, ::aws_smithy_types::error::operation::BuildError> {
126        ::std::result::Result::Ok(crate::operation::update_user::UpdateUserInput {
127            application_id: self.application_id,
128            user_id: self.user_id,
129            user_aliases_to_update: self.user_aliases_to_update,
130            user_aliases_to_delete: self.user_aliases_to_delete,
131        })
132    }
133}