Skip to main content

aws_sdk_securityagent/operation/update_finding/
_update_finding_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Input for updating an existing security finding
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateFindingInput {
7    /// Identifier of the finding to update
8    pub finding_id: ::std::option::Option<::std::string::String>,
9    /// ID of the agent space where the finding exists
10    pub agent_space_id: ::std::option::Option<::std::string::String>,
11    /// Updated severity level of the identified risk
12    pub risk_level: ::std::option::Option<crate::types::RiskLevel>,
13    /// Updated status of the finding
14    pub status: ::std::option::Option<crate::types::FindingStatus>,
15}
16impl UpdateFindingInput {
17    /// Identifier of the finding to update
18    pub fn finding_id(&self) -> ::std::option::Option<&str> {
19        self.finding_id.as_deref()
20    }
21    /// ID of the agent space where the finding exists
22    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
23        self.agent_space_id.as_deref()
24    }
25    /// Updated severity level of the identified risk
26    pub fn risk_level(&self) -> ::std::option::Option<&crate::types::RiskLevel> {
27        self.risk_level.as_ref()
28    }
29    /// Updated status of the finding
30    pub fn status(&self) -> ::std::option::Option<&crate::types::FindingStatus> {
31        self.status.as_ref()
32    }
33}
34impl UpdateFindingInput {
35    /// Creates a new builder-style object to manufacture [`UpdateFindingInput`](crate::operation::update_finding::UpdateFindingInput).
36    pub fn builder() -> crate::operation::update_finding::builders::UpdateFindingInputBuilder {
37        crate::operation::update_finding::builders::UpdateFindingInputBuilder::default()
38    }
39}
40
41/// A builder for [`UpdateFindingInput`](crate::operation::update_finding::UpdateFindingInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpdateFindingInputBuilder {
45    pub(crate) finding_id: ::std::option::Option<::std::string::String>,
46    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
47    pub(crate) risk_level: ::std::option::Option<crate::types::RiskLevel>,
48    pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
49}
50impl UpdateFindingInputBuilder {
51    /// Identifier of the finding to update
52    /// This field is required.
53    pub fn finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.finding_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// Identifier of the finding to update
58    pub fn set_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.finding_id = input;
60        self
61    }
62    /// Identifier of the finding to update
63    pub fn get_finding_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.finding_id
65    }
66    /// ID of the agent space where the finding exists
67    /// This field is required.
68    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.agent_space_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// ID of the agent space where the finding exists
73    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.agent_space_id = input;
75        self
76    }
77    /// ID of the agent space where the finding exists
78    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.agent_space_id
80    }
81    /// Updated severity level of the identified risk
82    pub fn risk_level(mut self, input: crate::types::RiskLevel) -> Self {
83        self.risk_level = ::std::option::Option::Some(input);
84        self
85    }
86    /// Updated severity level of the identified risk
87    pub fn set_risk_level(mut self, input: ::std::option::Option<crate::types::RiskLevel>) -> Self {
88        self.risk_level = input;
89        self
90    }
91    /// Updated severity level of the identified risk
92    pub fn get_risk_level(&self) -> &::std::option::Option<crate::types::RiskLevel> {
93        &self.risk_level
94    }
95    /// Updated status of the finding
96    pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
97        self.status = ::std::option::Option::Some(input);
98        self
99    }
100    /// Updated status of the finding
101    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
102        self.status = input;
103        self
104    }
105    /// Updated status of the finding
106    pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
107        &self.status
108    }
109    /// Consumes the builder and constructs a [`UpdateFindingInput`](crate::operation::update_finding::UpdateFindingInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::update_finding::UpdateFindingInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::update_finding::UpdateFindingInput {
114            finding_id: self.finding_id,
115            agent_space_id: self.agent_space_id,
116            risk_level: self.risk_level,
117            status: self.status,
118        })
119    }
120}