aws-sdk-securityagent 1.2.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::add_artifact::_add_artifact_input::AddArtifactInputBuilder;

pub use crate::operation::add_artifact::_add_artifact_output::AddArtifactOutputBuilder;

impl crate::operation::add_artifact::builders::AddArtifactInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::add_artifact::AddArtifactOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::add_artifact::AddArtifactError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.add_artifact();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `AddArtifact`.
///
/// <p>Uploads an artifact to an agent space. Artifacts provide additional context for security testing, such as architecture diagrams, API specifications, or configuration files.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct AddArtifactFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::add_artifact::builders::AddArtifactInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::add_artifact::AddArtifactOutput,
        crate::operation::add_artifact::AddArtifactError,
    > for AddArtifactFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::add_artifact::AddArtifactOutput,
            crate::operation::add_artifact::AddArtifactError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl AddArtifactFluentBuilder {
    /// Creates a new `AddArtifactFluentBuilder`.
    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 AddArtifact as a reference.
    pub fn as_input(&self) -> &crate::operation::add_artifact::builders::AddArtifactInputBuilder {
        &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::add_artifact::AddArtifactOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::add_artifact::AddArtifactError,
            ::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::add_artifact::AddArtifact::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::add_artifact::AddArtifact::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::add_artifact::AddArtifactOutput,
        crate::operation::add_artifact::AddArtifactError,
        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 unique identifier of the agent space to add the artifact to.</p>
    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
    }
    /// <p>The unique identifier of the agent space to add the artifact to.</p>
    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
    }
    /// <p>The unique identifier of the agent space to add the artifact to.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_agent_space_id()
    }
    /// <p>The binary content of the artifact to upload.</p>
    pub fn artifact_content(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.inner = self.inner.artifact_content(input);
        self
    }
    /// <p>The binary content of the artifact to upload.</p>
    pub fn set_artifact_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.inner = self.inner.set_artifact_content(input);
        self
    }
    /// <p>The binary content of the artifact to upload.</p>
    pub fn get_artifact_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        self.inner.get_artifact_content()
    }
    /// <p>The file type of the artifact. Valid values include TXT, PNG, JPEG, MD, PDF, DOCX, DOC, JSON, and YAML.</p>
    pub fn artifact_type(mut self, input: crate::types::ArtifactType) -> Self {
        self.inner = self.inner.artifact_type(input);
        self
    }
    /// <p>The file type of the artifact. Valid values include TXT, PNG, JPEG, MD, PDF, DOCX, DOC, JSON, and YAML.</p>
    pub fn set_artifact_type(mut self, input: ::std::option::Option<crate::types::ArtifactType>) -> Self {
        self.inner = self.inner.set_artifact_type(input);
        self
    }
    /// <p>The file type of the artifact. Valid values include TXT, PNG, JPEG, MD, PDF, DOCX, DOC, JSON, and YAML.</p>
    pub fn get_artifact_type(&self) -> &::std::option::Option<crate::types::ArtifactType> {
        self.inner.get_artifact_type()
    }
    /// <p>The file name of the artifact.</p>
    pub fn file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.file_name(input.into());
        self
    }
    /// <p>The file name of the artifact.</p>
    pub fn set_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_file_name(input);
        self
    }
    /// <p>The file name of the artifact.</p>
    pub fn get_file_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_file_name()
    }
}