aws-sdk-workmail 1.94.0

AWS SDK for Amazon WorkMail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateUserInput {
    /// <p>The identifier of the organization for which the user is created.</p>
    pub organization_id: ::std::option::Option<::std::string::String>,
    /// <p>The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The display name for the new user.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>The password for the new user.</p>
    pub password: ::std::option::Option<::std::string::String>,
    /// <p>The role of the new user.</p>
    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i> role in a single request. When a user role is not selected, the default role of <i>USER</i> is selected.</p>
    pub role: ::std::option::Option<crate::types::UserRole>,
    /// <p>The first name of the new user.</p>
    pub first_name: ::std::option::Option<::std::string::String>,
    /// <p>The last name of the new user.</p>
    pub last_name: ::std::option::Option<::std::string::String>,
    /// <p>If this parameter is enabled, the user will be hidden from the address book.</p>
    pub hidden_from_global_address_list: ::std::option::Option<bool>,
    /// <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>
    pub identity_provider_user_id: ::std::option::Option<::std::string::String>,
}
impl CreateUserInput {
    /// <p>The identifier of the organization for which the user is created.</p>
    pub fn organization_id(&self) -> ::std::option::Option<&str> {
        self.organization_id.as_deref()
    }
    /// <p>The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The display name for the new user.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>The password for the new user.</p>
    pub fn password(&self) -> ::std::option::Option<&str> {
        self.password.as_deref()
    }
    /// <p>The role of the new user.</p>
    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i> role in a single request. When a user role is not selected, the default role of <i>USER</i> is selected.</p>
    pub fn role(&self) -> ::std::option::Option<&crate::types::UserRole> {
        self.role.as_ref()
    }
    /// <p>The first name of the new user.</p>
    pub fn first_name(&self) -> ::std::option::Option<&str> {
        self.first_name.as_deref()
    }
    /// <p>The last name of the new user.</p>
    pub fn last_name(&self) -> ::std::option::Option<&str> {
        self.last_name.as_deref()
    }
    /// <p>If this parameter is enabled, the user will be hidden from the address book.</p>
    pub fn hidden_from_global_address_list(&self) -> ::std::option::Option<bool> {
        self.hidden_from_global_address_list
    }
    /// <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>
    pub fn identity_provider_user_id(&self) -> ::std::option::Option<&str> {
        self.identity_provider_user_id.as_deref()
    }
}
impl ::std::fmt::Debug for CreateUserInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateUserInput");
        formatter.field("organization_id", &self.organization_id);
        formatter.field("name", &self.name);
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("password", &"*** Sensitive Data Redacted ***");
        formatter.field("role", &self.role);
        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
        formatter.field("hidden_from_global_address_list", &self.hidden_from_global_address_list);
        formatter.field("identity_provider_user_id", &self.identity_provider_user_id);
        formatter.finish()
    }
}
impl CreateUserInput {
    /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
    pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
        crate::operation::create_user::builders::CreateUserInputBuilder::default()
    }
}

/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateUserInputBuilder {
    pub(crate) organization_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) password: ::std::option::Option<::std::string::String>,
    pub(crate) role: ::std::option::Option<crate::types::UserRole>,
    pub(crate) first_name: ::std::option::Option<::std::string::String>,
    pub(crate) last_name: ::std::option::Option<::std::string::String>,
    pub(crate) hidden_from_global_address_list: ::std::option::Option<bool>,
    pub(crate) identity_provider_user_id: ::std::option::Option<::std::string::String>,
}
impl CreateUserInputBuilder {
    /// <p>The identifier of the organization for which the user is created.</p>
    /// This field is required.
    pub fn organization_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.organization_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the organization for which the user is created.</p>
    pub fn set_organization_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.organization_id = input;
        self
    }
    /// <p>The identifier of the organization for which the user is created.</p>
    pub fn get_organization_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.organization_id
    }
    /// <p>The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The display name for the new user.</p>
    /// This field is required.
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The display name for the new user.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The display name for the new user.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>The password for the new user.</p>
    pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.password = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The password for the new user.</p>
    pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.password = input;
        self
    }
    /// <p>The password for the new user.</p>
    pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
        &self.password
    }
    /// <p>The role of the new user.</p>
    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i> role in a single request. When a user role is not selected, the default role of <i>USER</i> is selected.</p>
    pub fn role(mut self, input: crate::types::UserRole) -> Self {
        self.role = ::std::option::Option::Some(input);
        self
    }
    /// <p>The role of the new user.</p>
    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i> role in a single request. When a user role is not selected, the default role of <i>USER</i> is selected.</p>
    pub fn set_role(mut self, input: ::std::option::Option<crate::types::UserRole>) -> Self {
        self.role = input;
        self
    }
    /// <p>The role of the new user.</p>
    /// <p>You cannot pass <i>SYSTEM_USER</i> or <i>RESOURCE</i> role in a single request. When a user role is not selected, the default role of <i>USER</i> is selected.</p>
    pub fn get_role(&self) -> &::std::option::Option<crate::types::UserRole> {
        &self.role
    }
    /// <p>The first name of the new user.</p>
    pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.first_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The first name of the new user.</p>
    pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.first_name = input;
        self
    }
    /// <p>The first name of the new user.</p>
    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.first_name
    }
    /// <p>The last name of the new user.</p>
    pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The last name of the new user.</p>
    pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_name = input;
        self
    }
    /// <p>The last name of the new user.</p>
    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_name
    }
    /// <p>If this parameter is enabled, the user will be hidden from the address book.</p>
    pub fn hidden_from_global_address_list(mut self, input: bool) -> Self {
        self.hidden_from_global_address_list = ::std::option::Option::Some(input);
        self
    }
    /// <p>If this parameter is enabled, the user will be hidden from the address book.</p>
    pub fn set_hidden_from_global_address_list(mut self, input: ::std::option::Option<bool>) -> Self {
        self.hidden_from_global_address_list = input;
        self
    }
    /// <p>If this parameter is enabled, the user will be hidden from the address book.</p>
    pub fn get_hidden_from_global_address_list(&self) -> &::std::option::Option<bool> {
        &self.hidden_from_global_address_list
    }
    /// <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>
    pub fn identity_provider_user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identity_provider_user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_identity_provider_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_provider_user_id = input;
        self
    }
    /// <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>
    pub fn get_identity_provider_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_provider_user_id
    }
    /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
            organization_id: self.organization_id,
            name: self.name,
            display_name: self.display_name,
            password: self.password,
            role: self.role,
            first_name: self.first_name,
            last_name: self.last_name,
            hidden_from_global_address_list: self.hidden_from_global_address_list,
            identity_provider_user_id: self.identity_provider_user_id,
        })
    }
}
impl ::std::fmt::Debug for CreateUserInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateUserInputBuilder");
        formatter.field("organization_id", &self.organization_id);
        formatter.field("name", &self.name);
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("password", &"*** Sensitive Data Redacted ***");
        formatter.field("role", &self.role);
        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
        formatter.field("hidden_from_global_address_list", &self.hidden_from_global_address_list);
        formatter.field("identity_provider_user_id", &self.identity_provider_user_id);
        formatter.finish()
    }
}