// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Specifies the environment and the finding document to ingest.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCodeFindingInput {
/// The environment to ingest the finding into.
pub environment_id: ::std::option::Option<::std::string::String>,
/// 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 ocsf_document: ::std::option::Option<::aws_smithy_types::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 client_token: ::std::option::Option<::std::string::String>,
}
impl CreateCodeFindingInput {
/// The environment to ingest the finding into.
pub fn environment_id(&self) -> ::std::option::Option<&str> {
self.environment_id.as_deref()
}
/// 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(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.ocsf_document.as_ref()
}
/// 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(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl CreateCodeFindingInput {
/// Creates a new builder-style object to manufacture [`CreateCodeFindingInput`](crate::operation::create_code_finding::CreateCodeFindingInput).
pub fn builder() -> crate::operation::create_code_finding::builders::CreateCodeFindingInputBuilder {
crate::operation::create_code_finding::builders::CreateCodeFindingInputBuilder::default()
}
}
/// A builder for [`CreateCodeFindingInput`](crate::operation::create_code_finding::CreateCodeFindingInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCodeFindingInputBuilder {
pub(crate) environment_id: ::std::option::Option<::std::string::String>,
pub(crate) ocsf_document: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateCodeFindingInputBuilder {
/// The environment to ingest the finding into.
/// This field is required.
pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.environment_id = ::std::option::Option::Some(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.environment_id = input;
self
}
/// The environment to ingest the finding into.
pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.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.
/// This field is required.
pub fn ocsf_document(mut self, input: ::aws_smithy_types::Document) -> Self {
self.ocsf_document = ::std::option::Option::Some(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.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.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.client_token = ::std::option::Option::Some(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.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.client_token
}
/// Consumes the builder and constructs a [`CreateCodeFindingInput`](crate::operation::create_code_finding::CreateCodeFindingInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_code_finding::CreateCodeFindingInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_code_finding::CreateCodeFindingInput {
environment_id: self.environment_id,
ocsf_document: self.ocsf_document,
client_token: self.client_token,
})
}
}