// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::batch_update_findings_v2::_batch_update_findings_v2_input::BatchUpdateFindingsV2InputBuilder;
pub use crate::operation::batch_update_findings_v2::_batch_update_findings_v2_output::BatchUpdateFindingsV2OutputBuilder;
impl crate::operation::batch_update_findings_v2::builders::BatchUpdateFindingsV2InputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Output,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Error,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.batch_update_findings_v2();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `BatchUpdateFindingsV2`.
///
/// <p>Updates information about a customer's investigation into a finding. Delegated administrator accounts can update findings for their account and their member accounts. Member accounts can update findings for their own account.</p>
/// <p><code>BatchUpdateFindings</code> and <code>BatchUpdateFindingsV2</code> both use <code>securityhub:BatchUpdateFindings</code> in the <code>Action</code> element of an IAM policy statement. You must have permission to perform the <code>securityhub:BatchUpdateFindings</code> action. You can configure IAM policies to restrict access to specific finding fields or field values by using the <code>securityhub:OCSFSyntaxPath/<fieldname></fieldname></code> condition key, where <code><fieldname></fieldname></code> is one of the following supported fields: <code>SeverityId</code>, <code>StatusId</code>, or <code>Comment</code>.</p>
/// <p>To prevent a user from updating a specific field, use a <code>Null</code> condition with <code>securityhub:OCSFSyntaxPath/<fieldname></fieldname></code> set to <code>"false"</code>. To prevent a user from setting a field to a specific value, use a <code>StringEquals</code> condition with <code>securityhub:OCSFSyntaxPath/<fieldname></fieldname></code> set to the disallowed value or list of values.</p>
/// <p>Updates from <code>BatchUpdateFindingsV2</code> don't affect the value of <code>finding_info.modified_time</code>, <code>finding_info.modified_time_dt</code>, <code>time</code>, or <code>time_dt</code> for a finding.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct BatchUpdateFindingsV2FluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::batch_update_findings_v2::builders::BatchUpdateFindingsV2InputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Output,
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Error,
> for BatchUpdateFindingsV2FluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Output,
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Error,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl BatchUpdateFindingsV2FluentBuilder {
/// Creates a new `BatchUpdateFindingsV2FluentBuilder`.
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 BatchUpdateFindingsV2 as a reference.
pub fn as_input(&self) -> &crate::operation::batch_update_findings_v2::builders::BatchUpdateFindingsV2InputBuilder {
&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::batch_update_findings_v2::BatchUpdateFindingsV2Output,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Error,
::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::batch_update_findings_v2::BatchUpdateFindingsV2::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2::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::batch_update_findings_v2::BatchUpdateFindingsV2Output,
crate::operation::batch_update_findings_v2::BatchUpdateFindingsV2Error,
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
}
///
/// Appends an item to `MetadataUids`.
///
/// To override the contents of this collection use [`set_metadata_uids`](Self::set_metadata_uids).
///
/// <p>The list of finding <code>metadata.uid</code> to indicate findings to update. Finding <code>metadata.uid</code> is a globally unique identifier associated with the finding. Customers cannot use <code>MetadataUids</code> together with <code>FindingIdentifiers</code>.</p>
pub fn metadata_uids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.metadata_uids(input.into());
self
}
/// <p>The list of finding <code>metadata.uid</code> to indicate findings to update. Finding <code>metadata.uid</code> is a globally unique identifier associated with the finding. Customers cannot use <code>MetadataUids</code> together with <code>FindingIdentifiers</code>.</p>
pub fn set_metadata_uids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_metadata_uids(input);
self
}
/// <p>The list of finding <code>metadata.uid</code> to indicate findings to update. Finding <code>metadata.uid</code> is a globally unique identifier associated with the finding. Customers cannot use <code>MetadataUids</code> together with <code>FindingIdentifiers</code>.</p>
pub fn get_metadata_uids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_metadata_uids()
}
///
/// Appends an item to `FindingIdentifiers`.
///
/// To override the contents of this collection use [`set_finding_identifiers`](Self::set_finding_identifiers).
///
/// <p>Provides information to identify a specific V2 finding.</p>
pub fn finding_identifiers(mut self, input: crate::types::OcsfFindingIdentifier) -> Self {
self.inner = self.inner.finding_identifiers(input);
self
}
/// <p>Provides information to identify a specific V2 finding.</p>
pub fn set_finding_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OcsfFindingIdentifier>>) -> Self {
self.inner = self.inner.set_finding_identifiers(input);
self
}
/// <p>Provides information to identify a specific V2 finding.</p>
pub fn get_finding_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OcsfFindingIdentifier>> {
self.inner.get_finding_identifiers()
}
/// <p>The updated value for a user provided comment about the finding. Minimum character length 1. Maximum character length 512.</p>
pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.comment(input.into());
self
}
/// <p>The updated value for a user provided comment about the finding. Minimum character length 1. Maximum character length 512.</p>
pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_comment(input);
self
}
/// <p>The updated value for a user provided comment about the finding. Minimum character length 1. Maximum character length 512.</p>
pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_comment()
}
/// <p>The updated value for the normalized severity identifier. The severity ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 6, 99\]. When customer provides the updated severity ID, the string sibling severity will automatically be updated in the finding.</p>
pub fn severity_id(mut self, input: i32) -> Self {
self.inner = self.inner.severity_id(input);
self
}
/// <p>The updated value for the normalized severity identifier. The severity ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 6, 99\]. When customer provides the updated severity ID, the string sibling severity will automatically be updated in the finding.</p>
pub fn set_severity_id(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_severity_id(input);
self
}
/// <p>The updated value for the normalized severity identifier. The severity ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 6, 99\]. When customer provides the updated severity ID, the string sibling severity will automatically be updated in the finding.</p>
pub fn get_severity_id(&self) -> &::std::option::Option<i32> {
self.inner.get_severity_id()
}
/// <p>The updated value for the normalized status identifier. The status ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 99\]. When customer provides the updated status ID, the string sibling status will automatically be updated in the finding.</p>
pub fn status_id(mut self, input: i32) -> Self {
self.inner = self.inner.status_id(input);
self
}
/// <p>The updated value for the normalized status identifier. The status ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 99\]. When customer provides the updated status ID, the string sibling status will automatically be updated in the finding.</p>
pub fn set_status_id(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_status_id(input);
self
}
/// <p>The updated value for the normalized status identifier. The status ID is an integer with the allowed enum values \[0, 1, 2, 3, 4, 5, 99\]. When customer provides the updated status ID, the string sibling status will automatically be updated in the finding.</p>
pub fn get_status_id(&self) -> &::std::option::Option<i32> {
self.inner.get_status_id()
}
}