// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Contains the current state and details of the requested finding. Which type-specific members are populated depends on `type`.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetCodeFindingOutput {
/// What kind of finding this is. Determines which of the type-specific members below are populated.
pub r#type: crate::types::FindingType,
/// The producer's title for the finding.
pub title: ::std::string::String,
/// The finding's severity.
pub severity: crate::types::FindingSeverityId,
/// A one-paragraph description.
pub summary: ::std::option::Option<::std::string::String>,
/// The full analysis.
pub detailed_description: ::std::option::Option<::std::string::String>,
/// The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
pub category: ::std::option::Option<::std::string::String>,
/// A more specific classification within `category`.
pub sub_category: ::std::option::Option<::std::string::String>,
/// CWE identifiers classifying the finding.
pub cwe_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// The OWASP Top 10 category, when the producer supplies one.
pub owasp_category: ::std::option::Option<::std::string::String>,
/// How to fix the finding.
pub mitigation: ::std::option::Option<::std::string::String>,
/// The file the finding is about.
pub file_path: ::std::option::Option<::std::string::String>,
/// The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
pub line_number: ::std::option::Option<i32>,
/// The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities\[\].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
pub cve_id: ::std::option::Option<::std::string::String>,
/// The CVSS base score accompanying `cveId`, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
pub cvss_base_score: ::std::option::Option<f64>,
/// Packages implicated by the finding.
pub affected_packages: ::std::option::Option<::std::vec::Vec<crate::types::AffectedPackage>>,
/// The vulnerable code fragment.
pub vulnerable_code: ::std::option::Option<::std::string::String>,
/// User-controlled inputs that reach the vulnerability.
pub relevant_inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// Steps to reproduce or exploit the finding.
pub steps_to_reproduce: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// The validator's assessment. Absent when no validation ran.
pub validation: ::std::option::Option<crate::types::FindingValidation>,
/// The last line of the affected range, from the document's affected_code\[\].end_line.
pub end_line: ::std::option::Option<i32>,
/// MITRE ATT&CK technique identifiers, from the document's finding_info.attacks\[\].technique.uid.
pub mitre_techniques: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// Remediation references, from the document's vulnerabilities\[\].remediation.references.
pub remediation_references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// The OCSF class the document declared. Determines whether `posture` is populated.
pub ocsf_class: ::std::option::Option<crate::types::FindingOcsfClass>,
/// The OCSF schema version the producer wrote against (metadata.version).
pub ocsf_schema_version: ::std::option::Option<::std::string::String>,
/// The producing product and vendor (metadata.product).
pub product_name: ::std::option::Option<::std::string::String>,
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub product_vendor_name: ::std::option::Option<::std::string::String>,
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub product_version: ::std::option::Option<::std::string::String>,
/// The producer's own status for the finding, and the enum value behind it. Distinct from `status`, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
pub source_status: ::std::option::Option<::std::string::String>,
/// The producer's numeric enum value for `sourceStatus`.
pub source_status_id: ::std::option::Option<i32>,
/// When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
pub first_seen_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// The producer's own classification of the finding (finding_info.types).
pub finding_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// Every vulnerability the document reported. A document may report several; the flat `cveId`/`cvssBaseScore`/`filePath`/`lineNumber` members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
pub vulnerabilities: ::std::option::Option<::std::vec::Vec<crate::types::FindingVulnerability>>,
/// Resources the document named (resources\[\]).
pub resources: ::std::option::Option<::std::vec::Vec<crate::types::FindingResource>>,
/// The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
pub posture: ::std::option::Option<crate::types::FindingPosture>,
/// The unique identifier of the finding.
pub finding_id: ::std::string::String,
/// The ARN of the finding.
pub finding_arn: ::std::string::String,
/// The environment that owns the finding.
pub environment_id: ::std::string::String,
/// The system that produced the finding.
pub source: ::std::string::String,
/// The producer's own identifier for the finding.
pub source_finding_id: ::std::string::String,
/// When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. `createdAt` is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one. For CreateCodeFinding, this is the submitted OCSF document's own top-level `time`. For findings Continuum's scanner produces, it is the finding's own creation time. Continuum does not validate it for plausibility: a producer's value is echoed as given, so a `timestamp` here asserts the unit and format, not that the instant is genuine.
pub reported_at: ::aws_smithy_types::DateTime,
/// The current lifecycle status of the finding.
pub status: crate::types::FindingStatus,
/// The timestamp when the status last transitioned.
pub status_updated_at: ::aws_smithy_types::DateTime,
/// The timestamp when the finding was ingested.
pub created_at: ::aws_smithy_types::DateTime,
/// The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's `metadata.correlation_uid`, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
pub scan_run_id: ::std::option::Option<::std::string::String>,
/// Human-readable context about the current status.
pub status_message: ::std::option::Option<::std::string::String>,
/// Why the finding was not escalated. Present only when status is DISCARDED.
pub discard_reason: ::std::option::Option<crate::types::FindingDiscardReason>,
/// Customer-facing explanation accompanying `discardReason`.
pub discard_reasoning: ::std::option::Option<::std::string::String>,
/// The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
pub duplicate_of_issue_id: ::std::option::Option<::std::string::String>,
/// The issue Continuum created from this finding.
pub created_issue_id: ::std::option::Option<::std::string::String>,
/// When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
pub completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetCodeFindingOutput {
/// What kind of finding this is. Determines which of the type-specific members below are populated.
pub fn r#type(&self) -> &crate::types::FindingType {
&self.r#type
}
/// The producer's title for the finding.
pub fn title(&self) -> &str {
use std::ops::Deref;
self.title.deref()
}
/// The finding's severity.
pub fn severity(&self) -> &crate::types::FindingSeverityId {
&self.severity
}
/// A one-paragraph description.
pub fn summary(&self) -> ::std::option::Option<&str> {
self.summary.as_deref()
}
/// The full analysis.
pub fn detailed_description(&self) -> ::std::option::Option<&str> {
self.detailed_description.as_deref()
}
/// The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
pub fn category(&self) -> ::std::option::Option<&str> {
self.category.as_deref()
}
/// A more specific classification within `category`.
pub fn sub_category(&self) -> ::std::option::Option<&str> {
self.sub_category.as_deref()
}
/// CWE identifiers classifying the finding.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cwe_ids.is_none()`.
pub fn cwe_ids(&self) -> &[::std::string::String] {
self.cwe_ids.as_deref().unwrap_or_default()
}
/// The OWASP Top 10 category, when the producer supplies one.
pub fn owasp_category(&self) -> ::std::option::Option<&str> {
self.owasp_category.as_deref()
}
/// How to fix the finding.
pub fn mitigation(&self) -> ::std::option::Option<&str> {
self.mitigation.as_deref()
}
/// The file the finding is about.
pub fn file_path(&self) -> ::std::option::Option<&str> {
self.file_path.as_deref()
}
/// The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
pub fn line_number(&self) -> ::std::option::Option<i32> {
self.line_number
}
/// The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities\[\].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
pub fn cve_id(&self) -> ::std::option::Option<&str> {
self.cve_id.as_deref()
}
/// The CVSS base score accompanying `cveId`, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
pub fn cvss_base_score(&self) -> ::std::option::Option<f64> {
self.cvss_base_score
}
/// Packages implicated by the finding.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.affected_packages.is_none()`.
pub fn affected_packages(&self) -> &[crate::types::AffectedPackage] {
self.affected_packages.as_deref().unwrap_or_default()
}
/// The vulnerable code fragment.
pub fn vulnerable_code(&self) -> ::std::option::Option<&str> {
self.vulnerable_code.as_deref()
}
/// User-controlled inputs that reach the vulnerability.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.relevant_inputs.is_none()`.
pub fn relevant_inputs(&self) -> &[::std::string::String] {
self.relevant_inputs.as_deref().unwrap_or_default()
}
/// Steps to reproduce or exploit the finding.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.steps_to_reproduce.is_none()`.
pub fn steps_to_reproduce(&self) -> &[::std::string::String] {
self.steps_to_reproduce.as_deref().unwrap_or_default()
}
/// The validator's assessment. Absent when no validation ran.
pub fn validation(&self) -> ::std::option::Option<&crate::types::FindingValidation> {
self.validation.as_ref()
}
/// The last line of the affected range, from the document's affected_code\[\].end_line.
pub fn end_line(&self) -> ::std::option::Option<i32> {
self.end_line
}
/// MITRE ATT&CK technique identifiers, from the document's finding_info.attacks\[\].technique.uid.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mitre_techniques.is_none()`.
pub fn mitre_techniques(&self) -> &[::std::string::String] {
self.mitre_techniques.as_deref().unwrap_or_default()
}
/// Remediation references, from the document's vulnerabilities\[\].remediation.references.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.remediation_references.is_none()`.
pub fn remediation_references(&self) -> &[::std::string::String] {
self.remediation_references.as_deref().unwrap_or_default()
}
/// The OCSF class the document declared. Determines whether `posture` is populated.
pub fn ocsf_class(&self) -> ::std::option::Option<&crate::types::FindingOcsfClass> {
self.ocsf_class.as_ref()
}
/// The OCSF schema version the producer wrote against (metadata.version).
pub fn ocsf_schema_version(&self) -> ::std::option::Option<&str> {
self.ocsf_schema_version.as_deref()
}
/// The producing product and vendor (metadata.product).
pub fn product_name(&self) -> ::std::option::Option<&str> {
self.product_name.as_deref()
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn product_vendor_name(&self) -> ::std::option::Option<&str> {
self.product_vendor_name.as_deref()
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn product_version(&self) -> ::std::option::Option<&str> {
self.product_version.as_deref()
}
/// The producer's own status for the finding, and the enum value behind it. Distinct from `status`, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
pub fn source_status(&self) -> ::std::option::Option<&str> {
self.source_status.as_deref()
}
/// The producer's numeric enum value for `sourceStatus`.
pub fn source_status_id(&self) -> ::std::option::Option<i32> {
self.source_status_id
}
/// When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
pub fn first_seen_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.first_seen_at.as_ref()
}
/// The producer's own classification of the finding (finding_info.types).
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.finding_types.is_none()`.
pub fn finding_types(&self) -> &[::std::string::String] {
self.finding_types.as_deref().unwrap_or_default()
}
/// Every vulnerability the document reported. A document may report several; the flat `cveId`/`cvssBaseScore`/`filePath`/`lineNumber` members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vulnerabilities.is_none()`.
pub fn vulnerabilities(&self) -> &[crate::types::FindingVulnerability] {
self.vulnerabilities.as_deref().unwrap_or_default()
}
/// Resources the document named (resources\[\]).
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
pub fn resources(&self) -> &[crate::types::FindingResource] {
self.resources.as_deref().unwrap_or_default()
}
/// The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
pub fn posture(&self) -> ::std::option::Option<&crate::types::FindingPosture> {
self.posture.as_ref()
}
/// The unique identifier of the finding.
pub fn finding_id(&self) -> &str {
use std::ops::Deref;
self.finding_id.deref()
}
/// The ARN of the finding.
pub fn finding_arn(&self) -> &str {
use std::ops::Deref;
self.finding_arn.deref()
}
/// The environment that owns the finding.
pub fn environment_id(&self) -> &str {
use std::ops::Deref;
self.environment_id.deref()
}
/// The system that produced the finding.
pub fn source(&self) -> &str {
use std::ops::Deref;
self.source.deref()
}
/// The producer's own identifier for the finding.
pub fn source_finding_id(&self) -> &str {
use std::ops::Deref;
self.source_finding_id.deref()
}
/// When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. `createdAt` is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one. For CreateCodeFinding, this is the submitted OCSF document's own top-level `time`. For findings Continuum's scanner produces, it is the finding's own creation time. Continuum does not validate it for plausibility: a producer's value is echoed as given, so a `timestamp` here asserts the unit and format, not that the instant is genuine.
pub fn reported_at(&self) -> &::aws_smithy_types::DateTime {
&self.reported_at
}
/// The current lifecycle status of the finding.
pub fn status(&self) -> &crate::types::FindingStatus {
&self.status
}
/// The timestamp when the status last transitioned.
pub fn status_updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.status_updated_at
}
/// The timestamp when the finding was ingested.
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
/// The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's `metadata.correlation_uid`, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
pub fn scan_run_id(&self) -> ::std::option::Option<&str> {
self.scan_run_id.as_deref()
}
/// Human-readable context about the current status.
pub fn status_message(&self) -> ::std::option::Option<&str> {
self.status_message.as_deref()
}
/// Why the finding was not escalated. Present only when status is DISCARDED.
pub fn discard_reason(&self) -> ::std::option::Option<&crate::types::FindingDiscardReason> {
self.discard_reason.as_ref()
}
/// Customer-facing explanation accompanying `discardReason`.
pub fn discard_reasoning(&self) -> ::std::option::Option<&str> {
self.discard_reasoning.as_deref()
}
/// The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
pub fn duplicate_of_issue_id(&self) -> ::std::option::Option<&str> {
self.duplicate_of_issue_id.as_deref()
}
/// The issue Continuum created from this finding.
pub fn created_issue_id(&self) -> ::std::option::Option<&str> {
self.created_issue_id.as_deref()
}
/// When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
pub fn completed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.completed_at.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetCodeFindingOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetCodeFindingOutput {
/// Creates a new builder-style object to manufacture [`GetCodeFindingOutput`](crate::operation::get_code_finding::GetCodeFindingOutput).
pub fn builder() -> crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder {
crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::default()
}
}
/// A builder for [`GetCodeFindingOutput`](crate::operation::get_code_finding::GetCodeFindingOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetCodeFindingOutputBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::FindingType>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) severity: ::std::option::Option<crate::types::FindingSeverityId>,
pub(crate) summary: ::std::option::Option<::std::string::String>,
pub(crate) detailed_description: ::std::option::Option<::std::string::String>,
pub(crate) category: ::std::option::Option<::std::string::String>,
pub(crate) sub_category: ::std::option::Option<::std::string::String>,
pub(crate) cwe_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) owasp_category: ::std::option::Option<::std::string::String>,
pub(crate) mitigation: ::std::option::Option<::std::string::String>,
pub(crate) file_path: ::std::option::Option<::std::string::String>,
pub(crate) line_number: ::std::option::Option<i32>,
pub(crate) cve_id: ::std::option::Option<::std::string::String>,
pub(crate) cvss_base_score: ::std::option::Option<f64>,
pub(crate) affected_packages: ::std::option::Option<::std::vec::Vec<crate::types::AffectedPackage>>,
pub(crate) vulnerable_code: ::std::option::Option<::std::string::String>,
pub(crate) relevant_inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) steps_to_reproduce: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) validation: ::std::option::Option<crate::types::FindingValidation>,
pub(crate) end_line: ::std::option::Option<i32>,
pub(crate) mitre_techniques: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) remediation_references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) ocsf_class: ::std::option::Option<crate::types::FindingOcsfClass>,
pub(crate) ocsf_schema_version: ::std::option::Option<::std::string::String>,
pub(crate) product_name: ::std::option::Option<::std::string::String>,
pub(crate) product_vendor_name: ::std::option::Option<::std::string::String>,
pub(crate) product_version: ::std::option::Option<::std::string::String>,
pub(crate) source_status: ::std::option::Option<::std::string::String>,
pub(crate) source_status_id: ::std::option::Option<i32>,
pub(crate) first_seen_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) finding_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) vulnerabilities: ::std::option::Option<::std::vec::Vec<crate::types::FindingVulnerability>>,
pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::FindingResource>>,
pub(crate) posture: ::std::option::Option<crate::types::FindingPosture>,
pub(crate) finding_id: ::std::option::Option<::std::string::String>,
pub(crate) finding_arn: ::std::option::Option<::std::string::String>,
pub(crate) environment_id: ::std::option::Option<::std::string::String>,
pub(crate) source: ::std::option::Option<::std::string::String>,
pub(crate) source_finding_id: ::std::option::Option<::std::string::String>,
pub(crate) reported_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
pub(crate) status_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) scan_run_id: ::std::option::Option<::std::string::String>,
pub(crate) status_message: ::std::option::Option<::std::string::String>,
pub(crate) discard_reason: ::std::option::Option<crate::types::FindingDiscardReason>,
pub(crate) discard_reasoning: ::std::option::Option<::std::string::String>,
pub(crate) duplicate_of_issue_id: ::std::option::Option<::std::string::String>,
pub(crate) created_issue_id: ::std::option::Option<::std::string::String>,
pub(crate) completed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetCodeFindingOutputBuilder {
/// What kind of finding this is. Determines which of the type-specific members below are populated.
/// This field is required.
pub fn r#type(mut self, input: crate::types::FindingType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// What kind of finding this is. Determines which of the type-specific members below are populated.
pub fn set_type(mut self, input: ::std::option::Option<crate::types::FindingType>) -> Self {
self.r#type = input;
self
}
/// What kind of finding this is. Determines which of the type-specific members below are populated.
pub fn get_type(&self) -> &::std::option::Option<crate::types::FindingType> {
&self.r#type
}
/// The producer's title for the finding.
/// This field is required.
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
/// The producer's title for the finding.
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
/// The producer's title for the finding.
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
/// The finding's severity.
/// This field is required.
pub fn severity(mut self, input: crate::types::FindingSeverityId) -> Self {
self.severity = ::std::option::Option::Some(input);
self
}
/// The finding's severity.
pub fn set_severity(mut self, input: ::std::option::Option<crate::types::FindingSeverityId>) -> Self {
self.severity = input;
self
}
/// The finding's severity.
pub fn get_severity(&self) -> &::std::option::Option<crate::types::FindingSeverityId> {
&self.severity
}
/// A one-paragraph description.
pub fn summary(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.summary = ::std::option::Option::Some(input.into());
self
}
/// A one-paragraph description.
pub fn set_summary(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.summary = input;
self
}
/// A one-paragraph description.
pub fn get_summary(&self) -> &::std::option::Option<::std::string::String> {
&self.summary
}
/// The full analysis.
pub fn detailed_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.detailed_description = ::std::option::Option::Some(input.into());
self
}
/// The full analysis.
pub fn set_detailed_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.detailed_description = input;
self
}
/// The full analysis.
pub fn get_detailed_description(&self) -> &::std::option::Option<::std::string::String> {
&self.detailed_description
}
/// The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.category = ::std::option::Option::Some(input.into());
self
}
/// The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.category = input;
self
}
/// The producer's vulnerability category. Not a stable filter key across finding types -- see FindingCategory.
pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
&self.category
}
/// A more specific classification within `category`.
pub fn sub_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sub_category = ::std::option::Option::Some(input.into());
self
}
/// A more specific classification within `category`.
pub fn set_sub_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sub_category = input;
self
}
/// A more specific classification within `category`.
pub fn get_sub_category(&self) -> &::std::option::Option<::std::string::String> {
&self.sub_category
}
/// Appends an item to `cwe_ids`.
///
/// To override the contents of this collection use [`set_cwe_ids`](Self::set_cwe_ids).
///
/// CWE identifiers classifying the finding.
pub fn cwe_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.cwe_ids.unwrap_or_default();
v.push(input.into());
self.cwe_ids = ::std::option::Option::Some(v);
self
}
/// CWE identifiers classifying the finding.
pub fn set_cwe_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.cwe_ids = input;
self
}
/// CWE identifiers classifying the finding.
pub fn get_cwe_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.cwe_ids
}
/// The OWASP Top 10 category, when the producer supplies one.
pub fn owasp_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owasp_category = ::std::option::Option::Some(input.into());
self
}
/// The OWASP Top 10 category, when the producer supplies one.
pub fn set_owasp_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owasp_category = input;
self
}
/// The OWASP Top 10 category, when the producer supplies one.
pub fn get_owasp_category(&self) -> &::std::option::Option<::std::string::String> {
&self.owasp_category
}
/// How to fix the finding.
pub fn mitigation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.mitigation = ::std::option::Option::Some(input.into());
self
}
/// How to fix the finding.
pub fn set_mitigation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.mitigation = input;
self
}
/// How to fix the finding.
pub fn get_mitigation(&self) -> &::std::option::Option<::std::string::String> {
&self.mitigation
}
/// The file the finding is about.
pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.file_path = ::std::option::Option::Some(input.into());
self
}
/// The file the finding is about.
pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.file_path = input;
self
}
/// The file the finding is about.
pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
&self.file_path
}
/// The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
pub fn line_number(mut self, input: i32) -> Self {
self.line_number = ::std::option::Option::Some(input);
self
}
/// The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
pub fn set_line_number(mut self, input: ::std::option::Option<i32>) -> Self {
self.line_number = input;
self
}
/// The 1-indexed line the finding is about. Bounds are enforced server-side rather than by a constraint trait: a numeric constraint generates a distinct newtype per enclosing structure, so the same concept would not share a type across the create input and the read output.
pub fn get_line_number(&self) -> &::std::option::Option<i32> {
&self.line_number
}
/// The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities\[\].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
pub fn cve_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cve_id = ::std::option::Option::Some(input.into());
self
}
/// The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities\[\].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
pub fn set_cve_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cve_id = input;
self
}
/// The CVE this finding reports, for software-composition findings. Both code types can carry one: a customer document supplies it under vulnerabilities\[\].cve, and Continuum's scanner reports CVEs for dependency-manifest findings.
pub fn get_cve_id(&self) -> &::std::option::Option<::std::string::String> {
&self.cve_id
}
/// The CVSS base score accompanying `cveId`, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
pub fn cvss_base_score(mut self, input: f64) -> Self {
self.cvss_base_score = ::std::option::Option::Some(input);
self
}
/// The CVSS base score accompanying `cveId`, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
pub fn set_cvss_base_score(mut self, input: ::std::option::Option<f64>) -> Self {
self.cvss_base_score = input;
self
}
/// The CVSS base score accompanying `cveId`, when the producer supplies one, from 0.0 to 10.0. Not computed by Continuum. The range is enforced server-side, not by a @range trait -- the smithy-rs server SDK does not support range constraints on double shapes (smithy-rs#2007).
pub fn get_cvss_base_score(&self) -> &::std::option::Option<f64> {
&self.cvss_base_score
}
/// Appends an item to `affected_packages`.
///
/// To override the contents of this collection use [`set_affected_packages`](Self::set_affected_packages).
///
/// Packages implicated by the finding.
pub fn affected_packages(mut self, input: crate::types::AffectedPackage) -> Self {
let mut v = self.affected_packages.unwrap_or_default();
v.push(input);
self.affected_packages = ::std::option::Option::Some(v);
self
}
/// Packages implicated by the finding.
pub fn set_affected_packages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AffectedPackage>>) -> Self {
self.affected_packages = input;
self
}
/// Packages implicated by the finding.
pub fn get_affected_packages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AffectedPackage>> {
&self.affected_packages
}
/// The vulnerable code fragment.
pub fn vulnerable_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.vulnerable_code = ::std::option::Option::Some(input.into());
self
}
/// The vulnerable code fragment.
pub fn set_vulnerable_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.vulnerable_code = input;
self
}
/// The vulnerable code fragment.
pub fn get_vulnerable_code(&self) -> &::std::option::Option<::std::string::String> {
&self.vulnerable_code
}
/// Appends an item to `relevant_inputs`.
///
/// To override the contents of this collection use [`set_relevant_inputs`](Self::set_relevant_inputs).
///
/// User-controlled inputs that reach the vulnerability.
pub fn relevant_inputs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.relevant_inputs.unwrap_or_default();
v.push(input.into());
self.relevant_inputs = ::std::option::Option::Some(v);
self
}
/// User-controlled inputs that reach the vulnerability.
pub fn set_relevant_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.relevant_inputs = input;
self
}
/// User-controlled inputs that reach the vulnerability.
pub fn get_relevant_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.relevant_inputs
}
/// Appends an item to `steps_to_reproduce`.
///
/// To override the contents of this collection use [`set_steps_to_reproduce`](Self::set_steps_to_reproduce).
///
/// Steps to reproduce or exploit the finding.
pub fn steps_to_reproduce(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.steps_to_reproduce.unwrap_or_default();
v.push(input.into());
self.steps_to_reproduce = ::std::option::Option::Some(v);
self
}
/// Steps to reproduce or exploit the finding.
pub fn set_steps_to_reproduce(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.steps_to_reproduce = input;
self
}
/// Steps to reproduce or exploit the finding.
pub fn get_steps_to_reproduce(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.steps_to_reproduce
}
/// The validator's assessment. Absent when no validation ran.
pub fn validation(mut self, input: crate::types::FindingValidation) -> Self {
self.validation = ::std::option::Option::Some(input);
self
}
/// The validator's assessment. Absent when no validation ran.
pub fn set_validation(mut self, input: ::std::option::Option<crate::types::FindingValidation>) -> Self {
self.validation = input;
self
}
/// The validator's assessment. Absent when no validation ran.
pub fn get_validation(&self) -> &::std::option::Option<crate::types::FindingValidation> {
&self.validation
}
/// The last line of the affected range, from the document's affected_code\[\].end_line.
pub fn end_line(mut self, input: i32) -> Self {
self.end_line = ::std::option::Option::Some(input);
self
}
/// The last line of the affected range, from the document's affected_code\[\].end_line.
pub fn set_end_line(mut self, input: ::std::option::Option<i32>) -> Self {
self.end_line = input;
self
}
/// The last line of the affected range, from the document's affected_code\[\].end_line.
pub fn get_end_line(&self) -> &::std::option::Option<i32> {
&self.end_line
}
/// Appends an item to `mitre_techniques`.
///
/// To override the contents of this collection use [`set_mitre_techniques`](Self::set_mitre_techniques).
///
/// MITRE ATT&CK technique identifiers, from the document's finding_info.attacks\[\].technique.uid.
pub fn mitre_techniques(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.mitre_techniques.unwrap_or_default();
v.push(input.into());
self.mitre_techniques = ::std::option::Option::Some(v);
self
}
/// MITRE ATT&CK technique identifiers, from the document's finding_info.attacks\[\].technique.uid.
pub fn set_mitre_techniques(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.mitre_techniques = input;
self
}
/// MITRE ATT&CK technique identifiers, from the document's finding_info.attacks\[\].technique.uid.
pub fn get_mitre_techniques(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.mitre_techniques
}
/// Appends an item to `remediation_references`.
///
/// To override the contents of this collection use [`set_remediation_references`](Self::set_remediation_references).
///
/// Remediation references, from the document's vulnerabilities\[\].remediation.references.
pub fn remediation_references(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.remediation_references.unwrap_or_default();
v.push(input.into());
self.remediation_references = ::std::option::Option::Some(v);
self
}
/// Remediation references, from the document's vulnerabilities\[\].remediation.references.
pub fn set_remediation_references(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.remediation_references = input;
self
}
/// Remediation references, from the document's vulnerabilities\[\].remediation.references.
pub fn get_remediation_references(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.remediation_references
}
/// The OCSF class the document declared. Determines whether `posture` is populated.
pub fn ocsf_class(mut self, input: crate::types::FindingOcsfClass) -> Self {
self.ocsf_class = ::std::option::Option::Some(input);
self
}
/// The OCSF class the document declared. Determines whether `posture` is populated.
pub fn set_ocsf_class(mut self, input: ::std::option::Option<crate::types::FindingOcsfClass>) -> Self {
self.ocsf_class = input;
self
}
/// The OCSF class the document declared. Determines whether `posture` is populated.
pub fn get_ocsf_class(&self) -> &::std::option::Option<crate::types::FindingOcsfClass> {
&self.ocsf_class
}
/// The OCSF schema version the producer wrote against (metadata.version).
pub fn ocsf_schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ocsf_schema_version = ::std::option::Option::Some(input.into());
self
}
/// The OCSF schema version the producer wrote against (metadata.version).
pub fn set_ocsf_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ocsf_schema_version = input;
self
}
/// The OCSF schema version the producer wrote against (metadata.version).
pub fn get_ocsf_schema_version(&self) -> &::std::option::Option<::std::string::String> {
&self.ocsf_schema_version
}
/// The producing product and vendor (metadata.product).
pub fn product_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.product_name = ::std::option::Option::Some(input.into());
self
}
/// The producing product and vendor (metadata.product).
pub fn set_product_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.product_name = input;
self
}
/// The producing product and vendor (metadata.product).
pub fn get_product_name(&self) -> &::std::option::Option<::std::string::String> {
&self.product_name
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn product_vendor_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.product_vendor_name = ::std::option::Option::Some(input.into());
self
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn set_product_vendor_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.product_vendor_name = input;
self
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn get_product_vendor_name(&self) -> &::std::option::Option<::std::string::String> {
&self.product_vendor_name
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn product_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.product_version = ::std::option::Option::Some(input.into());
self
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn set_product_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.product_version = input;
self
}
/// A vulnerability-taxonomy label: the producer's category, sub-category, or OWASP category. Deliberately unconstrained beyond length -- producers do not share a taxonomy, so this is NOT a stable filter key across finding types. Use `cweIds` when a stable classification is needed.
pub fn get_product_version(&self) -> &::std::option::Option<::std::string::String> {
&self.product_version
}
/// The producer's own status for the finding, and the enum value behind it. Distinct from `status`, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
pub fn source_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_status = ::std::option::Option::Some(input.into());
self
}
/// The producer's own status for the finding, and the enum value behind it. Distinct from `status`, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
pub fn set_source_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_status = input;
self
}
/// The producer's own status for the finding, and the enum value behind it. Distinct from `status`, which is Continuum's lifecycle state -- a producer may call a finding "New" while Continuum has it SUBMITTED.
pub fn get_source_status(&self) -> &::std::option::Option<::std::string::String> {
&self.source_status
}
/// The producer's numeric enum value for `sourceStatus`.
pub fn source_status_id(mut self, input: i32) -> Self {
self.source_status_id = ::std::option::Option::Some(input);
self
}
/// The producer's numeric enum value for `sourceStatus`.
pub fn set_source_status_id(mut self, input: ::std::option::Option<i32>) -> Self {
self.source_status_id = input;
self
}
/// The producer's numeric enum value for `sourceStatus`.
pub fn get_source_status_id(&self) -> &::std::option::Option<i32> {
&self.source_status_id
}
/// When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
pub fn first_seen_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.first_seen_at = ::std::option::Option::Some(input);
self
}
/// When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
pub fn set_first_seen_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.first_seen_at = input;
self
}
/// When the producer first observed the finding (finding_info.first_seen_time). The producer's own clock, not Continuum's.
pub fn get_first_seen_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.first_seen_at
}
/// Appends an item to `finding_types`.
///
/// To override the contents of this collection use [`set_finding_types`](Self::set_finding_types).
///
/// The producer's own classification of the finding (finding_info.types).
pub fn finding_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.finding_types.unwrap_or_default();
v.push(input.into());
self.finding_types = ::std::option::Option::Some(v);
self
}
/// The producer's own classification of the finding (finding_info.types).
pub fn set_finding_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.finding_types = input;
self
}
/// The producer's own classification of the finding (finding_info.types).
pub fn get_finding_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.finding_types
}
/// Appends an item to `vulnerabilities`.
///
/// To override the contents of this collection use [`set_vulnerabilities`](Self::set_vulnerabilities).
///
/// Every vulnerability the document reported. A document may report several; the flat `cveId`/`cvssBaseScore`/`filePath`/`lineNumber` members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
pub fn vulnerabilities(mut self, input: crate::types::FindingVulnerability) -> Self {
let mut v = self.vulnerabilities.unwrap_or_default();
v.push(input);
self.vulnerabilities = ::std::option::Option::Some(v);
self
}
/// Every vulnerability the document reported. A document may report several; the flat `cveId`/`cvssBaseScore`/`filePath`/`lineNumber` members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
pub fn set_vulnerabilities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FindingVulnerability>>) -> Self {
self.vulnerabilities = input;
self
}
/// Every vulnerability the document reported. A document may report several; the flat `cveId`/`cvssBaseScore`/`filePath`/`lineNumber` members above carry the first one's identity so a caller that only needs "what and where" does not have to walk this list.
pub fn get_vulnerabilities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FindingVulnerability>> {
&self.vulnerabilities
}
/// Appends an item to `resources`.
///
/// To override the contents of this collection use [`set_resources`](Self::set_resources).
///
/// Resources the document named (resources\[\]).
pub fn resources(mut self, input: crate::types::FindingResource) -> Self {
let mut v = self.resources.unwrap_or_default();
v.push(input);
self.resources = ::std::option::Option::Some(v);
self
}
/// Resources the document named (resources\[\]).
pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FindingResource>>) -> Self {
self.resources = input;
self
}
/// Resources the document named (resources\[\]).
pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FindingResource>> {
&self.resources
}
/// The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
pub fn posture(mut self, input: crate::types::FindingPosture) -> Self {
self.posture = ::std::option::Option::Some(input);
self
}
/// The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
pub fn set_posture(mut self, input: ::std::option::Option<crate::types::FindingPosture>) -> Self {
self.posture = input;
self
}
/// The compliance posture, for an Application Security Posture Finding. Absent for a vulnerability finding.
pub fn get_posture(&self) -> &::std::option::Option<crate::types::FindingPosture> {
&self.posture
}
/// The unique identifier of the finding.
/// This field is required.
pub fn finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.finding_id = ::std::option::Option::Some(input.into());
self
}
/// The unique identifier of the finding.
pub fn set_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.finding_id = input;
self
}
/// The unique identifier of the finding.
pub fn get_finding_id(&self) -> &::std::option::Option<::std::string::String> {
&self.finding_id
}
/// The ARN of the finding.
/// This field is required.
pub fn finding_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.finding_arn = ::std::option::Option::Some(input.into());
self
}
/// The ARN of the finding.
pub fn set_finding_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.finding_arn = input;
self
}
/// The ARN of the finding.
pub fn get_finding_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.finding_arn
}
/// The environment that owns the finding.
/// 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 that owns the finding.
pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.environment_id = input;
self
}
/// The environment that owns the finding.
pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.environment_id
}
/// The system that produced the finding.
/// This field is required.
pub fn source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source = ::std::option::Option::Some(input.into());
self
}
/// The system that produced the finding.
pub fn set_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source = input;
self
}
/// The system that produced the finding.
pub fn get_source(&self) -> &::std::option::Option<::std::string::String> {
&self.source
}
/// The producer's own identifier for the finding.
/// This field is required.
pub fn source_finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_finding_id = ::std::option::Option::Some(input.into());
self
}
/// The producer's own identifier for the finding.
pub fn set_source_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_finding_id = input;
self
}
/// The producer's own identifier for the finding.
pub fn get_source_finding_id(&self) -> &::std::option::Option<::std::string::String> {
&self.source_finding_id
}
/// When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. `createdAt` is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one. For CreateCodeFinding, this is the submitted OCSF document's own top-level `time`. For findings Continuum's scanner produces, it is the finding's own creation time. Continuum does not validate it for plausibility: a producer's value is echoed as given, so a `timestamp` here asserts the unit and format, not that the instant is genuine.
/// This field is required.
pub fn reported_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.reported_at = ::std::option::Option::Some(input);
self
}
/// When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. `createdAt` is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one. For CreateCodeFinding, this is the submitted OCSF document's own top-level `time`. For findings Continuum's scanner produces, it is the finding's own creation time. Continuum does not validate it for plausibility: a producer's value is echoed as given, so a `timestamp` here asserts the unit and format, not that the instant is genuine.
pub fn set_reported_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.reported_at = input;
self
}
/// When the producer reported the finding -- its own clock, which is not Continuum's ingestion time. `createdAt` is when Continuum accepted it; these are genuinely different instants and a reader usually wants this one. For CreateCodeFinding, this is the submitted OCSF document's own top-level `time`. For findings Continuum's scanner produces, it is the finding's own creation time. Continuum does not validate it for plausibility: a producer's value is echoed as given, so a `timestamp` here asserts the unit and format, not that the instant is genuine.
pub fn get_reported_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.reported_at
}
/// The current lifecycle status of the finding.
/// This field is required.
pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// The current lifecycle status of the finding.
pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
self.status = input;
self
}
/// The current lifecycle status of the finding.
pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
&self.status
}
/// The timestamp when the status last transitioned.
/// This field is required.
pub fn status_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.status_updated_at = ::std::option::Option::Some(input);
self
}
/// The timestamp when the status last transitioned.
pub fn set_status_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.status_updated_at = input;
self
}
/// The timestamp when the status last transitioned.
pub fn get_status_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.status_updated_at
}
/// The timestamp when the finding was ingested.
/// This field is required.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// The timestamp when the finding was ingested.
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// The timestamp when the finding was ingested.
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's `metadata.correlation_uid`, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
pub fn scan_run_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.scan_run_id = ::std::option::Option::Some(input.into());
self
}
/// The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's `metadata.correlation_uid`, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
pub fn set_scan_run_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.scan_run_id = input;
self
}
/// The scan that produced the finding, when it came from one. For a finding Continuum's scanner produced, this is the Continuum scan run (see GetCodeScan). For a finding submitted with CreateCodeFinding, it is the OCSF document's `metadata.correlation_uid`, when that value is a valid ScanRunId. Absent when the finding did not come from a scan.
pub fn get_scan_run_id(&self) -> &::std::option::Option<::std::string::String> {
&self.scan_run_id
}
/// Human-readable context about the current status.
pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_message = ::std::option::Option::Some(input.into());
self
}
/// Human-readable context about the current status.
pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_message = input;
self
}
/// Human-readable context about the current status.
pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
&self.status_message
}
/// Why the finding was not escalated. Present only when status is DISCARDED.
pub fn discard_reason(mut self, input: crate::types::FindingDiscardReason) -> Self {
self.discard_reason = ::std::option::Option::Some(input);
self
}
/// Why the finding was not escalated. Present only when status is DISCARDED.
pub fn set_discard_reason(mut self, input: ::std::option::Option<crate::types::FindingDiscardReason>) -> Self {
self.discard_reason = input;
self
}
/// Why the finding was not escalated. Present only when status is DISCARDED.
pub fn get_discard_reason(&self) -> &::std::option::Option<crate::types::FindingDiscardReason> {
&self.discard_reason
}
/// Customer-facing explanation accompanying `discardReason`.
pub fn discard_reasoning(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.discard_reasoning = ::std::option::Option::Some(input.into());
self
}
/// Customer-facing explanation accompanying `discardReason`.
pub fn set_discard_reasoning(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.discard_reasoning = input;
self
}
/// Customer-facing explanation accompanying `discardReason`.
pub fn get_discard_reasoning(&self) -> &::std::option::Option<::std::string::String> {
&self.discard_reasoning
}
/// The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
pub fn duplicate_of_issue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.duplicate_of_issue_id = ::std::option::Option::Some(input.into());
self
}
/// The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
pub fn set_duplicate_of_issue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.duplicate_of_issue_id = input;
self
}
/// The existing issue this finding duplicates. Present only for the DUPLICATE_OF_* discard reasons.
pub fn get_duplicate_of_issue_id(&self) -> &::std::option::Option<::std::string::String> {
&self.duplicate_of_issue_id
}
/// The issue Continuum created from this finding.
pub fn created_issue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.created_issue_id = ::std::option::Option::Some(input.into());
self
}
/// The issue Continuum created from this finding.
pub fn set_created_issue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.created_issue_id = input;
self
}
/// The issue Continuum created from this finding.
pub fn get_created_issue_id(&self) -> &::std::option::Option<::std::string::String> {
&self.created_issue_id
}
/// When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
pub fn completed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.completed_at = ::std::option::Option::Some(input);
self
}
/// When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
pub fn set_completed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.completed_at = input;
self
}
/// When processing finished, whether by creating an issue or discarding. Absent while the finding is still in flight.
pub fn get_completed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.completed_at
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetCodeFindingOutput`](crate::operation::get_code_finding::GetCodeFindingOutput).
/// This method will fail if any of the following fields are not set:
/// - [`r#type`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::type)
/// - [`title`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::title)
/// - [`severity`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::severity)
/// - [`finding_id`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::finding_id)
/// - [`finding_arn`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::finding_arn)
/// - [`environment_id`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::environment_id)
/// - [`source`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::source)
/// - [`source_finding_id`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::source_finding_id)
/// - [`reported_at`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::reported_at)
/// - [`status`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::status)
/// - [`status_updated_at`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::status_updated_at)
/// - [`created_at`](crate::operation::get_code_finding::builders::GetCodeFindingOutputBuilder::created_at)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_code_finding::GetCodeFindingOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_code_finding::GetCodeFindingOutput {
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building GetCodeFindingOutput",
)
})?,
title: self.title.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"title",
"title was not specified but it is required when building GetCodeFindingOutput",
)
})?,
severity: self.severity.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"severity",
"severity was not specified but it is required when building GetCodeFindingOutput",
)
})?,
summary: self.summary,
detailed_description: self.detailed_description,
category: self.category,
sub_category: self.sub_category,
cwe_ids: self.cwe_ids,
owasp_category: self.owasp_category,
mitigation: self.mitigation,
file_path: self.file_path,
line_number: self.line_number,
cve_id: self.cve_id,
cvss_base_score: self.cvss_base_score,
affected_packages: self.affected_packages,
vulnerable_code: self.vulnerable_code,
relevant_inputs: self.relevant_inputs,
steps_to_reproduce: self.steps_to_reproduce,
validation: self.validation,
end_line: self.end_line,
mitre_techniques: self.mitre_techniques,
remediation_references: self.remediation_references,
ocsf_class: self.ocsf_class,
ocsf_schema_version: self.ocsf_schema_version,
product_name: self.product_name,
product_vendor_name: self.product_vendor_name,
product_version: self.product_version,
source_status: self.source_status,
source_status_id: self.source_status_id,
first_seen_at: self.first_seen_at,
finding_types: self.finding_types,
vulnerabilities: self.vulnerabilities,
resources: self.resources,
posture: self.posture,
finding_id: self.finding_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"finding_id",
"finding_id was not specified but it is required when building GetCodeFindingOutput",
)
})?,
finding_arn: self.finding_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"finding_arn",
"finding_arn was not specified but it is required when building GetCodeFindingOutput",
)
})?,
environment_id: self.environment_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"environment_id",
"environment_id was not specified but it is required when building GetCodeFindingOutput",
)
})?,
source: self.source.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source",
"source was not specified but it is required when building GetCodeFindingOutput",
)
})?,
source_finding_id: self.source_finding_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_finding_id",
"source_finding_id was not specified but it is required when building GetCodeFindingOutput",
)
})?,
reported_at: self.reported_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"reported_at",
"reported_at was not specified but it is required when building GetCodeFindingOutput",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building GetCodeFindingOutput",
)
})?,
status_updated_at: self.status_updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status_updated_at",
"status_updated_at was not specified but it is required when building GetCodeFindingOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building GetCodeFindingOutput",
)
})?,
scan_run_id: self.scan_run_id,
status_message: self.status_message,
discard_reason: self.discard_reason,
discard_reasoning: self.discard_reasoning,
duplicate_of_issue_id: self.duplicate_of_issue_id,
created_issue_id: self.created_issue_id,
completed_at: self.completed_at,
_request_id: self._request_id,
})
}
}