21 21 | /// <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>
|
22 22 | pub fn path(&self) -> ::std::option::Option<&str> {
|
23 23 | self.path.as_deref()
|
24 24 | }
|
25 25 | /// <p>The name of the virtual MFA device, which must be unique. Use with path to uniquely identify a virtual MFA device.</p>
|
26 26 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
|
27 27 | pub fn virtual_mfa_device_name(&self) -> ::std::option::Option<&str> {
|
28 28 | self.virtual_mfa_device_name.as_deref()
|
29 29 | }
|
30 30 | /// <p>A list of tags that you want to attach to the new IAM virtual MFA device. Each tag consists of a key name and an associated value. For more information about tagging, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html">Tagging IAM resources</a> in the <i>IAM User Guide</i>.</p><note>
|
31 31 | /// <p>If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.</p>
|
32 32 | /// </note>
|
33 33 | ///
|
34 34 | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
|
35 35 | pub fn tags(&self) -> &[crate::types::Tag] {
|
36 36 | self.tags.as_deref().unwrap_or_default()
|
37 37 | }
|
38 38 | }
|
39 39 | static CREATEVIRTUALMFADEVICEINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
40 40 | "com.amazonaws.iam.synthetic#CreateVirtualMFADeviceInput",
|
41 41 | "com.amazonaws.iam.synthetic",
|
42 42 | "CreateVirtualMFADeviceInput",
|
43 43 | );
|
44 44 | static CREATEVIRTUALMFADEVICEINPUT_MEMBER_PATH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
45 45 | ::aws_smithy_schema::ShapeId::from_static(
|
46 46 | "com.amazonaws.iam.synthetic#CreateVirtualMFADeviceInput$Path",
|
47 47 | "com.amazonaws.iam.synthetic",
|
48 48 | "CreateVirtualMFADeviceInput",
|
49 49 | ),
|
50 50 | ::aws_smithy_schema::ShapeType::String,
|
51 - | "path",
|
51 + | "Path",
|
52 52 | 0,
|
53 53 | );
|
54 54 | static CREATEVIRTUALMFADEVICEINPUT_MEMBER_VIRTUAL_MFA_DEVICE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
55 55 | ::aws_smithy_schema::ShapeId::from_static(
|
56 56 | "com.amazonaws.iam.synthetic#CreateVirtualMFADeviceInput$VirtualMFADeviceName",
|
57 57 | "com.amazonaws.iam.synthetic",
|
58 58 | "CreateVirtualMFADeviceInput",
|
59 59 | ),
|
60 60 | ::aws_smithy_schema::ShapeType::String,
|
61 - | "virtual_mfa_device_name",
|
61 + | "VirtualMFADeviceName",
|
62 62 | 1,
|
63 63 | );
|
64 64 | static CREATEVIRTUALMFADEVICEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
65 65 | ::aws_smithy_schema::ShapeId::from_static(
|
66 66 | "com.amazonaws.iam.synthetic#CreateVirtualMFADeviceInput$Tags",
|
67 67 | "com.amazonaws.iam.synthetic",
|
68 68 | "CreateVirtualMFADeviceInput",
|
69 69 | ),
|
70 70 | ::aws_smithy_schema::ShapeType::List,
|
71 - | "tags",
|
71 + | "Tags",
|
72 72 | 2,
|
73 73 | );
|
74 74 | static CREATEVIRTUALMFADEVICEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
75 75 | CREATEVIRTUALMFADEVICEINPUT_SCHEMA_ID,
|
76 76 | ::aws_smithy_schema::ShapeType::Structure,
|
77 77 | &[
|
78 78 | &CREATEVIRTUALMFADEVICEINPUT_MEMBER_PATH,
|
79 79 | &CREATEVIRTUALMFADEVICEINPUT_MEMBER_VIRTUAL_MFA_DEVICE_NAME,
|
80 80 | &CREATEVIRTUALMFADEVICEINPUT_MEMBER_TAGS,
|
81 81 | ],
|
82 82 | );
|
83 83 | impl CreateVirtualMfaDeviceInput {
|
84 84 | /// The schema for this shape.
|
85 85 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEVIRTUALMFADEVICEINPUT_SCHEMA;
|
86 86 | }
|
87 87 | impl ::aws_smithy_schema::serde::SerializableStruct for CreateVirtualMfaDeviceInput {
|
88 88 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
89 89 | fn serialize_members(
|
90 90 | &self,
|
91 91 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
92 92 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
93 93 | if let Some(ref val) = self.path {
|
94 94 | ser.write_string(&CREATEVIRTUALMFADEVICEINPUT_MEMBER_PATH, val)?;
|
95 95 | }
|
96 96 | if let Some(ref val) = self.virtual_mfa_device_name {
|
97 97 | ser.write_string(&CREATEVIRTUALMFADEVICEINPUT_MEMBER_VIRTUAL_MFA_DEVICE_NAME, val)?;
|
98 98 | }
|
99 99 | if let Some(ref val) = self.tags {
|
100 100 | ser.write_list(
|
101 101 | &CREATEVIRTUALMFADEVICEINPUT_MEMBER_TAGS,
|
102 102 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
103 103 | for item in val {
|
104 104 | ser.write_struct(crate::types::Tag::SCHEMA, item)?;
|
105 105 | }
|
106 106 | Ok(())
|
107 107 | },
|
108 108 | )?;
|
109 109 | }
|
110 110 | Ok(())
|
111 111 | }
|
112 112 | }
|
113 113 | impl CreateVirtualMfaDeviceInput {
|
114 114 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
115 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
116 - | deserializer: &mut D,
|
115 + | pub fn deserialize(
|
116 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
117 117 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
118 118 | #[allow(unused_variables, unused_mut)]
|
119 119 | let mut builder = Self::builder();
|
120 120 | #[allow(
|
121 121 | unused_variables,
|
122 122 | unreachable_code,
|
123 123 | clippy::single_match,
|
124 124 | clippy::match_single_binding,
|
125 125 | clippy::diverging_sub_expression
|
126 126 | )]
|
127 - | deserializer.read_struct(&CREATEVIRTUALMFADEVICEINPUT_SCHEMA, (), |_, member, deser| {
|
127 + | deserializer.read_struct(&CREATEVIRTUALMFADEVICEINPUT_SCHEMA, &mut |member, deser| {
|
128 128 | match member.member_index() {
|
129 129 | Some(0) => {
|
130 130 | builder.path = Some(deser.read_string(member)?);
|
131 131 | }
|
132 132 | Some(1) => {
|
133 133 | builder.virtual_mfa_device_name = Some(deser.read_string(member)?);
|
134 134 | }
|
135 135 | Some(2) => {
|
136 136 | builder.tags = Some({
|
137 - | let container = if let Some(cap) = deser.container_size() {
|
138 - | Vec::with_capacity(cap)
|
139 - | } else {
|
140 - | Vec::new()
|
141 - | };
|
142 - | deser.read_list(member, container, |mut list, deser| {
|
143 - | list.push(crate::types::Tag::deserialize(deser)?);
|
144 - | Ok(list)
|
145 - | })?
|
137 + | let mut container = Vec::new();
|
138 + | deser.read_list(member, &mut |deser| {
|
139 + | container.push(crate::types::Tag::deserialize(deser)?);
|
140 + | Ok(())
|
141 + | })?;
|
142 + | container
|
146 143 | });
|
147 144 | }
|
148 145 | _ => {}
|
149 146 | }
|
150 147 | Ok(())
|
151 148 | })?;
|
149 + | builder.virtual_mfa_device_name = builder.virtual_mfa_device_name.or(Some(String::new()));
|
152 150 | builder
|
153 151 | .build()
|
154 152 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
155 153 | }
|
156 154 | }
|
155 + | impl CreateVirtualMfaDeviceInput {
|
156 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
157 + | pub fn deserialize_with_response(
|
158 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
159 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
160 + | _status: u16,
|
161 + | _body: &[u8],
|
162 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
163 + | Self::deserialize(deserializer)
|
164 + | }
|
165 + | }
|
157 166 | impl CreateVirtualMfaDeviceInput {
|
158 167 | /// Creates a new builder-style object to manufacture [`CreateVirtualMfaDeviceInput`](crate::operation::create_virtual_mfa_device::CreateVirtualMfaDeviceInput).
|
159 168 | pub fn builder() -> crate::operation::create_virtual_mfa_device::builders::CreateVirtualMfaDeviceInputBuilder {
|
160 169 | crate::operation::create_virtual_mfa_device::builders::CreateVirtualMfaDeviceInputBuilder::default()
|
161 170 | }
|
162 171 | }
|
163 172 |
|
164 173 | /// A builder for [`CreateVirtualMfaDeviceInput`](crate::operation::create_virtual_mfa_device::CreateVirtualMfaDeviceInput).
|
165 174 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
166 175 | #[non_exhaustive]
|
167 176 | pub struct CreateVirtualMfaDeviceInputBuilder {
|
168 177 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
169 178 | pub(crate) virtual_mfa_device_name: ::std::option::Option<::std::string::String>,
|
170 179 | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
|
171 180 | }
|
172 181 | impl CreateVirtualMfaDeviceInputBuilder {
|
173 182 | /// <p>The path for the virtual MFA device. 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>
|
174 183 | /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
|
175 184 | /// <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>
|
176 185 | pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
177 186 | self.path = ::std::option::Option::Some(input.into());
|
178 187 | self
|
179 188 | }
|
180 189 | /// <p>The path for the virtual MFA device. 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>
|
181 190 | /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
|
182 191 | /// <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>
|
183 192 | pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
184 193 | self.path = input;
|
185 194 | self
|
186 195 | }
|