aws_sdk_guardduty/operation/get_findings/_get_findings_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetFindingsInput {
6 /// <p>The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.</p>
7 /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
8 pub detector_id: ::std::option::Option<::std::string::String>,
9 /// <p>The IDs of the findings that you want to retrieve.</p>
10 pub finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11 /// <p>Represents the criteria used for sorting findings.</p>
12 pub sort_criteria: ::std::option::Option<crate::types::SortCriteria>,
13}
14impl GetFindingsInput {
15 /// <p>The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.</p>
16 /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
17 pub fn detector_id(&self) -> ::std::option::Option<&str> {
18 self.detector_id.as_deref()
19 }
20 /// <p>The IDs of the findings that you want to retrieve.</p>
21 ///
22 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.finding_ids.is_none()`.
23 pub fn finding_ids(&self) -> &[::std::string::String] {
24 self.finding_ids.as_deref().unwrap_or_default()
25 }
26 /// <p>Represents the criteria used for sorting findings.</p>
27 pub fn sort_criteria(&self) -> ::std::option::Option<&crate::types::SortCriteria> {
28 self.sort_criteria.as_ref()
29 }
30}
31impl GetFindingsInput {
32 /// Creates a new builder-style object to manufacture [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
33 pub fn builder() -> crate::operation::get_findings::builders::GetFindingsInputBuilder {
34 crate::operation::get_findings::builders::GetFindingsInputBuilder::default()
35 }
36}
37
38/// A builder for [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct GetFindingsInputBuilder {
42 pub(crate) detector_id: ::std::option::Option<::std::string::String>,
43 pub(crate) finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
44 pub(crate) sort_criteria: ::std::option::Option<crate::types::SortCriteria>,
45}
46impl GetFindingsInputBuilder {
47 /// <p>The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.</p>
48 /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
49 /// This field is required.
50 pub fn detector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51 self.detector_id = ::std::option::Option::Some(input.into());
52 self
53 }
54 /// <p>The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.</p>
55 /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
56 pub fn set_detector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.detector_id = input;
58 self
59 }
60 /// <p>The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.</p>
61 /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
62 pub fn get_detector_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.detector_id
64 }
65 /// Appends an item to `finding_ids`.
66 ///
67 /// To override the contents of this collection use [`set_finding_ids`](Self::set_finding_ids).
68 ///
69 /// <p>The IDs of the findings that you want to retrieve.</p>
70 pub fn finding_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 let mut v = self.finding_ids.unwrap_or_default();
72 v.push(input.into());
73 self.finding_ids = ::std::option::Option::Some(v);
74 self
75 }
76 /// <p>The IDs of the findings that you want to retrieve.</p>
77 pub fn set_finding_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
78 self.finding_ids = input;
79 self
80 }
81 /// <p>The IDs of the findings that you want to retrieve.</p>
82 pub fn get_finding_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
83 &self.finding_ids
84 }
85 /// <p>Represents the criteria used for sorting findings.</p>
86 pub fn sort_criteria(mut self, input: crate::types::SortCriteria) -> Self {
87 self.sort_criteria = ::std::option::Option::Some(input);
88 self
89 }
90 /// <p>Represents the criteria used for sorting findings.</p>
91 pub fn set_sort_criteria(mut self, input: ::std::option::Option<crate::types::SortCriteria>) -> Self {
92 self.sort_criteria = input;
93 self
94 }
95 /// <p>Represents the criteria used for sorting findings.</p>
96 pub fn get_sort_criteria(&self) -> &::std::option::Option<crate::types::SortCriteria> {
97 &self.sort_criteria
98 }
99 /// Consumes the builder and constructs a [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
100 pub fn build(self) -> ::std::result::Result<crate::operation::get_findings::GetFindingsInput, ::aws_smithy_types::error::operation::BuildError> {
101 ::std::result::Result::Ok(crate::operation::get_findings::GetFindingsInput {
102 detector_id: self.detector_id,
103 finding_ids: self.finding_ids,
104 sort_criteria: self.sort_criteria,
105 })
106 }
107}