aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
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 CreatePermissionSetInput {
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the permission set.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the permission set.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The permissions granted by the permission set.</p>
    pub permissions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreatePermissionSetInput {
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> ::std::option::Option<&str> {
        self.environment_arn.as_deref()
    }
    /// <p>The name of the permission set.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the permission set.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The permissions granted by the permission set.</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 `.permissions.is_none()`.
    pub fn permissions(&self) -> &[::std::string::String] {
        self.permissions.as_deref().unwrap_or_default()
    }
}
impl CreatePermissionSetInput {
    /// Creates a new builder-style object to manufacture [`CreatePermissionSetInput`](crate::operation::create_permission_set::CreatePermissionSetInput).
    pub fn builder() -> crate::operation::create_permission_set::builders::CreatePermissionSetInputBuilder {
        crate::operation::create_permission_set::builders::CreatePermissionSetInputBuilder::default()
    }
}

/// A builder for [`CreatePermissionSetInput`](crate::operation::create_permission_set::CreatePermissionSetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreatePermissionSetInputBuilder {
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreatePermissionSetInputBuilder {
    /// <p>The ARN of this governance environment.</p>
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// <p>The name of the permission set.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the permission set.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the permission set.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the permission set.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the permission set.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the permission set.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `permissions`.
    ///
    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
    ///
    /// <p>The permissions granted by the permission set.</p>
    pub fn permissions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.permissions.unwrap_or_default();
        v.push(input.into());
        self.permissions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The permissions granted by the permission set.</p>
    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.permissions = input;
        self
    }
    /// <p>The permissions granted by the permission set.</p>
    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.permissions
    }
    /// Consumes the builder and constructs a [`CreatePermissionSetInput`](crate::operation::create_permission_set::CreatePermissionSetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_permission_set::CreatePermissionSetInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_permission_set::CreatePermissionSetInput {
            environment_arn: self.environment_arn,
            name: self.name,
            description: self.description,
            permissions: self.permissions,
        })
    }
}