// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_code_finding::_create_code_finding_input::CreateCodeFindingInputBuilder;
pub use crate::operation::create_code_finding::_create_code_finding_output::CreateCodeFindingOutputBuilder;
impl crate::operation::create_code_finding::builders::CreateCodeFindingInputBuilder {
/// 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_code_finding::CreateCodeFindingOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_code_finding::CreateCodeFindingError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_code_finding();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateCodeFinding`.
///
/// Ingests a customer-supplied security finding into an environment. Continuum validates the document synchronously against the required overlay fields for the declared format; invalid documents are rejected with a ValidationException. The maximum accepted document size is 256 KB. The environment must have a source configured, and the finding must identify a code location so Continuum can tie it to a repository in the environment's build. Continuum assigns a findingId and stores the verbatim document. When no successful build yet contains the finding's repository, the finding stays SUBMITTED until the next successful build; if that build does not contain it either, the finding is DISCARDED with discardReason SOURCE_REPO_NOT_FOUND.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateCodeFindingFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_code_finding::builders::CreateCodeFindingInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_code_finding::CreateCodeFindingOutput,
crate::operation::create_code_finding::CreateCodeFindingError,
> for CreateCodeFindingFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_code_finding::CreateCodeFindingOutput,
crate::operation::create_code_finding::CreateCodeFindingError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateCodeFindingFluentBuilder {
/// Creates a new `CreateCodeFindingFluentBuilder`.
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 CreateCodeFinding as a reference.
pub fn as_input(&self) -> &crate::operation::create_code_finding::builders::CreateCodeFindingInputBuilder {
&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_code_finding::CreateCodeFindingOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_code_finding::CreateCodeFindingError,
::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_code_finding::CreateCodeFinding::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_code_finding::CreateCodeFinding::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_code_finding::CreateCodeFindingOutput,
crate::operation::create_code_finding::CreateCodeFindingError,
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
}
/// The environment to ingest the finding into.
pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.environment_id(input.into());
self
}
/// The environment to ingest the finding into.
pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_environment_id(input);
self
}
/// The environment to ingest the finding into.
pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_environment_id()
}
/// The OCSF finding document to ingest, verbatim. Must declare a class_uid Continuum supports (2002 Vulnerability Finding, or 2007 Application Security Posture Finding) and validate against the vendored OCSF JSON Schema for that class, including the Continuum overlay requirements that finding_info.uid be present and that vulnerabilities\[0\].affected_code\[0\].file identify the code location. With several repositories in the environment, the file path must begin with the repository name. Maximum size 256 KB. Stored verbatim and normalized into the typed Finding members returned by GetCodeFinding. GetCodeFinding does not return the document itself.
pub fn ocsf_document(mut self, input: ::aws_smithy_types::Document) -> Self {
self.inner = self.inner.ocsf_document(input);
self
}
/// The OCSF finding document to ingest, verbatim. Must declare a class_uid Continuum supports (2002 Vulnerability Finding, or 2007 Application Security Posture Finding) and validate against the vendored OCSF JSON Schema for that class, including the Continuum overlay requirements that finding_info.uid be present and that vulnerabilities\[0\].affected_code\[0\].file identify the code location. With several repositories in the environment, the file path must begin with the repository name. Maximum size 256 KB. Stored verbatim and normalized into the typed Finding members returned by GetCodeFinding. GetCodeFinding does not return the document itself.
pub fn set_ocsf_document(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.inner = self.inner.set_ocsf_document(input);
self
}
/// The OCSF finding document to ingest, verbatim. Must declare a class_uid Continuum supports (2002 Vulnerability Finding, or 2007 Application Security Posture Finding) and validate against the vendored OCSF JSON Schema for that class, including the Continuum overlay requirements that finding_info.uid be present and that vulnerabilities\[0\].affected_code\[0\].file identify the code location. With several repositories in the environment, the file path must begin with the repository name. Maximum size 256 KB. Stored verbatim and normalized into the typed Finding members returned by GetCodeFinding. GetCodeFinding does not return the document itself.
pub fn get_ocsf_document(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
self.inner.get_ocsf_document()
}
/// Caller-provided idempotency token. A retry with the same token and an identical finding document replays the original result; the same token with different content is rejected.
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// Caller-provided idempotency token. A retry with the same token and an identical finding document replays the original result; the same token with different content is rejected.
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// Caller-provided idempotency token. A retry with the same token and an identical finding document replays the original result; the same token with different content is rejected.
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_token()
}
}