95 95 | "com.amazonaws.iam.synthetic",
|
96 96 | "CreateRoleInput",
|
97 97 | );
|
98 98 | static CREATEROLEINPUT_MEMBER_PATH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
99 99 | ::aws_smithy_schema::ShapeId::from_static(
|
100 100 | "com.amazonaws.iam.synthetic#CreateRoleInput$Path",
|
101 101 | "com.amazonaws.iam.synthetic",
|
102 102 | "CreateRoleInput",
|
103 103 | ),
|
104 104 | ::aws_smithy_schema::ShapeType::String,
|
105 - | "path",
|
105 + | "Path",
|
106 106 | 0,
|
107 107 | );
|
108 108 | static CREATEROLEINPUT_MEMBER_ROLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
109 109 | ::aws_smithy_schema::ShapeId::from_static(
|
110 110 | "com.amazonaws.iam.synthetic#CreateRoleInput$RoleName",
|
111 111 | "com.amazonaws.iam.synthetic",
|
112 112 | "CreateRoleInput",
|
113 113 | ),
|
114 114 | ::aws_smithy_schema::ShapeType::String,
|
115 - | "role_name",
|
115 + | "RoleName",
|
116 116 | 1,
|
117 117 | );
|
118 118 | static CREATEROLEINPUT_MEMBER_ASSUME_ROLE_POLICY_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
119 119 | ::aws_smithy_schema::ShapeId::from_static(
|
120 120 | "com.amazonaws.iam.synthetic#CreateRoleInput$AssumeRolePolicyDocument",
|
121 121 | "com.amazonaws.iam.synthetic",
|
122 122 | "CreateRoleInput",
|
123 123 | ),
|
124 124 | ::aws_smithy_schema::ShapeType::String,
|
125 - | "assume_role_policy_document",
|
125 + | "AssumeRolePolicyDocument",
|
126 126 | 2,
|
127 127 | );
|
128 128 | static CREATEROLEINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
129 129 | ::aws_smithy_schema::ShapeId::from_static(
|
130 130 | "com.amazonaws.iam.synthetic#CreateRoleInput$Description",
|
131 131 | "com.amazonaws.iam.synthetic",
|
132 132 | "CreateRoleInput",
|
133 133 | ),
|
134 134 | ::aws_smithy_schema::ShapeType::String,
|
135 - | "description",
|
135 + | "Description",
|
136 136 | 3,
|
137 137 | );
|
138 138 | static CREATEROLEINPUT_MEMBER_MAX_SESSION_DURATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
139 139 | ::aws_smithy_schema::ShapeId::from_static(
|
140 140 | "com.amazonaws.iam.synthetic#CreateRoleInput$MaxSessionDuration",
|
141 141 | "com.amazonaws.iam.synthetic",
|
142 142 | "CreateRoleInput",
|
143 143 | ),
|
144 144 | ::aws_smithy_schema::ShapeType::Integer,
|
145 - | "max_session_duration",
|
145 + | "MaxSessionDuration",
|
146 146 | 4,
|
147 147 | );
|
148 148 | static CREATEROLEINPUT_MEMBER_PERMISSIONS_BOUNDARY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
149 149 | ::aws_smithy_schema::ShapeId::from_static(
|
150 150 | "com.amazonaws.iam.synthetic#CreateRoleInput$PermissionsBoundary",
|
151 151 | "com.amazonaws.iam.synthetic",
|
152 152 | "CreateRoleInput",
|
153 153 | ),
|
154 154 | ::aws_smithy_schema::ShapeType::String,
|
155 - | "permissions_boundary",
|
155 + | "PermissionsBoundary",
|
156 156 | 5,
|
157 157 | );
|
158 158 | static CREATEROLEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
159 159 | ::aws_smithy_schema::ShapeId::from_static(
|
160 160 | "com.amazonaws.iam.synthetic#CreateRoleInput$Tags",
|
161 161 | "com.amazonaws.iam.synthetic",
|
162 162 | "CreateRoleInput",
|
163 163 | ),
|
164 164 | ::aws_smithy_schema::ShapeType::List,
|
165 - | "tags",
|
165 + | "Tags",
|
166 166 | 6,
|
167 167 | );
|
168 168 | static CREATEROLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
169 169 | CREATEROLEINPUT_SCHEMA_ID,
|
170 170 | ::aws_smithy_schema::ShapeType::Structure,
|
171 171 | &[
|
172 172 | &CREATEROLEINPUT_MEMBER_PATH,
|
173 173 | &CREATEROLEINPUT_MEMBER_ROLE_NAME,
|
174 174 | &CREATEROLEINPUT_MEMBER_ASSUME_ROLE_POLICY_DOCUMENT,
|
175 175 | &CREATEROLEINPUT_MEMBER_DESCRIPTION,
|
176 176 | &CREATEROLEINPUT_MEMBER_MAX_SESSION_DURATION,
|
177 177 | &CREATEROLEINPUT_MEMBER_PERMISSIONS_BOUNDARY,
|
178 178 | &CREATEROLEINPUT_MEMBER_TAGS,
|
179 179 | ],
|
180 180 | );
|
181 181 | impl CreateRoleInput {
|
182 182 | /// The schema for this shape.
|
183 183 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEROLEINPUT_SCHEMA;
|
184 184 | }
|
185 185 | impl ::aws_smithy_schema::serde::SerializableStruct for CreateRoleInput {
|
186 186 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
187 187 | fn serialize_members(
|
188 188 | &self,
|
189 189 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
190 190 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
191 191 | if let Some(ref val) = self.path {
|
192 192 | ser.write_string(&CREATEROLEINPUT_MEMBER_PATH, val)?;
|
193 193 | }
|
194 194 | if let Some(ref val) = self.role_name {
|
195 195 | ser.write_string(&CREATEROLEINPUT_MEMBER_ROLE_NAME, val)?;
|
196 196 | }
|
197 197 | if let Some(ref val) = self.assume_role_policy_document {
|
198 198 | ser.write_string(&CREATEROLEINPUT_MEMBER_ASSUME_ROLE_POLICY_DOCUMENT, val)?;
|
199 199 | }
|
200 200 | if let Some(ref val) = self.description {
|
201 201 | ser.write_string(&CREATEROLEINPUT_MEMBER_DESCRIPTION, val)?;
|
202 202 | }
|
203 203 | if let Some(ref val) = self.max_session_duration {
|
204 204 | ser.write_integer(&CREATEROLEINPUT_MEMBER_MAX_SESSION_DURATION, *val)?;
|
205 205 | }
|
206 206 | if let Some(ref val) = self.permissions_boundary {
|
207 207 | ser.write_string(&CREATEROLEINPUT_MEMBER_PERMISSIONS_BOUNDARY, val)?;
|
208 208 | }
|
209 209 | if let Some(ref val) = self.tags {
|
210 210 | ser.write_list(
|
211 211 | &CREATEROLEINPUT_MEMBER_TAGS,
|
212 212 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
213 213 | for item in val {
|
214 214 | ser.write_struct(crate::types::Tag::SCHEMA, item)?;
|
215 215 | }
|
216 216 | Ok(())
|
217 217 | },
|
218 218 | )?;
|
219 219 | }
|
220 220 | Ok(())
|
221 221 | }
|
222 222 | }
|
223 223 | impl CreateRoleInput {
|
224 224 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
225 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
226 - | deserializer: &mut D,
|
225 + | pub fn deserialize(
|
226 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
227 227 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
228 228 | #[allow(unused_variables, unused_mut)]
|
229 229 | let mut builder = Self::builder();
|
230 230 | #[allow(
|
231 231 | unused_variables,
|
232 232 | unreachable_code,
|
233 233 | clippy::single_match,
|
234 234 | clippy::match_single_binding,
|
235 235 | clippy::diverging_sub_expression
|
236 236 | )]
|
237 - | deserializer.read_struct(&CREATEROLEINPUT_SCHEMA, (), |_, member, deser| {
|
237 + | deserializer.read_struct(&CREATEROLEINPUT_SCHEMA, &mut |member, deser| {
|
238 238 | match member.member_index() {
|
239 239 | Some(0) => {
|
240 240 | builder.path = Some(deser.read_string(member)?);
|
241 241 | }
|
242 242 | Some(1) => {
|
243 243 | builder.role_name = Some(deser.read_string(member)?);
|
244 244 | }
|
245 245 | Some(2) => {
|
246 246 | builder.assume_role_policy_document = Some(deser.read_string(member)?);
|
247 247 | }
|
248 248 | Some(3) => {
|
249 249 | builder.description = Some(deser.read_string(member)?);
|
250 250 | }
|
251 251 | Some(4) => {
|
252 252 | builder.max_session_duration = Some(deser.read_integer(member)?);
|
253 253 | }
|
254 254 | Some(5) => {
|
255 255 | builder.permissions_boundary = Some(deser.read_string(member)?);
|
256 256 | }
|
257 257 | Some(6) => {
|
258 258 | builder.tags = Some({
|
259 - | let container = if let Some(cap) = deser.container_size() {
|
260 - | Vec::with_capacity(cap)
|
261 - | } else {
|
262 - | Vec::new()
|
263 - | };
|
264 - | deser.read_list(member, container, |mut list, deser| {
|
265 - | list.push(crate::types::Tag::deserialize(deser)?);
|
266 - | Ok(list)
|
267 - | })?
|
259 + | let mut container = Vec::new();
|
260 + | deser.read_list(member, &mut |deser| {
|
261 + | container.push(crate::types::Tag::deserialize(deser)?);
|
262 + | Ok(())
|
263 + | })?;
|
264 + | container
|
268 265 | });
|
269 266 | }
|
270 267 | _ => {}
|
271 268 | }
|
272 269 | Ok(())
|
273 270 | })?;
|
271 + | builder.role_name = builder.role_name.or(Some(String::new()));
|
272 + | builder.assume_role_policy_document = builder.assume_role_policy_document.or(Some(String::new()));
|
274 273 | builder
|
275 274 | .build()
|
276 275 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
277 276 | }
|
278 277 | }
|
278 + | impl CreateRoleInput {
|
279 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
280 + | pub fn deserialize_with_response(
|
281 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
282 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
283 + | _status: u16,
|
284 + | _body: &[u8],
|
285 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
286 + | Self::deserialize(deserializer)
|
287 + | }
|
288 + | }
|
279 289 | impl CreateRoleInput {
|
280 290 | /// Creates a new builder-style object to manufacture [`CreateRoleInput`](crate::operation::create_role::CreateRoleInput).
|
281 291 | pub fn builder() -> crate::operation::create_role::builders::CreateRoleInputBuilder {
|
282 292 | crate::operation::create_role::builders::CreateRoleInputBuilder::default()
|
283 293 | }
|
284 294 | }
|
285 295 |
|
286 296 | /// A builder for [`CreateRoleInput`](crate::operation::create_role::CreateRoleInput).
|
287 297 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
288 298 | #[non_exhaustive]
|
289 299 | pub struct CreateRoleInputBuilder {
|
290 300 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
291 301 | pub(crate) role_name: ::std::option::Option<::std::string::String>,
|
292 302 | pub(crate) assume_role_policy_document: ::std::option::Option<::std::string::String>,
|
293 303 | pub(crate) description: ::std::option::Option<::std::string::String>,
|
294 304 | pub(crate) max_session_duration: ::std::option::Option<i32>,
|
295 305 | pub(crate) permissions_boundary: ::std::option::Option<::std::string::String>,
|
296 306 | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
|
297 307 | }
|
298 308 | impl CreateRoleInputBuilder {
|
299 309 | /// <p>The path to the role. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM Identifiers</a> in the <i>IAM User Guide</i>.</p>
|
300 310 | /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
|
301 311 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
|
302 312 | pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
303 313 | self.path = ::std::option::Option::Some(input.into());
|
304 314 | self
|
305 315 | }
|
306 316 | /// <p>The path to the role. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM Identifiers</a> in the <i>IAM User Guide</i>.</p>
|
307 317 | /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
|
308 318 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
|