aws-sdk-chime 1.99.0

AWS SDK for Amazon Chime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The user on the Amazon Chime account.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct User {
    /// <p>The user ID.</p>
    pub user_id: ::std::string::String,
    /// <p>The Amazon Chime account ID.</p>
    pub account_id: ::std::option::Option<::std::string::String>,
    /// <p>The primary email address of the user.</p>
    pub primary_email: ::std::option::Option<::std::string::String>,
    /// <p>The primary phone number associated with the user.</p>
    pub primary_provisioned_number: ::std::option::Option<::std::string::String>,
    /// <p>The display name of the user.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>The license type for the user.</p>
    pub license_type: ::std::option::Option<crate::types::License>,
    /// <p>The user type.</p>
    pub user_type: ::std::option::Option<crate::types::UserType>,
    /// <p>The user registration status.</p>
    pub user_registration_status: ::std::option::Option<crate::types::RegistrationStatus>,
    /// <p>The user invite status.</p>
    pub user_invitation_status: ::std::option::Option<crate::types::InviteStatus>,
    /// <p>Date and time when the user is registered, in ISO 8601 format.</p>
    pub registered_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>
    pub invited_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Alexa for Business metadata.</p>
    pub alexa_for_business_metadata: ::std::option::Option<crate::types::AlexaForBusinessMetadata>,
    /// <p>The user's personal meeting PIN.</p>
    pub personal_pin: ::std::option::Option<::std::string::String>,
}
impl User {
    /// <p>The user ID.</p>
    pub fn user_id(&self) -> &str {
        use std::ops::Deref;
        self.user_id.deref()
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn account_id(&self) -> ::std::option::Option<&str> {
        self.account_id.as_deref()
    }
    /// <p>The primary email address of the user.</p>
    pub fn primary_email(&self) -> ::std::option::Option<&str> {
        self.primary_email.as_deref()
    }
    /// <p>The primary phone number associated with the user.</p>
    pub fn primary_provisioned_number(&self) -> ::std::option::Option<&str> {
        self.primary_provisioned_number.as_deref()
    }
    /// <p>The display name of the user.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>The license type for the user.</p>
    pub fn license_type(&self) -> ::std::option::Option<&crate::types::License> {
        self.license_type.as_ref()
    }
    /// <p>The user type.</p>
    pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
        self.user_type.as_ref()
    }
    /// <p>The user registration status.</p>
    pub fn user_registration_status(&self) -> ::std::option::Option<&crate::types::RegistrationStatus> {
        self.user_registration_status.as_ref()
    }
    /// <p>The user invite status.</p>
    pub fn user_invitation_status(&self) -> ::std::option::Option<&crate::types::InviteStatus> {
        self.user_invitation_status.as_ref()
    }
    /// <p>Date and time when the user is registered, in ISO 8601 format.</p>
    pub fn registered_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.registered_on.as_ref()
    }
    /// <p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>
    pub fn invited_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.invited_on.as_ref()
    }
    /// <p>The Alexa for Business metadata.</p>
    pub fn alexa_for_business_metadata(&self) -> ::std::option::Option<&crate::types::AlexaForBusinessMetadata> {
        self.alexa_for_business_metadata.as_ref()
    }
    /// <p>The user's personal meeting PIN.</p>
    pub fn personal_pin(&self) -> ::std::option::Option<&str> {
        self.personal_pin.as_deref()
    }
}
impl ::std::fmt::Debug for User {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("User");
        formatter.field("user_id", &self.user_id);
        formatter.field("account_id", &self.account_id);
        formatter.field("primary_email", &"*** Sensitive Data Redacted ***");
        formatter.field("primary_provisioned_number", &"*** Sensitive Data Redacted ***");
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("license_type", &self.license_type);
        formatter.field("user_type", &self.user_type);
        formatter.field("user_registration_status", &self.user_registration_status);
        formatter.field("user_invitation_status", &self.user_invitation_status);
        formatter.field("registered_on", &self.registered_on);
        formatter.field("invited_on", &self.invited_on);
        formatter.field("alexa_for_business_metadata", &self.alexa_for_business_metadata);
        formatter.field("personal_pin", &self.personal_pin);
        formatter.finish()
    }
}
impl User {
    /// Creates a new builder-style object to manufacture [`User`](crate::types::User).
    pub fn builder() -> crate::types::builders::UserBuilder {
        crate::types::builders::UserBuilder::default()
    }
}

/// A builder for [`User`](crate::types::User).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct UserBuilder {
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) primary_email: ::std::option::Option<::std::string::String>,
    pub(crate) primary_provisioned_number: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) license_type: ::std::option::Option<crate::types::License>,
    pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
    pub(crate) user_registration_status: ::std::option::Option<crate::types::RegistrationStatus>,
    pub(crate) user_invitation_status: ::std::option::Option<crate::types::InviteStatus>,
    pub(crate) registered_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) invited_on: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) alexa_for_business_metadata: ::std::option::Option<crate::types::AlexaForBusinessMetadata>,
    pub(crate) personal_pin: ::std::option::Option<::std::string::String>,
}
impl UserBuilder {
    /// <p>The user ID.</p>
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user ID.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The user ID.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// <p>The primary email address of the user.</p>
    pub fn primary_email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_email = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The primary email address of the user.</p>
    pub fn set_primary_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.primary_email = input;
        self
    }
    /// <p>The primary email address of the user.</p>
    pub fn get_primary_email(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_email
    }
    /// <p>The primary phone number associated with the user.</p>
    pub fn primary_provisioned_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_provisioned_number = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The primary phone number associated with the user.</p>
    pub fn set_primary_provisioned_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.primary_provisioned_number = input;
        self
    }
    /// <p>The primary phone number associated with the user.</p>
    pub fn get_primary_provisioned_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_provisioned_number
    }
    /// <p>The display name of the user.</p>
    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 of the 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 of the user.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>The license type for the user.</p>
    pub fn license_type(mut self, input: crate::types::License) -> Self {
        self.license_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The license type for the user.</p>
    pub fn set_license_type(mut self, input: ::std::option::Option<crate::types::License>) -> Self {
        self.license_type = input;
        self
    }
    /// <p>The license type for the user.</p>
    pub fn get_license_type(&self) -> &::std::option::Option<crate::types::License> {
        &self.license_type
    }
    /// <p>The user type.</p>
    pub fn user_type(mut self, input: crate::types::UserType) -> Self {
        self.user_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The user type.</p>
    pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
        self.user_type = input;
        self
    }
    /// <p>The user type.</p>
    pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
        &self.user_type
    }
    /// <p>The user registration status.</p>
    pub fn user_registration_status(mut self, input: crate::types::RegistrationStatus) -> Self {
        self.user_registration_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The user registration status.</p>
    pub fn set_user_registration_status(mut self, input: ::std::option::Option<crate::types::RegistrationStatus>) -> Self {
        self.user_registration_status = input;
        self
    }
    /// <p>The user registration status.</p>
    pub fn get_user_registration_status(&self) -> &::std::option::Option<crate::types::RegistrationStatus> {
        &self.user_registration_status
    }
    /// <p>The user invite status.</p>
    pub fn user_invitation_status(mut self, input: crate::types::InviteStatus) -> Self {
        self.user_invitation_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The user invite status.</p>
    pub fn set_user_invitation_status(mut self, input: ::std::option::Option<crate::types::InviteStatus>) -> Self {
        self.user_invitation_status = input;
        self
    }
    /// <p>The user invite status.</p>
    pub fn get_user_invitation_status(&self) -> &::std::option::Option<crate::types::InviteStatus> {
        &self.user_invitation_status
    }
    /// <p>Date and time when the user is registered, in ISO 8601 format.</p>
    pub fn registered_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.registered_on = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date and time when the user is registered, in ISO 8601 format.</p>
    pub fn set_registered_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.registered_on = input;
        self
    }
    /// <p>Date and time when the user is registered, in ISO 8601 format.</p>
    pub fn get_registered_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.registered_on
    }
    /// <p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>
    pub fn invited_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.invited_on = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>
    pub fn set_invited_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.invited_on = input;
        self
    }
    /// <p>Date and time when the user is invited to the Amazon Chime account, in ISO 8601 format.</p>
    pub fn get_invited_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.invited_on
    }
    /// <p>The Alexa for Business metadata.</p>
    pub fn alexa_for_business_metadata(mut self, input: crate::types::AlexaForBusinessMetadata) -> Self {
        self.alexa_for_business_metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Alexa for Business metadata.</p>
    pub fn set_alexa_for_business_metadata(mut self, input: ::std::option::Option<crate::types::AlexaForBusinessMetadata>) -> Self {
        self.alexa_for_business_metadata = input;
        self
    }
    /// <p>The Alexa for Business metadata.</p>
    pub fn get_alexa_for_business_metadata(&self) -> &::std::option::Option<crate::types::AlexaForBusinessMetadata> {
        &self.alexa_for_business_metadata
    }
    /// <p>The user's personal meeting PIN.</p>
    pub fn personal_pin(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.personal_pin = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user's personal meeting PIN.</p>
    pub fn set_personal_pin(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.personal_pin = input;
        self
    }
    /// <p>The user's personal meeting PIN.</p>
    pub fn get_personal_pin(&self) -> &::std::option::Option<::std::string::String> {
        &self.personal_pin
    }
    /// Consumes the builder and constructs a [`User`](crate::types::User).
    /// This method will fail if any of the following fields are not set:
    /// - [`user_id`](crate::types::builders::UserBuilder::user_id)
    pub fn build(self) -> ::std::result::Result<crate::types::User, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::User {
            user_id: self.user_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "user_id",
                    "user_id was not specified but it is required when building User",
                )
            })?,
            account_id: self.account_id,
            primary_email: self.primary_email,
            primary_provisioned_number: self.primary_provisioned_number,
            display_name: self.display_name,
            license_type: self.license_type,
            user_type: self.user_type,
            user_registration_status: self.user_registration_status,
            user_invitation_status: self.user_invitation_status,
            registered_on: self.registered_on,
            invited_on: self.invited_on,
            alexa_for_business_metadata: self.alexa_for_business_metadata,
            personal_pin: self.personal_pin,
        })
    }
}
impl ::std::fmt::Debug for UserBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UserBuilder");
        formatter.field("user_id", &self.user_id);
        formatter.field("account_id", &self.account_id);
        formatter.field("primary_email", &"*** Sensitive Data Redacted ***");
        formatter.field("primary_provisioned_number", &"*** Sensitive Data Redacted ***");
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("license_type", &self.license_type);
        formatter.field("user_type", &self.user_type);
        formatter.field("user_registration_status", &self.user_registration_status);
        formatter.field("user_invitation_status", &self.user_invitation_status);
        formatter.field("registered_on", &self.registered_on);
        formatter.field("invited_on", &self.invited_on);
        formatter.field("alexa_for_business_metadata", &self.alexa_for_business_metadata);
        formatter.field("personal_pin", &self.personal_pin);
        formatter.finish()
    }
}