aws-sdk-elasticache 1.110.0

AWS SDK for Amazon ElastiCache
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, ::std::fmt::Debug)]
pub struct User {
    /// <p>The ID of the user.</p>
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>The username of the user.</p>
    pub user_name: ::std::option::Option<::std::string::String>,
    /// <p>Indicates the user status. Can be "active", "modifying" or "deleting".</p>
    pub status: ::std::option::Option<::std::string::String>,
    /// <p>The options are valkey or redis.</p>
    pub engine: ::std::option::Option<::std::string::String>,
    /// <p>The minimum engine version required, which is Redis OSS 6.0</p>
    pub minimum_engine_version: ::std::option::Option<::std::string::String>,
    /// <p>Access permissions string used for this user.</p>
    pub access_string: ::std::option::Option<::std::string::String>,
    /// <p>Returns a list of the user group IDs the user belongs to.</p>
    pub user_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Denotes whether the user requires a password to authenticate.</p>
    pub authentication: ::std::option::Option<crate::types::Authentication>,
    /// <p>The Amazon Resource Name (ARN) of the user.</p>
    pub arn: ::std::option::Option<::std::string::String>,
}
impl User {
    /// <p>The ID of the user.</p>
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>The username of the user.</p>
    pub fn user_name(&self) -> ::std::option::Option<&str> {
        self.user_name.as_deref()
    }
    /// <p>Indicates the user status. Can be "active", "modifying" or "deleting".</p>
    pub fn status(&self) -> ::std::option::Option<&str> {
        self.status.as_deref()
    }
    /// <p>The options are valkey or redis.</p>
    pub fn engine(&self) -> ::std::option::Option<&str> {
        self.engine.as_deref()
    }
    /// <p>The minimum engine version required, which is Redis OSS 6.0</p>
    pub fn minimum_engine_version(&self) -> ::std::option::Option<&str> {
        self.minimum_engine_version.as_deref()
    }
    /// <p>Access permissions string used for this user.</p>
    pub fn access_string(&self) -> ::std::option::Option<&str> {
        self.access_string.as_deref()
    }
    /// <p>Returns a list of the user group IDs the user belongs to.</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 `.user_group_ids.is_none()`.
    pub fn user_group_ids(&self) -> &[::std::string::String] {
        self.user_group_ids.as_deref().unwrap_or_default()
    }
    /// <p>Denotes whether the user requires a password to authenticate.</p>
    pub fn authentication(&self) -> ::std::option::Option<&crate::types::Authentication> {
        self.authentication.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the user.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
}
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, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UserBuilder {
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_name: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<::std::string::String>,
    pub(crate) engine: ::std::option::Option<::std::string::String>,
    pub(crate) minimum_engine_version: ::std::option::Option<::std::string::String>,
    pub(crate) access_string: ::std::option::Option<::std::string::String>,
    pub(crate) user_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) authentication: ::std::option::Option<crate::types::Authentication>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
}
impl UserBuilder {
    /// <p>The ID of the user.</p>
    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 ID 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 ID of the user.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The username of the user.</p>
    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The username of the user.</p>
    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_name = input;
        self
    }
    /// <p>The username of the user.</p>
    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_name
    }
    /// <p>Indicates the user status. Can be "active", "modifying" or "deleting".</p>
    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates the user status. Can be "active", "modifying" or "deleting".</p>
    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status = input;
        self
    }
    /// <p>Indicates the user status. Can be "active", "modifying" or "deleting".</p>
    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.status
    }
    /// <p>The options are valkey or redis.</p>
    pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.engine = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The options are valkey or redis.</p>
    pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.engine = input;
        self
    }
    /// <p>The options are valkey or redis.</p>
    pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
        &self.engine
    }
    /// <p>The minimum engine version required, which is Redis OSS 6.0</p>
    pub fn minimum_engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.minimum_engine_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The minimum engine version required, which is Redis OSS 6.0</p>
    pub fn set_minimum_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.minimum_engine_version = input;
        self
    }
    /// <p>The minimum engine version required, which is Redis OSS 6.0</p>
    pub fn get_minimum_engine_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.minimum_engine_version
    }
    /// <p>Access permissions string used for this user.</p>
    pub fn access_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_string = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Access permissions string used for this user.</p>
    pub fn set_access_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_string = input;
        self
    }
    /// <p>Access permissions string used for this user.</p>
    pub fn get_access_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_string
    }
    /// Appends an item to `user_group_ids`.
    ///
    /// To override the contents of this collection use [`set_user_group_ids`](Self::set_user_group_ids).
    ///
    /// <p>Returns a list of the user group IDs the user belongs to.</p>
    pub fn user_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.user_group_ids.unwrap_or_default();
        v.push(input.into());
        self.user_group_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>Returns a list of the user group IDs the user belongs to.</p>
    pub fn set_user_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.user_group_ids = input;
        self
    }
    /// <p>Returns a list of the user group IDs the user belongs to.</p>
    pub fn get_user_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.user_group_ids
    }
    /// <p>Denotes whether the user requires a password to authenticate.</p>
    pub fn authentication(mut self, input: crate::types::Authentication) -> Self {
        self.authentication = ::std::option::Option::Some(input);
        self
    }
    /// <p>Denotes whether the user requires a password to authenticate.</p>
    pub fn set_authentication(mut self, input: ::std::option::Option<crate::types::Authentication>) -> Self {
        self.authentication = input;
        self
    }
    /// <p>Denotes whether the user requires a password to authenticate.</p>
    pub fn get_authentication(&self) -> &::std::option::Option<crate::types::Authentication> {
        &self.authentication
    }
    /// <p>The Amazon Resource Name (ARN) of the user.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the user.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// Consumes the builder and constructs a [`User`](crate::types::User).
    pub fn build(self) -> crate::types::User {
        crate::types::User {
            user_id: self.user_id,
            user_name: self.user_name,
            status: self.status,
            engine: self.engine,
            minimum_engine_version: self.minimum_engine_version,
            access_string: self.access_string,
            user_group_ids: self.user_group_ids,
            authentication: self.authentication,
            arn: self.arn,
        }
    }
}