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 EnableFrameworkOutput {
    /// <p>The name of the governance environment the framework belongs to.</p>
    pub environment: ::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::option::Option<::std::string::String>,
    /// <p>The name of the project.</p>
    pub project: ::std::string::String,
    /// <p>The type of the compliance framework.</p>
    pub r#type: crate::types::FrameworkType,
    /// <p>The way that assessments run for the framework. This field is empty if assessment modes aren't available for your account.</p>
    pub assessment_mode: ::std::option::Option<crate::types::AssessmentMode>,
    _request_id: Option<String>,
}
impl EnableFrameworkOutput {
    /// <p>The name of the governance environment the framework belongs to.</p>
    pub fn environment(&self) -> &str {
        use std::ops::Deref;
        self.environment.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) -> ::std::option::Option<&str> {
        self.framework_version.as_deref()
    }
    /// <p>The name of the project.</p>
    pub fn project(&self) -> &str {
        use std::ops::Deref;
        self.project.deref()
    }
    /// <p>The type of the compliance framework.</p>
    pub fn r#type(&self) -> &crate::types::FrameworkType {
        &self.r#type
    }
    /// <p>The way that assessments run for the framework. This field is empty if assessment modes aren't available for your account.</p>
    pub fn assessment_mode(&self) -> ::std::option::Option<&crate::types::AssessmentMode> {
        self.assessment_mode.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for EnableFrameworkOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl EnableFrameworkOutput {
    /// Creates a new builder-style object to manufacture [`EnableFrameworkOutput`](crate::operation::enable_framework::EnableFrameworkOutput).
    pub fn builder() -> crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder {
        crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder::default()
    }
}

/// A builder for [`EnableFrameworkOutput`](crate::operation::enable_framework::EnableFrameworkOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnableFrameworkOutputBuilder {
    pub(crate) environment: ::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) project: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::FrameworkType>,
    pub(crate) assessment_mode: ::std::option::Option<crate::types::AssessmentMode>,
    _request_id: Option<String>,
}
impl EnableFrameworkOutputBuilder {
    /// <p>The name of the governance environment the framework belongs to.</p>
    /// This field is required.
    pub fn environment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the governance environment the framework belongs to.</p>
    pub fn set_environment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment = input;
        self
    }
    /// <p>The name of the governance environment the framework belongs to.</p>
    pub fn get_environment(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment
    }
    /// <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>
    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 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 type of the compliance framework.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::FrameworkType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the compliance framework.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::FrameworkType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of the compliance framework.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::FrameworkType> {
        &self.r#type
    }
    /// <p>The way that assessments run for the framework. This field is empty if assessment modes aren't available for your account.</p>
    pub fn assessment_mode(mut self, input: crate::types::AssessmentMode) -> Self {
        self.assessment_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The way that assessments run for the framework. This field is empty if assessment modes aren't available for your account.</p>
    pub fn set_assessment_mode(mut self, input: ::std::option::Option<crate::types::AssessmentMode>) -> Self {
        self.assessment_mode = input;
        self
    }
    /// <p>The way that assessments run for the framework. This field is empty if assessment modes aren't available for your account.</p>
    pub fn get_assessment_mode(&self) -> &::std::option::Option<crate::types::AssessmentMode> {
        &self.assessment_mode
    }
    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 [`EnableFrameworkOutput`](crate::operation::enable_framework::EnableFrameworkOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`environment`](crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder::environment)
    /// - [`framework`](crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder::framework)
    /// - [`project`](crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder::project)
    /// - [`r#type`](crate::operation::enable_framework::builders::EnableFrameworkOutputBuilder::type)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::enable_framework::EnableFrameworkOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::enable_framework::EnableFrameworkOutput {
            environment: self.environment.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment",
                    "environment was not specified but it is required when building EnableFrameworkOutput",
                )
            })?,
            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 EnableFrameworkOutput",
                )
            })?,
            framework_version: self.framework_version,
            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 EnableFrameworkOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building EnableFrameworkOutput",
                )
            })?,
            assessment_mode: self.assessment_mode,
            _request_id: self._request_id,
        })
    }
}