87 87 | "com.amazonaws.iam.synthetic",
|
88 88 | "CreatePolicyInput",
|
89 89 | );
|
90 90 | static CREATEPOLICYINPUT_MEMBER_POLICY_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
91 91 | ::aws_smithy_schema::ShapeId::from_static(
|
92 92 | "com.amazonaws.iam.synthetic#CreatePolicyInput$PolicyName",
|
93 93 | "com.amazonaws.iam.synthetic",
|
94 94 | "CreatePolicyInput",
|
95 95 | ),
|
96 96 | ::aws_smithy_schema::ShapeType::String,
|
97 - | "policy_name",
|
97 + | "PolicyName",
|
98 98 | 0,
|
99 99 | );
|
100 100 | static CREATEPOLICYINPUT_MEMBER_PATH: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
101 101 | ::aws_smithy_schema::ShapeId::from_static(
|
102 102 | "com.amazonaws.iam.synthetic#CreatePolicyInput$Path",
|
103 103 | "com.amazonaws.iam.synthetic",
|
104 104 | "CreatePolicyInput",
|
105 105 | ),
|
106 106 | ::aws_smithy_schema::ShapeType::String,
|
107 - | "path",
|
107 + | "Path",
|
108 108 | 1,
|
109 109 | );
|
110 110 | static CREATEPOLICYINPUT_MEMBER_POLICY_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
111 111 | ::aws_smithy_schema::ShapeId::from_static(
|
112 112 | "com.amazonaws.iam.synthetic#CreatePolicyInput$PolicyDocument",
|
113 113 | "com.amazonaws.iam.synthetic",
|
114 114 | "CreatePolicyInput",
|
115 115 | ),
|
116 116 | ::aws_smithy_schema::ShapeType::String,
|
117 - | "policy_document",
|
117 + | "PolicyDocument",
|
118 118 | 2,
|
119 119 | );
|
120 120 | static CREATEPOLICYINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
121 121 | ::aws_smithy_schema::ShapeId::from_static(
|
122 122 | "com.amazonaws.iam.synthetic#CreatePolicyInput$Description",
|
123 123 | "com.amazonaws.iam.synthetic",
|
124 124 | "CreatePolicyInput",
|
125 125 | ),
|
126 126 | ::aws_smithy_schema::ShapeType::String,
|
127 - | "description",
|
127 + | "Description",
|
128 128 | 3,
|
129 129 | );
|
130 130 | static CREATEPOLICYINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
131 131 | ::aws_smithy_schema::ShapeId::from_static(
|
132 132 | "com.amazonaws.iam.synthetic#CreatePolicyInput$Tags",
|
133 133 | "com.amazonaws.iam.synthetic",
|
134 134 | "CreatePolicyInput",
|
135 135 | ),
|
136 136 | ::aws_smithy_schema::ShapeType::List,
|
137 - | "tags",
|
137 + | "Tags",
|
138 138 | 4,
|
139 139 | );
|
140 140 | static CREATEPOLICYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
141 141 | CREATEPOLICYINPUT_SCHEMA_ID,
|
142 142 | ::aws_smithy_schema::ShapeType::Structure,
|
143 143 | &[
|
144 144 | &CREATEPOLICYINPUT_MEMBER_POLICY_NAME,
|
145 145 | &CREATEPOLICYINPUT_MEMBER_PATH,
|
146 146 | &CREATEPOLICYINPUT_MEMBER_POLICY_DOCUMENT,
|
147 147 | &CREATEPOLICYINPUT_MEMBER_DESCRIPTION,
|
148 148 | &CREATEPOLICYINPUT_MEMBER_TAGS,
|
149 149 | ],
|
150 150 | );
|
151 151 | impl CreatePolicyInput {
|
152 152 | /// The schema for this shape.
|
153 153 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATEPOLICYINPUT_SCHEMA;
|
154 154 | }
|
155 155 | impl ::aws_smithy_schema::serde::SerializableStruct for CreatePolicyInput {
|
156 156 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
157 157 | fn serialize_members(
|
158 158 | &self,
|
159 159 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
160 160 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
161 161 | if let Some(ref val) = self.policy_name {
|
162 162 | ser.write_string(&CREATEPOLICYINPUT_MEMBER_POLICY_NAME, val)?;
|
163 163 | }
|
164 164 | if let Some(ref val) = self.path {
|
165 165 | ser.write_string(&CREATEPOLICYINPUT_MEMBER_PATH, val)?;
|
166 166 | }
|
167 167 | if let Some(ref val) = self.policy_document {
|
168 168 | ser.write_string(&CREATEPOLICYINPUT_MEMBER_POLICY_DOCUMENT, val)?;
|
169 169 | }
|
170 170 | if let Some(ref val) = self.description {
|
171 171 | ser.write_string(&CREATEPOLICYINPUT_MEMBER_DESCRIPTION, val)?;
|
172 172 | }
|
173 173 | if let Some(ref val) = self.tags {
|
174 174 | ser.write_list(
|
175 175 | &CREATEPOLICYINPUT_MEMBER_TAGS,
|
176 176 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
177 177 | for item in val {
|
178 178 | ser.write_struct(crate::types::Tag::SCHEMA, item)?;
|
179 179 | }
|
180 180 | Ok(())
|
181 181 | },
|
182 182 | )?;
|
183 183 | }
|
184 184 | Ok(())
|
185 185 | }
|
186 186 | }
|
187 187 | impl CreatePolicyInput {
|
188 188 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
189 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
190 - | deserializer: &mut D,
|
189 + | pub fn deserialize(
|
190 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
191 191 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
192 192 | #[allow(unused_variables, unused_mut)]
|
193 193 | let mut builder = Self::builder();
|
194 194 | #[allow(
|
195 195 | unused_variables,
|
196 196 | unreachable_code,
|
197 197 | clippy::single_match,
|
198 198 | clippy::match_single_binding,
|
199 199 | clippy::diverging_sub_expression
|
200 200 | )]
|
201 - | deserializer.read_struct(&CREATEPOLICYINPUT_SCHEMA, (), |_, member, deser| {
|
201 + | deserializer.read_struct(&CREATEPOLICYINPUT_SCHEMA, &mut |member, deser| {
|
202 202 | match member.member_index() {
|
203 203 | Some(0) => {
|
204 204 | builder.policy_name = Some(deser.read_string(member)?);
|
205 205 | }
|
206 206 | Some(1) => {
|
207 207 | builder.path = Some(deser.read_string(member)?);
|
208 208 | }
|
209 209 | Some(2) => {
|
210 210 | builder.policy_document = Some(deser.read_string(member)?);
|
211 211 | }
|
212 212 | Some(3) => {
|
213 213 | builder.description = Some(deser.read_string(member)?);
|
214 214 | }
|
215 215 | Some(4) => {
|
216 216 | builder.tags = Some({
|
217 - | let container = if let Some(cap) = deser.container_size() {
|
218 - | Vec::with_capacity(cap)
|
219 - | } else {
|
220 - | Vec::new()
|
221 - | };
|
222 - | deser.read_list(member, container, |mut list, deser| {
|
223 - | list.push(crate::types::Tag::deserialize(deser)?);
|
224 - | Ok(list)
|
225 - | })?
|
217 + | let mut container = Vec::new();
|
218 + | deser.read_list(member, &mut |deser| {
|
219 + | container.push(crate::types::Tag::deserialize(deser)?);
|
220 + | Ok(())
|
221 + | })?;
|
222 + | container
|
226 223 | });
|
227 224 | }
|
228 225 | _ => {}
|
229 226 | }
|
230 227 | Ok(())
|
231 228 | })?;
|
229 + | builder.policy_name = builder.policy_name.or(Some(String::new()));
|
230 + | builder.policy_document = builder.policy_document.or(Some(String::new()));
|
232 231 | builder
|
233 232 | .build()
|
234 233 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
235 234 | }
|
236 235 | }
|
236 + | impl CreatePolicyInput {
|
237 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
238 + | pub fn deserialize_with_response(
|
239 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
240 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
241 + | _status: u16,
|
242 + | _body: &[u8],
|
243 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
244 + | Self::deserialize(deserializer)
|
245 + | }
|
246 + | }
|
237 247 | impl CreatePolicyInput {
|
238 248 | /// Creates a new builder-style object to manufacture [`CreatePolicyInput`](crate::operation::create_policy::CreatePolicyInput).
|
239 249 | pub fn builder() -> crate::operation::create_policy::builders::CreatePolicyInputBuilder {
|
240 250 | crate::operation::create_policy::builders::CreatePolicyInputBuilder::default()
|
241 251 | }
|
242 252 | }
|
243 253 |
|
244 254 | /// A builder for [`CreatePolicyInput`](crate::operation::create_policy::CreatePolicyInput).
|
245 255 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
246 256 | #[non_exhaustive]
|
247 257 | pub struct CreatePolicyInputBuilder {
|
248 258 | pub(crate) policy_name: ::std::option::Option<::std::string::String>,
|
249 259 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
250 260 | pub(crate) policy_document: ::std::option::Option<::std::string::String>,
|
251 261 | pub(crate) description: ::std::option::Option<::std::string::String>,
|
252 262 | pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
|
253 263 | }
|
254 264 | impl CreatePolicyInputBuilder {
|
255 265 | /// <p>The friendly name of the policy.</p>
|
256 266 | /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
|
257 267 | /// This field is required.
|
258 268 | pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
259 269 | self.policy_name = ::std::option::Option::Some(input.into());
|
260 270 | self
|
261 271 | }
|
262 272 | /// <p>The friendly name of the policy.</p>
|
263 273 | /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
|
264 274 | pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
265 275 | self.policy_name = input;
|
266 276 | self
|