aws_sdk_accessanalyzer/operation/update_findings/
_update_findings_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates findings with the new values provided in the request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateFindingsInput {
7    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the findings to update.</p>
8    pub analyzer_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>
10    pub status: ::std::option::Option<crate::types::FindingStatusUpdate>,
11    /// <p>The IDs of the findings to update.</p>
12    pub ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>The ARN of the resource identified in the finding.</p>
14    pub resource_arn: ::std::option::Option<::std::string::String>,
15    /// <p>A client token.</p>
16    pub client_token: ::std::option::Option<::std::string::String>,
17}
18impl UpdateFindingsInput {
19    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the findings to update.</p>
20    pub fn analyzer_arn(&self) -> ::std::option::Option<&str> {
21        self.analyzer_arn.as_deref()
22    }
23    /// <p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>
24    pub fn status(&self) -> ::std::option::Option<&crate::types::FindingStatusUpdate> {
25        self.status.as_ref()
26    }
27    /// <p>The IDs of the findings to update.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ids.is_none()`.
30    pub fn ids(&self) -> &[::std::string::String] {
31        self.ids.as_deref().unwrap_or_default()
32    }
33    /// <p>The ARN of the resource identified in the finding.</p>
34    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
35        self.resource_arn.as_deref()
36    }
37    /// <p>A client token.</p>
38    pub fn client_token(&self) -> ::std::option::Option<&str> {
39        self.client_token.as_deref()
40    }
41}
42impl UpdateFindingsInput {
43    /// Creates a new builder-style object to manufacture [`UpdateFindingsInput`](crate::operation::update_findings::UpdateFindingsInput).
44    pub fn builder() -> crate::operation::update_findings::builders::UpdateFindingsInputBuilder {
45        crate::operation::update_findings::builders::UpdateFindingsInputBuilder::default()
46    }
47}
48
49/// A builder for [`UpdateFindingsInput`](crate::operation::update_findings::UpdateFindingsInput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct UpdateFindingsInputBuilder {
53    pub(crate) analyzer_arn: ::std::option::Option<::std::string::String>,
54    pub(crate) status: ::std::option::Option<crate::types::FindingStatusUpdate>,
55    pub(crate) ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
56    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
57    pub(crate) client_token: ::std::option::Option<::std::string::String>,
58}
59impl UpdateFindingsInputBuilder {
60    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the findings to update.</p>
61    /// This field is required.
62    pub fn analyzer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.analyzer_arn = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the findings to update.</p>
67    pub fn set_analyzer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.analyzer_arn = input;
69        self
70    }
71    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the findings to update.</p>
72    pub fn get_analyzer_arn(&self) -> &::std::option::Option<::std::string::String> {
73        &self.analyzer_arn
74    }
75    /// <p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>
76    /// This field is required.
77    pub fn status(mut self, input: crate::types::FindingStatusUpdate) -> Self {
78        self.status = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>
82    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatusUpdate>) -> Self {
83        self.status = input;
84        self
85    }
86    /// <p>The state represents the action to take to update the finding Status. Use <code>ARCHIVE</code> to change an Active finding to an Archived finding. Use <code>ACTIVE</code> to change an Archived finding to an Active finding.</p>
87    pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatusUpdate> {
88        &self.status
89    }
90    /// Appends an item to `ids`.
91    ///
92    /// To override the contents of this collection use [`set_ids`](Self::set_ids).
93    ///
94    /// <p>The IDs of the findings to update.</p>
95    pub fn ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        let mut v = self.ids.unwrap_or_default();
97        v.push(input.into());
98        self.ids = ::std::option::Option::Some(v);
99        self
100    }
101    /// <p>The IDs of the findings to update.</p>
102    pub fn set_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
103        self.ids = input;
104        self
105    }
106    /// <p>The IDs of the findings to update.</p>
107    pub fn get_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
108        &self.ids
109    }
110    /// <p>The ARN of the resource identified in the finding.</p>
111    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.resource_arn = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The ARN of the resource identified in the finding.</p>
116    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.resource_arn = input;
118        self
119    }
120    /// <p>The ARN of the resource identified in the finding.</p>
121    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
122        &self.resource_arn
123    }
124    /// <p>A client token.</p>
125    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.client_token = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>A client token.</p>
130    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.client_token = input;
132        self
133    }
134    /// <p>A client token.</p>
135    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
136        &self.client_token
137    }
138    /// Consumes the builder and constructs a [`UpdateFindingsInput`](crate::operation::update_findings::UpdateFindingsInput).
139    pub fn build(
140        self,
141    ) -> ::std::result::Result<crate::operation::update_findings::UpdateFindingsInput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::update_findings::UpdateFindingsInput {
143            analyzer_arn: self.analyzer_arn,
144            status: self.status,
145            ids: self.ids,
146            resource_arn: self.resource_arn,
147            client_token: self.client_token,
148        })
149    }
150}