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; self
78 }
79 /// <p>The member account principal ARN or account ID.</p>
80 pub fn get_target_principal(&self) -> &::std::option::Option<::std::string::String> {
81 &self.target_principal
82 }
83 /// <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>
84 /// <ul>
85 /// <li>
86 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
87 /// <li>
88 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
89 /// <li>
90 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
91 /// <li>
92 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
93 /// <li>
94 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
95 /// </ul>
96 /// This field is required.
97 pub fn task_policy_arn(mut self, input: crate::types::PolicyDescriptorType) -> Self {
98 self.task_policy_arn = ::std::option::Option::Some(input);
99 self
100 }
101 /// <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>
102 /// <ul>
103 /// <li>
104 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
105 /// <li>
106 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
107 /// <li>
108 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
109 /// <li>
110 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
111 /// <li>
112 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
113 /// </ul>
114 pub fn set_task_policy_arn(mut self, input: ::std::option::Option<crate::types::PolicyDescriptorType>) -> Self {
115 self.task_policy_arn = input; self
116 }
117 /// <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>
118 /// <ul>
119 /// <li>
120 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials">IAMAuditRootUserCredentials</a></p></li>
121 /// <li>
122 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword">IAMCreateRootUserPassword</a></p></li>
123 /// <li>
124 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials">IAMDeleteRootUserCredentials</a></p></li>
125 /// <li>
126 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy">S3UnlockBucketPolicy</a></p></li>
127 /// <li>
128 /// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy">SQSUnlockQueuePolicy</a></p></li>
129 /// </ul>
130 pub fn get_task_policy_arn(&self) -> &::std::option::Option<crate::types::PolicyDescriptorType> {
131 &self.task_policy_arn
132 }
133 /// <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>
134 /// <p>By default, the value is set to <code>900</code> seconds.</p>
135 pub fn duration_seconds(mut self, input: i32) -> Self {
136 self.duration_seconds = ::std::option::Option::Some(input);
137 self
138 }
139 /// <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>
140 /// <p>By default, the value is set to <code>900</code> seconds.</p>
141 pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
142 self.duration_seconds = input; self
143 }
144 /// <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>
145 /// <p>By default, the value is set to <code>900</code> seconds.</p>
146 pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
147 &self.duration_seconds
148 }
149 /// Consumes the builder and constructs a [`AssumeRootInput`](crate::operation::assume_root::AssumeRootInput).
150 pub fn build(self) -> ::std::result::Result<crate::operation::assume_root::AssumeRootInput, ::aws_smithy_types::error::operation::BuildError> {
151 ::std::result::Result::Ok(
152 crate::operation::assume_root::AssumeRootInput {
153 target_principal: self.target_principal
154 ,
155 task_policy_arn: self.task_policy_arn
156 ,
157 duration_seconds: self.duration_seconds
158 ,
159 }
160 )
161 }
162}
163