aws-sdk-wickr 1.1.0

AWS SDK for AWS Wickr Admin API
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 GetUserOutput {
    /// <p>The unique identifier of the user.</p>
    pub user_id: ::std::string::String,
    /// <p>The first name of the user.</p>
    pub first_name: ::std::option::Option<::std::string::String>,
    /// <p>The last name of the user.</p>
    pub last_name: ::std::option::Option<::std::string::String>,
    /// <p>The email address or username of the user.</p>
    pub username: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether the user has administrator privileges in the network.</p>
    pub is_admin: ::std::option::Option<bool>,
    /// <p>Indicates whether the user is currently suspended.</p>
    pub suspended: ::std::option::Option<bool>,
    /// <p>The current status of the user (1 for pending, 2 for active).</p>
    pub status: ::std::option::Option<i32>,
    /// <p>The timestamp of the user's last activity in the network, specified in epoch seconds.</p>
    pub last_activity: ::std::option::Option<i32>,
    /// <p>The timestamp of the user's last login to the network, specified in epoch seconds.</p>
    pub last_login: ::std::option::Option<i32>,
    /// <p>A list of security group IDs to which the user belongs.</p>
    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl GetUserOutput {
    /// <p>The unique identifier of the user.</p>
    pub fn user_id(&self) -> &str {
        use std::ops::Deref;
        self.user_id.deref()
    }
    /// <p>The first name of the user.</p>
    pub fn first_name(&self) -> ::std::option::Option<&str> {
        self.first_name.as_deref()
    }
    /// <p>The last name of the user.</p>
    pub fn last_name(&self) -> ::std::option::Option<&str> {
        self.last_name.as_deref()
    }
    /// <p>The email address or username of the user.</p>
    pub fn username(&self) -> ::std::option::Option<&str> {
        self.username.as_deref()
    }
    /// <p>Indicates whether the user has administrator privileges in the network.</p>
    pub fn is_admin(&self) -> ::std::option::Option<bool> {
        self.is_admin
    }
    /// <p>Indicates whether the user is currently suspended.</p>
    pub fn suspended(&self) -> ::std::option::Option<bool> {
        self.suspended
    }
    /// <p>The current status of the user (1 for pending, 2 for active).</p>
    pub fn status(&self) -> ::std::option::Option<i32> {
        self.status
    }
    /// <p>The timestamp of the user's last activity in the network, specified in epoch seconds.</p>
    pub fn last_activity(&self) -> ::std::option::Option<i32> {
        self.last_activity
    }
    /// <p>The timestamp of the user's last login to the network, specified in epoch seconds.</p>
    pub fn last_login(&self) -> ::std::option::Option<i32> {
        self.last_login
    }
    /// <p>A list of security group IDs to which the user belongs.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
    pub fn security_group_ids(&self) -> &[::std::string::String] {
        self.security_group_ids.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for GetUserOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetUserOutput");
        formatter.field("user_id", &self.user_id);
        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
        formatter.field("username", &self.username);
        formatter.field("is_admin", &self.is_admin);
        formatter.field("suspended", &self.suspended);
        formatter.field("status", &self.status);
        formatter.field("last_activity", &self.last_activity);
        formatter.field("last_login", &self.last_login);
        formatter.field("security_group_ids", &self.security_group_ids);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetUserOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetUserOutput {
    /// Creates a new builder-style object to manufacture [`GetUserOutput`](crate::operation::get_user::GetUserOutput).
    pub fn builder() -> crate::operation::get_user::builders::GetUserOutputBuilder {
        crate::operation::get_user::builders::GetUserOutputBuilder::default()
    }
}

/// A builder for [`GetUserOutput`](crate::operation::get_user::GetUserOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetUserOutputBuilder {
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) first_name: ::std::option::Option<::std::string::String>,
    pub(crate) last_name: ::std::option::Option<::std::string::String>,
    pub(crate) username: ::std::option::Option<::std::string::String>,
    pub(crate) is_admin: ::std::option::Option<bool>,
    pub(crate) suspended: ::std::option::Option<bool>,
    pub(crate) status: ::std::option::Option<i32>,
    pub(crate) last_activity: ::std::option::Option<i32>,
    pub(crate) last_login: ::std::option::Option<i32>,
    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl GetUserOutputBuilder {
    /// <p>The unique identifier of the user.</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 unique identifier of the user.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The unique identifier of the user.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The first name of the 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 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 user.</p>
    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.first_name
    }
    /// <p>The last name of the 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 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 user.</p>
    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_name
    }
    /// <p>The email address or username of the user.</p>
    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.username = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The email address or username of the user.</p>
    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.username = input;
        self
    }
    /// <p>The email address or username of the user.</p>
    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
        &self.username
    }
    /// <p>Indicates whether the user has administrator privileges in the network.</p>
    pub fn is_admin(mut self, input: bool) -> Self {
        self.is_admin = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the user has administrator privileges in the network.</p>
    pub fn set_is_admin(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_admin = input;
        self
    }
    /// <p>Indicates whether the user has administrator privileges in the network.</p>
    pub fn get_is_admin(&self) -> &::std::option::Option<bool> {
        &self.is_admin
    }
    /// <p>Indicates whether the user is currently suspended.</p>
    pub fn suspended(mut self, input: bool) -> Self {
        self.suspended = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the user is currently suspended.</p>
    pub fn set_suspended(mut self, input: ::std::option::Option<bool>) -> Self {
        self.suspended = input;
        self
    }
    /// <p>Indicates whether the user is currently suspended.</p>
    pub fn get_suspended(&self) -> &::std::option::Option<bool> {
        &self.suspended
    }
    /// <p>The current status of the user (1 for pending, 2 for active).</p>
    pub fn status(mut self, input: i32) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the user (1 for pending, 2 for active).</p>
    pub fn set_status(mut self, input: ::std::option::Option<i32>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the user (1 for pending, 2 for active).</p>
    pub fn get_status(&self) -> &::std::option::Option<i32> {
        &self.status
    }
    /// <p>The timestamp of the user's last activity in the network, specified in epoch seconds.</p>
    pub fn last_activity(mut self, input: i32) -> Self {
        self.last_activity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of the user's last activity in the network, specified in epoch seconds.</p>
    pub fn set_last_activity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.last_activity = input;
        self
    }
    /// <p>The timestamp of the user's last activity in the network, specified in epoch seconds.</p>
    pub fn get_last_activity(&self) -> &::std::option::Option<i32> {
        &self.last_activity
    }
    /// <p>The timestamp of the user's last login to the network, specified in epoch seconds.</p>
    pub fn last_login(mut self, input: i32) -> Self {
        self.last_login = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of the user's last login to the network, specified in epoch seconds.</p>
    pub fn set_last_login(mut self, input: ::std::option::Option<i32>) -> Self {
        self.last_login = input;
        self
    }
    /// <p>The timestamp of the user's last login to the network, specified in epoch seconds.</p>
    pub fn get_last_login(&self) -> &::std::option::Option<i32> {
        &self.last_login
    }
    /// Appends an item to `security_group_ids`.
    ///
    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
    ///
    /// <p>A list of security group IDs to which the user belongs.</p>
    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.security_group_ids.unwrap_or_default();
        v.push(input.into());
        self.security_group_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of security group IDs to which the user belongs.</p>
    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.security_group_ids = input;
        self
    }
    /// <p>A list of security group IDs to which the user belongs.</p>
    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.security_group_ids
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetUserOutput`](crate::operation::get_user::GetUserOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`user_id`](crate::operation::get_user::builders::GetUserOutputBuilder::user_id)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_user::GetUserOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_user::GetUserOutput {
            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 GetUserOutput",
                )
            })?,
            first_name: self.first_name,
            last_name: self.last_name,
            username: self.username,
            is_admin: self.is_admin,
            suspended: self.suspended,
            status: self.status,
            last_activity: self.last_activity,
            last_login: self.last_login,
            security_group_ids: self.security_group_ids,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetUserOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetUserOutputBuilder");
        formatter.field("user_id", &self.user_id);
        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
        formatter.field("username", &self.username);
        formatter.field("is_admin", &self.is_admin);
        formatter.field("suspended", &self.suspended);
        formatter.field("status", &self.status);
        formatter.field("last_activity", &self.last_activity);
        formatter.field("last_login", &self.last_login);
        formatter.field("security_group_ids", &self.security_group_ids);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}