aws_sdk_securityhub/operation/batch_update_findings/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_update_findings::_batch_update_findings_output::BatchUpdateFindingsOutputBuilder;
3
4pub use crate::operation::batch_update_findings::_batch_update_findings_input::BatchUpdateFindingsInputBuilder;
5
6impl crate::operation::batch_update_findings::builders::BatchUpdateFindingsInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::batch_update_findings::BatchUpdateFindingsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::batch_update_findings::BatchUpdateFindingsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.batch_update_findings();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `BatchUpdateFindings`.
24///
25/// <p>Used by Security Hub customers to update information about their investigation into a finding. Requested by administrator accounts or member accounts. Administrator accounts can update findings for their account and their member accounts. Member accounts can update findings for their account.</p>
26/// <p>Updates from <code>BatchUpdateFindings</code> don't affect the value of <code>UpdatedAt</code> for a finding.</p>
27/// <p>Administrator and member accounts can use <code>BatchUpdateFindings</code> to update the following finding fields and objects.</p>
28/// <ul>
29/// <li>
30/// <p><code>Confidence</code></p></li>
31/// <li>
32/// <p><code>Criticality</code></p></li>
33/// <li>
34/// <p><code>Note</code></p></li>
35/// <li>
36/// <p><code>RelatedFindings</code></p></li>
37/// <li>
38/// <p><code>Severity</code></p></li>
39/// <li>
40/// <p><code>Types</code></p></li>
41/// <li>
42/// <p><code>UserDefinedFields</code></p></li>
43/// <li>
44/// <p><code>VerificationState</code></p></li>
45/// <li>
46/// <p><code>Workflow</code></p></li>
47/// </ul>
48/// <p>You can configure IAM policies to restrict access to fields and field values. For example, you might not want member accounts to be able to suppress findings or change the finding severity. See <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/finding-update-batchupdatefindings.html#batchupdatefindings-configure-access">Configuring access to BatchUpdateFindings</a> in the <i>Security Hub User Guide</i>.</p>
49#[derive(::std::clone::Clone, ::std::fmt::Debug)]
50pub struct BatchUpdateFindingsFluentBuilder {
51 handle: ::std::sync::Arc<crate::client::Handle>,
52 inner: crate::operation::batch_update_findings::builders::BatchUpdateFindingsInputBuilder,
53 config_override: ::std::option::Option<crate::config::Builder>,
54}
55impl
56 crate::client::customize::internal::CustomizableSend<
57 crate::operation::batch_update_findings::BatchUpdateFindingsOutput,
58 crate::operation::batch_update_findings::BatchUpdateFindingsError,
59 > for BatchUpdateFindingsFluentBuilder
60{
61 fn send(
62 self,
63 config_override: crate::config::Builder,
64 ) -> crate::client::customize::internal::BoxFuture<
65 crate::client::customize::internal::SendResult<
66 crate::operation::batch_update_findings::BatchUpdateFindingsOutput,
67 crate::operation::batch_update_findings::BatchUpdateFindingsError,
68 >,
69 > {
70 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
71 }
72}
73impl BatchUpdateFindingsFluentBuilder {
74 /// Creates a new `BatchUpdateFindingsFluentBuilder`.
75 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
76 Self {
77 handle,
78 inner: ::std::default::Default::default(),
79 config_override: ::std::option::Option::None,
80 }
81 }
82 /// Access the BatchUpdateFindings as a reference.
83 pub fn as_input(&self) -> &crate::operation::batch_update_findings::builders::BatchUpdateFindingsInputBuilder {
84 &self.inner
85 }
86 /// Sends the request and returns the response.
87 ///
88 /// If an error occurs, an `SdkError` will be returned with additional details that
89 /// can be matched against.
90 ///
91 /// By default, any retryable failures will be retried twice. Retry behavior
92 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
93 /// set when configuring the client.
94 pub async fn send(
95 self,
96 ) -> ::std::result::Result<
97 crate::operation::batch_update_findings::BatchUpdateFindingsOutput,
98 ::aws_smithy_runtime_api::client::result::SdkError<
99 crate::operation::batch_update_findings::BatchUpdateFindingsError,
100 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
101 >,
102 > {
103 let input = self
104 .inner
105 .build()
106 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
107 let runtime_plugins = crate::operation::batch_update_findings::BatchUpdateFindings::operation_runtime_plugins(
108 self.handle.runtime_plugins.clone(),
109 &self.handle.conf,
110 self.config_override,
111 );
112 crate::operation::batch_update_findings::BatchUpdateFindings::orchestrate(&runtime_plugins, input).await
113 }
114
115 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
116 pub fn customize(
117 self,
118 ) -> crate::client::customize::CustomizableOperation<
119 crate::operation::batch_update_findings::BatchUpdateFindingsOutput,
120 crate::operation::batch_update_findings::BatchUpdateFindingsError,
121 Self,
122 > {
123 crate::client::customize::CustomizableOperation::new(self)
124 }
125 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
126 self.set_config_override(::std::option::Option::Some(config_override.into()));
127 self
128 }
129
130 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
131 self.config_override = config_override;
132 self
133 }
134 ///
135 /// Appends an item to `FindingIdentifiers`.
136 ///
137 /// To override the contents of this collection use [`set_finding_identifiers`](Self::set_finding_identifiers).
138 ///
139 /// <p>The list of findings to update. <code>BatchUpdateFindings</code> can be used to update up to 100 findings at a time.</p>
140 /// <p>For each finding, the list provides the finding identifier and the ARN of the finding provider.</p>
141 pub fn finding_identifiers(mut self, input: crate::types::AwsSecurityFindingIdentifier) -> Self {
142 self.inner = self.inner.finding_identifiers(input);
143 self
144 }
145 /// <p>The list of findings to update. <code>BatchUpdateFindings</code> can be used to update up to 100 findings at a time.</p>
146 /// <p>For each finding, the list provides the finding identifier and the ARN of the finding provider.</p>
147 pub fn set_finding_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AwsSecurityFindingIdentifier>>) -> Self {
148 self.inner = self.inner.set_finding_identifiers(input);
149 self
150 }
151 /// <p>The list of findings to update. <code>BatchUpdateFindings</code> can be used to update up to 100 findings at a time.</p>
152 /// <p>For each finding, the list provides the finding identifier and the ARN of the finding provider.</p>
153 pub fn get_finding_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AwsSecurityFindingIdentifier>> {
154 self.inner.get_finding_identifiers()
155 }
156 /// <p>The updated note.</p>
157 pub fn note(mut self, input: crate::types::NoteUpdate) -> Self {
158 self.inner = self.inner.note(input);
159 self
160 }
161 /// <p>The updated note.</p>
162 pub fn set_note(mut self, input: ::std::option::Option<crate::types::NoteUpdate>) -> Self {
163 self.inner = self.inner.set_note(input);
164 self
165 }
166 /// <p>The updated note.</p>
167 pub fn get_note(&self) -> &::std::option::Option<crate::types::NoteUpdate> {
168 self.inner.get_note()
169 }
170 /// <p>Used to update the finding severity.</p>
171 pub fn severity(mut self, input: crate::types::SeverityUpdate) -> Self {
172 self.inner = self.inner.severity(input);
173 self
174 }
175 /// <p>Used to update the finding severity.</p>
176 pub fn set_severity(mut self, input: ::std::option::Option<crate::types::SeverityUpdate>) -> Self {
177 self.inner = self.inner.set_severity(input);
178 self
179 }
180 /// <p>Used to update the finding severity.</p>
181 pub fn get_severity(&self) -> &::std::option::Option<crate::types::SeverityUpdate> {
182 self.inner.get_severity()
183 }
184 /// <p>Indicates the veracity of a finding.</p>
185 /// <p>The available values for <code>VerificationState</code> are as follows.</p>
186 /// <ul>
187 /// <li>
188 /// <p><code>UNKNOWN</code> – The default disposition of a security finding</p></li>
189 /// <li>
190 /// <p><code>TRUE_POSITIVE</code> – The security finding is confirmed</p></li>
191 /// <li>
192 /// <p><code>FALSE_POSITIVE</code> – The security finding was determined to be a false alarm</p></li>
193 /// <li>
194 /// <p><code>BENIGN_POSITIVE</code> – A special case of <code>TRUE_POSITIVE</code> where the finding doesn't pose any threat, is expected, or both</p></li>
195 /// </ul>
196 pub fn verification_state(mut self, input: crate::types::VerificationState) -> Self {
197 self.inner = self.inner.verification_state(input);
198 self
199 }
200 /// <p>Indicates the veracity of a finding.</p>
201 /// <p>The available values for <code>VerificationState</code> are as follows.</p>
202 /// <ul>
203 /// <li>
204 /// <p><code>UNKNOWN</code> – The default disposition of a security finding</p></li>
205 /// <li>
206 /// <p><code>TRUE_POSITIVE</code> – The security finding is confirmed</p></li>
207 /// <li>
208 /// <p><code>FALSE_POSITIVE</code> – The security finding was determined to be a false alarm</p></li>
209 /// <li>
210 /// <p><code>BENIGN_POSITIVE</code> – A special case of <code>TRUE_POSITIVE</code> where the finding doesn't pose any threat, is expected, or both</p></li>
211 /// </ul>
212 pub fn set_verification_state(mut self, input: ::std::option::Option<crate::types::VerificationState>) -> Self {
213 self.inner = self.inner.set_verification_state(input);
214 self
215 }
216 /// <p>Indicates the veracity of a finding.</p>
217 /// <p>The available values for <code>VerificationState</code> are as follows.</p>
218 /// <ul>
219 /// <li>
220 /// <p><code>UNKNOWN</code> – The default disposition of a security finding</p></li>
221 /// <li>
222 /// <p><code>TRUE_POSITIVE</code> – The security finding is confirmed</p></li>
223 /// <li>
224 /// <p><code>FALSE_POSITIVE</code> – The security finding was determined to be a false alarm</p></li>
225 /// <li>
226 /// <p><code>BENIGN_POSITIVE</code> – A special case of <code>TRUE_POSITIVE</code> where the finding doesn't pose any threat, is expected, or both</p></li>
227 /// </ul>
228 pub fn get_verification_state(&self) -> &::std::option::Option<crate::types::VerificationState> {
229 self.inner.get_verification_state()
230 }
231 /// <p>The updated value for the finding confidence. Confidence is defined as the likelihood that a finding accurately identifies the behavior or issue that it was intended to identify.</p>
232 /// <p>Confidence is scored on a 0-100 basis using a ratio scale, where 0 means zero percent confidence and 100 means 100 percent confidence.</p>
233 pub fn confidence(mut self, input: i32) -> Self {
234 self.inner = self.inner.confidence(input);
235 self
236 }
237 /// <p>The updated value for the finding confidence. Confidence is defined as the likelihood that a finding accurately identifies the behavior or issue that it was intended to identify.</p>
238 /// <p>Confidence is scored on a 0-100 basis using a ratio scale, where 0 means zero percent confidence and 100 means 100 percent confidence.</p>
239 pub fn set_confidence(mut self, input: ::std::option::Option<i32>) -> Self {
240 self.inner = self.inner.set_confidence(input);
241 self
242 }
243 /// <p>The updated value for the finding confidence. Confidence is defined as the likelihood that a finding accurately identifies the behavior or issue that it was intended to identify.</p>
244 /// <p>Confidence is scored on a 0-100 basis using a ratio scale, where 0 means zero percent confidence and 100 means 100 percent confidence.</p>
245 pub fn get_confidence(&self) -> &::std::option::Option<i32> {
246 self.inner.get_confidence()
247 }
248 /// <p>The updated value for the level of importance assigned to the resources associated with the findings.</p>
249 /// <p>A score of 0 means that the underlying resources have no criticality, and a score of 100 is reserved for the most critical resources.</p>
250 pub fn criticality(mut self, input: i32) -> Self {
251 self.inner = self.inner.criticality(input);
252 self
253 }
254 /// <p>The updated value for the level of importance assigned to the resources associated with the findings.</p>
255 /// <p>A score of 0 means that the underlying resources have no criticality, and a score of 100 is reserved for the most critical resources.</p>
256 pub fn set_criticality(mut self, input: ::std::option::Option<i32>) -> Self {
257 self.inner = self.inner.set_criticality(input);
258 self
259 }
260 /// <p>The updated value for the level of importance assigned to the resources associated with the findings.</p>
261 /// <p>A score of 0 means that the underlying resources have no criticality, and a score of 100 is reserved for the most critical resources.</p>
262 pub fn get_criticality(&self) -> &::std::option::Option<i32> {
263 self.inner.get_criticality()
264 }
265 ///
266 /// Appends an item to `Types`.
267 ///
268 /// To override the contents of this collection use [`set_types`](Self::set_types).
269 ///
270 /// <p>One or more finding types in the format of namespace/category/classifier that classify a finding.</p>
271 /// <p>Valid namespace values are as follows.</p>
272 /// <ul>
273 /// <li>
274 /// <p>Software and Configuration Checks</p></li>
275 /// <li>
276 /// <p>TTPs</p></li>
277 /// <li>
278 /// <p>Effects</p></li>
279 /// <li>
280 /// <p>Unusual Behaviors</p></li>
281 /// <li>
282 /// <p>Sensitive Data Identifications</p></li>
283 /// </ul>
284 pub fn types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.inner = self.inner.types(input.into());
286 self
287 }
288 /// <p>One or more finding types in the format of namespace/category/classifier that classify a finding.</p>
289 /// <p>Valid namespace values are as follows.</p>
290 /// <ul>
291 /// <li>
292 /// <p>Software and Configuration Checks</p></li>
293 /// <li>
294 /// <p>TTPs</p></li>
295 /// <li>
296 /// <p>Effects</p></li>
297 /// <li>
298 /// <p>Unusual Behaviors</p></li>
299 /// <li>
300 /// <p>Sensitive Data Identifications</p></li>
301 /// </ul>
302 pub fn set_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
303 self.inner = self.inner.set_types(input);
304 self
305 }
306 /// <p>One or more finding types in the format of namespace/category/classifier that classify a finding.</p>
307 /// <p>Valid namespace values are as follows.</p>
308 /// <ul>
309 /// <li>
310 /// <p>Software and Configuration Checks</p></li>
311 /// <li>
312 /// <p>TTPs</p></li>
313 /// <li>
314 /// <p>Effects</p></li>
315 /// <li>
316 /// <p>Unusual Behaviors</p></li>
317 /// <li>
318 /// <p>Sensitive Data Identifications</p></li>
319 /// </ul>
320 pub fn get_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
321 self.inner.get_types()
322 }
323 ///
324 /// Adds a key-value pair to `UserDefinedFields`.
325 ///
326 /// To override the contents of this collection use [`set_user_defined_fields`](Self::set_user_defined_fields).
327 ///
328 /// <p>A list of name/value string pairs associated with the finding. These are custom, user-defined fields added to a finding.</p>
329 pub fn user_defined_fields(
330 mut self,
331 k: impl ::std::convert::Into<::std::string::String>,
332 v: impl ::std::convert::Into<::std::string::String>,
333 ) -> Self {
334 self.inner = self.inner.user_defined_fields(k.into(), v.into());
335 self
336 }
337 /// <p>A list of name/value string pairs associated with the finding. These are custom, user-defined fields added to a finding.</p>
338 pub fn set_user_defined_fields(
339 mut self,
340 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
341 ) -> Self {
342 self.inner = self.inner.set_user_defined_fields(input);
343 self
344 }
345 /// <p>A list of name/value string pairs associated with the finding. These are custom, user-defined fields added to a finding.</p>
346 pub fn get_user_defined_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
347 self.inner.get_user_defined_fields()
348 }
349 /// <p>Used to update the workflow status of a finding.</p>
350 /// <p>The workflow status indicates the progress of the investigation into the finding.</p>
351 pub fn workflow(mut self, input: crate::types::WorkflowUpdate) -> Self {
352 self.inner = self.inner.workflow(input);
353 self
354 }
355 /// <p>Used to update the workflow status of a finding.</p>
356 /// <p>The workflow status indicates the progress of the investigation into the finding.</p>
357 pub fn set_workflow(mut self, input: ::std::option::Option<crate::types::WorkflowUpdate>) -> Self {
358 self.inner = self.inner.set_workflow(input);
359 self
360 }
361 /// <p>Used to update the workflow status of a finding.</p>
362 /// <p>The workflow status indicates the progress of the investigation into the finding.</p>
363 pub fn get_workflow(&self) -> &::std::option::Option<crate::types::WorkflowUpdate> {
364 self.inner.get_workflow()
365 }
366 ///
367 /// Appends an item to `RelatedFindings`.
368 ///
369 /// To override the contents of this collection use [`set_related_findings`](Self::set_related_findings).
370 ///
371 /// <p>A list of findings that are related to the updated findings.</p>
372 pub fn related_findings(mut self, input: crate::types::RelatedFinding) -> Self {
373 self.inner = self.inner.related_findings(input);
374 self
375 }
376 /// <p>A list of findings that are related to the updated findings.</p>
377 pub fn set_related_findings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>>) -> Self {
378 self.inner = self.inner.set_related_findings(input);
379 self
380 }
381 /// <p>A list of findings that are related to the updated findings.</p>
382 pub fn get_related_findings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>> {
383 self.inner.get_related_findings()
384 }
385}