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.
pub use crate::operation::create_control::_create_control_input::CreateControlInputBuilder;

pub use crate::operation::create_control::_create_control_output::CreateControlOutputBuilder;

impl crate::operation::create_control::builders::CreateControlInputBuilder {
    /// 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_control::CreateControlOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_control::CreateControlError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_control();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateControl`.
///
/// <p>Creates a leaf control, which is a control with no child controls, in a custom framework.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateControlFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_control::builders::CreateControlInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_control::CreateControlOutput,
        crate::operation::create_control::CreateControlError,
    > for CreateControlFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_control::CreateControlOutput,
            crate::operation::create_control::CreateControlError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateControlFluentBuilder {
    /// Creates a new `CreateControlFluentBuilder`.
    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 CreateControl as a reference.
    pub fn as_input(&self) -> &crate::operation::create_control::builders::CreateControlInputBuilder {
        &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_control::CreateControlOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_control::CreateControlError,
            ::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_control::CreateControl::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_control::CreateControl::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_control::CreateControlOutput,
        crate::operation::create_control::CreateControlError,
        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 ARN of this governance environment.</p>
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.environment_arn(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.inner = self.inner.set_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.inner.get_environment_arn()
    }
    /// <p>The name of the compliance framework.</p>
    pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.framework(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.inner = self.inner.set_framework(input);
        self
    }
    /// <p>The name of the compliance framework.</p>
    pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_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.inner = self.inner.framework_version(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.inner = self.inner.set_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.inner.get_framework_version()
    }
    /// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
    pub fn control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.control_id(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.inner = self.inner.set_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.inner.get_control_id()
    }
    /// <p>The identifier of the parent control group.</p>
    pub fn parent_control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.parent_control_id(input.into());
        self
    }
    /// <p>The identifier of the parent control group.</p>
    pub fn set_parent_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_parent_control_id(input);
        self
    }
    /// <p>The identifier of the parent control group.</p>
    pub fn get_parent_control_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_parent_control_id()
    }
    /// <p>The display name for the control.</p>
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.title(input.into());
        self
    }
    /// <p>The display name for the control.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_title(input);
        self
    }
    /// <p>The display name for the control.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_title()
    }
    /// <p>A description of the control.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of the control.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of the control.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    ///
    /// Appends an item to `requirements`.
    ///
    /// To override the contents of this collection use [`set_requirements`](Self::set_requirements).
    ///
    /// <p>The individual checks an assessment scores for this control. Assign each one an <code>id</code> that findings, assessment results, and remediation tasks reference.</p>
    pub fn requirements(mut self, input: crate::types::Requirement) -> Self {
        self.inner = self.inner.requirements(input);
        self
    }
    /// <p>The individual checks an assessment scores for this control. Assign each one an <code>id</code> that findings, assessment results, and remediation tasks reference.</p>
    pub fn set_requirements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Requirement>>) -> Self {
        self.inner = self.inner.set_requirements(input);
        self
    }
    /// <p>The individual checks an assessment scores for this control. Assign each one an <code>id</code> that findings, assessment results, and remediation tasks reference.</p>
    pub fn get_requirements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Requirement>> {
        self.inner.get_requirements()
    }
    /// <p>The ordering key that determines the display sequence within the framework.</p>
    pub fn display_order(mut self, input: i32) -> Self {
        self.inner = self.inner.display_order(input);
        self
    }
    /// <p>The ordering key that determines the display sequence within the framework.</p>
    pub fn set_display_order(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_display_order(input);
        self
    }
    /// <p>The ordering key that determines the display sequence within the framework.</p>
    pub fn get_display_order(&self) -> &::std::option::Option<i32> {
        self.inner.get_display_order()
    }
    ///
    /// Appends an item to `controlIntents`.
    ///
    /// To override the contents of this collection use [`set_control_intents`](Self::set_control_intents).
    ///
    /// <p>The technical control intents that classify how an assessment evaluates this leaf control. Supplying at least one intent makes the control eligible for automated scanning. Leaf controls only.</p>
    pub fn control_intents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.control_intents(input.into());
        self
    }
    /// <p>The technical control intents that classify how an assessment evaluates this leaf control. Supplying at least one intent makes the control eligible for automated scanning. Leaf controls only.</p>
    pub fn set_control_intents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_control_intents(input);
        self
    }
    /// <p>The technical control intents that classify how an assessment evaluates this leaf control. Supplying at least one intent makes the control eligible for automated scanning. Leaf controls only.</p>
    pub fn get_control_intents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_control_intents()
    }
    /// <p>The optional evaluation workflow type. When omitted and controlIntents are present, the service defaults this to automated-scan. Leaf controls only.</p>
    pub fn workflow_type(mut self, input: crate::types::WorkflowType) -> Self {
        self.inner = self.inner.workflow_type(input);
        self
    }
    /// <p>The optional evaluation workflow type. When omitted and controlIntents are present, the service defaults this to automated-scan. Leaf controls only.</p>
    pub fn set_workflow_type(mut self, input: ::std::option::Option<crate::types::WorkflowType>) -> Self {
        self.inner = self.inner.set_workflow_type(input);
        self
    }
    /// <p>The optional evaluation workflow type. When omitted and controlIntents are present, the service defaults this to automated-scan. Leaf controls only.</p>
    pub fn get_workflow_type(&self) -> &::std::option::Option<crate::types::WorkflowType> {
        self.inner.get_workflow_type()
    }
}