36 36 | /// <p>The source identity specified by the principal that is calling the <code>AssumeRole</code> operation.</p>
|
37 37 | /// <p>You can require users to specify a source identity when they assume a role. You do this by using the <code>sts:SourceIdentity</code> condition key in a role trust policy. You can use source identity information in CloudTrail logs to determine who took actions with a role. You can use the <code>aws:SourceIdentity</code> condition key to further control access to Amazon Web Services resources 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>
|
38 38 | /// <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>
|
39 39 | pub fn source_identity(&self) -> ::std::option::Option<&str> {
|
40 40 | self.source_identity.as_deref()
|
41 41 | }
|
42 42 | }
|
43 43 | impl ::std::fmt::Debug for AssumeRoleOutput {
|
44 44 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
45 45 | let mut formatter = f.debug_struct("AssumeRoleOutput");
|
46 46 | formatter.field("credentials", &"*** Sensitive Data Redacted ***");
|
47 47 | formatter.field("assumed_role_user", &self.assumed_role_user);
|
48 48 | formatter.field("packed_policy_size", &self.packed_policy_size);
|
49 49 | formatter.field("source_identity", &self.source_identity);
|
50 50 | formatter.field("_request_id", &self._request_id);
|
51 51 | formatter.finish()
|
52 52 | }
|
53 53 | }
|
54 54 | static ASSUMEROLEOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
55 55 | "com.amazonaws.sts.synthetic#AssumeRoleOutput",
|
56 56 | "com.amazonaws.sts.synthetic",
|
57 57 | "AssumeRoleOutput",
|
58 58 | );
|
59 59 | static ASSUMEROLEOUTPUT_MEMBER_CREDENTIALS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
60 60 | ::aws_smithy_schema::ShapeId::from_static(
|
61 61 | "com.amazonaws.sts.synthetic#AssumeRoleOutput$Credentials",
|
62 62 | "com.amazonaws.sts.synthetic",
|
63 63 | "AssumeRoleOutput",
|
64 64 | ),
|
65 65 | ::aws_smithy_schema::ShapeType::Structure,
|
66 - | "credentials",
|
66 + | "Credentials",
|
67 67 | 0,
|
68 68 | );
|
69 69 | static ASSUMEROLEOUTPUT_MEMBER_ASSUMED_ROLE_USER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
70 70 | ::aws_smithy_schema::ShapeId::from_static(
|
71 71 | "com.amazonaws.sts.synthetic#AssumeRoleOutput$AssumedRoleUser",
|
72 72 | "com.amazonaws.sts.synthetic",
|
73 73 | "AssumeRoleOutput",
|
74 74 | ),
|
75 75 | ::aws_smithy_schema::ShapeType::Structure,
|
76 - | "assumed_role_user",
|
76 + | "AssumedRoleUser",
|
77 77 | 1,
|
78 78 | );
|
79 79 | static ASSUMEROLEOUTPUT_MEMBER_PACKED_POLICY_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
80 80 | ::aws_smithy_schema::ShapeId::from_static(
|
81 81 | "com.amazonaws.sts.synthetic#AssumeRoleOutput$PackedPolicySize",
|
82 82 | "com.amazonaws.sts.synthetic",
|
83 83 | "AssumeRoleOutput",
|
84 84 | ),
|
85 85 | ::aws_smithy_schema::ShapeType::Integer,
|
86 - | "packed_policy_size",
|
86 + | "PackedPolicySize",
|
87 87 | 2,
|
88 88 | );
|
89 89 | static ASSUMEROLEOUTPUT_MEMBER_SOURCE_IDENTITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
90 90 | ::aws_smithy_schema::ShapeId::from_static(
|
91 91 | "com.amazonaws.sts.synthetic#AssumeRoleOutput$SourceIdentity",
|
92 92 | "com.amazonaws.sts.synthetic",
|
93 93 | "AssumeRoleOutput",
|
94 94 | ),
|
95 95 | ::aws_smithy_schema::ShapeType::String,
|
96 - | "source_identity",
|
96 + | "SourceIdentity",
|
97 97 | 3,
|
98 98 | );
|
99 + | static ASSUMEROLEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
100 + | ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
|
101 + | ::aws_smithy_schema::ShapeType::String,
|
102 + | "request_id",
|
103 + | 4,
|
104 + | )
|
105 + | .with_http_header("x-amzn-requestid");
|
99 106 | static ASSUMEROLEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
100 107 | ASSUMEROLEOUTPUT_SCHEMA_ID,
|
101 108 | ::aws_smithy_schema::ShapeType::Structure,
|
102 109 | &[
|
103 110 | &ASSUMEROLEOUTPUT_MEMBER_CREDENTIALS,
|
104 111 | &ASSUMEROLEOUTPUT_MEMBER_ASSUMED_ROLE_USER,
|
105 112 | &ASSUMEROLEOUTPUT_MEMBER_PACKED_POLICY_SIZE,
|
106 113 | &ASSUMEROLEOUTPUT_MEMBER_SOURCE_IDENTITY,
|
114 + | &ASSUMEROLEOUTPUT_MEMBER__REQUEST_ID,
|
107 115 | ],
|
108 116 | );
|
109 117 | impl AssumeRoleOutput {
|
110 118 | /// The schema for this shape.
|
111 119 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ASSUMEROLEOUTPUT_SCHEMA;
|
112 120 | }
|
113 121 | impl ::aws_smithy_schema::serde::SerializableStruct for AssumeRoleOutput {
|
114 122 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
115 123 | fn serialize_members(
|
116 124 | &self,
|
117 125 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
118 126 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
119 127 | if let Some(ref val) = self.credentials {
|
120 128 | ser.write_struct(&ASSUMEROLEOUTPUT_MEMBER_CREDENTIALS, val)?;
|
121 129 | }
|
122 130 | if let Some(ref val) = self.assumed_role_user {
|
123 131 | ser.write_struct(&ASSUMEROLEOUTPUT_MEMBER_ASSUMED_ROLE_USER, val)?;
|
124 132 | }
|
125 133 | if let Some(ref val) = self.packed_policy_size {
|
126 134 | ser.write_integer(&ASSUMEROLEOUTPUT_MEMBER_PACKED_POLICY_SIZE, *val)?;
|
127 135 | }
|
128 136 | if let Some(ref val) = self.source_identity {
|
129 137 | ser.write_string(&ASSUMEROLEOUTPUT_MEMBER_SOURCE_IDENTITY, val)?;
|
130 138 | }
|
131 139 | Ok(())
|
132 140 | }
|
133 141 | }
|
134 142 | impl AssumeRoleOutput {
|
135 143 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
136 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
137 - | deserializer: &mut D,
|
144 + | pub fn deserialize(
|
145 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
146 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
147 + | #[allow(unused_variables, unused_mut)]
|
148 + | let mut builder = Self::builder();
|
149 + | #[allow(
|
150 + | unused_variables,
|
151 + | unreachable_code,
|
152 + | clippy::single_match,
|
153 + | clippy::match_single_binding,
|
154 + | clippy::diverging_sub_expression
|
155 + | )]
|
156 + | deserializer.read_struct(&ASSUMEROLEOUTPUT_SCHEMA, &mut |member, deser| {
|
157 + | match member.member_index() {
|
158 + | Some(0) => {
|
159 + | builder.credentials = Some(crate::types::Credentials::deserialize(deser)?);
|
160 + | }
|
161 + | Some(1) => {
|
162 + | builder.assumed_role_user = Some(crate::types::AssumedRoleUser::deserialize(deser)?);
|
163 + | }
|
164 + | Some(2) => {
|
165 + | builder.packed_policy_size = Some(deser.read_integer(member)?);
|
166 + | }
|
167 + | Some(3) => {
|
168 + | builder.source_identity = Some(deser.read_string(member)?);
|
169 + | }
|
170 + | Some(4) => {
|
171 + | builder._request_id = Some(deser.read_string(member)?);
|
172 + | }
|
173 + | _ => {}
|
174 + | }
|
175 + | Ok(())
|
176 + | })?;
|
177 + | Ok(builder.build())
|
178 + | }
|
179 + | }
|
180 + | impl AssumeRoleOutput {
|
181 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
182 + | /// Header-bound members are read directly from headers, avoiding runtime
|
183 + | /// member iteration overhead. Body members are read via the deserializer.
|
184 + | pub fn deserialize_with_response(
|
185 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
186 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
187 + | _status: u16,
|
188 + | _body: &[u8],
|
138 189 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
139 190 | #[allow(unused_variables, unused_mut)]
|
140 191 | let mut builder = Self::builder();
|
192 + | if let Some(val) = headers.get("x-amzn-requestid") {
|
193 + | builder._request_id = Some(val.to_string());
|
194 + | }
|
141 195 | #[allow(
|
142 196 | unused_variables,
|
143 197 | unreachable_code,
|
144 198 | clippy::single_match,
|
145 199 | clippy::match_single_binding,
|
146 200 | clippy::diverging_sub_expression
|
147 201 | )]
|
148 - | deserializer.read_struct(&ASSUMEROLEOUTPUT_SCHEMA, (), |_, member, deser| {
|
202 + | deserializer.read_struct(&ASSUMEROLEOUTPUT_SCHEMA, &mut |member, deser| {
|
149 203 | match member.member_index() {
|
150 204 | Some(0) => {
|
151 205 | builder.credentials = Some(crate::types::Credentials::deserialize(deser)?);
|
152 206 | }
|
153 207 | Some(1) => {
|
154 208 | builder.assumed_role_user = Some(crate::types::AssumedRoleUser::deserialize(deser)?);
|
155 209 | }
|
156 210 | Some(2) => {
|
157 211 | builder.packed_policy_size = Some(deser.read_integer(member)?);
|
158 212 | }
|