aws_sdk_securityhub/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 finding attributes used to define a condition to filter the returned findings.</p>
7 /// <p>You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.</p>
8 /// <p>Note that in the available filter fields, <code>WorkflowState</code> is deprecated. To search for a finding based on its workflow status, use <code>WorkflowStatus</code>.</p>
9 pub filters: ::std::option::Option<crate::types::AwsSecurityFindingFilters>,
10 /// <p>The finding attributes used to sort the list of returned findings.</p>
11 pub sort_criteria: ::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>>,
12 /// <p>The token that is required for pagination. On your first call to the <code>GetFindings</code> operation, set the value of this parameter to <code>NULL</code>.</p>
13 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
14 pub next_token: ::std::option::Option<::std::string::String>,
15 /// <p>The maximum number of findings to return.</p>
16 pub max_results: ::std::option::Option<i32>,
17}
18impl GetFindingsInput {
19 /// <p>The finding attributes used to define a condition to filter the returned findings.</p>
20 /// <p>You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.</p>
21 /// <p>Note that in the available filter fields, <code>WorkflowState</code> is deprecated. To search for a finding based on its workflow status, use <code>WorkflowStatus</code>.</p>
22 pub fn filters(&self) -> ::std::option::Option<&crate::types::AwsSecurityFindingFilters> {
23 self.filters.as_ref()
24 }
25 /// <p>The finding attributes used to sort the list of returned findings.</p>
26 ///
27 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sort_criteria.is_none()`.
28 pub fn sort_criteria(&self) -> &[crate::types::SortCriterion] {
29 self.sort_criteria.as_deref().unwrap_or_default()
30 }
31 /// <p>The token that is required for pagination. On your first call to the <code>GetFindings</code> operation, set the value of this parameter to <code>NULL</code>.</p>
32 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
33 pub fn next_token(&self) -> ::std::option::Option<&str> {
34 self.next_token.as_deref()
35 }
36 /// <p>The maximum number of findings to return.</p>
37 pub fn max_results(&self) -> ::std::option::Option<i32> {
38 self.max_results
39 }
40}
41impl GetFindingsInput {
42 /// Creates a new builder-style object to manufacture [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
43 pub fn builder() -> crate::operation::get_findings::builders::GetFindingsInputBuilder {
44 crate::operation::get_findings::builders::GetFindingsInputBuilder::default()
45 }
46}
47
48/// A builder for [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetFindingsInputBuilder {
52 pub(crate) filters: ::std::option::Option<crate::types::AwsSecurityFindingFilters>,
53 pub(crate) sort_criteria: ::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>>,
54 pub(crate) next_token: ::std::option::Option<::std::string::String>,
55 pub(crate) max_results: ::std::option::Option<i32>,
56}
57impl GetFindingsInputBuilder {
58 /// <p>The finding attributes used to define a condition to filter the returned findings.</p>
59 /// <p>You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.</p>
60 /// <p>Note that in the available filter fields, <code>WorkflowState</code> is deprecated. To search for a finding based on its workflow status, use <code>WorkflowStatus</code>.</p>
61 pub fn filters(mut self, input: crate::types::AwsSecurityFindingFilters) -> Self {
62 self.filters = ::std::option::Option::Some(input);
63 self
64 }
65 /// <p>The finding attributes used to define a condition to filter the returned findings.</p>
66 /// <p>You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.</p>
67 /// <p>Note that in the available filter fields, <code>WorkflowState</code> is deprecated. To search for a finding based on its workflow status, use <code>WorkflowStatus</code>.</p>
68 pub fn set_filters(mut self, input: ::std::option::Option<crate::types::AwsSecurityFindingFilters>) -> Self {
69 self.filters = input;
70 self
71 }
72 /// <p>The finding attributes used to define a condition to filter the returned findings.</p>
73 /// <p>You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.</p>
74 /// <p>Note that in the available filter fields, <code>WorkflowState</code> is deprecated. To search for a finding based on its workflow status, use <code>WorkflowStatus</code>.</p>
75 pub fn get_filters(&self) -> &::std::option::Option<crate::types::AwsSecurityFindingFilters> {
76 &self.filters
77 }
78 /// Appends an item to `sort_criteria`.
79 ///
80 /// To override the contents of this collection use [`set_sort_criteria`](Self::set_sort_criteria).
81 ///
82 /// <p>The finding attributes used to sort the list of returned findings.</p>
83 pub fn sort_criteria(mut self, input: crate::types::SortCriterion) -> Self {
84 let mut v = self.sort_criteria.unwrap_or_default();
85 v.push(input);
86 self.sort_criteria = ::std::option::Option::Some(v);
87 self
88 }
89 /// <p>The finding attributes used to sort the list of returned findings.</p>
90 pub fn set_sort_criteria(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>>) -> Self {
91 self.sort_criteria = input;
92 self
93 }
94 /// <p>The finding attributes used to sort the list of returned findings.</p>
95 pub fn get_sort_criteria(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SortCriterion>> {
96 &self.sort_criteria
97 }
98 /// <p>The token that is required for pagination. On your first call to the <code>GetFindings</code> operation, set the value of this parameter to <code>NULL</code>.</p>
99 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
100 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.next_token = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>The token that is required for pagination. On your first call to the <code>GetFindings</code> operation, set the value of this parameter to <code>NULL</code>.</p>
105 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
106 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107 self.next_token = input;
108 self
109 }
110 /// <p>The token that is required for pagination. On your first call to the <code>GetFindings</code> operation, set the value of this parameter to <code>NULL</code>.</p>
111 /// <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
112 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
113 &self.next_token
114 }
115 /// <p>The maximum number of findings to return.</p>
116 pub fn max_results(mut self, input: i32) -> Self {
117 self.max_results = ::std::option::Option::Some(input);
118 self
119 }
120 /// <p>The maximum number of findings to return.</p>
121 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
122 self.max_results = input;
123 self
124 }
125 /// <p>The maximum number of findings to return.</p>
126 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
127 &self.max_results
128 }
129 /// Consumes the builder and constructs a [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
130 pub fn build(self) -> ::std::result::Result<crate::operation::get_findings::GetFindingsInput, ::aws_smithy_types::error::operation::BuildError> {
131 ::std::result::Result::Ok(crate::operation::get_findings::GetFindingsInput {
132 filters: self.filters,
133 sort_criteria: self.sort_criteria,
134 next_token: self.next_token,
135 max_results: self.max_results,
136 })
137 }
138}