aws_sdk_accessanalyzer/operation/get_finding/
_get_finding_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Retrieves a finding.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetFindingInput {
7    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the finding.</p>
8    pub analyzer_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the finding to retrieve.</p>
10    pub id: ::std::option::Option<::std::string::String>,
11}
12impl GetFindingInput {
13    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the finding.</p>
14    pub fn analyzer_arn(&self) -> ::std::option::Option<&str> {
15        self.analyzer_arn.as_deref()
16    }
17    /// <p>The ID of the finding to retrieve.</p>
18    pub fn id(&self) -> ::std::option::Option<&str> {
19        self.id.as_deref()
20    }
21}
22impl GetFindingInput {
23    /// Creates a new builder-style object to manufacture [`GetFindingInput`](crate::operation::get_finding::GetFindingInput).
24    pub fn builder() -> crate::operation::get_finding::builders::GetFindingInputBuilder {
25        crate::operation::get_finding::builders::GetFindingInputBuilder::default()
26    }
27}
28
29/// A builder for [`GetFindingInput`](crate::operation::get_finding::GetFindingInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetFindingInputBuilder {
33    pub(crate) analyzer_arn: ::std::option::Option<::std::string::String>,
34    pub(crate) id: ::std::option::Option<::std::string::String>,
35}
36impl GetFindingInputBuilder {
37    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the finding.</p>
38    /// This field is required.
39    pub fn analyzer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.analyzer_arn = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the finding.</p>
44    pub fn set_analyzer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.analyzer_arn = input;
46        self
47    }
48    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> that generated the finding.</p>
49    pub fn get_analyzer_arn(&self) -> &::std::option::Option<::std::string::String> {
50        &self.analyzer_arn
51    }
52    /// <p>The ID of the finding to retrieve.</p>
53    /// This field is required.
54    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ID of the finding to retrieve.</p>
59    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.id = input;
61        self
62    }
63    /// <p>The ID of the finding to retrieve.</p>
64    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.id
66    }
67    /// Consumes the builder and constructs a [`GetFindingInput`](crate::operation::get_finding::GetFindingInput).
68    pub fn build(self) -> ::std::result::Result<crate::operation::get_finding::GetFindingInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::get_finding::GetFindingInput {
70            analyzer_arn: self.analyzer_arn,
71            id: self.id,
72        })
73    }
74}