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::put_evidence::_put_evidence_input::PutEvidenceInputBuilder;

pub use crate::operation::put_evidence::_put_evidence_output::PutEvidenceOutputBuilder;

impl crate::operation::put_evidence::builders::PutEvidenceInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_evidence::PutEvidenceOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_evidence::PutEvidenceError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_evidence();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutEvidence`.
///
/// <p>Adds evidence to support a compliance assessment. To add a new version of existing evidence, specify <code>evidenceId</code>.</p>
/// <p>Provide either the file content in <code>content</code> or a link to the document in <code>reference</code>, but not both.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutEvidenceFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_evidence::builders::PutEvidenceInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_evidence::PutEvidenceOutput,
        crate::operation::put_evidence::PutEvidenceError,
    > for PutEvidenceFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_evidence::PutEvidenceOutput,
            crate::operation::put_evidence::PutEvidenceError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutEvidenceFluentBuilder {
    /// Creates a new `PutEvidenceFluentBuilder`.
    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 PutEvidence as a reference.
    pub fn as_input(&self) -> &crate::operation::put_evidence::builders::PutEvidenceInputBuilder {
        &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::put_evidence::PutEvidenceOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_evidence::PutEvidenceError,
            ::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::put_evidence::PutEvidence::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_evidence::PutEvidence::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::put_evidence::PutEvidenceOutput,
        crate::operation::put_evidence::PutEvidenceError,
        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 Amazon Resource Name (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 Amazon Resource Name (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 Amazon Resource Name (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 file content. Required for a direct upload. You can't specify both <code>content</code> and <code>reference</code>.</p>
    pub fn content(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.inner = self.inner.content(input);
        self
    }
    /// <p>The file content. Required for a direct upload. You can't specify both <code>content</code> and <code>reference</code>.</p>
    pub fn set_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.inner = self.inner.set_content(input);
        self
    }
    /// <p>The file content. Required for a direct upload. You can't specify both <code>content</code> and <code>reference</code>.</p>
    pub fn get_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        self.inner.get_content()
    }
    /// <p>The title of the evidence. When you create new evidence, AWS Assurance derives the evidence ID from the title, in the form <code>assurance://{sanitized-title}</code>.</p>
    /// <p>Required when you specify <code>content</code>. Optional when you specify <code>reference</code>. If you omit it, AWS Assurance uses the name of the referenced document.</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 title of the evidence. When you create new evidence, AWS Assurance derives the evidence ID from the title, in the form <code>assurance://{sanitized-title}</code>.</p>
    /// <p>Required when you specify <code>content</code>. Optional when you specify <code>reference</code>. If you omit it, AWS Assurance uses the name of the referenced document.</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 title of the evidence. When you create new evidence, AWS Assurance derives the evidence ID from the title, in the form <code>assurance://{sanitized-title}</code>.</p>
    /// <p>Required when you specify <code>content</code>. Optional when you specify <code>reference</code>. If you omit it, AWS Assurance uses the name of the referenced document.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_title()
    }
    /// <p>The optional description of the evidence.</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 evidence.</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 evidence.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The ID of existing evidence. Specify it to add a new version of that evidence. Omit it to create new evidence.</p>
    pub fn evidence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.evidence_id(input.into());
        self
    }
    /// <p>The ID of existing evidence. Specify it to add a new version of that evidence. Omit it to create new evidence.</p>
    pub fn set_evidence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_evidence_id(input);
        self
    }
    /// <p>The ID of existing evidence. Specify it to add a new version of that evidence. Omit it to create new evidence.</p>
    pub fn get_evidence_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_evidence_id()
    }
    /// <p>The declared Multipurpose Internet Mail Extensions (MIME) type of the file, for example <code>application/pdf</code>. AWS Assurance checks the declared type against the actual file content. For the list of registered types, see <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">Media Types</a> on the IANA website.</p>
    pub fn content_mime_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.content_mime_type(input.into());
        self
    }
    /// <p>The declared Multipurpose Internet Mail Extensions (MIME) type of the file, for example <code>application/pdf</code>. AWS Assurance checks the declared type against the actual file content. For the list of registered types, see <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">Media Types</a> on the IANA website.</p>
    pub fn set_content_mime_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_content_mime_type(input);
        self
    }
    /// <p>The declared Multipurpose Internet Mail Extensions (MIME) type of the file, for example <code>application/pdf</code>. AWS Assurance checks the declared type against the actual file content. For the list of registered types, see <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">Media Types</a> on the IANA website.</p>
    pub fn get_content_mime_type(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_content_mime_type()
    }
    /// <p>Project scope for the evidence.</p>
    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.project(input.into());
        self
    }
    /// <p>Project scope for the evidence.</p>
    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_project(input);
        self
    }
    /// <p>Project scope for the evidence.</p>
    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_project()
    }
    /// <p>A link to the document. You can't specify both <code>reference</code> and <code>content</code>. Supported formats:</p>
    /// <ul>
    /// <li>
    /// <p>For a file in GitHub, a link in the form https://github.com/{owner}/{repo}/blob/{ref}/{path}.</p></li>
    /// <li>
    /// <p>For a document in SharePoint, any link to the document in the form https://{tenant}.sharepoint.com/{path}, including a sharing link.</p></li>
    /// <li>
    /// <p>For an object in Amazon S3, a URI in the form s3://{bucket}/{key}. The bucket must be the evidence bucket configured for the environment.</p></li>
    /// </ul>
    pub fn reference(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.reference(input.into());
        self
    }
    /// <p>A link to the document. You can't specify both <code>reference</code> and <code>content</code>. Supported formats:</p>
    /// <ul>
    /// <li>
    /// <p>For a file in GitHub, a link in the form https://github.com/{owner}/{repo}/blob/{ref}/{path}.</p></li>
    /// <li>
    /// <p>For a document in SharePoint, any link to the document in the form https://{tenant}.sharepoint.com/{path}, including a sharing link.</p></li>
    /// <li>
    /// <p>For an object in Amazon S3, a URI in the form s3://{bucket}/{key}. The bucket must be the evidence bucket configured for the environment.</p></li>
    /// </ul>
    pub fn set_reference(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_reference(input);
        self
    }
    /// <p>A link to the document. You can't specify both <code>reference</code> and <code>content</code>. Supported formats:</p>
    /// <ul>
    /// <li>
    /// <p>For a file in GitHub, a link in the form https://github.com/{owner}/{repo}/blob/{ref}/{path}.</p></li>
    /// <li>
    /// <p>For a document in SharePoint, any link to the document in the form https://{tenant}.sharepoint.com/{path}, including a sharing link.</p></li>
    /// <li>
    /// <p>For an object in Amazon S3, a URI in the form s3://{bucket}/{key}. The bucket must be the evidence bucket configured for the environment.</p></li>
    /// </ul>
    pub fn get_reference(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_reference()
    }
    /// <p>The ID of the connection to read <code>reference</code> through, as returned by <code>ListEnvironmentConnections</code>. Each new version of the document uses this connection too.</p>
    /// <p>Use this parameter only with <code>reference</code>.</p>
    /// <p>If you omit this parameter, the operation uses the single connection that can read the document. If the environment has more than one connection to the same provider, specify this parameter.</p>
    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.connection_id(input.into());
        self
    }
    /// <p>The ID of the connection to read <code>reference</code> through, as returned by <code>ListEnvironmentConnections</code>. Each new version of the document uses this connection too.</p>
    /// <p>Use this parameter only with <code>reference</code>.</p>
    /// <p>If you omit this parameter, the operation uses the single connection that can read the document. If the environment has more than one connection to the same provider, specify this parameter.</p>
    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_connection_id(input);
        self
    }
    /// <p>The ID of the connection to read <code>reference</code> through, as returned by <code>ListEnvironmentConnections</code>. Each new version of the document uses this connection too.</p>
    /// <p>Use this parameter only with <code>reference</code>.</p>
    /// <p>If you omit this parameter, the operation uses the single connection that can read the document. If the environment has more than one connection to the same provider, specify this parameter.</p>
    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_connection_id()
    }
    ///
    /// Appends an item to `controlReferences`.
    ///
    /// To override the contents of this collection use [`set_control_references`](Self::set_control_references).
    ///
    /// <p>The controls to link the evidence to when you add it. You can specify control links only when <code>purpose</code> is <code>CONTROL_EVIDENCE</code>.</p>
    pub fn control_references(mut self, input: crate::types::ControlReference) -> Self {
        self.inner = self.inner.control_references(input);
        self
    }
    /// <p>The controls to link the evidence to when you add it. You can specify control links only when <code>purpose</code> is <code>CONTROL_EVIDENCE</code>.</p>
    pub fn set_control_references(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlReference>>) -> Self {
        self.inner = self.inner.set_control_references(input);
        self
    }
    /// <p>The controls to link the evidence to when you add it. You can specify control links only when <code>purpose</code> is <code>CONTROL_EVIDENCE</code>.</p>
    pub fn get_control_references(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlReference>> {
        self.inner.get_control_references()
    }
    /// <p>Specifies whether AWS Assurance analyzes the evidence and links it to relevant controls. A link shows that the evidence is relevant to a control, not that you meet the control. An assessment determines whether you meet the control. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>AUTO</code> – AWS Assurance analyzes the evidence and adds control links.</p></li>
    /// <li>
    /// <p><code>MANUAL</code> – AWS Assurance doesn't analyze the evidence. You add control links yourself.</p></li>
    /// </ul>
    /// <p>Automatic linking is available only to some accounts during the preview. If you omit this parameter, the default is <code>AUTO</code> for those accounts and <code>MANUAL</code> for all other accounts. Evidence whose <code>purpose</code> isn't <code>CONTROL_EVIDENCE</code> always has the mode <code>DISABLED</code>, which means that it can't be linked to controls. You can't specify <code>AUTO</code> for that evidence.</p>
    pub fn link_mode(mut self, input: crate::types::LinkMode) -> Self {
        self.inner = self.inner.link_mode(input);
        self
    }
    /// <p>Specifies whether AWS Assurance analyzes the evidence and links it to relevant controls. A link shows that the evidence is relevant to a control, not that you meet the control. An assessment determines whether you meet the control. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>AUTO</code> – AWS Assurance analyzes the evidence and adds control links.</p></li>
    /// <li>
    /// <p><code>MANUAL</code> – AWS Assurance doesn't analyze the evidence. You add control links yourself.</p></li>
    /// </ul>
    /// <p>Automatic linking is available only to some accounts during the preview. If you omit this parameter, the default is <code>AUTO</code> for those accounts and <code>MANUAL</code> for all other accounts. Evidence whose <code>purpose</code> isn't <code>CONTROL_EVIDENCE</code> always has the mode <code>DISABLED</code>, which means that it can't be linked to controls. You can't specify <code>AUTO</code> for that evidence.</p>
    pub fn set_link_mode(mut self, input: ::std::option::Option<crate::types::LinkMode>) -> Self {
        self.inner = self.inner.set_link_mode(input);
        self
    }
    /// <p>Specifies whether AWS Assurance analyzes the evidence and links it to relevant controls. A link shows that the evidence is relevant to a control, not that you meet the control. An assessment determines whether you meet the control. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>AUTO</code> – AWS Assurance analyzes the evidence and adds control links.</p></li>
    /// <li>
    /// <p><code>MANUAL</code> – AWS Assurance doesn't analyze the evidence. You add control links yourself.</p></li>
    /// </ul>
    /// <p>Automatic linking is available only to some accounts during the preview. If you omit this parameter, the default is <code>AUTO</code> for those accounts and <code>MANUAL</code> for all other accounts. Evidence whose <code>purpose</code> isn't <code>CONTROL_EVIDENCE</code> always has the mode <code>DISABLED</code>, which means that it can't be linked to controls. You can't specify <code>AUTO</code> for that evidence.</p>
    pub fn get_link_mode(&self) -> &::std::option::Option<crate::types::LinkMode> {
        self.inner.get_link_mode()
    }
    /// <p>What the evidence is for. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTROL_EVIDENCE</code> – Evidence that supports controls.</p></li>
    /// <li>
    /// <p><code>FRAMEWORK_SOURCE</code> – The document that you create a custom framework from. AWS Assurance never links this evidence to controls.</p></li>
    /// </ul>
    /// <p>You can't specify <code>SCAN_EVIDENCE</code>. If you omit this parameter, a new version keeps the purpose of the existing evidence, and new evidence uses <code>CONTROL_EVIDENCE</code>. You can't change the purpose in a new version.</p>
    pub fn purpose(mut self, input: crate::types::EvidencePurpose) -> Self {
        self.inner = self.inner.purpose(input);
        self
    }
    /// <p>What the evidence is for. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTROL_EVIDENCE</code> – Evidence that supports controls.</p></li>
    /// <li>
    /// <p><code>FRAMEWORK_SOURCE</code> – The document that you create a custom framework from. AWS Assurance never links this evidence to controls.</p></li>
    /// </ul>
    /// <p>You can't specify <code>SCAN_EVIDENCE</code>. If you omit this parameter, a new version keeps the purpose of the existing evidence, and new evidence uses <code>CONTROL_EVIDENCE</code>. You can't change the purpose in a new version.</p>
    pub fn set_purpose(mut self, input: ::std::option::Option<crate::types::EvidencePurpose>) -> Self {
        self.inner = self.inner.set_purpose(input);
        self
    }
    /// <p>What the evidence is for. Specify one of the following values:</p>
    /// <ul>
    /// <li>
    /// <p><code>CONTROL_EVIDENCE</code> – Evidence that supports controls.</p></li>
    /// <li>
    /// <p><code>FRAMEWORK_SOURCE</code> – The document that you create a custom framework from. AWS Assurance never links this evidence to controls.</p></li>
    /// </ul>
    /// <p>You can't specify <code>SCAN_EVIDENCE</code>. If you omit this parameter, a new version keeps the purpose of the existing evidence, and new evidence uses <code>CONTROL_EVIDENCE</code>. You can't change the purpose in a new version.</p>
    pub fn get_purpose(&self) -> &::std::option::Option<crate::types::EvidencePurpose> {
        self.inner.get_purpose()
    }
}