aws_sdk_sts/operation/assume_role/
_assume_role_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 AssumeRoleInput  {
6    /// <p>The Amazon Resource Name (ARN) of the role to assume.</p>
7    pub role_arn: ::std::option::Option<::std::string::String>,
8    /// <p>An identifier for the assumed role session.</p>
9    /// <p>Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.</p>
10    /// <p>For security purposes, administrators can view this field in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds">CloudTrail logs</a> to help identify who performed an action in Amazon Web Services. Your administrator might require that you specify your user name as the session name when you assume the role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname"> <code>sts:RoleSessionName</code> </a>.</p>
11    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
12    pub role_session_name: ::std::option::Option<::std::string::String>,
13    /// <p>The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role.</p>
14    /// <p>This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. 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) and Amazon Web Services Service Namespaces</a> in the Amazon Web Services General Reference.</p><note>
15    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
16    /// </note>
17    /// <p>Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
18    pub policy_arns: ::std::option::Option<::std::vec::Vec::<crate::types::PolicyDescriptorType>>,
19    /// <p>An IAM policy in JSON format that you want to use as an inline session policy.</p>
20    /// <p>This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
21    /// <p>The plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. The JSON policy characters can be any ASCII character from the space character to the end of the valid character list (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.</p><note>
22    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
23    /// </note>
24    /// <p>For more information about role session permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session policies</a>.</p>
25    pub policy: ::std::option::Option<::std::string::String>,
26    /// <p>The duration, in seconds, of the role session. The value specified can range from 900 seconds (15 minutes) up to the maximum session duration set for the role. The maximum session duration setting can have a value from 1 hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower), the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the maximum session duration to 6 hours, your operation fails.</p>
27    /// <p>Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. When you use the <code>AssumeRole</code> API operation to assume a role, you can specify the duration of your role session with the <code>DurationSeconds</code> parameter. You can specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum session duration setting for your role. However, if you assume a role using role chaining and provide a <code>DurationSeconds</code> parameter value greater than one hour, the operation fails. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration">Update the maximum session duration for a role</a>.</p>
28    /// <p>By default, the value is set to <code>3600</code> seconds.</p><note>
29    /// <p>The <code>DurationSeconds</code> parameter is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a <code>SessionDuration</code> parameter that specifies the maximum length of the console session. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html">Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console</a> in the <i>IAM User Guide</i>.</p>
30    /// </note>
31    pub duration_seconds: ::std::option::Option<i32>,
32    /// <p>A list of session tags that you want to pass. Each session tag consists of a key name and an associated value. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Tagging Amazon Web Services STS Sessions</a> in the <i>IAM User Guide</i>.</p>
33    /// <p>This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these and additional limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM and STS Character Limits</a> in the <i>IAM User Guide</i>.</p><note>
34    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
35    /// </note>
36    /// <p>You can pass a session tag with the same key as a tag that is already attached to the role. When you do, session tags override a role tag with the same key.</p>
37    /// <p>Tag key–value pairs are not case sensitive, but case is preserved. This means that you cannot have separate <code>Department</code> and <code>department</code> tag keys. Assume that the role has the <code>Department</code>=<code>Marketing</code> tag and you pass the <code>department</code>=<code>engineering</code> session tag. <code>Department</code> and <code>department</code> are not saved as separate tags, and the session tag passed in the request takes precedence over the role tag.</p>
38    /// <p>Additionally, if you used temporary credentials to perform this operation, the new session inherits any transitive session tags from the calling session. If you pass a session tag with the same key as an inherited tag, the operation fails. To view the inherited tags for a session, see the CloudTrail logs. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs">Viewing Session Tags in CloudTrail</a> in the <i>IAM User Guide</i>.</p>
39    pub tags: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>,
40    /// <p>A list of keys for session tags that you want to set as transitive. If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles with Session Tags</a> in the <i>IAM User Guide</i>.</p>
41    /// <p>This parameter is optional. The transitive status of a session tag does not impact its packed binary size.</p>
42    /// <p>If you choose not to specify a transitive tag key, then no tags are passed from this session to any subsequent sessions.</p>
43    pub transitive_tag_keys: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
44    /// <p>A unique identifier that might be required when you assume a role in another account. If the administrator of the account to which the role belongs provided you with an external ID, then provide that value in the <code>ExternalId</code> parameter. This value can be any string, such as a passphrase or account number. A cross-account role is usually set up to trust everyone in an account. Therefore, the administrator of the trusting account might send an external ID to the administrator of the trusted account. That way, only someone with the ID can assume the role, rather than everyone in the account. For more information about the external ID, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party</a> in the <i>IAM User Guide</i>.</p>
45    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>
46    pub external_id: ::std::option::Option<::std::string::String>,
47    /// <p>The identification number of the MFA device that is associated with the user who is making the <code>AssumeRole</code> call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as <code>GAHT12345678</code>) or an Amazon Resource Name (ARN) for a virtual device (such as <code>arn:aws:iam::123456789012:mfa/user</code>).</p>
48    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
49    pub serial_number: ::std::option::Option<::std::string::String>,
50    /// <p>The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the <code>TokenCode</code> value is missing or expired, the <code>AssumeRole</code> call returns an "access denied" error.</p>
51    /// <p>The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.</p>
52    pub token_code: ::std::option::Option<::std::string::String>,
53    /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation. The source identity value persists across <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining">chained role</a> sessions.</p>
54    /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity"> <code>sts:SourceIdentity</code> </a> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
55    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: +=,.@-. You cannot use a value that begins with the text <code>aws:</code>. This prefix is reserved for Amazon Web Services internal use.</p>
56    pub source_identity: ::std::option::Option<::std::string::String>,
57    /// <p>A list of previously acquired trusted context assertions in the format of a JSON array. The trusted context assertion is signed and encrypted by Amazon Web Services STS.</p>
58    /// <p>The following is an example of a <code>ProvidedContext</code> value that includes a single trusted context assertion and the ARN of the context provider from which the trusted context assertion was generated.</p>
59    /// <p><code>\[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}\]</code></p>
60    pub provided_contexts: ::std::option::Option<::std::vec::Vec::<crate::types::ProvidedContext>>,
61}
62impl  AssumeRoleInput  {
63    /// <p>The Amazon Resource Name (ARN) of the role to assume.</p>
64    pub fn role_arn(&self) -> ::std::option::Option<&str> {
65        self.role_arn.as_deref()
66    }
67    /// <p>An identifier for the assumed role session.</p>
68    /// <p>Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.</p>
69    /// <p>For security purposes, administrators can view this field in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds">CloudTrail logs</a> to help identify who performed an action in Amazon Web Services. Your administrator might require that you specify your user name as the session name when you assume the role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname"> <code>sts:RoleSessionName</code> </a>.</p>
70    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
71    pub fn role_session_name(&self) -> ::std::option::Option<&str> {
72        self.role_session_name.as_deref()
73    }
74    /// <p>The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role.</p>
75    /// <p>This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. 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) and Amazon Web Services Service Namespaces</a> in the Amazon Web Services General Reference.</p><note>
76    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
77    /// </note>
78    /// <p>Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
79    /// 
80    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policy_arns.is_none()`.
81    pub fn policy_arns(&self) -> &[crate::types::PolicyDescriptorType] {
82        self.policy_arns.as_deref()
83        .unwrap_or_default()
84    }
85    /// <p>An IAM policy in JSON format that you want to use as an inline session policy.</p>
86    /// <p>This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
87    /// <p>The plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. The JSON policy characters can be any ASCII character from the space character to the end of the valid character list (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.</p><note>
88    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
89    /// </note>
90    /// <p>For more information about role session permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session policies</a>.</p>
91    pub fn policy(&self) -> ::std::option::Option<&str> {
92        self.policy.as_deref()
93    }
94    /// <p>The duration, in seconds, of the role session. The value specified can range from 900 seconds (15 minutes) up to the maximum session duration set for the role. The maximum session duration setting can have a value from 1 hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower), the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the maximum session duration to 6 hours, your operation fails.</p>
95    /// <p>Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. When you use the <code>AssumeRole</code> API operation to assume a role, you can specify the duration of your role session with the <code>DurationSeconds</code> parameter. You can specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum session duration setting for your role. However, if you assume a role using role chaining and provide a <code>DurationSeconds</code> parameter value greater than one hour, the operation fails. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration">Update the maximum session duration for a role</a>.</p>
96    /// <p>By default, the value is set to <code>3600</code> seconds.</p><note>
97    /// <p>The <code>DurationSeconds</code> parameter is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a <code>SessionDuration</code> parameter that specifies the maximum length of the console session. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html">Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console</a> in the <i>IAM User Guide</i>.</p>
98    /// </note>
99    pub fn duration_seconds(&self) -> ::std::option::Option<i32> {
100        self.duration_seconds
101    }
102    /// <p>A list of session tags that you want to pass. Each session tag consists of a key name and an associated value. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Tagging Amazon Web Services STS Sessions</a> in the <i>IAM User Guide</i>.</p>
103    /// <p>This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these and additional limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM and STS Character Limits</a> in the <i>IAM User Guide</i>.</p><note>
104    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
105    /// </note>
106    /// <p>You can pass a session tag with the same key as a tag that is already attached to the role. When you do, session tags override a role tag with the same key.</p>
107    /// <p>Tag key–value pairs are not case sensitive, but case is preserved. This means that you cannot have separate <code>Department</code> and <code>department</code> tag keys. Assume that the role has the <code>Department</code>=<code>Marketing</code> tag and you pass the <code>department</code>=<code>engineering</code> session tag. <code>Department</code> and <code>department</code> are not saved as separate tags, and the session tag passed in the request takes precedence over the role tag.</p>
108    /// <p>Additionally, if you used temporary credentials to perform this operation, the new session inherits any transitive session tags from the calling session. If you pass a session tag with the same key as an inherited tag, the operation fails. To view the inherited tags for a session, see the CloudTrail logs. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs">Viewing Session Tags in CloudTrail</a> in the <i>IAM User Guide</i>.</p>
109    /// 
110    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
111    pub fn tags(&self) -> &[crate::types::Tag] {
112        self.tags.as_deref()
113        .unwrap_or_default()
114    }
115    /// <p>A list of keys for session tags that you want to set as transitive. If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles with Session Tags</a> in the <i>IAM User Guide</i>.</p>
116    /// <p>This parameter is optional. The transitive status of a session tag does not impact its packed binary size.</p>
117    /// <p>If you choose not to specify a transitive tag key, then no tags are passed from this session to any subsequent sessions.</p>
118    /// 
119    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.transitive_tag_keys.is_none()`.
120    pub fn transitive_tag_keys(&self) -> &[::std::string::String] {
121        self.transitive_tag_keys.as_deref()
122        .unwrap_or_default()
123    }
124    /// <p>A unique identifier that might be required when you assume a role in another account. If the administrator of the account to which the role belongs provided you with an external ID, then provide that value in the <code>ExternalId</code> parameter. This value can be any string, such as a passphrase or account number. A cross-account role is usually set up to trust everyone in an account. Therefore, the administrator of the trusting account might send an external ID to the administrator of the trusted account. That way, only someone with the ID can assume the role, rather than everyone in the account. For more information about the external ID, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party</a> in the <i>IAM User Guide</i>.</p>
125    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>
126    pub fn external_id(&self) -> ::std::option::Option<&str> {
127        self.external_id.as_deref()
128    }
129    /// <p>The identification number of the MFA device that is associated with the user who is making the <code>AssumeRole</code> call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as <code>GAHT12345678</code>) or an Amazon Resource Name (ARN) for a virtual device (such as <code>arn:aws:iam::123456789012:mfa/user</code>).</p>
130    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
131    pub fn serial_number(&self) -> ::std::option::Option<&str> {
132        self.serial_number.as_deref()
133    }
134    /// <p>The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the <code>TokenCode</code> value is missing or expired, the <code>AssumeRole</code> call returns an "access denied" error.</p>
135    /// <p>The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.</p>
136    pub fn token_code(&self) -> ::std::option::Option<&str> {
137        self.token_code.as_deref()
138    }
139    /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation. The source identity value persists across <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining">chained role</a> sessions.</p>
140    /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity"> <code>sts:SourceIdentity</code> </a> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
141    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: +=,.@-. You cannot use a value that begins with the text <code>aws:</code>. This prefix is reserved for Amazon Web Services internal use.</p>
142    pub fn source_identity(&self) -> ::std::option::Option<&str> {
143        self.source_identity.as_deref()
144    }
145    /// <p>A list of previously acquired trusted context assertions in the format of a JSON array. The trusted context assertion is signed and encrypted by Amazon Web Services STS.</p>
146    /// <p>The following is an example of a <code>ProvidedContext</code> value that includes a single trusted context assertion and the ARN of the context provider from which the trusted context assertion was generated.</p>
147    /// <p><code>\[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}\]</code></p>
148    /// 
149    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.provided_contexts.is_none()`.
150    pub fn provided_contexts(&self) -> &[crate::types::ProvidedContext] {
151        self.provided_contexts.as_deref()
152        .unwrap_or_default()
153    }
154}
155static ASSUMEROLEINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts.synthetic#AssumeRoleInput", "com.amazonaws.sts.synthetic", "AssumeRoleInput");
156static ASSUMEROLEINPUT_MEMBER_ROLE_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
157                            ::aws_smithy_schema::ShapeId::from_static(
158                                "com.amazonaws.sts.synthetic#AssumeRoleInput$RoleArn",
159                                "com.amazonaws.sts.synthetic",
160                                "AssumeRoleInput",
161                            ),
162                            ::aws_smithy_schema::ShapeType::String,
163                            "RoleArn",
164                            0,
165                        );
166static ASSUMEROLEINPUT_MEMBER_ROLE_SESSION_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
167                            ::aws_smithy_schema::ShapeId::from_static(
168                                "com.amazonaws.sts.synthetic#AssumeRoleInput$RoleSessionName",
169                                "com.amazonaws.sts.synthetic",
170                                "AssumeRoleInput",
171                            ),
172                            ::aws_smithy_schema::ShapeType::String,
173                            "RoleSessionName",
174                            1,
175                        );
176static ASSUMEROLEINPUT_MEMBER_POLICY_ARNS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
177                            ::aws_smithy_schema::ShapeId::from_static(
178                                "com.amazonaws.sts.synthetic#AssumeRoleInput$PolicyArns",
179                                "com.amazonaws.sts.synthetic",
180                                "AssumeRoleInput",
181                            ),
182                            ::aws_smithy_schema::ShapeType::List,
183                            "PolicyArns",
184                            2,
185                        );
186static ASSUMEROLEINPUT_MEMBER_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
187                            ::aws_smithy_schema::ShapeId::from_static(
188                                "com.amazonaws.sts.synthetic#AssumeRoleInput$Policy",
189                                "com.amazonaws.sts.synthetic",
190                                "AssumeRoleInput",
191                            ),
192                            ::aws_smithy_schema::ShapeType::String,
193                            "Policy",
194                            3,
195                        );
196static ASSUMEROLEINPUT_MEMBER_DURATION_SECONDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
197                            ::aws_smithy_schema::ShapeId::from_static(
198                                "com.amazonaws.sts.synthetic#AssumeRoleInput$DurationSeconds",
199                                "com.amazonaws.sts.synthetic",
200                                "AssumeRoleInput",
201                            ),
202                            ::aws_smithy_schema::ShapeType::Integer,
203                            "DurationSeconds",
204                            4,
205                        );
206static ASSUMEROLEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
207                            ::aws_smithy_schema::ShapeId::from_static(
208                                "com.amazonaws.sts.synthetic#AssumeRoleInput$Tags",
209                                "com.amazonaws.sts.synthetic",
210                                "AssumeRoleInput",
211                            ),
212                            ::aws_smithy_schema::ShapeType::List,
213                            "Tags",
214                            5,
215                        );
216static ASSUMEROLEINPUT_MEMBER_TRANSITIVE_TAG_KEYS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
217                            ::aws_smithy_schema::ShapeId::from_static(
218                                "com.amazonaws.sts.synthetic#AssumeRoleInput$TransitiveTagKeys",
219                                "com.amazonaws.sts.synthetic",
220                                "AssumeRoleInput",
221                            ),
222                            ::aws_smithy_schema::ShapeType::List,
223                            "TransitiveTagKeys",
224                            6,
225                        );
226static ASSUMEROLEINPUT_MEMBER_EXTERNAL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
227                            ::aws_smithy_schema::ShapeId::from_static(
228                                "com.amazonaws.sts.synthetic#AssumeRoleInput$ExternalId",
229                                "com.amazonaws.sts.synthetic",
230                                "AssumeRoleInput",
231                            ),
232                            ::aws_smithy_schema::ShapeType::String,
233                            "ExternalId",
234                            7,
235                        );
236static ASSUMEROLEINPUT_MEMBER_SERIAL_NUMBER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
237                            ::aws_smithy_schema::ShapeId::from_static(
238                                "com.amazonaws.sts.synthetic#AssumeRoleInput$SerialNumber",
239                                "com.amazonaws.sts.synthetic",
240                                "AssumeRoleInput",
241                            ),
242                            ::aws_smithy_schema::ShapeType::String,
243                            "SerialNumber",
244                            8,
245                        );
246static ASSUMEROLEINPUT_MEMBER_TOKEN_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
247                            ::aws_smithy_schema::ShapeId::from_static(
248                                "com.amazonaws.sts.synthetic#AssumeRoleInput$TokenCode",
249                                "com.amazonaws.sts.synthetic",
250                                "AssumeRoleInput",
251                            ),
252                            ::aws_smithy_schema::ShapeType::String,
253                            "TokenCode",
254                            9,
255                        );
256static ASSUMEROLEINPUT_MEMBER_SOURCE_IDENTITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
257                            ::aws_smithy_schema::ShapeId::from_static(
258                                "com.amazonaws.sts.synthetic#AssumeRoleInput$SourceIdentity",
259                                "com.amazonaws.sts.synthetic",
260                                "AssumeRoleInput",
261                            ),
262                            ::aws_smithy_schema::ShapeType::String,
263                            "SourceIdentity",
264                            10,
265                        );
266static ASSUMEROLEINPUT_MEMBER_PROVIDED_CONTEXTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
267                            ::aws_smithy_schema::ShapeId::from_static(
268                                "com.amazonaws.sts.synthetic#AssumeRoleInput$ProvidedContexts",
269                                "com.amazonaws.sts.synthetic",
270                                "AssumeRoleInput",
271                            ),
272                            ::aws_smithy_schema::ShapeType::List,
273                            "ProvidedContexts",
274                            11,
275                        );
276static ASSUMEROLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
277                            ASSUMEROLEINPUT_SCHEMA_ID,
278                            ::aws_smithy_schema::ShapeType::Structure,
279                            &[&ASSUMEROLEINPUT_MEMBER_ROLE_ARN, &ASSUMEROLEINPUT_MEMBER_ROLE_SESSION_NAME, &ASSUMEROLEINPUT_MEMBER_POLICY_ARNS, &ASSUMEROLEINPUT_MEMBER_POLICY, &ASSUMEROLEINPUT_MEMBER_DURATION_SECONDS, &ASSUMEROLEINPUT_MEMBER_TAGS, &ASSUMEROLEINPUT_MEMBER_TRANSITIVE_TAG_KEYS, &ASSUMEROLEINPUT_MEMBER_EXTERNAL_ID, &ASSUMEROLEINPUT_MEMBER_SERIAL_NUMBER, &ASSUMEROLEINPUT_MEMBER_TOKEN_CODE, &ASSUMEROLEINPUT_MEMBER_SOURCE_IDENTITY, &ASSUMEROLEINPUT_MEMBER_PROVIDED_CONTEXTS],
280                        );
281impl AssumeRoleInput {
282                /// The schema for this shape.
283                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ASSUMEROLEINPUT_SCHEMA;
284            }
285impl ::aws_smithy_schema::serde::SerializableStruct for AssumeRoleInput {
286                #[allow(unused_variables, clippy::diverging_sub_expression)]
287                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
288                    if let Some(ref val) = self.role_arn {
289                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_ROLE_ARN, val)?;
290                            }
291if let Some(ref val) = self.role_session_name {
292                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_ROLE_SESSION_NAME, val)?;
293                            }
294if let Some(ref val) = self.policy_arns {
295                                
296                    ser.write_list(&ASSUMEROLEINPUT_MEMBER_POLICY_ARNS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
297                        for item in val {
298                            ser.write_struct(crate::types::PolicyDescriptorType::SCHEMA, item)?;
299                        }
300                        Ok(())
301                    })?;
302                    
303                            }
304if let Some(ref val) = self.policy {
305                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_POLICY, val)?;
306                            }
307if let Some(ref val) = self.duration_seconds {
308                                ser.write_integer(&ASSUMEROLEINPUT_MEMBER_DURATION_SECONDS, *val)?;
309                            }
310if let Some(ref val) = self.tags {
311                                
312                    ser.write_list(&ASSUMEROLEINPUT_MEMBER_TAGS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
313                        for item in val {
314                            ser.write_struct(crate::types::Tag::SCHEMA, item)?;
315                        }
316                        Ok(())
317                    })?;
318                    
319                            }
320if let Some(ref val) = self.transitive_tag_keys {
321                                
322                    ser.write_list(&ASSUMEROLEINPUT_MEMBER_TRANSITIVE_TAG_KEYS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
323                        for item in val {
324                            ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
325                        }
326                        Ok(())
327                    })?;
328                    
329                            }
330if let Some(ref val) = self.external_id {
331                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_EXTERNAL_ID, val)?;
332                            }
333if let Some(ref val) = self.serial_number {
334                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_SERIAL_NUMBER, val)?;
335                            }
336if let Some(ref val) = self.token_code {
337                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_TOKEN_CODE, val)?;
338                            }
339if let Some(ref val) = self.source_identity {
340                                ser.write_string(&ASSUMEROLEINPUT_MEMBER_SOURCE_IDENTITY, val)?;
341                            }
342if let Some(ref val) = self.provided_contexts {
343                                
344                    ser.write_list(&ASSUMEROLEINPUT_MEMBER_PROVIDED_CONTEXTS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
345                        for item in val {
346                            ser.write_struct(crate::types::ProvidedContext::SCHEMA, item)?;
347                        }
348                        Ok(())
349                    })?;
350                    
351                            }
352                    Ok(())
353                }
354            }
355impl AssumeRoleInput {
356                /// Deserializes this structure from a [`ShapeDeserializer`].
357                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
358                    #[allow(unused_variables, unused_mut)]
359                    let mut builder = Self::builder();
360                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
361                    deserializer.read_struct(&ASSUMEROLEINPUT_SCHEMA, &mut |member, deser| {
362                        match member.member_index() {
363                            Some(0) => {
364                                    builder.role_arn = Some(deser.read_string(member)?);
365                                }
366Some(1) => {
367                                    builder.role_session_name = Some(deser.read_string(member)?);
368                                }
369Some(2) => {
370                                    builder.policy_arns = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::PolicyDescriptorType::deserialize(deser)?); Ok(()) })?; container });
371                                }
372Some(3) => {
373                                    builder.policy = Some(deser.read_string(member)?);
374                                }
375Some(4) => {
376                                    builder.duration_seconds = Some(deser.read_integer(member)?);
377                                }
378Some(5) => {
379                                    builder.tags = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::Tag::deserialize(deser)?); Ok(()) })?; container });
380                                }
381Some(6) => {
382                                    builder.transitive_tag_keys = Some(deser.read_string_list(member)?);
383                                }
384Some(7) => {
385                                    builder.external_id = Some(deser.read_string(member)?);
386                                }
387Some(8) => {
388                                    builder.serial_number = Some(deser.read_string(member)?);
389                                }
390Some(9) => {
391                                    builder.token_code = Some(deser.read_string(member)?);
392                                }
393Some(10) => {
394                                    builder.source_identity = Some(deser.read_string(member)?);
395                                }
396Some(11) => {
397                                    builder.provided_contexts = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::ProvidedContext::deserialize(deser)?); Ok(()) })?; container });
398                                }
399                            _ => {}
400                        }
401                        Ok(())
402                    })?;
403                    builder.role_arn = builder.role_arn.or(Some(String::new()));
404builder.role_session_name = builder.role_session_name.or(Some(String::new()));
405builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
406                }
407            }
408impl AssumeRoleInput {
409                        /// Deserializes this structure from a body deserializer and HTTP response.
410                        pub fn deserialize_with_response(
411                            deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
412                            _headers: &::aws_smithy_runtime_api::http::Headers,
413                            _status: u16,
414                            _body: &[u8],
415                        ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
416                            Self::deserialize(deserializer)
417                        }
418                    }
419impl AssumeRoleInput {
420    /// Creates a new builder-style object to manufacture [`AssumeRoleInput`](crate::operation::assume_role::AssumeRoleInput).
421    pub fn builder() -> crate::operation::assume_role::builders::AssumeRoleInputBuilder {
422        crate::operation::assume_role::builders::AssumeRoleInputBuilder::default()
423    }
424}
425
426/// A builder for [`AssumeRoleInput`](crate::operation::assume_role::AssumeRoleInput).
427#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
428#[non_exhaustive]
429pub struct AssumeRoleInputBuilder {
430    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
431    pub(crate) role_session_name: ::std::option::Option<::std::string::String>,
432    pub(crate) policy_arns: ::std::option::Option<::std::vec::Vec::<crate::types::PolicyDescriptorType>>,
433    pub(crate) policy: ::std::option::Option<::std::string::String>,
434    pub(crate) duration_seconds: ::std::option::Option<i32>,
435    pub(crate) tags: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>,
436    pub(crate) transitive_tag_keys: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
437    pub(crate) external_id: ::std::option::Option<::std::string::String>,
438    pub(crate) serial_number: ::std::option::Option<::std::string::String>,
439    pub(crate) token_code: ::std::option::Option<::std::string::String>,
440    pub(crate) source_identity: ::std::option::Option<::std::string::String>,
441    pub(crate) provided_contexts: ::std::option::Option<::std::vec::Vec::<crate::types::ProvidedContext>>,
442}
443impl AssumeRoleInputBuilder {
444    /// <p>The Amazon Resource Name (ARN) of the role to assume.</p>
445    /// This field is required.
446    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
447        self.role_arn = ::std::option::Option::Some(input.into());
448        self
449    }
450    /// <p>The Amazon Resource Name (ARN) of the role to assume.</p>
451    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
452        self.role_arn = input; self
453    }
454    /// <p>The Amazon Resource Name (ARN) of the role to assume.</p>
455    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
456        &self.role_arn
457    }
458    /// <p>An identifier for the assumed role session.</p>
459    /// <p>Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.</p>
460    /// <p>For security purposes, administrators can view this field in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds">CloudTrail logs</a> to help identify who performed an action in Amazon Web Services. Your administrator might require that you specify your user name as the session name when you assume the role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname"> <code>sts:RoleSessionName</code> </a>.</p>
461    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
462    /// This field is required.
463    pub fn role_session_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
464        self.role_session_name = ::std::option::Option::Some(input.into());
465        self
466    }
467    /// <p>An identifier for the assumed role session.</p>
468    /// <p>Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.</p>
469    /// <p>For security purposes, administrators can view this field in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds">CloudTrail logs</a> to help identify who performed an action in Amazon Web Services. Your administrator might require that you specify your user name as the session name when you assume the role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname"> <code>sts:RoleSessionName</code> </a>.</p>
470    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
471    pub fn set_role_session_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
472        self.role_session_name = input; self
473    }
474    /// <p>An identifier for the assumed role session.</p>
475    /// <p>Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests that use the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.</p>
476    /// <p>For security purposes, administrators can view this field in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds">CloudTrail logs</a> to help identify who performed an action in Amazon Web Services. Your administrator might require that you specify your user name as the session name when you assume the role. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname"> <code>sts:RoleSessionName</code> </a>.</p>
477    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
478    pub fn get_role_session_name(&self) -> &::std::option::Option<::std::string::String> {
479        &self.role_session_name
480    }
481    /// Appends an item to `policy_arns`.
482    ///
483    /// To override the contents of this collection use [`set_policy_arns`](Self::set_policy_arns).
484    ///
485    /// <p>The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role.</p>
486    /// <p>This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. 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) and Amazon Web Services Service Namespaces</a> in the Amazon Web Services General Reference.</p><note>
487    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
488    /// </note>
489    /// <p>Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
490    pub fn policy_arns(mut self, input: crate::types::PolicyDescriptorType) -> Self {
491        let mut v = self.policy_arns.unwrap_or_default();
492                        v.push(input);
493                        self.policy_arns = ::std::option::Option::Some(v);
494                        self
495    }
496    /// <p>The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role.</p>
497    /// <p>This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. 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) and Amazon Web Services Service Namespaces</a> in the Amazon Web Services General Reference.</p><note>
498    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
499    /// </note>
500    /// <p>Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
501    pub fn set_policy_arns(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::PolicyDescriptorType>>) -> Self {
502        self.policy_arns = input; self
503    }
504    /// <p>The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies. The policies must exist in the same account as the role.</p>
505    /// <p>This parameter is optional. You can provide up to 10 managed policy ARNs. However, the plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. 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) and Amazon Web Services Service Namespaces</a> in the Amazon Web Services General Reference.</p><note>
506    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
507    /// </note>
508    /// <p>Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
509    pub fn get_policy_arns(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::PolicyDescriptorType>> {
510        &self.policy_arns
511    }
512    /// <p>An IAM policy in JSON format that you want to use as an inline session policy.</p>
513    /// <p>This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
514    /// <p>The plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. The JSON policy characters can be any ASCII character from the space character to the end of the valid character list (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.</p><note>
515    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
516    /// </note>
517    /// <p>For more information about role session permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session policies</a>.</p>
518    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
519        self.policy = ::std::option::Option::Some(input.into());
520        self
521    }
522    /// <p>An IAM policy in JSON format that you want to use as an inline session policy.</p>
523    /// <p>This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
524    /// <p>The plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. The JSON policy characters can be any ASCII character from the space character to the end of the valid character list (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.</p><note>
525    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
526    /// </note>
527    /// <p>For more information about role session permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session policies</a>.</p>
528    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
529        self.policy = input; self
530    }
531    /// <p>An IAM policy in JSON format that you want to use as an inline session policy.</p>
532    /// <p>This parameter is optional. Passing policies to this operation returns new temporary credentials. The resulting session's permissions are the intersection of the role's identity-based policy and the session policies. You can use the role's temporary credentials in subsequent Amazon Web Services API calls to access resources in the account that owns the role. You cannot use session policies to grant more permissions than those allowed by the identity-based policy of the role that is being assumed. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in the <i>IAM User Guide</i>.</p>
533    /// <p>The plaintext that you use for both inline and managed session policies can't exceed 2,048 characters. The JSON policy characters can be any ASCII character from the space character to the end of the valid character list (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.</p><note>
534    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
535    /// </note>
536    /// <p>For more information about role session permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session policies</a>.</p>
537    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
538        &self.policy
539    }
540    /// <p>The duration, in seconds, of the role session. The value specified can range from 900 seconds (15 minutes) up to the maximum session duration set for the role. The maximum session duration setting can have a value from 1 hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower), the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the maximum session duration to 6 hours, your operation fails.</p>
541    /// <p>Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. When you use the <code>AssumeRole</code> API operation to assume a role, you can specify the duration of your role session with the <code>DurationSeconds</code> parameter. You can specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum session duration setting for your role. However, if you assume a role using role chaining and provide a <code>DurationSeconds</code> parameter value greater than one hour, the operation fails. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration">Update the maximum session duration for a role</a>.</p>
542    /// <p>By default, the value is set to <code>3600</code> seconds.</p><note>
543    /// <p>The <code>DurationSeconds</code> parameter is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a <code>SessionDuration</code> parameter that specifies the maximum length of the console session. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html">Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console</a> in the <i>IAM User Guide</i>.</p>
544    /// </note>
545    pub fn duration_seconds(mut self, input: i32) -> Self {
546        self.duration_seconds = ::std::option::Option::Some(input);
547        self
548    }
549    /// <p>The duration, in seconds, of the role session. The value specified can range from 900 seconds (15 minutes) up to the maximum session duration set for the role. The maximum session duration setting can have a value from 1 hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower), the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the maximum session duration to 6 hours, your operation fails.</p>
550    /// <p>Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. When you use the <code>AssumeRole</code> API operation to assume a role, you can specify the duration of your role session with the <code>DurationSeconds</code> parameter. You can specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum session duration setting for your role. However, if you assume a role using role chaining and provide a <code>DurationSeconds</code> parameter value greater than one hour, the operation fails. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration">Update the maximum session duration for a role</a>.</p>
551    /// <p>By default, the value is set to <code>3600</code> seconds.</p><note>
552    /// <p>The <code>DurationSeconds</code> parameter is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a <code>SessionDuration</code> parameter that specifies the maximum length of the console session. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html">Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console</a> in the <i>IAM User Guide</i>.</p>
553    /// </note>
554    pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
555        self.duration_seconds = input; self
556    }
557    /// <p>The duration, in seconds, of the role session. The value specified can range from 900 seconds (15 minutes) up to the maximum session duration set for the role. The maximum session duration setting can have a value from 1 hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower), the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the maximum session duration to 6 hours, your operation fails.</p>
558    /// <p>Role chaining limits your Amazon Web Services CLI or Amazon Web Services API role session to a maximum of one hour. When you use the <code>AssumeRole</code> API operation to assume a role, you can specify the duration of your role session with the <code>DurationSeconds</code> parameter. You can specify a parameter value of up to 43200 seconds (12 hours), depending on the maximum session duration setting for your role. However, if you assume a role using role chaining and provide a <code>DurationSeconds</code> parameter value greater than one hour, the operation fails. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration">Update the maximum session duration for a role</a>.</p>
559    /// <p>By default, the value is set to <code>3600</code> seconds.</p><note>
560    /// <p>The <code>DurationSeconds</code> parameter is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a <code>SessionDuration</code> parameter that specifies the maximum length of the console session. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html">Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console</a> in the <i>IAM User Guide</i>.</p>
561    /// </note>
562    pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
563        &self.duration_seconds
564    }
565    /// Appends an item to `tags`.
566    ///
567    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
568    ///
569    /// <p>A list of session tags that you want to pass. Each session tag consists of a key name and an associated value. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Tagging Amazon Web Services STS Sessions</a> in the <i>IAM User Guide</i>.</p>
570    /// <p>This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these and additional limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM and STS Character Limits</a> in the <i>IAM User Guide</i>.</p><note>
571    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
572    /// </note>
573    /// <p>You can pass a session tag with the same key as a tag that is already attached to the role. When you do, session tags override a role tag with the same key.</p>
574    /// <p>Tag key–value pairs are not case sensitive, but case is preserved. This means that you cannot have separate <code>Department</code> and <code>department</code> tag keys. Assume that the role has the <code>Department</code>=<code>Marketing</code> tag and you pass the <code>department</code>=<code>engineering</code> session tag. <code>Department</code> and <code>department</code> are not saved as separate tags, and the session tag passed in the request takes precedence over the role tag.</p>
575    /// <p>Additionally, if you used temporary credentials to perform this operation, the new session inherits any transitive session tags from the calling session. If you pass a session tag with the same key as an inherited tag, the operation fails. To view the inherited tags for a session, see the CloudTrail logs. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs">Viewing Session Tags in CloudTrail</a> in the <i>IAM User Guide</i>.</p>
576    pub fn tags(mut self, input: crate::types::Tag) -> Self {
577        let mut v = self.tags.unwrap_or_default();
578                        v.push(input);
579                        self.tags = ::std::option::Option::Some(v);
580                        self
581    }
582    /// <p>A list of session tags that you want to pass. Each session tag consists of a key name and an associated value. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Tagging Amazon Web Services STS Sessions</a> in the <i>IAM User Guide</i>.</p>
583    /// <p>This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these and additional limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM and STS Character Limits</a> in the <i>IAM User Guide</i>.</p><note>
584    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
585    /// </note>
586    /// <p>You can pass a session tag with the same key as a tag that is already attached to the role. When you do, session tags override a role tag with the same key.</p>
587    /// <p>Tag key–value pairs are not case sensitive, but case is preserved. This means that you cannot have separate <code>Department</code> and <code>department</code> tag keys. Assume that the role has the <code>Department</code>=<code>Marketing</code> tag and you pass the <code>department</code>=<code>engineering</code> session tag. <code>Department</code> and <code>department</code> are not saved as separate tags, and the session tag passed in the request takes precedence over the role tag.</p>
588    /// <p>Additionally, if you used temporary credentials to perform this operation, the new session inherits any transitive session tags from the calling session. If you pass a session tag with the same key as an inherited tag, the operation fails. To view the inherited tags for a session, see the CloudTrail logs. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs">Viewing Session Tags in CloudTrail</a> in the <i>IAM User Guide</i>.</p>
589    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>) -> Self {
590        self.tags = input; self
591    }
592    /// <p>A list of session tags that you want to pass. Each session tag consists of a key name and an associated value. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Tagging Amazon Web Services STS Sessions</a> in the <i>IAM User Guide</i>.</p>
593    /// <p>This parameter is optional. You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128 characters, and the values can’t exceed 256 characters. For these and additional limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM and STS Character Limits</a> in the <i>IAM User Guide</i>.</p><note>
594    /// <p>An Amazon Web Services conversion compresses the passed inline session policy, managed policy ARNs, and session tags into a packed binary format that has a separate limit. Your request can fail for this limit even if your plaintext meets the other requirements. The <code>PackedPolicySize</code> response element indicates by percentage how close the policies and tags for your request are to the upper size limit.</p>
595    /// </note>
596    /// <p>You can pass a session tag with the same key as a tag that is already attached to the role. When you do, session tags override a role tag with the same key.</p>
597    /// <p>Tag key–value pairs are not case sensitive, but case is preserved. This means that you cannot have separate <code>Department</code> and <code>department</code> tag keys. Assume that the role has the <code>Department</code>=<code>Marketing</code> tag and you pass the <code>department</code>=<code>engineering</code> session tag. <code>Department</code> and <code>department</code> are not saved as separate tags, and the session tag passed in the request takes precedence over the role tag.</p>
598    /// <p>Additionally, if you used temporary credentials to perform this operation, the new session inherits any transitive session tags from the calling session. If you pass a session tag with the same key as an inherited tag, the operation fails. To view the inherited tags for a session, see the CloudTrail logs. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs">Viewing Session Tags in CloudTrail</a> in the <i>IAM User Guide</i>.</p>
599    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::Tag>> {
600        &self.tags
601    }
602    /// Appends an item to `transitive_tag_keys`.
603    ///
604    /// To override the contents of this collection use [`set_transitive_tag_keys`](Self::set_transitive_tag_keys).
605    ///
606    /// <p>A list of keys for session tags that you want to set as transitive. If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles with Session Tags</a> in the <i>IAM User Guide</i>.</p>
607    /// <p>This parameter is optional. The transitive status of a session tag does not impact its packed binary size.</p>
608    /// <p>If you choose not to specify a transitive tag key, then no tags are passed from this session to any subsequent sessions.</p>
609    pub fn transitive_tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
610        let mut v = self.transitive_tag_keys.unwrap_or_default();
611                        v.push(input.into());
612                        self.transitive_tag_keys = ::std::option::Option::Some(v);
613                        self
614    }
615    /// <p>A list of keys for session tags that you want to set as transitive. If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles with Session Tags</a> in the <i>IAM User Guide</i>.</p>
616    /// <p>This parameter is optional. The transitive status of a session tag does not impact its packed binary size.</p>
617    /// <p>If you choose not to specify a transitive tag key, then no tags are passed from this session to any subsequent sessions.</p>
618    pub fn set_transitive_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
619        self.transitive_tag_keys = input; self
620    }
621    /// <p>A list of keys for session tags that you want to set as transitive. If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles with Session Tags</a> in the <i>IAM User Guide</i>.</p>
622    /// <p>This parameter is optional. The transitive status of a session tag does not impact its packed binary size.</p>
623    /// <p>If you choose not to specify a transitive tag key, then no tags are passed from this session to any subsequent sessions.</p>
624    pub fn get_transitive_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
625        &self.transitive_tag_keys
626    }
627    /// <p>A unique identifier that might be required when you assume a role in another account. If the administrator of the account to which the role belongs provided you with an external ID, then provide that value in the <code>ExternalId</code> parameter. This value can be any string, such as a passphrase or account number. A cross-account role is usually set up to trust everyone in an account. Therefore, the administrator of the trusting account might send an external ID to the administrator of the trusted account. That way, only someone with the ID can assume the role, rather than everyone in the account. For more information about the external ID, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party</a> in the <i>IAM User Guide</i>.</p>
628    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>
629    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
630        self.external_id = ::std::option::Option::Some(input.into());
631        self
632    }
633    /// <p>A unique identifier that might be required when you assume a role in another account. If the administrator of the account to which the role belongs provided you with an external ID, then provide that value in the <code>ExternalId</code> parameter. This value can be any string, such as a passphrase or account number. A cross-account role is usually set up to trust everyone in an account. Therefore, the administrator of the trusting account might send an external ID to the administrator of the trusted account. That way, only someone with the ID can assume the role, rather than everyone in the account. For more information about the external ID, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party</a> in the <i>IAM User Guide</i>.</p>
634    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>
635    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
636        self.external_id = input; self
637    }
638    /// <p>A unique identifier that might be required when you assume a role in another account. If the administrator of the account to which the role belongs provided you with an external ID, then provide that value in the <code>ExternalId</code> parameter. This value can be any string, such as a passphrase or account number. A cross-account role is usually set up to trust everyone in an account. Therefore, the administrator of the trusting account might send an external ID to the administrator of the trusted account. That way, only someone with the ID can assume the role, rather than everyone in the account. For more information about the external ID, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party</a> in the <i>IAM User Guide</i>.</p>
639    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-</p>
640    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
641        &self.external_id
642    }
643    /// <p>The identification number of the MFA device that is associated with the user who is making the <code>AssumeRole</code> call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as <code>GAHT12345678</code>) or an Amazon Resource Name (ARN) for a virtual device (such as <code>arn:aws:iam::123456789012:mfa/user</code>).</p>
644    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
645    pub fn serial_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
646        self.serial_number = ::std::option::Option::Some(input.into());
647        self
648    }
649    /// <p>The identification number of the MFA device that is associated with the user who is making the <code>AssumeRole</code> call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as <code>GAHT12345678</code>) or an Amazon Resource Name (ARN) for a virtual device (such as <code>arn:aws:iam::123456789012:mfa/user</code>).</p>
650    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
651    pub fn set_serial_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
652        self.serial_number = input; self
653    }
654    /// <p>The identification number of the MFA device that is associated with the user who is making the <code>AssumeRole</code> call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as <code>GAHT12345678</code>) or an Amazon Resource Name (ARN) for a virtual device (such as <code>arn:aws:iam::123456789012:mfa/user</code>).</p>
655    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
656    pub fn get_serial_number(&self) -> &::std::option::Option<::std::string::String> {
657        &self.serial_number
658    }
659    /// <p>The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the <code>TokenCode</code> value is missing or expired, the <code>AssumeRole</code> call returns an "access denied" error.</p>
660    /// <p>The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.</p>
661    pub fn token_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
662        self.token_code = ::std::option::Option::Some(input.into());
663        self
664    }
665    /// <p>The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the <code>TokenCode</code> value is missing or expired, the <code>AssumeRole</code> call returns an "access denied" error.</p>
666    /// <p>The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.</p>
667    pub fn set_token_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
668        self.token_code = input; self
669    }
670    /// <p>The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the <code>TokenCode</code> value is missing or expired, the <code>AssumeRole</code> call returns an "access denied" error.</p>
671    /// <p>The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.</p>
672    pub fn get_token_code(&self) -> &::std::option::Option<::std::string::String> {
673        &self.token_code
674    }
675    /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation. The source identity value persists across <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining">chained role</a> sessions.</p>
676    /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity"> <code>sts:SourceIdentity</code> </a> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
677    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: +=,.@-. You cannot use a value that begins with the text <code>aws:</code>. This prefix is reserved for Amazon Web Services internal use.</p>
678    pub fn source_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
679        self.source_identity = ::std::option::Option::Some(input.into());
680        self
681    }
682    /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation. The source identity value persists across <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining">chained role</a> sessions.</p>
683    /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity"> <code>sts:SourceIdentity</code> </a> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
684    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: +=,.@-. You cannot use a value that begins with the text <code>aws:</code>. This prefix is reserved for Amazon Web Services internal use.</p>
685    pub fn set_source_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
686        self.source_identity = input; self
687    }
688    /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation. The source identity value persists across <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining">chained role</a> sessions.</p>
689    /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity"> <code>sts:SourceIdentity</code> </a> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
690    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: +=,.@-. You cannot use a value that begins with the text <code>aws:</code>. This prefix is reserved for Amazon Web Services internal use.</p>
691    pub fn get_source_identity(&self) -> &::std::option::Option<::std::string::String> {
692        &self.source_identity
693    }
694    /// Appends an item to `provided_contexts`.
695    ///
696    /// To override the contents of this collection use [`set_provided_contexts`](Self::set_provided_contexts).
697    ///
698    /// <p>A list of previously acquired trusted context assertions in the format of a JSON array. The trusted context assertion is signed and encrypted by Amazon Web Services STS.</p>
699    /// <p>The following is an example of a <code>ProvidedContext</code> value that includes a single trusted context assertion and the ARN of the context provider from which the trusted context assertion was generated.</p>
700    /// <p><code>\[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}\]</code></p>
701    pub fn provided_contexts(mut self, input: crate::types::ProvidedContext) -> Self {
702        let mut v = self.provided_contexts.unwrap_or_default();
703                        v.push(input);
704                        self.provided_contexts = ::std::option::Option::Some(v);
705                        self
706    }
707    /// <p>A list of previously acquired trusted context assertions in the format of a JSON array. The trusted context assertion is signed and encrypted by Amazon Web Services STS.</p>
708    /// <p>The following is an example of a <code>ProvidedContext</code> value that includes a single trusted context assertion and the ARN of the context provider from which the trusted context assertion was generated.</p>
709    /// <p><code>\[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}\]</code></p>
710    pub fn set_provided_contexts(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ProvidedContext>>) -> Self {
711        self.provided_contexts = input; self
712    }
713    /// <p>A list of previously acquired trusted context assertions in the format of a JSON array. The trusted context assertion is signed and encrypted by Amazon Web Services STS.</p>
714    /// <p>The following is an example of a <code>ProvidedContext</code> value that includes a single trusted context assertion and the ARN of the context provider from which the trusted context assertion was generated.</p>
715    /// <p><code>\[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}\]</code></p>
716    pub fn get_provided_contexts(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ProvidedContext>> {
717        &self.provided_contexts
718    }
719    /// Consumes the builder and constructs a [`AssumeRoleInput`](crate::operation::assume_role::AssumeRoleInput).
720    pub fn build(self) -> ::std::result::Result<crate::operation::assume_role::AssumeRoleInput, ::aws_smithy_types::error::operation::BuildError> {
721        ::std::result::Result::Ok(
722            crate::operation::assume_role::AssumeRoleInput {
723                role_arn: self.role_arn
724                ,
725                role_session_name: self.role_session_name
726                ,
727                policy_arns: self.policy_arns
728                ,
729                policy: self.policy
730                ,
731                duration_seconds: self.duration_seconds
732                ,
733                tags: self.tags
734                ,
735                transitive_tag_keys: self.transitive_tag_keys
736                ,
737                external_id: self.external_id
738                ,
739                serial_number: self.serial_number
740                ,
741                token_code: self.token_code
742                ,
743                source_identity: self.source_identity
744                ,
745                provided_contexts: self.provided_contexts
746                ,
747            }
748        )
749    }
750}
751