aws-sdk-accessanalyzer 1.106.0

AWS SDK for Access Analyzer
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Retrieves a list of findings generated by the specified analyzer.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListFindingsInput {
    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
    pub analyzer_arn: ::std::option::Option<::std::string::String>,
    /// <p>A filter to match for the findings to return.</p>
    pub filter: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Criterion>>,
    /// <p>The sort order for the findings returned.</p>
    pub sort: ::std::option::Option<crate::types::SortCriteria>,
    /// <p>A token used for pagination of results returned.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The maximum number of results to return in the response.</p>
    pub max_results: ::std::option::Option<i32>,
}
impl ListFindingsInput {
    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
    pub fn analyzer_arn(&self) -> ::std::option::Option<&str> {
        self.analyzer_arn.as_deref()
    }
    /// <p>A filter to match for the findings to return.</p>
    pub fn filter(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Criterion>> {
        self.filter.as_ref()
    }
    /// <p>The sort order for the findings returned.</p>
    pub fn sort(&self) -> ::std::option::Option<&crate::types::SortCriteria> {
        self.sort.as_ref()
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The maximum number of results to return in the response.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
}
impl ListFindingsInput {
    /// Creates a new builder-style object to manufacture [`ListFindingsInput`](crate::operation::list_findings::ListFindingsInput).
    pub fn builder() -> crate::operation::list_findings::builders::ListFindingsInputBuilder {
        crate::operation::list_findings::builders::ListFindingsInputBuilder::default()
    }
}

/// A builder for [`ListFindingsInput`](crate::operation::list_findings::ListFindingsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListFindingsInputBuilder {
    pub(crate) analyzer_arn: ::std::option::Option<::std::string::String>,
    pub(crate) filter: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Criterion>>,
    pub(crate) sort: ::std::option::Option<crate::types::SortCriteria>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) max_results: ::std::option::Option<i32>,
}
impl ListFindingsInputBuilder {
    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
    /// This field is required.
    pub fn analyzer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.analyzer_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
    pub fn set_analyzer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.analyzer_arn = input;
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
    pub fn get_analyzer_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.analyzer_arn
    }
    /// Adds a key-value pair to `filter`.
    ///
    /// To override the contents of this collection use [`set_filter`](Self::set_filter).
    ///
    /// <p>A filter to match for the findings to return.</p>
    pub fn filter(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Criterion) -> Self {
        let mut hash_map = self.filter.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.filter = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A filter to match for the findings to return.</p>
    pub fn set_filter(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Criterion>>) -> Self {
        self.filter = input;
        self
    }
    /// <p>A filter to match for the findings to return.</p>
    pub fn get_filter(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Criterion>> {
        &self.filter
    }
    /// <p>The sort order for the findings returned.</p>
    pub fn sort(mut self, input: crate::types::SortCriteria) -> Self {
        self.sort = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sort order for the findings returned.</p>
    pub fn set_sort(mut self, input: ::std::option::Option<crate::types::SortCriteria>) -> Self {
        self.sort = input;
        self
    }
    /// <p>The sort order for the findings returned.</p>
    pub fn get_sort(&self) -> &::std::option::Option<crate::types::SortCriteria> {
        &self.sort
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>A token used for pagination of results returned.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>The maximum number of results to return in the response.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of results to return in the response.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>The maximum number of results to return in the response.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// Consumes the builder and constructs a [`ListFindingsInput`](crate::operation::list_findings::ListFindingsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_findings::ListFindingsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_findings::ListFindingsInput {
            analyzer_arn: self.analyzer_arn,
            filter: self.filter,
            sort: self.sort,
            next_token: self.next_token,
            max_results: self.max_results,
        })
    }
}