aws_sdk_sts/operation/assume_root/_assume_root_output.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)]
5pub struct AssumeRootOutput {
6 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
7 /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
8 /// </note>
9 pub credentials: ::std::option::Option<crate::types::Credentials>,
10 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
11 /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access 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>
12 /// <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>
13 pub source_identity: ::std::option::Option<::std::string::String>,
14 /// The percentage (0-100) of the maximum allowed session token size that the returned session token consumes.
15 pub session_token_utilization: ::std::option::Option<i32>,
16 /// The size, in bytes, of the session token returned in the Credentials for this response.
17 pub session_token_size: ::std::option::Option<i32>,
18 _request_id: Option<String>,
19}
20impl AssumeRootOutput {
21 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
22 /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
23 /// </note>
24 pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
25 self.credentials.as_ref()
26 }
27 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
28 /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access 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>
29 /// <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>
30 pub fn source_identity(&self) -> ::std::option::Option<&str> {
31 self.source_identity.as_deref()
32 }
33 /// The percentage (0-100) of the maximum allowed session token size that the returned session token consumes.
34 pub fn session_token_utilization(&self) -> ::std::option::Option<i32> {
35 self.session_token_utilization
36 }
37 /// The size, in bytes, of the session token returned in the Credentials for this response.
38 pub fn session_token_size(&self) -> ::std::option::Option<i32> {
39 self.session_token_size
40 }
41}
42impl ::std::fmt::Debug for AssumeRootOutput {
43 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
44 let mut formatter = f.debug_struct("AssumeRootOutput");
45 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
46 formatter.field("source_identity", &self.source_identity);
47 formatter.field("session_token_utilization", &self.session_token_utilization);
48 formatter.field("session_token_size", &self.session_token_size);
49 formatter.field("_request_id", &self._request_id);
50 formatter.finish()
51 }
52}
53impl ::aws_types::request_id::RequestId for AssumeRootOutput {
54 fn request_id(&self) -> Option<&str> {
55 self._request_id.as_deref()
56 }
57}
58impl AssumeRootOutput {
59 /// Creates a new builder-style object to manufacture [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
60 pub fn builder() -> crate::operation::assume_root::builders::AssumeRootOutputBuilder {
61 crate::operation::assume_root::builders::AssumeRootOutputBuilder::default()
62 }
63}
64
65/// A builder for [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
67#[non_exhaustive]
68pub struct AssumeRootOutputBuilder {
69 pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
70 pub(crate) source_identity: ::std::option::Option<::std::string::String>,
71 pub(crate) session_token_utilization: ::std::option::Option<i32>,
72 pub(crate) session_token_size: ::std::option::Option<i32>,
73 _request_id: Option<String>,
74}
75impl AssumeRootOutputBuilder {
76 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
77 /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
78 /// </note>
79 pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
80 self.credentials = ::std::option::Option::Some(input);
81 self
82 }
83 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
84 /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
85 /// </note>
86 pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
87 self.credentials = input;
88 self
89 }
90 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
91 /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
92 /// </note>
93 pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
94 &self.credentials
95 }
96 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
97 /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access 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>
98 /// <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>
99 pub fn source_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100 self.source_identity = ::std::option::Option::Some(input.into());
101 self
102 }
103 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
104 /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access 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>
105 /// <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>
106 pub fn set_source_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107 self.source_identity = input;
108 self
109 }
110 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
111 /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access 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>
112 /// <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>
113 pub fn get_source_identity(&self) -> &::std::option::Option<::std::string::String> {
114 &self.source_identity
115 }
116 /// The percentage (0-100) of the maximum allowed session token size that the returned session token consumes.
117 pub fn session_token_utilization(mut self, input: i32) -> Self {
118 self.session_token_utilization = ::std::option::Option::Some(input);
119 self
120 }
121 /// The percentage (0-100) of the maximum allowed session token size that the returned session token consumes.
122 pub fn set_session_token_utilization(mut self, input: ::std::option::Option<i32>) -> Self {
123 self.session_token_utilization = input;
124 self
125 }
126 /// The percentage (0-100) of the maximum allowed session token size that the returned session token consumes.
127 pub fn get_session_token_utilization(&self) -> &::std::option::Option<i32> {
128 &self.session_token_utilization
129 }
130 /// The size, in bytes, of the session token returned in the Credentials for this response.
131 pub fn session_token_size(mut self, input: i32) -> Self {
132 self.session_token_size = ::std::option::Option::Some(input);
133 self
134 }
135 /// The size, in bytes, of the session token returned in the Credentials for this response.
136 pub fn set_session_token_size(mut self, input: ::std::option::Option<i32>) -> Self {
137 self.session_token_size = input;
138 self
139 }
140 /// The size, in bytes, of the session token returned in the Credentials for this response.
141 pub fn get_session_token_size(&self) -> &::std::option::Option<i32> {
142 &self.session_token_size
143 }
144 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
145 self._request_id = Some(request_id.into());
146 self
147 }
148
149 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
150 self._request_id = request_id;
151 self
152 }
153 /// Consumes the builder and constructs a [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
154 pub fn build(self) -> crate::operation::assume_root::AssumeRootOutput {
155 crate::operation::assume_root::AssumeRootOutput {
156 credentials: self.credentials,
157 source_identity: self.source_identity,
158 session_token_utilization: self.session_token_utilization,
159 session_token_size: self.session_token_size,
160 _request_id: self._request_id,
161 }
162 }
163}
164impl ::std::fmt::Debug for AssumeRootOutputBuilder {
165 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
166 let mut formatter = f.debug_struct("AssumeRootOutputBuilder");
167 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
168 formatter.field("source_identity", &self.source_identity);
169 formatter.field("session_token_utilization", &self.session_token_utilization);
170 formatter.field("session_token_size", &self.session_token_size);
171 formatter.field("_request_id", &self._request_id);
172 formatter.finish()
173 }
174}