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 can 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}
26impl AssumeRootInput {
27    /// <p>The member account principal ARN or account ID.</p>
28    pub fn target_principal(&self) -> ::std::option::Option<&str> {
29        self.target_principal.as_deref()
30    }
31    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You can use one of following Amazon Web Services managed policies to scope root session actions.</p>
32    /// <ul>
33    /// <li>
34    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
35    /// <li>
36    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
37    /// <li>
38    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
39    /// <li>
40    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
41    /// <li>
42    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
43    /// </ul>
44    pub fn task_policy_arn(&self) -> ::std::option::Option<&crate::types::PolicyDescriptorType> {
45        self.task_policy_arn.as_ref()
46    }
47    /// <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>
48    /// <p>By default, the value is set to <code>900</code> seconds.</p>
49    pub fn duration_seconds(&self) -> ::std::option::Option<i32> {
50        self.duration_seconds
51    }
52}
53impl AssumeRootInput {
54    /// Creates a new builder-style object to manufacture [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
55    pub fn builder() -> crate::operation::assume_root::builders::AssumeRootInputBuilder {
56        crate::operation::assume_root::builders::AssumeRootInputBuilder::default()
57    }
58}
59
60/// A builder for [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct AssumeRootInputBuilder {
64    pub(crate) target_principal: ::std::option::Option<::std::string::String>,
65    pub(crate) task_policy_arn: ::std::option::Option<crate::types::PolicyDescriptorType>,
66    pub(crate) duration_seconds: ::std::option::Option<i32>,
67}
68impl AssumeRootInputBuilder {
69    /// <p>The member account principal ARN or account ID.</p>
70    /// This field is required.
71    pub fn target_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.target_principal = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The member account principal ARN or account ID.</p>
76    pub fn set_target_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.target_principal = input;
78        self
79    }
80    /// <p>The member account principal ARN or account ID.</p>
81    pub fn get_target_principal(&self) -> &::std::option::Option<::std::string::String> {
82        &self.target_principal
83    }
84    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You can use one of following Amazon Web Services managed policies to scope root session actions.</p>
85    /// <ul>
86    /// <li>
87    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
88    /// <li>
89    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
90    /// <li>
91    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
92    /// <li>
93    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
94    /// <li>
95    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
96    /// </ul>
97    /// This field is required.
98    pub fn task_policy_arn(mut self, input: crate::types::PolicyDescriptorType) -> Self {
99        self.task_policy_arn = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You can use one of following Amazon Web Services managed policies to scope root session actions.</p>
103    /// <ul>
104    /// <li>
105    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
106    /// <li>
107    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
108    /// <li>
109    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
110    /// <li>
111    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
112    /// <li>
113    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
114    /// </ul>
115    pub fn set_task_policy_arn(mut self, input: ::std::option::Option<crate::types::PolicyDescriptorType>) -> Self {
116        self.task_policy_arn = input;
117        self
118    }
119    /// <p>The identity based policy that scopes the session to the privileged tasks that can be performed. You can use one of following Amazon Web Services managed policies to scope root session actions.</p>
120    /// <ul>
121    /// <li>
122    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
123    /// <li>
124    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
125    /// <li>
126    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
127    /// <li>
128    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
129    /// <li>
130    /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
131    /// </ul>
132    pub fn get_task_policy_arn(&self) -> &::std::option::Option<crate::types::PolicyDescriptorType> {
133        &self.task_policy_arn
134    }
135    /// <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>
136    /// <p>By default, the value is set to <code>900</code> seconds.</p>
137    pub fn duration_seconds(mut self, input: i32) -> Self {
138        self.duration_seconds = ::std::option::Option::Some(input);
139        self
140    }
141    /// <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>
142    /// <p>By default, the value is set to <code>900</code> seconds.</p>
143    pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
144        self.duration_seconds = input;
145        self
146    }
147    /// <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>
148    /// <p>By default, the value is set to <code>900</code> seconds.</p>
149    pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
150        &self.duration_seconds
151    }
152    /// Consumes the builder and constructs a [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
153    pub fn build(self) -> ::std::result::Result<crate::operation::assume_root::AssumeRootInput, ::aws_smithy_types::error::operation::BuildError> {
154        ::std::result::Result::Ok(crate::operation::assume_root::AssumeRootInput {
155            target_principal: self.target_principal,
156            task_policy_arn: self.task_policy_arn,
157            duration_seconds: self.duration_seconds,
158        })
159    }
160}