aws_sdk_macie2/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>An array of strings that lists the unique identifiers for the findings to retrieve. You can specify as many as 50 unique identifiers in this array.</p>
7    pub finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The criteria for sorting the results of the request.</p>
9    pub sort_criteria: ::std::option::Option<crate::types::SortCriteria>,
10}
11impl GetFindingsInput {
12    /// <p>An array of strings that lists the unique identifiers for the findings to retrieve. You can specify as many as 50 unique identifiers in this array.</p>
13    ///
14    /// 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()`.
15    pub fn finding_ids(&self) -> &[::std::string::String] {
16        self.finding_ids.as_deref().unwrap_or_default()
17    }
18    /// <p>The criteria for sorting the results of the request.</p>
19    pub fn sort_criteria(&self) -> ::std::option::Option<&crate::types::SortCriteria> {
20        self.sort_criteria.as_ref()
21    }
22}
23impl GetFindingsInput {
24    /// Creates a new builder-style object to manufacture [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
25    pub fn builder() -> crate::operation::get_findings::builders::GetFindingsInputBuilder {
26        crate::operation::get_findings::builders::GetFindingsInputBuilder::default()
27    }
28}
29
30/// A builder for [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct GetFindingsInputBuilder {
34    pub(crate) finding_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
35    pub(crate) sort_criteria: ::std::option::Option<crate::types::SortCriteria>,
36}
37impl GetFindingsInputBuilder {
38    /// Appends an item to `finding_ids`.
39    ///
40    /// To override the contents of this collection use [`set_finding_ids`](Self::set_finding_ids).
41    ///
42    /// <p>An array of strings that lists the unique identifiers for the findings to retrieve. You can specify as many as 50 unique identifiers in this array.</p>
43    pub fn finding_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        let mut v = self.finding_ids.unwrap_or_default();
45        v.push(input.into());
46        self.finding_ids = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>An array of strings that lists the unique identifiers for the findings to retrieve. You can specify as many as 50 unique identifiers in this array.</p>
50    pub fn set_finding_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
51        self.finding_ids = input;
52        self
53    }
54    /// <p>An array of strings that lists the unique identifiers for the findings to retrieve. You can specify as many as 50 unique identifiers in this array.</p>
55    pub fn get_finding_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
56        &self.finding_ids
57    }
58    /// <p>The criteria for sorting the results of the request.</p>
59    pub fn sort_criteria(mut self, input: crate::types::SortCriteria) -> Self {
60        self.sort_criteria = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The criteria for sorting the results of the request.</p>
64    pub fn set_sort_criteria(mut self, input: ::std::option::Option<crate::types::SortCriteria>) -> Self {
65        self.sort_criteria = input;
66        self
67    }
68    /// <p>The criteria for sorting the results of the request.</p>
69    pub fn get_sort_criteria(&self) -> &::std::option::Option<crate::types::SortCriteria> {
70        &self.sort_criteria
71    }
72    /// Consumes the builder and constructs a [`GetFindingsInput`](crate::operation::get_findings::GetFindingsInput).
73    pub fn build(self) -> ::std::result::Result<crate::operation::get_findings::GetFindingsInput, ::aws_smithy_types::error::operation::BuildError> {
74        ::std::result::Result::Ok(crate::operation::get_findings::GetFindingsInput {
75            finding_ids: self.finding_ids,
76            sort_criteria: self.sort_criteria,
77        })
78    }
79}