#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateThreatOutput {
pub threat_id: ::std::string::String,
pub threat_job_id: ::std::string::String,
pub title: ::std::option::Option<::std::string::String>,
pub statement: ::std::option::Option<::std::string::String>,
pub severity: ::std::option::Option<crate::types::ThreatSeverity>,
pub status: ::std::option::Option<crate::types::ThreatStatus>,
pub comments: ::std::option::Option<::std::string::String>,
pub stride: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>,
pub threat_source: ::std::option::Option<::std::string::String>,
pub prerequisites: ::std::option::Option<::std::string::String>,
pub threat_action: ::std::option::Option<::std::string::String>,
pub threat_impact: ::std::option::Option<::std::string::String>,
pub impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
pub evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
pub recommendation: ::std::option::Option<::std::string::String>,
pub created_by: ::std::option::Option<crate::types::ThreatActor>,
pub updated_by: ::std::option::Option<crate::types::ThreatActor>,
pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl UpdateThreatOutput {
pub fn threat_id(&self) -> &str {
use std::ops::Deref;
self.threat_id.deref()
}
pub fn threat_job_id(&self) -> &str {
use std::ops::Deref;
self.threat_job_id.deref()
}
pub fn title(&self) -> ::std::option::Option<&str> {
self.title.as_deref()
}
pub fn statement(&self) -> ::std::option::Option<&str> {
self.statement.as_deref()
}
pub fn severity(&self) -> ::std::option::Option<&crate::types::ThreatSeverity> {
self.severity.as_ref()
}
pub fn status(&self) -> ::std::option::Option<&crate::types::ThreatStatus> {
self.status.as_ref()
}
pub fn comments(&self) -> ::std::option::Option<&str> {
self.comments.as_deref()
}
pub fn stride(&self) -> &[crate::types::StrideCategory] {
self.stride.as_deref().unwrap_or_default()
}
pub fn threat_source(&self) -> ::std::option::Option<&str> {
self.threat_source.as_deref()
}
pub fn prerequisites(&self) -> ::std::option::Option<&str> {
self.prerequisites.as_deref()
}
pub fn threat_action(&self) -> ::std::option::Option<&str> {
self.threat_action.as_deref()
}
pub fn threat_impact(&self) -> ::std::option::Option<&str> {
self.threat_impact.as_deref()
}
pub fn impacted_goal(&self) -> &[::std::string::String] {
self.impacted_goal.as_deref().unwrap_or_default()
}
pub fn impacted_assets(&self) -> &[::std::string::String] {
self.impacted_assets.as_deref().unwrap_or_default()
}
pub fn anchor(&self) -> ::std::option::Option<&crate::types::ThreatAnchorShape> {
self.anchor.as_ref()
}
pub fn evidence(&self) -> &[crate::types::ThreatEvidenceShape] {
self.evidence.as_deref().unwrap_or_default()
}
pub fn recommendation(&self) -> ::std::option::Option<&str> {
self.recommendation.as_deref()
}
pub fn created_by(&self) -> ::std::option::Option<&crate::types::ThreatActor> {
self.created_by.as_ref()
}
pub fn updated_by(&self) -> ::std::option::Option<&crate::types::ThreatActor> {
self.updated_by.as_ref()
}
pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
}
impl ::aws_types::request_id::RequestId for UpdateThreatOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl UpdateThreatOutput {
pub fn builder() -> crate::operation::update_threat::builders::UpdateThreatOutputBuilder {
crate::operation::update_threat::builders::UpdateThreatOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateThreatOutputBuilder {
pub(crate) threat_id: ::std::option::Option<::std::string::String>,
pub(crate) threat_job_id: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) statement: ::std::option::Option<::std::string::String>,
pub(crate) severity: ::std::option::Option<crate::types::ThreatSeverity>,
pub(crate) status: ::std::option::Option<crate::types::ThreatStatus>,
pub(crate) comments: ::std::option::Option<::std::string::String>,
pub(crate) stride: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>,
pub(crate) threat_source: ::std::option::Option<::std::string::String>,
pub(crate) prerequisites: ::std::option::Option<::std::string::String>,
pub(crate) threat_action: ::std::option::Option<::std::string::String>,
pub(crate) threat_impact: ::std::option::Option<::std::string::String>,
pub(crate) impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
pub(crate) evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
pub(crate) recommendation: ::std::option::Option<::std::string::String>,
pub(crate) created_by: ::std::option::Option<crate::types::ThreatActor>,
pub(crate) updated_by: ::std::option::Option<crate::types::ThreatActor>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl UpdateThreatOutputBuilder {
pub fn threat_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.threat_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_threat_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.threat_id = input;
self
}
pub fn get_threat_id(&self) -> &::std::option::Option<::std::string::String> {
&self.threat_id
}
pub fn threat_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.threat_job_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_threat_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.threat_job_id = input;
self
}
pub fn get_threat_job_id(&self) -> &::std::option::Option<::std::string::String> {
&self.threat_job_id
}
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.statement = ::std::option::Option::Some(input.into());
self
}
pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.statement = input;
self
}
pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
&self.statement
}
pub fn severity(mut self, input: crate::types::ThreatSeverity) -> Self {
self.severity = ::std::option::Option::Some(input);
self
}
pub fn set_severity(mut self, input: ::std::option::Option<crate::types::ThreatSeverity>) -> Self {
self.severity = input;
self
}
pub fn get_severity(&self) -> &::std::option::Option<crate::types::ThreatSeverity> {
&self.severity
}
pub fn status(mut self, input: crate::types::ThreatStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ThreatStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::ThreatStatus> {
&self.status
}
pub fn comments(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.comments = ::std::option::Option::Some(input.into());
self
}
pub fn set_comments(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.comments = input;
self
}
pub fn get_comments(&self) -> &::std::option::Option<::std::string::String> {
&self.comments
}
pub fn stride(mut self, input: crate::types::StrideCategory) -> Self {
let mut v = self.stride.unwrap_or_default();
v.push(input);
self.stride = ::std::option::Option::Some(v);
self
}
pub fn set_stride(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>) -> Self {
self.stride = input;
self
}
pub fn get_stride(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>> {
&self.stride
}
pub fn threat_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.threat_source = ::std::option::Option::Some(input.into());
self
}
pub fn set_threat_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.threat_source = input;
self
}
pub fn get_threat_source(&self) -> &::std::option::Option<::std::string::String> {
&self.threat_source
}
pub fn prerequisites(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.prerequisites = ::std::option::Option::Some(input.into());
self
}
pub fn set_prerequisites(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.prerequisites = input;
self
}
pub fn get_prerequisites(&self) -> &::std::option::Option<::std::string::String> {
&self.prerequisites
}
pub fn threat_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.threat_action = ::std::option::Option::Some(input.into());
self
}
pub fn set_threat_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.threat_action = input;
self
}
pub fn get_threat_action(&self) -> &::std::option::Option<::std::string::String> {
&self.threat_action
}
pub fn threat_impact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.threat_impact = ::std::option::Option::Some(input.into());
self
}
pub fn set_threat_impact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.threat_impact = input;
self
}
pub fn get_threat_impact(&self) -> &::std::option::Option<::std::string::String> {
&self.threat_impact
}
pub fn impacted_goal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.impacted_goal.unwrap_or_default();
v.push(input.into());
self.impacted_goal = ::std::option::Option::Some(v);
self
}
pub fn set_impacted_goal(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.impacted_goal = input;
self
}
pub fn get_impacted_goal(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.impacted_goal
}
pub fn impacted_assets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.impacted_assets.unwrap_or_default();
v.push(input.into());
self.impacted_assets = ::std::option::Option::Some(v);
self
}
pub fn set_impacted_assets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.impacted_assets = input;
self
}
pub fn get_impacted_assets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.impacted_assets
}
pub fn anchor(mut self, input: crate::types::ThreatAnchorShape) -> Self {
self.anchor = ::std::option::Option::Some(input);
self
}
pub fn set_anchor(mut self, input: ::std::option::Option<crate::types::ThreatAnchorShape>) -> Self {
self.anchor = input;
self
}
pub fn get_anchor(&self) -> &::std::option::Option<crate::types::ThreatAnchorShape> {
&self.anchor
}
pub fn evidence(mut self, input: crate::types::ThreatEvidenceShape) -> Self {
let mut v = self.evidence.unwrap_or_default();
v.push(input);
self.evidence = ::std::option::Option::Some(v);
self
}
pub fn set_evidence(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>) -> Self {
self.evidence = input;
self
}
pub fn get_evidence(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>> {
&self.evidence
}
pub fn recommendation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.recommendation = ::std::option::Option::Some(input.into());
self
}
pub fn set_recommendation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.recommendation = input;
self
}
pub fn get_recommendation(&self) -> &::std::option::Option<::std::string::String> {
&self.recommendation
}
pub fn created_by(mut self, input: crate::types::ThreatActor) -> Self {
self.created_by = ::std::option::Option::Some(input);
self
}
pub fn set_created_by(mut self, input: ::std::option::Option<crate::types::ThreatActor>) -> Self {
self.created_by = input;
self
}
pub fn get_created_by(&self) -> &::std::option::Option<crate::types::ThreatActor> {
&self.created_by
}
pub fn updated_by(mut self, input: crate::types::ThreatActor) -> Self {
self.updated_by = ::std::option::Option::Some(input);
self
}
pub fn set_updated_by(mut self, input: ::std::option::Option<crate::types::ThreatActor>) -> Self {
self.updated_by = input;
self
}
pub fn get_updated_by(&self) -> &::std::option::Option<crate::types::ThreatActor> {
&self.updated_by
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_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
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_threat::UpdateThreatOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_threat::UpdateThreatOutput {
threat_id: self.threat_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"threat_id",
"threat_id was not specified but it is required when building UpdateThreatOutput",
)
})?,
threat_job_id: self.threat_job_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"threat_job_id",
"threat_job_id was not specified but it is required when building UpdateThreatOutput",
)
})?,
title: self.title,
statement: self.statement,
severity: self.severity,
status: self.status,
comments: self.comments,
stride: self.stride,
threat_source: self.threat_source,
prerequisites: self.prerequisites,
threat_action: self.threat_action,
threat_impact: self.threat_impact,
impacted_goal: self.impacted_goal,
impacted_assets: self.impacted_assets,
anchor: self.anchor,
evidence: self.evidence,
recommendation: self.recommendation,
created_by: self.created_by,
updated_by: self.updated_by,
created_at: self.created_at,
updated_at: self.updated_at,
_request_id: self._request_id,
})
}
}