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.
pub use crate::operation::create_assessment::_create_assessment_input::CreateAssessmentInputBuilder;

pub use crate::operation::create_assessment::_create_assessment_output::CreateAssessmentOutputBuilder;

impl crate::operation::create_assessment::builders::CreateAssessmentInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_assessment::CreateAssessmentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_assessment::CreateAssessmentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_assessment();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAssessment`.
///
/// <p>Creates an assessment in Audit Manager.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAssessmentFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_assessment::builders::CreateAssessmentInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_assessment::CreateAssessmentOutput,
        crate::operation::create_assessment::CreateAssessmentError,
    > for CreateAssessmentFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_assessment::CreateAssessmentOutput,
            crate::operation::create_assessment::CreateAssessmentError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAssessmentFluentBuilder {
    /// Creates a new `CreateAssessmentFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateAssessment as a reference.
    pub fn as_input(&self) -> &crate::operation::create_assessment::builders::CreateAssessmentInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_assessment::CreateAssessmentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_assessment::CreateAssessmentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_assessment::CreateAssessment::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_assessment::CreateAssessment::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_assessment::CreateAssessmentOutput,
        crate::operation::create_assessment::CreateAssessmentError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name of the assessment to be created.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the assessment to be created.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the assessment to be created.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The optional description of the assessment to be created.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>The optional description of the assessment to be created.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>The optional description of the assessment to be created.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The assessment report storage destination for the assessment that's being created.</p>
    pub fn assessment_reports_destination(mut self, input: crate::types::AssessmentReportsDestination) -> Self {
        self.inner = self.inner.assessment_reports_destination(input);
        self
    }
    /// <p>The assessment report storage destination for the assessment that's being created.</p>
    pub fn set_assessment_reports_destination(mut self, input: ::std::option::Option<crate::types::AssessmentReportsDestination>) -> Self {
        self.inner = self.inner.set_assessment_reports_destination(input);
        self
    }
    /// <p>The assessment report storage destination for the assessment that's being created.</p>
    pub fn get_assessment_reports_destination(&self) -> &::std::option::Option<crate::types::AssessmentReportsDestination> {
        self.inner.get_assessment_reports_destination()
    }
    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
    /// </note>
    pub fn scope(mut self, input: crate::types::Scope) -> Self {
        self.inner = self.inner.scope(input);
        self
    }
    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
    /// </note>
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
        self.inner = self.inner.set_scope(input);
        self
    }
    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
    /// </note>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
        self.inner.get_scope()
    }
    ///
    /// Appends an item to `roles`.
    ///
    /// To override the contents of this collection use [`set_roles`](Self::set_roles).
    ///
    /// <p>The list of roles for the assessment.</p>
    pub fn roles(mut self, input: crate::types::Role) -> Self {
        self.inner = self.inner.roles(input);
        self
    }
    /// <p>The list of roles for the assessment.</p>
    pub fn set_roles(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Role>>) -> Self {
        self.inner = self.inner.set_roles(input);
        self
    }
    /// <p>The list of roles for the assessment.</p>
    pub fn get_roles(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Role>> {
        self.inner.get_roles()
    }
    /// <p>The identifier for the framework that the assessment will be created from.</p>
    pub fn framework_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.framework_id(input.into());
        self
    }
    /// <p>The identifier for the framework that the assessment will be created from.</p>
    pub fn set_framework_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_framework_id(input);
        self
    }
    /// <p>The identifier for the framework that the assessment will be created from.</p>
    pub fn get_framework_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_framework_id()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags that are associated with the assessment.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>The tags that are associated with the assessment.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The tags that are associated with the assessment.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}