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 AssignPermissionSetInput {
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of principal the permission set is assigned to.</p>
    pub principal_type: ::std::option::Option<crate::types::PrincipalType>,
    /// <p>The unique identifier of the principal the permission set is assigned to.</p>
    pub principal_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the permission set.</p>
    pub permission_set_id: ::std::option::Option<::std::string::String>,
    /// <p>The scopes the assignment applies to.</p>
    pub scopes: ::std::option::Option<::std::vec::Vec<crate::types::AssignmentScope>>,
}
impl AssignPermissionSetInput {
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> ::std::option::Option<&str> {
        self.environment_arn.as_deref()
    }
    /// <p>The type of principal the permission set is assigned to.</p>
    pub fn principal_type(&self) -> ::std::option::Option<&crate::types::PrincipalType> {
        self.principal_type.as_ref()
    }
    /// <p>The unique identifier of the principal the permission set is assigned to.</p>
    pub fn principal_id(&self) -> ::std::option::Option<&str> {
        self.principal_id.as_deref()
    }
    /// <p>The identifier of the permission set.</p>
    pub fn permission_set_id(&self) -> ::std::option::Option<&str> {
        self.permission_set_id.as_deref()
    }
    /// <p>The scopes the assignment applies 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 `.scopes.is_none()`.
    pub fn scopes(&self) -> &[crate::types::AssignmentScope] {
        self.scopes.as_deref().unwrap_or_default()
    }
}
impl AssignPermissionSetInput {
    /// Creates a new builder-style object to manufacture [`AssignPermissionSetInput`](crate::operation::assign_permission_set::AssignPermissionSetInput).
    pub fn builder() -> crate::operation::assign_permission_set::builders::AssignPermissionSetInputBuilder {
        crate::operation::assign_permission_set::builders::AssignPermissionSetInputBuilder::default()
    }
}

/// A builder for [`AssignPermissionSetInput`](crate::operation::assign_permission_set::AssignPermissionSetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssignPermissionSetInputBuilder {
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) principal_type: ::std::option::Option<crate::types::PrincipalType>,
    pub(crate) principal_id: ::std::option::Option<::std::string::String>,
    pub(crate) permission_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) scopes: ::std::option::Option<::std::vec::Vec<crate::types::AssignmentScope>>,
}
impl AssignPermissionSetInputBuilder {
    /// <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 type of principal the permission set is assigned to.</p>
    /// This field is required.
    pub fn principal_type(mut self, input: crate::types::PrincipalType) -> Self {
        self.principal_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of principal the permission set is assigned to.</p>
    pub fn set_principal_type(mut self, input: ::std::option::Option<crate::types::PrincipalType>) -> Self {
        self.principal_type = input;
        self
    }
    /// <p>The type of principal the permission set is assigned to.</p>
    pub fn get_principal_type(&self) -> &::std::option::Option<crate::types::PrincipalType> {
        &self.principal_type
    }
    /// <p>The unique identifier of the principal the permission set is assigned to.</p>
    /// This field is required.
    pub fn principal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.principal_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the principal the permission set is assigned to.</p>
    pub fn set_principal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.principal_id = input;
        self
    }
    /// <p>The unique identifier of the principal the permission set is assigned to.</p>
    pub fn get_principal_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.principal_id
    }
    /// <p>The identifier of the permission set.</p>
    /// This field is required.
    pub fn permission_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.permission_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the permission set.</p>
    pub fn set_permission_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.permission_set_id = input;
        self
    }
    /// <p>The identifier of the permission set.</p>
    pub fn get_permission_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.permission_set_id
    }
    /// Appends an item to `scopes`.
    ///
    /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
    ///
    /// <p>The scopes the assignment applies to.</p>
    pub fn scopes(mut self, input: crate::types::AssignmentScope) -> Self {
        let mut v = self.scopes.unwrap_or_default();
        v.push(input);
        self.scopes = ::std::option::Option::Some(v);
        self
    }
    /// <p>The scopes the assignment applies to.</p>
    pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssignmentScope>>) -> Self {
        self.scopes = input;
        self
    }
    /// <p>The scopes the assignment applies to.</p>
    pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssignmentScope>> {
        &self.scopes
    }
    /// Consumes the builder and constructs a [`AssignPermissionSetInput`](crate::operation::assign_permission_set::AssignPermissionSetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::assign_permission_set::AssignPermissionSetInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::assign_permission_set::AssignPermissionSetInput {
            environment_arn: self.environment_arn,
            principal_type: self.principal_type,
            principal_id: self.principal_id,
            permission_set_id: self.permission_set_id,
            scopes: self.scopes,
        })
    }
}