aws_sdk_iam/operation/simulate_custom_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::simulate_custom_policy::_simulate_custom_policy_output::SimulateCustomPolicyOutputBuilder;
3
4pub use crate::operation::simulate_custom_policy::_simulate_custom_policy_input::SimulateCustomPolicyInputBuilder;
5
6impl crate::operation::simulate_custom_policy::builders::SimulateCustomPolicyInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::simulate_custom_policy::SimulateCustomPolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::simulate_custom_policy::SimulateCustomPolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.simulate_custom_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SimulateCustomPolicy`.
24///
25/// <p>Simulate how a set of IAM policies and optionally a resource-based policy works with a list of API operations and Amazon Web Services resources to determine the policies' effective permissions. The policies are provided as strings.</p>
26/// <p>The simulation does not perform the API operations; it only checks the authorization to determine if the simulated policies allow or deny the operations. You can simulate resources that don't exist in your account.</p>
27/// <p>If you want to simulate existing policies that are attached to an IAM user, group, or role, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_SimulatePrincipalPolicy.html">SimulatePrincipalPolicy</a> instead.</p>
28/// <p>Context keys are variables that are maintained by Amazon Web Services and its services and which provide details about the context of an API query request. You can use the <code>Condition</code> element of an IAM policy to evaluate context keys. To get the list of context keys that the policies require for correct simulation, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetContextKeysForCustomPolicy.html">GetContextKeysForCustomPolicy</a>.</p>
29/// <p>If the output is long, you can use <code>MaxItems</code> and <code>Marker</code> parameters to paginate the results.</p><note>
30/// <p>The IAM policy simulator evaluates statements in the identity-based policy and the inputs that you provide during simulation. The policy simulator results can differ from your live Amazon Web Services environment. We recommend that you check your policies against your live Amazon Web Services environment after testing using the policy simulator to confirm that you have the desired results. For more information about using the policy simulator, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html">Testing IAM policies with the IAM policy simulator </a>in the <i>IAM User Guide</i>.</p>
31/// </note>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct SimulateCustomPolicyFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::simulate_custom_policy::builders::SimulateCustomPolicyInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::simulate_custom_policy::SimulateCustomPolicyOutput,
41        crate::operation::simulate_custom_policy::SimulateCustomPolicyError,
42    > for SimulateCustomPolicyFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::simulate_custom_policy::SimulateCustomPolicyOutput,
50            crate::operation::simulate_custom_policy::SimulateCustomPolicyError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl SimulateCustomPolicyFluentBuilder {
57    /// Creates a new `SimulateCustomPolicyFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the SimulateCustomPolicy as a reference.
66    pub fn as_input(&self) -> &crate::operation::simulate_custom_policy::builders::SimulateCustomPolicyInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::simulate_custom_policy::SimulateCustomPolicyOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::simulate_custom_policy::SimulateCustomPolicyError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::simulate_custom_policy::SimulateCustomPolicy::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::simulate_custom_policy::SimulateCustomPolicy::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::simulate_custom_policy::SimulateCustomPolicyOutput,
103        crate::operation::simulate_custom_policy::SimulateCustomPolicyError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// Create a paginator for this request
118    ///
119    /// Paginators are used by calling [`send().await`](crate::operation::simulate_custom_policy::paginator::SimulateCustomPolicyPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120    pub fn into_paginator(self) -> crate::operation::simulate_custom_policy::paginator::SimulateCustomPolicyPaginator {
121        crate::operation::simulate_custom_policy::paginator::SimulateCustomPolicyPaginator::new(self.handle, self.inner)
122    }
123    ///
124    /// Appends an item to `PolicyInputList`.
125    ///
126    /// To override the contents of this collection use [`set_policy_input_list`](Self::set_policy_input_list).
127    ///
128    /// <p>A list of policy documents to include in the simulation. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. Do not include any resource-based policies in this parameter. Any resource-based policy must be submitted with the <code>ResourcePolicy</code> parameter. The policies cannot be "scope-down" policies, such as you could include in a call to <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetFederationToken.html">GetFederationToken</a> or one of the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_AssumeRole.html">AssumeRole</a> API operations. In other words, do not use policies designed to restrict what a user can do while using the temporary credentials.</p>
129    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
130    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
131    /// <ul>
132    /// <li>
133    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
134    /// <li>
135    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
136    /// <li>
137    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
138    /// </ul>
139    pub fn policy_input_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.policy_input_list(input.into());
141        self
142    }
143    /// <p>A list of policy documents to include in the simulation. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. Do not include any resource-based policies in this parameter. Any resource-based policy must be submitted with the <code>ResourcePolicy</code> parameter. The policies cannot be "scope-down" policies, such as you could include in a call to <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetFederationToken.html">GetFederationToken</a> or one of the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_AssumeRole.html">AssumeRole</a> API operations. In other words, do not use policies designed to restrict what a user can do while using the temporary credentials.</p>
144    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
145    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
146    /// <ul>
147    /// <li>
148    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
149    /// <li>
150    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
151    /// <li>
152    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
153    /// </ul>
154    pub fn set_policy_input_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
155        self.inner = self.inner.set_policy_input_list(input);
156        self
157    }
158    /// <p>A list of policy documents to include in the simulation. Each document is specified as a string containing the complete, valid JSON text of an IAM policy. Do not include any resource-based policies in this parameter. Any resource-based policy must be submitted with the <code>ResourcePolicy</code> parameter. The policies cannot be "scope-down" policies, such as you could include in a call to <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetFederationToken.html">GetFederationToken</a> or one of the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_AssumeRole.html">AssumeRole</a> API operations. In other words, do not use policies designed to restrict what a user can do while using the temporary credentials.</p>
159    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
160    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
161    /// <ul>
162    /// <li>
163    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
164    /// <li>
165    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
166    /// <li>
167    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
168    /// </ul>
169    pub fn get_policy_input_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170        self.inner.get_policy_input_list()
171    }
172    ///
173    /// Appends an item to `PermissionsBoundaryPolicyInputList`.
174    ///
175    /// To override the contents of this collection use [`set_permissions_boundary_policy_input_list`](Self::set_permissions_boundary_policy_input_list).
176    ///
177    /// <p>The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that an IAM entity can have. You can input only one permissions boundary when you pass a policy to this operation. For more information about permissions boundaries, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html">Permissions boundaries for IAM entities</a> in the <i>IAM User Guide</i>. The policy input is specified as a string that contains the complete, valid JSON text of a permissions boundary policy.</p>
178    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
179    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
180    /// <ul>
181    /// <li>
182    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
183    /// <li>
184    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
185    /// <li>
186    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
187    /// </ul>
188    pub fn permissions_boundary_policy_input_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.inner = self.inner.permissions_boundary_policy_input_list(input.into());
190        self
191    }
192    /// <p>The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that an IAM entity can have. You can input only one permissions boundary when you pass a policy to this operation. For more information about permissions boundaries, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html">Permissions boundaries for IAM entities</a> in the <i>IAM User Guide</i>. The policy input is specified as a string that contains the complete, valid JSON text of a permissions boundary policy.</p>
193    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
194    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
195    /// <ul>
196    /// <li>
197    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
198    /// <li>
199    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
200    /// <li>
201    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
202    /// </ul>
203    pub fn set_permissions_boundary_policy_input_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
204        self.inner = self.inner.set_permissions_boundary_policy_input_list(input);
205        self
206    }
207    /// <p>The IAM permissions boundary policy to simulate. The permissions boundary sets the maximum permissions that an IAM entity can have. You can input only one permissions boundary when you pass a policy to this operation. For more information about permissions boundaries, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html">Permissions boundaries for IAM entities</a> in the <i>IAM User Guide</i>. The policy input is specified as a string that contains the complete, valid JSON text of a permissions boundary policy.</p>
208    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
209    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
210    /// <ul>
211    /// <li>
212    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
213    /// <li>
214    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
215    /// <li>
216    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
217    /// </ul>
218    pub fn get_permissions_boundary_policy_input_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
219        self.inner.get_permissions_boundary_policy_input_list()
220    }
221    ///
222    /// Appends an item to `ActionNames`.
223    ///
224    /// To override the contents of this collection use [`set_action_names`](Self::set_action_names).
225    ///
226    /// <p>A list of names of API operations to evaluate in the simulation. Each operation is evaluated against each resource. Each operation must include the service identifier, such as <code>iam:CreateUser</code>. This operation does not support using wildcards (*) in an action name.</p>
227    pub fn action_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228        self.inner = self.inner.action_names(input.into());
229        self
230    }
231    /// <p>A list of names of API operations to evaluate in the simulation. Each operation is evaluated against each resource. Each operation must include the service identifier, such as <code>iam:CreateUser</code>. This operation does not support using wildcards (*) in an action name.</p>
232    pub fn set_action_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
233        self.inner = self.inner.set_action_names(input);
234        self
235    }
236    /// <p>A list of names of API operations to evaluate in the simulation. Each operation is evaluated against each resource. Each operation must include the service identifier, such as <code>iam:CreateUser</code>. This operation does not support using wildcards (*) in an action name.</p>
237    pub fn get_action_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
238        self.inner.get_action_names()
239    }
240    ///
241    /// Appends an item to `ResourceArns`.
242    ///
243    /// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
244    ///
245    /// <p>A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to <code>*</code> (all resources). Each API in the <code>ActionNames</code> parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.</p>
246    /// <p>The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the <code>ResourcePolicy</code> parameter.</p>
247    /// <p>If you include a <code>ResourcePolicy</code>, then it must be applicable to all of the resources included in the simulation or you receive an invalid input error.</p>
248    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p><note>
249    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
250    /// </note>
251    pub fn resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.inner = self.inner.resource_arns(input.into());
253        self
254    }
255    /// <p>A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to <code>*</code> (all resources). Each API in the <code>ActionNames</code> parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.</p>
256    /// <p>The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the <code>ResourcePolicy</code> parameter.</p>
257    /// <p>If you include a <code>ResourcePolicy</code>, then it must be applicable to all of the resources included in the simulation or you receive an invalid input error.</p>
258    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p><note>
259    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
260    /// </note>
261    pub fn set_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
262        self.inner = self.inner.set_resource_arns(input);
263        self
264    }
265    /// <p>A list of ARNs of Amazon Web Services resources to include in the simulation. If this parameter is not provided, then the value defaults to <code>*</code> (all resources). Each API in the <code>ActionNames</code> parameter is evaluated for each resource in this list. The simulation determines the access result (allowed or denied) of each combination and reports it in the response. You can simulate resources that don't exist in your account.</p>
266    /// <p>The simulation does not automatically retrieve policies for the specified resources. If you want to include a resource policy in the simulation, then you must include the policy as a string in the <code>ResourcePolicy</code> parameter.</p>
267    /// <p>If you include a <code>ResourcePolicy</code>, then it must be applicable to all of the resources included in the simulation or you receive an invalid input error.</p>
268    /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p><note>
269    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
270    /// </note>
271    pub fn get_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
272        self.inner.get_resource_arns()
273    }
274    /// <p>A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.</p>
275    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
276    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
277    /// <ul>
278    /// <li>
279    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
280    /// <li>
281    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
282    /// <li>
283    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
284    /// </ul><note>
285    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
286    /// </note>
287    pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288        self.inner = self.inner.resource_policy(input.into());
289        self
290    }
291    /// <p>A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.</p>
292    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
293    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
294    /// <ul>
295    /// <li>
296    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
297    /// <li>
298    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
299    /// <li>
300    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
301    /// </ul><note>
302    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
303    /// </note>
304    pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305        self.inner = self.inner.set_resource_policy(input);
306        self
307    }
308    /// <p>A resource-based policy to include in the simulation provided as a string. Each resource in the simulation is treated as if it had this policy attached. You can include only one resource-based policy in a simulation.</p>
309    /// <p>The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length">IAM and STS character quotas</a>.</p>
310    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
311    /// <ul>
312    /// <li>
313    /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
314    /// <li>
315    /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
316    /// <li>
317    /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
318    /// </ul><note>
319    /// <p>Simulation of resource-based policies isn't supported for IAM roles.</p>
320    /// </note>
321    pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
322        self.inner.get_resource_policy()
323    }
324    /// <p>An ARN representing the Amazon Web Services account ID that specifies the owner of any simulated resource that does not identify its owner in the resource ARN. Examples of resource ARNs include an S3 bucket or object. If <code>ResourceOwner</code> is specified, it is also used as the account owner of any <code>ResourcePolicy</code> included in the simulation. If the <code>ResourceOwner</code> parameter is not specified, then the owner of the resources and the resource policy defaults to the account of the identity provided in <code>CallerArn</code>. This parameter is required only if you specify a resource-based policy and account that owns the resource is different from the account that owns the simulated calling user <code>CallerArn</code>.</p>
325    /// <p>The ARN for an account uses the following syntax: <code>arn:aws:iam::<i>AWS-account-ID</i>:root</code>. For example, to represent the account with the 112233445566 ID, use the following ARN: <code>arn:aws:iam::112233445566-ID:root</code>.</p>
326    pub fn resource_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
327        self.inner = self.inner.resource_owner(input.into());
328        self
329    }
330    /// <p>An ARN representing the Amazon Web Services account ID that specifies the owner of any simulated resource that does not identify its owner in the resource ARN. Examples of resource ARNs include an S3 bucket or object. If <code>ResourceOwner</code> is specified, it is also used as the account owner of any <code>ResourcePolicy</code> included in the simulation. If the <code>ResourceOwner</code> parameter is not specified, then the owner of the resources and the resource policy defaults to the account of the identity provided in <code>CallerArn</code>. This parameter is required only if you specify a resource-based policy and account that owns the resource is different from the account that owns the simulated calling user <code>CallerArn</code>.</p>
331    /// <p>The ARN for an account uses the following syntax: <code>arn:aws:iam::<i>AWS-account-ID</i>:root</code>. For example, to represent the account with the 112233445566 ID, use the following ARN: <code>arn:aws:iam::112233445566-ID:root</code>.</p>
332    pub fn set_resource_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
333        self.inner = self.inner.set_resource_owner(input);
334        self
335    }
336    /// <p>An ARN representing the Amazon Web Services account ID that specifies the owner of any simulated resource that does not identify its owner in the resource ARN. Examples of resource ARNs include an S3 bucket or object. If <code>ResourceOwner</code> is specified, it is also used as the account owner of any <code>ResourcePolicy</code> included in the simulation. If the <code>ResourceOwner</code> parameter is not specified, then the owner of the resources and the resource policy defaults to the account of the identity provided in <code>CallerArn</code>. This parameter is required only if you specify a resource-based policy and account that owns the resource is different from the account that owns the simulated calling user <code>CallerArn</code>.</p>
337    /// <p>The ARN for an account uses the following syntax: <code>arn:aws:iam::<i>AWS-account-ID</i>:root</code>. For example, to represent the account with the 112233445566 ID, use the following ARN: <code>arn:aws:iam::112233445566-ID:root</code>.</p>
338    pub fn get_resource_owner(&self) -> &::std::option::Option<::std::string::String> {
339        self.inner.get_resource_owner()
340    }
341    /// <p>The ARN of the IAM user that you want to use as the simulated caller of the API operations. <code>CallerArn</code> is required if you include a <code>ResourcePolicy</code> so that the policy's <code>Principal</code> element has a value to use in evaluating the policy.</p>
342    /// <p>You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.</p>
343    pub fn caller_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
344        self.inner = self.inner.caller_arn(input.into());
345        self
346    }
347    /// <p>The ARN of the IAM user that you want to use as the simulated caller of the API operations. <code>CallerArn</code> is required if you include a <code>ResourcePolicy</code> so that the policy's <code>Principal</code> element has a value to use in evaluating the policy.</p>
348    /// <p>You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.</p>
349    pub fn set_caller_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
350        self.inner = self.inner.set_caller_arn(input);
351        self
352    }
353    /// <p>The ARN of the IAM user that you want to use as the simulated caller of the API operations. <code>CallerArn</code> is required if you include a <code>ResourcePolicy</code> so that the policy's <code>Principal</code> element has a value to use in evaluating the policy.</p>
354    /// <p>You can specify only the ARN of an IAM user. You cannot specify the ARN of an assumed role, federated user, or a service principal.</p>
355    pub fn get_caller_arn(&self) -> &::std::option::Option<::std::string::String> {
356        self.inner.get_caller_arn()
357    }
358    ///
359    /// Appends an item to `ContextEntries`.
360    ///
361    /// To override the contents of this collection use [`set_context_entries`](Self::set_context_entries).
362    ///
363    /// <p>A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.</p>
364    pub fn context_entries(mut self, input: crate::types::ContextEntry) -> Self {
365        self.inner = self.inner.context_entries(input);
366        self
367    }
368    /// <p>A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.</p>
369    pub fn set_context_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContextEntry>>) -> Self {
370        self.inner = self.inner.set_context_entries(input);
371        self
372    }
373    /// <p>A list of context keys and corresponding values for the simulation to use. Whenever a context key is evaluated in one of the simulated IAM permissions policies, the corresponding value is supplied.</p>
374    pub fn get_context_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContextEntry>> {
375        self.inner.get_context_entries()
376    }
377    /// <p>Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.</p>
378    /// <p>Each of the Amazon EC2 scenarios requires that you specify instance, image, and security group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the Amazon EC2 scenario includes VPC, then you must supply the network interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the Amazon EC2 scenario options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html">Supported platforms</a> in the <i>Amazon EC2 User Guide</i>.</p>
379    /// <ul>
380    /// <li>
381    /// <p><b>EC2-VPC-InstanceStore</b></p>
382    /// <p>instance, image, security group, network interface</p></li>
383    /// <li>
384    /// <p><b>EC2-VPC-InstanceStore-Subnet</b></p>
385    /// <p>instance, image, security group, network interface, subnet</p></li>
386    /// <li>
387    /// <p><b>EC2-VPC-EBS</b></p>
388    /// <p>instance, image, security group, network interface, volume</p></li>
389    /// <li>
390    /// <p><b>EC2-VPC-EBS-Subnet</b></p>
391    /// <p>instance, image, security group, network interface, subnet, volume</p></li>
392    /// </ul>
393    pub fn resource_handling_option(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
394        self.inner = self.inner.resource_handling_option(input.into());
395        self
396    }
397    /// <p>Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.</p>
398    /// <p>Each of the Amazon EC2 scenarios requires that you specify instance, image, and security group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the Amazon EC2 scenario includes VPC, then you must supply the network interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the Amazon EC2 scenario options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html">Supported platforms</a> in the <i>Amazon EC2 User Guide</i>.</p>
399    /// <ul>
400    /// <li>
401    /// <p><b>EC2-VPC-InstanceStore</b></p>
402    /// <p>instance, image, security group, network interface</p></li>
403    /// <li>
404    /// <p><b>EC2-VPC-InstanceStore-Subnet</b></p>
405    /// <p>instance, image, security group, network interface, subnet</p></li>
406    /// <li>
407    /// <p><b>EC2-VPC-EBS</b></p>
408    /// <p>instance, image, security group, network interface, volume</p></li>
409    /// <li>
410    /// <p><b>EC2-VPC-EBS-Subnet</b></p>
411    /// <p>instance, image, security group, network interface, subnet, volume</p></li>
412    /// </ul>
413    pub fn set_resource_handling_option(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
414        self.inner = self.inner.set_resource_handling_option(input);
415        self
416    }
417    /// <p>Specifies the type of simulation to run. Different API operations that support resource-based policies require different combinations of resources. By specifying the type of simulation to run, you enable the policy simulator to enforce the presence of the required resources to ensure reliable simulation results. If your simulation does not match one of the following scenarios, then you can omit this parameter. The following list shows each of the supported scenario values and the resources that you must define to run the simulation.</p>
418    /// <p>Each of the Amazon EC2 scenarios requires that you specify instance, image, and security group resources. If your scenario includes an EBS volume, then you must specify that volume as a resource. If the Amazon EC2 scenario includes VPC, then you must supply the network interface resource. If it includes an IP subnet, then you must specify the subnet resource. For more information on the Amazon EC2 scenario options, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html">Supported platforms</a> in the <i>Amazon EC2 User Guide</i>.</p>
419    /// <ul>
420    /// <li>
421    /// <p><b>EC2-VPC-InstanceStore</b></p>
422    /// <p>instance, image, security group, network interface</p></li>
423    /// <li>
424    /// <p><b>EC2-VPC-InstanceStore-Subnet</b></p>
425    /// <p>instance, image, security group, network interface, subnet</p></li>
426    /// <li>
427    /// <p><b>EC2-VPC-EBS</b></p>
428    /// <p>instance, image, security group, network interface, volume</p></li>
429    /// <li>
430    /// <p><b>EC2-VPC-EBS-Subnet</b></p>
431    /// <p>instance, image, security group, network interface, subnet, volume</p></li>
432    /// </ul>
433    pub fn get_resource_handling_option(&self) -> &::std::option::Option<::std::string::String> {
434        self.inner.get_resource_handling_option()
435    }
436    /// <p>Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the <code>IsTruncated</code> response element is <code>true</code>.</p>
437    /// <p>If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the <code>IsTruncated</code> response element returns <code>true</code>, and <code>Marker</code> contains a value to include in the subsequent call that tells the service where to continue from.</p>
438    pub fn max_items(mut self, input: i32) -> Self {
439        self.inner = self.inner.max_items(input);
440        self
441    }
442    /// <p>Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the <code>IsTruncated</code> response element is <code>true</code>.</p>
443    /// <p>If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the <code>IsTruncated</code> response element returns <code>true</code>, and <code>Marker</code> contains a value to include in the subsequent call that tells the service where to continue from.</p>
444    pub fn set_max_items(mut self, input: ::std::option::Option<i32>) -> Self {
445        self.inner = self.inner.set_max_items(input);
446        self
447    }
448    /// <p>Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the <code>IsTruncated</code> response element is <code>true</code>.</p>
449    /// <p>If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the <code>IsTruncated</code> response element returns <code>true</code>, and <code>Marker</code> contains a value to include in the subsequent call that tells the service where to continue from.</p>
450    pub fn get_max_items(&self) -> &::std::option::Option<i32> {
451        self.inner.get_max_items()
452    }
453    /// <p>Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the <code>Marker</code> element in the response that you received to indicate where the next call should start.</p>
454    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
455        self.inner = self.inner.marker(input.into());
456        self
457    }
458    /// <p>Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the <code>Marker</code> element in the response that you received to indicate where the next call should start.</p>
459    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
460        self.inner = self.inner.set_marker(input);
461        self
462    }
463    /// <p>Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the <code>Marker</code> element in the response that you received to indicate where the next call should start.</p>
464    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
465        self.inner.get_marker()
466    }
467}