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 ValidatePolicyOutput {
6/// <p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>
7pub findings: ::std::vec::Vec<crate::types::ValidatePolicyFinding>,
8/// <p>A token used for pagination of results returned.</p>
9pub next_token: ::std::option::Option<::std::string::String>,
10 _request_id: Option<String>,
11}
12impl ValidatePolicyOutput {
13/// <p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>
14pub fn findings(&self) -> &[crate::types::ValidatePolicyFinding] {
15use std::ops::Deref;
16self.findings.deref()
17 }
18/// <p>A token used for pagination of results returned.</p>
19pub fn next_token(&self) -> ::std::option::Option<&str> {
20self.next_token.as_deref()
21 }
22}
23impl ::aws_types::request_id::RequestId for ValidatePolicyOutput {
24fn request_id(&self) -> Option<&str> {
25self._request_id.as_deref()
26 }
27}
28impl ValidatePolicyOutput {
29/// Creates a new builder-style object to manufacture [`ValidatePolicyOutput`](crate::operation::validate_policy::ValidatePolicyOutput).
30pub fn builder() -> crate::operation::validate_policy::builders::ValidatePolicyOutputBuilder {
31crate::operation::validate_policy::builders::ValidatePolicyOutputBuilder::default()
32 }
33}
3435/// A builder for [`ValidatePolicyOutput`](crate::operation::validate_policy::ValidatePolicyOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ValidatePolicyOutputBuilder {
39pub(crate) findings: ::std::option::Option<::std::vec::Vec<crate::types::ValidatePolicyFinding>>,
40pub(crate) next_token: ::std::option::Option<::std::string::String>,
41 _request_id: Option<String>,
42}
43impl ValidatePolicyOutputBuilder {
44/// Appends an item to `findings`.
45 ///
46 /// To override the contents of this collection use [`set_findings`](Self::set_findings).
47 ///
48 /// <p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>
49pub fn findings(mut self, input: crate::types::ValidatePolicyFinding) -> Self {
50let mut v = self.findings.unwrap_or_default();
51 v.push(input);
52self.findings = ::std::option::Option::Some(v);
53self
54}
55/// <p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>
56pub fn set_findings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ValidatePolicyFinding>>) -> Self {
57self.findings = input;
58self
59}
60/// <p>The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.</p>
61pub fn get_findings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ValidatePolicyFinding>> {
62&self.findings
63 }
64/// <p>A token used for pagination of results returned.</p>
65pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66self.next_token = ::std::option::Option::Some(input.into());
67self
68}
69/// <p>A token used for pagination of results returned.</p>
70pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71self.next_token = input;
72self
73}
74/// <p>A token used for pagination of results returned.</p>
75pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
76&self.next_token
77 }
78pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
79self._request_id = Some(request_id.into());
80self
81}
8283pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
84self._request_id = request_id;
85self
86}
87/// Consumes the builder and constructs a [`ValidatePolicyOutput`](crate::operation::validate_policy::ValidatePolicyOutput).
88 /// This method will fail if any of the following fields are not set:
89 /// - [`findings`](crate::operation::validate_policy::builders::ValidatePolicyOutputBuilder::findings)
90pub fn build(
91self,
92 ) -> ::std::result::Result<crate::operation::validate_policy::ValidatePolicyOutput, ::aws_smithy_types::error::operation::BuildError> {
93 ::std::result::Result::Ok(crate::operation::validate_policy::ValidatePolicyOutput {
94 findings: self.findings.ok_or_else(|| {
95 ::aws_smithy_types::error::operation::BuildError::missing_field(
96"findings",
97"findings was not specified but it is required when building ValidatePolicyOutput",
98 )
99 })?,
100 next_token: self.next_token,
101 _request_id: self._request_id,
102 })
103 }
104}