aws-sdk-opsworks 0.27.0

AWS SDK for AWS OpsWorks
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 SetPermissionInput {
    /// <p>The stack ID.</p>
    #[doc(hidden)]
    pub stack_id: std::option::Option<std::string::String>,
    /// <p>The user's IAM ARN. This can also be a federated user's ARN.</p>
    #[doc(hidden)]
    pub iam_user_arn: std::option::Option<std::string::String>,
    /// <p>The user is allowed to use SSH to communicate with the instance.</p>
    #[doc(hidden)]
    pub allow_ssh: std::option::Option<bool>,
    /// <p>The user is allowed to use <b>sudo</b> to elevate privileges.</p>
    #[doc(hidden)]
    pub allow_sudo: std::option::Option<bool>,
    /// <p>The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.</p>
    /// <ul>
    /// <li> <p> <code>deny</code> </p> </li>
    /// <li> <p> <code>show</code> </p> </li>
    /// <li> <p> <code>deploy</code> </p> </li>
    /// <li> <p> <code>manage</code> </p> </li>
    /// <li> <p> <code>iam_only</code> </p> </li>
    /// </ul>
    /// <p>For more information about the permissions associated with these levels, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
    #[doc(hidden)]
    pub level: std::option::Option<std::string::String>,
}
impl SetPermissionInput {
    /// <p>The stack ID.</p>
    pub fn stack_id(&self) -> std::option::Option<&str> {
        self.stack_id.as_deref()
    }
    /// <p>The user's IAM ARN. This can also be a federated user's ARN.</p>
    pub fn iam_user_arn(&self) -> std::option::Option<&str> {
        self.iam_user_arn.as_deref()
    }
    /// <p>The user is allowed to use SSH to communicate with the instance.</p>
    pub fn allow_ssh(&self) -> std::option::Option<bool> {
        self.allow_ssh
    }
    /// <p>The user is allowed to use <b>sudo</b> to elevate privileges.</p>
    pub fn allow_sudo(&self) -> std::option::Option<bool> {
        self.allow_sudo
    }
    /// <p>The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.</p>
    /// <ul>
    /// <li> <p> <code>deny</code> </p> </li>
    /// <li> <p> <code>show</code> </p> </li>
    /// <li> <p> <code>deploy</code> </p> </li>
    /// <li> <p> <code>manage</code> </p> </li>
    /// <li> <p> <code>iam_only</code> </p> </li>
    /// </ul>
    /// <p>For more information about the permissions associated with these levels, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
    pub fn level(&self) -> std::option::Option<&str> {
        self.level.as_deref()
    }
}
impl SetPermissionInput {
    /// Creates a new builder-style object to manufacture [`SetPermissionInput`](crate::operation::set_permission::SetPermissionInput).
    pub fn builder() -> crate::operation::set_permission::builders::SetPermissionInputBuilder {
        crate::operation::set_permission::builders::SetPermissionInputBuilder::default()
    }
}

/// A builder for [`SetPermissionInput`](crate::operation::set_permission::SetPermissionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct SetPermissionInputBuilder {
    pub(crate) stack_id: std::option::Option<std::string::String>,
    pub(crate) iam_user_arn: std::option::Option<std::string::String>,
    pub(crate) allow_ssh: std::option::Option<bool>,
    pub(crate) allow_sudo: std::option::Option<bool>,
    pub(crate) level: std::option::Option<std::string::String>,
}
impl SetPermissionInputBuilder {
    /// <p>The stack ID.</p>
    pub fn stack_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.stack_id = Some(input.into());
        self
    }
    /// <p>The stack ID.</p>
    pub fn set_stack_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.stack_id = input;
        self
    }
    /// <p>The user's IAM ARN. This can also be a federated user's ARN.</p>
    pub fn iam_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.iam_user_arn = Some(input.into());
        self
    }
    /// <p>The user's IAM ARN. This can also be a federated user's ARN.</p>
    pub fn set_iam_user_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.iam_user_arn = input;
        self
    }
    /// <p>The user is allowed to use SSH to communicate with the instance.</p>
    pub fn allow_ssh(mut self, input: bool) -> Self {
        self.allow_ssh = Some(input);
        self
    }
    /// <p>The user is allowed to use SSH to communicate with the instance.</p>
    pub fn set_allow_ssh(mut self, input: std::option::Option<bool>) -> Self {
        self.allow_ssh = input;
        self
    }
    /// <p>The user is allowed to use <b>sudo</b> to elevate privileges.</p>
    pub fn allow_sudo(mut self, input: bool) -> Self {
        self.allow_sudo = Some(input);
        self
    }
    /// <p>The user is allowed to use <b>sudo</b> to elevate privileges.</p>
    pub fn set_allow_sudo(mut self, input: std::option::Option<bool>) -> Self {
        self.allow_sudo = input;
        self
    }
    /// <p>The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.</p>
    /// <ul>
    /// <li> <p> <code>deny</code> </p> </li>
    /// <li> <p> <code>show</code> </p> </li>
    /// <li> <p> <code>deploy</code> </p> </li>
    /// <li> <p> <code>manage</code> </p> </li>
    /// <li> <p> <code>iam_only</code> </p> </li>
    /// </ul>
    /// <p>For more information about the permissions associated with these levels, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
    pub fn level(mut self, input: impl Into<std::string::String>) -> Self {
        self.level = Some(input.into());
        self
    }
    /// <p>The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.</p>
    /// <ul>
    /// <li> <p> <code>deny</code> </p> </li>
    /// <li> <p> <code>show</code> </p> </li>
    /// <li> <p> <code>deploy</code> </p> </li>
    /// <li> <p> <code>manage</code> </p> </li>
    /// <li> <p> <code>iam_only</code> </p> </li>
    /// </ul>
    /// <p>For more information about the permissions associated with these levels, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
    pub fn set_level(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.level = input;
        self
    }
    /// Consumes the builder and constructs a [`SetPermissionInput`](crate::operation::set_permission::SetPermissionInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::set_permission::SetPermissionInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::set_permission::SetPermissionInput {
            stack_id: self.stack_id,
            iam_user_arn: self.iam_user_arn,
            allow_ssh: self.allow_ssh,
            allow_sudo: self.allow_sudo,
            level: self.level,
        })
    }
}