Skip to main content

aws_sdk_sts/operation/assume_root/
_assume_root_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 AssumeRootInput {
6    /// <p>The member account principal ARN or account ID.</p>
7    pub target_principal: ::std::option::Option<::std::string::String>,
8    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You must use one of following Amazon Web Services managed policies to scope root session actions:</p>
9    /// <ul>
10    /// <li>
11    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
12    /// <li>
13    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
14    /// <li>
15    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
16    /// <li>
17    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
18    /// <li>
19    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
20    /// </ul>
21    pub task_policy_arn: ::std::option::Option<crate::types::PolicyDescriptorType>,
22    /// <p>The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.</p>
23    /// <p>By default, the value is set to <code>900</code> seconds.</p>
24    pub duration_seconds: ::std::option::Option<i32>,
25    /// The minimum size, in bytes, of the session token that STS issues for the request. STS increases the session token to at least this size, regardless of its actual content. The value must not exceed 4,096 bytes. When set to 0 or not specified, the session token size is unchanged.
26    pub minimum_session_token_size: ::std::option::Option<i32>,
27}
28impl AssumeRootInput {
29    /// <p>The member account principal ARN or account ID.</p>
30    pub fn target_principal(&self) -> ::std::option::Option<&str> {
31        self.target_principal.as_deref()
32    }
33    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You must use one of following Amazon Web Services managed policies to scope root session actions:</p>
34    /// <ul>
35    /// <li>
36    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
37    /// <li>
38    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
39    /// <li>
40    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
41    /// <li>
42    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
43    /// <li>
44    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
45    /// </ul>
46    pub fn task_policy_arn(&self) -> ::std::option::Option<&crate::types::PolicyDescriptorType> {
47        self.task_policy_arn.as_ref()
48    }
49    /// <p>The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.</p>
50    /// <p>By default, the value is set to <code>900</code> seconds.</p>
51    pub fn duration_seconds(&self) -> ::std::option::Option<i32> {
52        self.duration_seconds
53    }
54    /// The minimum size, in bytes, of the session token that STS issues for the request. STS increases the session token to at least this size, regardless of its actual content. The value must not exceed 4,096 bytes. When set to 0 or not specified, the session token size is unchanged.
55    pub fn minimum_session_token_size(&self) -> ::std::option::Option<i32> {
56        self.minimum_session_token_size
57    }
58}
59impl AssumeRootInput {
60    /// Creates a new builder-style object to manufacture [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
61    pub fn builder() -> crate::operation::assume_root::builders::AssumeRootInputBuilder {
62        crate::operation::assume_root::builders::AssumeRootInputBuilder::default()
63    }
64}
65
66/// A builder for [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct AssumeRootInputBuilder {
70    pub(crate) target_principal: ::std::option::Option<::std::string::String>,
71    pub(crate) task_policy_arn: ::std::option::Option<crate::types::PolicyDescriptorType>,
72    pub(crate) duration_seconds: ::std::option::Option<i32>,
73    pub(crate) minimum_session_token_size: ::std::option::Option<i32>,
74}
75impl AssumeRootInputBuilder {
76    /// <p>The member account principal ARN or account ID.</p>
77    /// This field is required.
78    pub fn target_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.target_principal = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The member account principal ARN or account ID.</p>
83    pub fn set_target_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.target_principal = input;
85        self
86    }
87    /// <p>The member account principal ARN or account ID.</p>
88    pub fn get_target_principal(&self) -> &::std::option::Option<::std::string::String> {
89        &self.target_principal
90    }
91    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You must use one of following Amazon Web Services managed policies to scope root session actions:</p>
92    /// <ul>
93    /// <li>
94    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
95    /// <li>
96    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
97    /// <li>
98    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
99    /// <li>
100    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
101    /// <li>
102    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
103    /// </ul>
104    /// This field is required.
105    pub fn task_policy_arn(mut self, input: crate::types::PolicyDescriptorType) -> Self {
106        self.task_policy_arn = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You must use one of following Amazon Web Services managed policies to scope root session actions:</p>
110    /// <ul>
111    /// <li>
112    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
113    /// <li>
114    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
115    /// <li>
116    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
117    /// <li>
118    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
119    /// <li>
120    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
121    /// </ul>
122    pub fn set_task_policy_arn(mut self, input: ::std::option::Option<crate::types::PolicyDescriptorType>) -> Self {
123        self.task_policy_arn = input;
124        self
125    }
126    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You must use one of following Amazon Web Services managed policies to scope root session actions:</p>
127    /// <ul>
128    /// <li>
129    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
130    /// <li>
131    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
132    /// <li>
133    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
134    /// <li>
135    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
136    /// <li>
137    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
138    /// </ul>
139    pub fn get_task_policy_arn(&self) -> &::std::option::Option<crate::types::PolicyDescriptorType> {
140        &self.task_policy_arn
141    }
142    /// <p>The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.</p>
143    /// <p>By default, the value is set to <code>900</code> seconds.</p>
144    pub fn duration_seconds(mut self, input: i32) -> Self {
145        self.duration_seconds = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.</p>
149    /// <p>By default, the value is set to <code>900</code> seconds.</p>
150    pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
151        self.duration_seconds = input;
152        self
153    }
154    /// <p>The duration, in seconds, of the privileged session. The value can range from 0 seconds up to the maximum session duration of 900 seconds (15 minutes). If you specify a value higher than this setting, the operation fails.</p>
155    /// <p>By default, the value is set to <code>900</code> seconds.</p>
156    pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
157        &self.duration_seconds
158    }
159    /// The minimum size, in bytes, of the session token that STS issues for the request. STS increases the session token to at least this size, regardless of its actual content. The value must not exceed 4,096 bytes. When set to 0 or not specified, the session token size is unchanged.
160    pub fn minimum_session_token_size(mut self, input: i32) -> Self {
161        self.minimum_session_token_size = ::std::option::Option::Some(input);
162        self
163    }
164    /// The minimum size, in bytes, of the session token that STS issues for the request. STS increases the session token to at least this size, regardless of its actual content. The value must not exceed 4,096 bytes. When set to 0 or not specified, the session token size is unchanged.
165    pub fn set_minimum_session_token_size(mut self, input: ::std::option::Option<i32>) -> Self {
166        self.minimum_session_token_size = input;
167        self
168    }
169    /// The minimum size, in bytes, of the session token that STS issues for the request. STS increases the session token to at least this size, regardless of its actual content. The value must not exceed 4,096 bytes. When set to 0 or not specified, the session token size is unchanged.
170    pub fn get_minimum_session_token_size(&self) -> &::std::option::Option<i32> {
171        &self.minimum_session_token_size
172    }
173    /// Consumes the builder and constructs a [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
174    pub fn build(self) -> ::std::result::Result<crate::operation::assume_root::AssumeRootInput, ::aws_smithy_types::error::operation::BuildError> {
175        ::std::result::Result::Ok(crate::operation::assume_root::AssumeRootInput {
176            target_principal: self.target_principal,
177            task_policy_arn: self.task_policy_arn,
178            duration_seconds: self.duration_seconds,
179            minimum_session_token_size: self.minimum_session_token_size,
180        })
181    }
182}