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)]
pub struct GetAnnotationOutput {
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::string::String,
    /// <p>The name of the project.</p>
    pub project: ::std::string::String,
    /// <p>The name of the compliance framework.</p>
    pub framework: ::std::string::String,
    /// <p>The version of the compliance framework.</p>
    pub framework_version: ::std::string::String,
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    pub control_id: ::std::string::String,
    /// <p>The identifier of the assessment.</p>
    pub assessment_id: ::std::string::String,
    /// <p>The identifier of the evidence the annotation applies to.</p>
    pub evidence_id: ::std::string::String,
    /// <p>The version number of the evidence the annotation applies to.</p>
    pub evidence_version: i32,
    /// <p>The free-text reviewer note attached to the evidence.</p>
    pub notes: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp when the annotation was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAnnotationOutput {
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_arn.deref()
    }
    /// <p>The name of the project.</p>
    pub fn project(&self) -> &str {
        use std::ops::Deref;
        self.project.deref()
    }
    /// <p>The name of the compliance framework.</p>
    pub fn framework(&self) -> &str {
        use std::ops::Deref;
        self.framework.deref()
    }
    /// <p>The version of the compliance framework.</p>
    pub fn framework_version(&self) -> &str {
        use std::ops::Deref;
        self.framework_version.deref()
    }
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    pub fn control_id(&self) -> &str {
        use std::ops::Deref;
        self.control_id.deref()
    }
    /// <p>The identifier of the assessment.</p>
    pub fn assessment_id(&self) -> &str {
        use std::ops::Deref;
        self.assessment_id.deref()
    }
    /// <p>The identifier of the evidence the annotation applies to.</p>
    pub fn evidence_id(&self) -> &str {
        use std::ops::Deref;
        self.evidence_id.deref()
    }
    /// <p>The version number of the evidence the annotation applies to.</p>
    pub fn evidence_version(&self) -> i32 {
        self.evidence_version
    }
    /// <p>The free-text reviewer note attached to the evidence.</p>
    pub fn notes(&self) -> ::std::option::Option<&str> {
        self.notes.as_deref()
    }
    /// <p>The timestamp when the annotation was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
}
impl ::std::fmt::Debug for GetAnnotationOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetAnnotationOutput");
        formatter.field("environment_arn", &self.environment_arn);
        formatter.field("project", &self.project);
        formatter.field("framework", &self.framework);
        formatter.field("framework_version", &self.framework_version);
        formatter.field("control_id", &self.control_id);
        formatter.field("assessment_id", &self.assessment_id);
        formatter.field("evidence_id", &self.evidence_id);
        formatter.field("evidence_version", &self.evidence_version);
        formatter.field("notes", &"*** Sensitive Data Redacted ***");
        formatter.field("created_at", &self.created_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetAnnotationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAnnotationOutput {
    /// Creates a new builder-style object to manufacture [`GetAnnotationOutput`](crate::operation::get_annotation::GetAnnotationOutput).
    pub fn builder() -> crate::operation::get_annotation::builders::GetAnnotationOutputBuilder {
        crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::default()
    }
}

/// A builder for [`GetAnnotationOutput`](crate::operation::get_annotation::GetAnnotationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetAnnotationOutputBuilder {
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) project: ::std::option::Option<::std::string::String>,
    pub(crate) framework: ::std::option::Option<::std::string::String>,
    pub(crate) framework_version: ::std::option::Option<::std::string::String>,
    pub(crate) control_id: ::std::option::Option<::std::string::String>,
    pub(crate) assessment_id: ::std::option::Option<::std::string::String>,
    pub(crate) evidence_id: ::std::option::Option<::std::string::String>,
    pub(crate) evidence_version: ::std::option::Option<i32>,
    pub(crate) notes: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAnnotationOutputBuilder {
    /// <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 project.</p>
    /// This field is required.
    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.project = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the project.</p>
    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.project = input;
        self
    }
    /// <p>The name of the project.</p>
    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
        &self.project
    }
    /// <p>The name of the compliance framework.</p>
    /// This field is required.
    pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.framework = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the compliance framework.</p>
    pub fn set_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.framework = input;
        self
    }
    /// <p>The name of the compliance framework.</p>
    pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
        &self.framework
    }
    /// <p>The version of the compliance framework.</p>
    /// This field is required.
    pub fn framework_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.framework_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the compliance framework.</p>
    pub fn set_framework_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.framework_version = input;
        self
    }
    /// <p>The version of the compliance framework.</p>
    pub fn get_framework_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.framework_version
    }
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    /// This field is required.
    pub fn control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.control_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    pub fn set_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.control_id = input;
        self
    }
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    pub fn get_control_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.control_id
    }
    /// <p>The identifier of the assessment.</p>
    /// This field is required.
    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 of the assessment.</p>
    pub fn set_assessment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assessment_id = input;
        self
    }
    /// <p>The identifier of the assessment.</p>
    pub fn get_assessment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assessment_id
    }
    /// <p>The identifier of the evidence the annotation applies to.</p>
    /// This field is required.
    pub fn evidence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.evidence_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the evidence the annotation applies to.</p>
    pub fn set_evidence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.evidence_id = input;
        self
    }
    /// <p>The identifier of the evidence the annotation applies to.</p>
    pub fn get_evidence_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.evidence_id
    }
    /// <p>The version number of the evidence the annotation applies to.</p>
    /// This field is required.
    pub fn evidence_version(mut self, input: i32) -> Self {
        self.evidence_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The version number of the evidence the annotation applies to.</p>
    pub fn set_evidence_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.evidence_version = input;
        self
    }
    /// <p>The version number of the evidence the annotation applies to.</p>
    pub fn get_evidence_version(&self) -> &::std::option::Option<i32> {
        &self.evidence_version
    }
    /// <p>The free-text reviewer note attached to the evidence.</p>
    pub fn notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notes = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The free-text reviewer note attached to the evidence.</p>
    pub fn set_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notes = input;
        self
    }
    /// <p>The free-text reviewer note attached to the evidence.</p>
    pub fn get_notes(&self) -> &::std::option::Option<::std::string::String> {
        &self.notes
    }
    /// <p>The timestamp when the annotation was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the annotation was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp when the annotation was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetAnnotationOutput`](crate::operation::get_annotation::GetAnnotationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`environment_arn`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::environment_arn)
    /// - [`project`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::project)
    /// - [`framework`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::framework)
    /// - [`framework_version`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::framework_version)
    /// - [`control_id`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::control_id)
    /// - [`assessment_id`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::assessment_id)
    /// - [`evidence_id`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::evidence_id)
    /// - [`evidence_version`](crate::operation::get_annotation::builders::GetAnnotationOutputBuilder::evidence_version)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_annotation::GetAnnotationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_annotation::GetAnnotationOutput {
            environment_arn: self.environment_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_arn",
                    "environment_arn was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            project: self.project.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "project",
                    "project was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            framework: self.framework.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "framework",
                    "framework was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            framework_version: self.framework_version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "framework_version",
                    "framework_version was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            control_id: self.control_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "control_id",
                    "control_id was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            assessment_id: self.assessment_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "assessment_id",
                    "assessment_id was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            evidence_id: self.evidence_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "evidence_id",
                    "evidence_id was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            evidence_version: self.evidence_version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "evidence_version",
                    "evidence_version was not specified but it is required when building GetAnnotationOutput",
                )
            })?,
            notes: self.notes,
            created_at: self.created_at,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetAnnotationOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetAnnotationOutputBuilder");
        formatter.field("environment_arn", &self.environment_arn);
        formatter.field("project", &self.project);
        formatter.field("framework", &self.framework);
        formatter.field("framework_version", &self.framework_version);
        formatter.field("control_id", &self.control_id);
        formatter.field("assessment_id", &self.assessment_id);
        formatter.field("evidence_id", &self.evidence_id);
        formatter.field("evidence_version", &self.evidence_version);
        formatter.field("notes", &"*** Sensitive Data Redacted ***");
        formatter.field("created_at", &self.created_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}