Skip to main content

aws_sdk_accessanalyzer/operation/list_policy_generations/
_list_policy_generations_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 ListPolicyGenerationsInput {
6    /// <p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>
7    pub principal_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The maximum number of results to return in the response.</p>
9    pub max_results: ::std::option::Option<i32>,
10    /// <p>A token used for pagination of results returned.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12}
13impl ListPolicyGenerationsInput {
14    /// <p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>
15    pub fn principal_arn(&self) -> ::std::option::Option<&str> {
16        self.principal_arn.as_deref()
17    }
18    /// <p>The maximum number of results to return in the response.</p>
19    pub fn max_results(&self) -> ::std::option::Option<i32> {
20        self.max_results
21    }
22    /// <p>A token used for pagination of results returned.</p>
23    pub fn next_token(&self) -> ::std::option::Option<&str> {
24        self.next_token.as_deref()
25    }
26}
27impl ListPolicyGenerationsInput {
28    /// Creates a new builder-style object to manufacture [`ListPolicyGenerationsInput`](crate::operation::list_policy_generations::ListPolicyGenerationsInput).
29    pub fn builder() -> crate::operation::list_policy_generations::builders::ListPolicyGenerationsInputBuilder {
30        crate::operation::list_policy_generations::builders::ListPolicyGenerationsInputBuilder::default()
31    }
32}
33
34/// A builder for [`ListPolicyGenerationsInput`](crate::operation::list_policy_generations::ListPolicyGenerationsInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct ListPolicyGenerationsInputBuilder {
38    pub(crate) principal_arn: ::std::option::Option<::std::string::String>,
39    pub(crate) max_results: ::std::option::Option<i32>,
40    pub(crate) next_token: ::std::option::Option<::std::string::String>,
41}
42impl ListPolicyGenerationsInputBuilder {
43    /// <p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>
44    pub fn principal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.principal_arn = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>
49    pub fn set_principal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.principal_arn = input;
51        self
52    }
53    /// <p>The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with <code>ListGeneratedPolicies</code> to filter the results to only include results for a specific principal.</p>
54    pub fn get_principal_arn(&self) -> &::std::option::Option<::std::string::String> {
55        &self.principal_arn
56    }
57    /// <p>The maximum number of results to return in the response.</p>
58    pub fn max_results(mut self, input: i32) -> Self {
59        self.max_results = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>The maximum number of results to return in the response.</p>
63    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
64        self.max_results = input;
65        self
66    }
67    /// <p>The maximum number of results to return in the response.</p>
68    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
69        &self.max_results
70    }
71    /// <p>A token used for pagination of results returned.</p>
72    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.next_token = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>A token used for pagination of results returned.</p>
77    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.next_token = input;
79        self
80    }
81    /// <p>A token used for pagination of results returned.</p>
82    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
83        &self.next_token
84    }
85    /// Consumes the builder and constructs a [`ListPolicyGenerationsInput`](crate::operation::list_policy_generations::ListPolicyGenerationsInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::list_policy_generations::ListPolicyGenerationsInput, ::aws_smithy_types::error::operation::BuildError>
89    {
90        ::std::result::Result::Ok(crate::operation::list_policy_generations::ListPolicyGenerationsInput {
91            principal_arn: self.principal_arn,
92            max_results: self.max_results,
93            next_token: self.next_token,
94        })
95    }
96}