aws-sdk-opsworks 1.53.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>
    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>
    pub iam_user_arn: ::std::option::Option<::std::string::String>,
    /// <p>The user is allowed to use SSH to communicate with the instance.</p>
    pub allow_ssh: ::std::option::Option<bool>,
    /// <p>The user is allowed to use <b>sudo</b> to elevate privileges.</p>
    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>
    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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>
    /// This field is required.
    pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stack_id = ::std::option::Option::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 stack ID.</p>
    pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.stack_id
    }
    /// <p>The user's IAM ARN. This can also be a federated user's ARN.</p>
    /// This field is required.
    pub fn iam_user_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.iam_user_arn = ::std::option::Option::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's IAM ARN. This can also be a federated user's ARN.</p>
    pub fn get_iam_user_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.iam_user_arn
    }
    /// <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 = ::std::option::Option::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 SSH to communicate with the instance.</p>
    pub fn get_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(mut self, input: bool) -> Self {
        self.allow_sudo = ::std::option::Option::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 is allowed to use <b>sudo</b> to elevate privileges.</p>
    pub fn get_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(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.level = ::std::option::Option::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
    }
    /// <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 get_level(&self) -> &::std::option::Option<::std::string::String> {
        &self.level
    }
    /// Consumes the builder and constructs a [`SetPermissionInput`](crate::operation::set_permission::SetPermissionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::set_permission::SetPermissionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::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,
        })
    }
}