aws-sdk-auditmanager 1.102.0

AWS SDK for AWS Audit Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The assignment of a control set to a delegate for review.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Delegation {
    /// <p>The unique identifier for the delegation.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the assessment that's associated with the delegation.</p>
    pub assessment_name: ::std::option::Option<::std::string::String>,
    /// <p>The identifier for the assessment that's associated with the delegation.</p>
    pub assessment_id: ::std::option::Option<::std::string::String>,
    /// <p>The status of the delegation.</p>
    pub status: ::std::option::Option<crate::types::DelegationStatus>,
    /// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of customer persona.</p><note>
    /// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
    /// </note>
    pub role_type: ::std::option::Option<crate::types::RoleType>,
    /// <p>Specifies when the delegation was created.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Specifies when the delegation was last updated.</p>
    pub last_updated: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The identifier for the control set that's associated with the delegation.</p>
    pub control_set_id: ::std::option::Option<::std::string::String>,
    /// <p>The comment that's related to the delegation.</p>
    pub comment: ::std::option::Option<::std::string::String>,
    /// <p>The user or role that created the delegation.</p>
    pub created_by: ::std::option::Option<::std::string::String>,
}
impl Delegation {
    /// <p>The unique identifier for the delegation.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The name of the assessment that's associated with the delegation.</p>
    pub fn assessment_name(&self) -> ::std::option::Option<&str> {
        self.assessment_name.as_deref()
    }
    /// <p>The identifier for the assessment that's associated with the delegation.</p>
    pub fn assessment_id(&self) -> ::std::option::Option<&str> {
        self.assessment_id.as_deref()
    }
    /// <p>The status of the delegation.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::DelegationStatus> {
        self.status.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The type of customer persona.</p><note>
    /// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
    /// </note>
    pub fn role_type(&self) -> ::std::option::Option<&crate::types::RoleType> {
        self.role_type.as_ref()
    }
    /// <p>Specifies when the delegation was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>Specifies when the delegation was last updated.</p>
    pub fn last_updated(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated.as_ref()
    }
    /// <p>The identifier for the control set that's associated with the delegation.</p>
    pub fn control_set_id(&self) -> ::std::option::Option<&str> {
        self.control_set_id.as_deref()
    }
    /// <p>The comment that's related to the delegation.</p>
    pub fn comment(&self) -> ::std::option::Option<&str> {
        self.comment.as_deref()
    }
    /// <p>The user or role that created the delegation.</p>
    pub fn created_by(&self) -> ::std::option::Option<&str> {
        self.created_by.as_deref()
    }
}
impl ::std::fmt::Debug for Delegation {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Delegation");
        formatter.field("id", &"*** Sensitive Data Redacted ***");
        formatter.field("assessment_name", &"*** Sensitive Data Redacted ***");
        formatter.field("assessment_id", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &"*** Sensitive Data Redacted ***");
        formatter.field("role_arn", &"*** Sensitive Data Redacted ***");
        formatter.field("role_type", &"*** Sensitive Data Redacted ***");
        formatter.field("creation_time", &"*** Sensitive Data Redacted ***");
        formatter.field("last_updated", &"*** Sensitive Data Redacted ***");
        formatter.field("control_set_id", &"*** Sensitive Data Redacted ***");
        formatter.field("comment", &"*** Sensitive Data Redacted ***");
        formatter.field("created_by", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Delegation {
    /// Creates a new builder-style object to manufacture [`Delegation`](crate::types::Delegation).
    pub fn builder() -> crate::types::builders::DelegationBuilder {
        crate::types::builders::DelegationBuilder::default()
    }
}

/// A builder for [`Delegation`](crate::types::Delegation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DelegationBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) assessment_name: ::std::option::Option<::std::string::String>,
    pub(crate) assessment_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::DelegationStatus>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) role_type: ::std::option::Option<crate::types::RoleType>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_updated: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) control_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) comment: ::std::option::Option<::std::string::String>,
    pub(crate) created_by: ::std::option::Option<::std::string::String>,
}
impl DelegationBuilder {
    /// <p>The unique identifier for the delegation.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the delegation.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The unique identifier for the delegation.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The name of the assessment that's associated with the delegation.</p>
    pub fn assessment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assessment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the assessment that's associated with the delegation.</p>
    pub fn set_assessment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assessment_name = input;
        self
    }
    /// <p>The name of the assessment that's associated with the delegation.</p>
    pub fn get_assessment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.assessment_name
    }
    /// <p>The identifier for the assessment that's associated with the delegation.</p>
    pub fn assessment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assessment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the assessment that's associated with the delegation.</p>
    pub fn set_assessment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assessment_id = input;
        self
    }
    /// <p>The identifier for the assessment that's associated with the delegation.</p>
    pub fn get_assessment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assessment_id
    }
    /// <p>The status of the delegation.</p>
    pub fn status(mut self, input: crate::types::DelegationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the delegation.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DelegationStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the delegation.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DelegationStatus> {
        &self.status
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>The type of customer persona.</p><note>
    /// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
    /// </note>
    pub fn role_type(mut self, input: crate::types::RoleType) -> Self {
        self.role_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of customer persona.</p><note>
    /// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
    /// </note>
    pub fn set_role_type(mut self, input: ::std::option::Option<crate::types::RoleType>) -> Self {
        self.role_type = input;
        self
    }
    /// <p>The type of customer persona.</p><note>
    /// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
    /// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
    /// </note>
    pub fn get_role_type(&self) -> &::std::option::Option<crate::types::RoleType> {
        &self.role_type
    }
    /// <p>Specifies when the delegation was created.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies when the delegation was created.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>Specifies when the delegation was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>Specifies when the delegation was last updated.</p>
    pub fn last_updated(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies when the delegation was last updated.</p>
    pub fn set_last_updated(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated = input;
        self
    }
    /// <p>Specifies when the delegation was last updated.</p>
    pub fn get_last_updated(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated
    }
    /// <p>The identifier for the control set that's associated with the delegation.</p>
    pub fn control_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.control_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the control set that's associated with the delegation.</p>
    pub fn set_control_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.control_set_id = input;
        self
    }
    /// <p>The identifier for the control set that's associated with the delegation.</p>
    pub fn get_control_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.control_set_id
    }
    /// <p>The comment that's related to the delegation.</p>
    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.comment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The comment that's related to the delegation.</p>
    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.comment = input;
        self
    }
    /// <p>The comment that's related to the delegation.</p>
    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
        &self.comment
    }
    /// <p>The user or role that created the delegation.</p>
    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.created_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user or role that created the delegation.</p>
    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.created_by = input;
        self
    }
    /// <p>The user or role that created the delegation.</p>
    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.created_by
    }
    /// Consumes the builder and constructs a [`Delegation`](crate::types::Delegation).
    pub fn build(self) -> crate::types::Delegation {
        crate::types::Delegation {
            id: self.id,
            assessment_name: self.assessment_name,
            assessment_id: self.assessment_id,
            status: self.status,
            role_arn: self.role_arn,
            role_type: self.role_type,
            creation_time: self.creation_time,
            last_updated: self.last_updated,
            control_set_id: self.control_set_id,
            comment: self.comment,
            created_by: self.created_by,
        }
    }
}
impl ::std::fmt::Debug for DelegationBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("DelegationBuilder");
        formatter.field("id", &"*** Sensitive Data Redacted ***");
        formatter.field("assessment_name", &"*** Sensitive Data Redacted ***");
        formatter.field("assessment_id", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &"*** Sensitive Data Redacted ***");
        formatter.field("role_arn", &"*** Sensitive Data Redacted ***");
        formatter.field("role_type", &"*** Sensitive Data Redacted ***");
        formatter.field("creation_time", &"*** Sensitive Data Redacted ***");
        formatter.field("last_updated", &"*** Sensitive Data Redacted ***");
        formatter.field("control_set_id", &"*** Sensitive Data Redacted ***");
        formatter.field("comment", &"*** Sensitive Data Redacted ***");
        formatter.field("created_by", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}