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