aws_sdk_chime/operation/create_user/
_create_user_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateUserInput {
6 pub account_id: ::std::option::Option<::std::string::String>,
8 pub username: ::std::option::Option<::std::string::String>,
10 pub email: ::std::option::Option<::std::string::String>,
12 pub user_type: ::std::option::Option<crate::types::UserType>,
14}
15impl CreateUserInput {
16 pub fn account_id(&self) -> ::std::option::Option<&str> {
18 self.account_id.as_deref()
19 }
20 pub fn username(&self) -> ::std::option::Option<&str> {
22 self.username.as_deref()
23 }
24 pub fn email(&self) -> ::std::option::Option<&str> {
26 self.email.as_deref()
27 }
28 pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
30 self.user_type.as_ref()
31 }
32}
33impl ::std::fmt::Debug for CreateUserInput {
34 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35 let mut formatter = f.debug_struct("CreateUserInput");
36 formatter.field("account_id", &self.account_id);
37 formatter.field("username", &self.username);
38 formatter.field("email", &"*** Sensitive Data Redacted ***");
39 formatter.field("user_type", &self.user_type);
40 formatter.finish()
41 }
42}
43impl CreateUserInput {
44 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
46 crate::operation::create_user::builders::CreateUserInputBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct CreateUserInputBuilder {
54 pub(crate) account_id: ::std::option::Option<::std::string::String>,
55 pub(crate) username: ::std::option::Option<::std::string::String>,
56 pub(crate) email: ::std::option::Option<::std::string::String>,
57 pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
58}
59impl CreateUserInputBuilder {
60 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.account_id = ::std::option::Option::Some(input.into());
64 self
65 }
66 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.account_id = input;
69 self
70 }
71 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
73 &self.account_id
74 }
75 pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.username = ::std::option::Option::Some(input.into());
78 self
79 }
80 pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.username = input;
83 self
84 }
85 pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
87 &self.username
88 }
89 pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.email = ::std::option::Option::Some(input.into());
92 self
93 }
94 pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.email = input;
97 self
98 }
99 pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
101 &self.email
102 }
103 pub fn user_type(mut self, input: crate::types::UserType) -> Self {
105 self.user_type = ::std::option::Option::Some(input);
106 self
107 }
108 pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
110 self.user_type = input;
111 self
112 }
113 pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
115 &self.user_type
116 }
117 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
119 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
120 account_id: self.account_id,
121 username: self.username,
122 email: self.email,
123 user_type: self.user_type,
124 })
125 }
126}
127impl ::std::fmt::Debug for CreateUserInputBuilder {
128 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
129 let mut formatter = f.debug_struct("CreateUserInputBuilder");
130 formatter.field("account_id", &self.account_id);
131 formatter.field("username", &self.username);
132 formatter.field("email", &"*** Sensitive Data Redacted ***");
133 formatter.field("user_type", &self.user_type);
134 formatter.finish()
135 }
136}