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 _request_id: Option<String>,
15}
16impl AssumeRootOutput {
17 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
18 /// <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>
19 /// </note>
20 pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
21 self.credentials.as_ref()
22 }
23 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
24 /// <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>
25 /// <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>
26 pub fn source_identity(&self) -> ::std::option::Option<&str> {
27 self.source_identity.as_deref()
28 }
29}
30impl ::std::fmt::Debug for AssumeRootOutput {
31 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32 let mut formatter = f.debug_struct("AssumeRootOutput");
33 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
34 formatter.field("source_identity", &self.source_identity);
35 formatter.field("_request_id", &self._request_id);
36 formatter.finish()
37 }
38}
39static ASSUMEROOTOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.sts.synthetic#AssumeRootOutput", "com.amazonaws.sts.synthetic", "AssumeRootOutput");
40static ASSUMEROOTOUTPUT_MEMBER_CREDENTIALS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
41 ::aws_smithy_schema::ShapeId::from_static(
42 "com.amazonaws.sts.synthetic#AssumeRootOutput$Credentials",
43 "com.amazonaws.sts.synthetic",
44 "AssumeRootOutput",
45 ),
46 ::aws_smithy_schema::ShapeType::Structure,
47 "Credentials",
48 0,
49 );
50static ASSUMEROOTOUTPUT_MEMBER_SOURCE_IDENTITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
51 ::aws_smithy_schema::ShapeId::from_static(
52 "com.amazonaws.sts.synthetic#AssumeRootOutput$SourceIdentity",
53 "com.amazonaws.sts.synthetic",
54 "AssumeRootOutput",
55 ),
56 ::aws_smithy_schema::ShapeType::String,
57 "SourceIdentity",
58 1,
59 );
60static ASSUMEROOTOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
61 ::aws_smithy_schema::ShapeId::from_static(
62 "synthetic#request_id",
63 "synthetic",
64 "request_id",
65 ),
66 ::aws_smithy_schema::ShapeType::String,
67 "request_id",
68 2,
69 ).with_http_header("x-amzn-requestid");
70static ASSUMEROOTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
71 ASSUMEROOTOUTPUT_SCHEMA_ID,
72 ::aws_smithy_schema::ShapeType::Structure,
73 &[&ASSUMEROOTOUTPUT_MEMBER_CREDENTIALS, &ASSUMEROOTOUTPUT_MEMBER_SOURCE_IDENTITY, &ASSUMEROOTOUTPUT_MEMBER__REQUEST_ID],
74 );
75impl AssumeRootOutput {
76 /// The schema for this shape.
77 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ASSUMEROOTOUTPUT_SCHEMA;
78 }
79impl ::aws_smithy_schema::serde::SerializableStruct for AssumeRootOutput {
80 #[allow(unused_variables, clippy::diverging_sub_expression)]
81 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
82 if let Some(ref val) = self.credentials {
83 ser.write_struct(&ASSUMEROOTOUTPUT_MEMBER_CREDENTIALS, val)?;
84 }
85if let Some(ref val) = self.source_identity {
86 ser.write_string(&ASSUMEROOTOUTPUT_MEMBER_SOURCE_IDENTITY, val)?;
87 }
88 Ok(())
89 }
90 }
91impl AssumeRootOutput {
92 /// Deserializes this structure from a [`ShapeDeserializer`].
93 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
94 #[allow(unused_variables, unused_mut)]
95 let mut builder = Self::builder();
96 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
97 deserializer.read_struct(&ASSUMEROOTOUTPUT_SCHEMA, &mut |member, deser| {
98 match member.member_index() {
99 Some(0) => {
100 builder.credentials = Some(crate::types::Credentials::deserialize(deser)?);
101 }
102Some(1) => {
103 builder.source_identity = Some(deser.read_string(member)?);
104 }
105Some(2) => {
106 builder._request_id = Some(deser.read_string(member)?);
107 }
108 _ => {}
109 }
110 Ok(())
111 })?;
112 Ok(builder.build())
113 }
114 }
115impl AssumeRootOutput {
116 /// Deserializes this structure from a body deserializer and HTTP response headers.
117 /// Header-bound members are read directly from headers, avoiding runtime
118 /// member iteration overhead. Body members are read via the deserializer.
119 pub fn deserialize_with_response(
120 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
121 headers: &::aws_smithy_runtime_api::http::Headers,
122 _status: u16,
123 _body: &[u8],
124 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
125 #[allow(unused_variables, unused_mut)]
126 let mut builder = Self::builder();
127if let Some(val) = headers.get("x-amzn-requestid") {
128 builder._request_id = Some(val.to_string());
129 }
130#[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
131 deserializer.read_struct(&ASSUMEROOTOUTPUT_SCHEMA, &mut |member, deser| {
132 match member.member_index() {
133 Some(0) => { builder.credentials = Some(crate::types::Credentials::deserialize(deser)?); }
134Some(1) => { builder.source_identity = Some(deser.read_string(member)?); }
135 _ => {}
136 }
137 Ok(())
138 })?;
139 Ok(builder.build())
140 }
141 }
142impl ::aws_types::request_id::RequestId for AssumeRootOutput {
143 fn request_id(&self) -> Option<&str> {
144 self._request_id.as_deref()
145 }
146 }
147impl AssumeRootOutput {
148 /// Creates a new builder-style object to manufacture [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
149 pub fn builder() -> crate::operation::assume_root::builders::AssumeRootOutputBuilder {
150 crate::operation::assume_root::builders::AssumeRootOutputBuilder::default()
151 }
152}
153
154/// A builder for [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
155#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
156#[non_exhaustive]
157pub struct AssumeRootOutputBuilder {
158 pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
159 pub(crate) source_identity: ::std::option::Option<::std::string::String>,
160 _request_id: Option<String>,
161}
162impl AssumeRootOutputBuilder {
163 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
164 /// <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>
165 /// </note>
166 pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
167 self.credentials = ::std::option::Option::Some(input);
168 self
169 }
170 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
171 /// <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>
172 /// </note>
173 pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
174 self.credentials = input; self
175 }
176 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
177 /// <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>
178 /// </note>
179 pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
180 &self.credentials
181 }
182 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
183 /// <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>
184 /// <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>
185 pub fn source_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.source_identity = ::std::option::Option::Some(input.into());
187 self
188 }
189 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
190 /// <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>
191 /// <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>
192 pub fn set_source_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.source_identity = input; self
194 }
195 /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
196 /// <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>
197 /// <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>
198 pub fn get_source_identity(&self) -> &::std::option::Option<::std::string::String> {
199 &self.source_identity
200 }
201 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
202 self._request_id = Some(request_id.into());
203 self
204 }
205
206 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
207 self._request_id = request_id;
208 self
209 }
210 /// Consumes the builder and constructs a [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
211 pub fn build(self) -> crate::operation::assume_root::AssumeRootOutput {
212 crate::operation::assume_root::AssumeRootOutput {
213 credentials: self.credentials
214 ,
215 source_identity: self.source_identity
216 ,
217 _request_id: self._request_id,
218 }
219 }
220}
221impl ::std::fmt::Debug for AssumeRootOutputBuilder {
222 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
223 let mut formatter = f.debug_struct("AssumeRootOutputBuilder");
224 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
225 formatter.field("source_identity", &self.source_identity);
226 formatter.field("_request_id", &self._request_id);
227 formatter.finish()
228 }
229}
230