aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_pentest::_create_pentest_input::CreatePentestInputBuilder;

pub use crate::operation::create_pentest::_create_pentest_output::CreatePentestOutputBuilder;

impl crate::operation::create_pentest::builders::CreatePentestInputBuilder {
    /// 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_pentest::CreatePentestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_pentest::CreatePentestError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_pentest();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreatePentest`.
///
/// Creates a new pentest configuration
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreatePentestFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_pentest::builders::CreatePentestInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_pentest::CreatePentestOutput,
        crate::operation::create_pentest::CreatePentestError,
    > for CreatePentestFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_pentest::CreatePentestOutput,
            crate::operation::create_pentest::CreatePentestError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreatePentestFluentBuilder {
    /// Creates a new `CreatePentestFluentBuilder`.
    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 CreatePentest as a reference.
    pub fn as_input(&self) -> &crate::operation::create_pentest::builders::CreatePentestInputBuilder {
        &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_pentest::CreatePentestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_pentest::CreatePentestError,
            ::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_pentest::CreatePentest::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_pentest::CreatePentest::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_pentest::CreatePentestOutput,
        crate::operation::create_pentest::CreatePentestError,
        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
    }
    /// Title of the pentest
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.title(input.into());
        self
    }
    /// Title of the pentest
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_title(input);
        self
    }
    /// Title of the pentest
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_title()
    }
    /// ID of the agent space where the pentest should be created
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.agent_space_id(input.into());
        self
    }
    /// ID of the agent space where the pentest should be created
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_agent_space_id(input);
        self
    }
    /// ID of the agent space where the pentest should be created
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_agent_space_id()
    }
    /// Assets to be tested during the pentest
    pub fn assets(mut self, input: crate::types::Assets) -> Self {
        self.inner = self.inner.assets(input);
        self
    }
    /// Assets to be tested during the pentest
    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
        self.inner = self.inner.set_assets(input);
        self
    }
    /// Assets to be tested during the pentest
    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
        self.inner.get_assets()
    }
    ///
    /// Appends an item to `excludeRiskTypes`.
    ///
    /// To override the contents of this collection use [`set_exclude_risk_types`](Self::set_exclude_risk_types).
    ///
    /// A list of risk types excluded from the pentest execution
    pub fn exclude_risk_types(mut self, input: crate::types::RiskType) -> Self {
        self.inner = self.inner.exclude_risk_types(input);
        self
    }
    /// A list of risk types excluded from the pentest execution
    pub fn set_exclude_risk_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>) -> Self {
        self.inner = self.inner.set_exclude_risk_types(input);
        self
    }
    /// A list of risk types excluded from the pentest execution
    pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
        self.inner.get_exclude_risk_types()
    }
    /// Service role ARN for accessing customer resources
    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.service_role(input.into());
        self
    }
    /// Service role ARN for accessing customer resources
    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_service_role(input);
        self
    }
    /// Service role ARN for accessing customer resources
    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_service_role()
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
        self.inner = self.inner.log_config(input);
        self
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
        self.inner = self.inner.set_log_config(input);
        self
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
        self.inner.get_log_config()
    }
    /// VPC configuration that the Security Agent accesses
    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
        self.inner = self.inner.vpc_config(input);
        self
    }
    /// VPC configuration that the Security Agent accesses
    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
        self.inner = self.inner.set_vpc_config(input);
        self
    }
    /// VPC configuration that the Security Agent accesses
    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
        self.inner.get_vpc_config()
    }
    /// Configuration for network traffic filtering
    pub fn network_traffic_config(mut self, input: crate::types::NetworkTrafficConfig) -> Self {
        self.inner = self.inner.network_traffic_config(input);
        self
    }
    /// Configuration for network traffic filtering
    pub fn set_network_traffic_config(mut self, input: ::std::option::Option<crate::types::NetworkTrafficConfig>) -> Self {
        self.inner = self.inner.set_network_traffic_config(input);
        self
    }
    /// Configuration for network traffic filtering
    pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
        self.inner.get_network_traffic_config()
    }
    /// Strategy for code remediation on findings
    pub fn code_remediation_strategy(mut self, input: crate::types::CodeRemediationStrategy) -> Self {
        self.inner = self.inner.code_remediation_strategy(input);
        self
    }
    /// Strategy for code remediation on findings
    pub fn set_code_remediation_strategy(mut self, input: ::std::option::Option<crate::types::CodeRemediationStrategy>) -> Self {
        self.inner = self.inner.set_code_remediation_strategy(input);
        self
    }
    /// Strategy for code remediation on findings
    pub fn get_code_remediation_strategy(&self) -> &::std::option::Option<crate::types::CodeRemediationStrategy> {
        self.inner.get_code_remediation_strategy()
    }
}