144 150 | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError,
|
145 151 | >::new());
|
146 152 |
|
147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct RemoveLayerVersionPermissionResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RemoveLayerVersionPermissionResponseDeserializer {
|
154 - | fn deserialize_nonstreaming(
|
160 + | fn deserialize_nonstreaming_with_config(
|
155 161 | &self,
|
156 162 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
163 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 164 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 165 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
159 - | let headers = response.headers();
|
160 - | let body = response.body().bytes().expect("body loaded");
|
161 166 | #[allow(unused_mut)]
|
162 167 | let mut force_error = false;
|
163 168 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
164 - | let parse_result = if !success && status != 204 || force_error {
|
165 - | crate::protocol_serde::shape_remove_layer_version_permission::de_remove_layer_version_permission_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_remove_layer_version_permission::de_remove_layer_version_permission_http_response(status, headers, body)
|
169 + | if !success && status != 204 || force_error {
|
170 + | let headers = response.headers();
|
171 + | let body = response.body().bytes().expect("body loaded");
|
172 + | #[allow(unused_mut)]
|
173 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
177 + | let generic = generic_builder.build();
|
178 + | let error_code = match generic.code() {
|
179 + | ::std::option::Option::Some(code) => code,
|
180 + | ::std::option::Option::None => {
|
181 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
182 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
183 + | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
187 + | };
|
188 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
189 + | let protocol = _cfg
|
190 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
191 + | .expect("a SharedClientProtocol is required");
|
192 + | let err = match error_code {
|
193 + | "InvalidParameterValueException" => {
|
194 + | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::InvalidParameterValueException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
199 + | &mut *deser,
|
200 + | response.headers(),
|
201 + | response.status().into(),
|
202 + | body,
|
203 + | )
|
204 + | }) {
|
205 + | ::std::result::Result::Ok(val) => val,
|
206 + | ::std::result::Result::Err(e) => {
|
207 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
208 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
209 + | ))
|
210 + | }
|
211 + | };
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "PreconditionFailedException" => {
|
220 + | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::PreconditionFailedException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::PreconditionFailedException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::PreconditionFailedException::deserialize_with_response(
|
225 + | &mut *deser,
|
226 + | response.headers(),
|
227 + | response.status().into(),
|
228 + | body,
|
229 + | )
|
230 + | }) {
|
231 + | ::std::result::Result::Ok(val) => val,
|
232 + | ::std::result::Result::Err(e) => {
|
233 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
234 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
235 + | ))
|
236 + | }
|
237 + | };
|
238 + | tmp.meta = generic;
|
239 + | if tmp.message.is_none() {
|
240 + | tmp.message = _error_message;
|
241 + | }
|
242 + | tmp
|
243 + | })
|
244 + | }
|
245 + | "ResourceNotFoundException" => {
|
246 + | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::ResourceNotFoundException({
|
247 + | let mut tmp = match protocol
|
248 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
249 + | .and_then(|mut deser| {
|
250 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
251 + | &mut *deser,
|
252 + | response.headers(),
|
253 + | response.status().into(),
|
254 + | body,
|
255 + | )
|
256 + | }) {
|
257 + | ::std::result::Result::Ok(val) => val,
|
258 + | ::std::result::Result::Err(e) => {
|
259 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
260 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
261 + | ))
|
262 + | }
|
168 263 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
264 + | tmp.meta = generic;
|
265 + | if tmp.message.is_none() {
|
266 + | tmp.message = _error_message;
|
267 + | }
|
268 + | tmp
|
269 + | })
|
270 + | }
|
271 + | "ServiceException" => crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::ServiceException({
|
272 + | let mut tmp = match protocol
|
273 + | .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
|
274 + | .and_then(|mut deser| {
|
275 + | crate::types::error::ServiceException::deserialize_with_response(
|
276 + | &mut *deser,
|
277 + | response.headers(),
|
278 + | response.status().into(),
|
279 + | body,
|
280 + | )
|
281 + | }) {
|
282 + | ::std::result::Result::Ok(val) => val,
|
283 + | ::std::result::Result::Err(e) => {
|
284 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
285 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
286 + | ))
|
287 + | }
|
288 + | };
|
289 + | tmp.meta = generic;
|
290 + | if tmp.message.is_none() {
|
291 + | tmp.message = _error_message;
|
292 + | }
|
293 + | tmp
|
294 + | }),
|
295 + | "TooManyRequestsException" => {
|
296 + | crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::TooManyRequestsException({
|
297 + | let mut tmp = match protocol
|
298 + | .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
|
299 + | .and_then(|mut deser| {
|
300 + | crate::types::error::TooManyRequestsException::deserialize_with_response(
|
301 + | &mut *deser,
|
302 + | response.headers(),
|
303 + | response.status().into(),
|
304 + | body,
|
305 + | )
|
306 + | }) {
|
307 + | ::std::result::Result::Ok(val) => val,
|
308 + | ::std::result::Result::Err(e) => {
|
309 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
310 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
311 + | ))
|
312 + | }
|
313 + | };
|
314 + | tmp.meta = generic;
|
315 + | if tmp.message.is_none() {
|
316 + | tmp.message = _error_message;
|
317 + | }
|
318 + | tmp
|
319 + | })
|
320 + | }
|
321 + | _ => crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionError::generic(generic),
|
322 + | };
|
323 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
324 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
325 + | ))
|
326 + | } else {
|
327 + | let protocol = _cfg
|
328 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
329 + | .expect("a SharedClientProtocol is required");
|
330 + | let mut deser = protocol
|
331 + | .deserialize_response(response, RemoveLayerVersionPermission::OUTPUT_SCHEMA, _cfg)
|
332 + | .map_err(|e| {
|
333 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
334 + | })?;
|
335 + | let body = response.body().bytes().expect("body loaded");
|
336 + | let output = crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionOutput::deserialize_with_response(
|
337 + | &mut *deser,
|
338 + | response.headers(),
|
339 + | response.status().into(),
|
340 + | body,
|
341 + | )
|
342 + | .map_err(|e| {
|
343 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
344 + | })?;
|
345 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
346 + | }
|
170 347 | }
|
171 348 | }
|
172 349 | #[derive(Debug)]
|
173 350 | struct RemoveLayerVersionPermissionRequestSerializer;
|
174 351 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RemoveLayerVersionPermissionRequestSerializer {
|
175 352 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 353 | fn serialize_input(
|
177 354 | &self,
|
178 355 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 356 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 357 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 358 | let input = input
|
182 359 | .downcast::<crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionInput>()
|
183 360 | .expect("correct type");
|
184 - | let _header_serialization_settings = _cfg
|
185 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
186 - | .cloned()
|
187 - | .unwrap_or_default();
|
188 - | let mut request_builder = {
|
189 - | #[allow(clippy::uninlined_format_args)]
|
190 - | fn uri_base(
|
191 - | _input: &crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionInput,
|
192 - | output: &mut ::std::string::String,
|
193 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
194 - | use ::std::fmt::Write as _;
|
195 - | let input_1 = &_input.layer_name;
|
196 - | let input_1 = input_1
|
197 - | .as_ref()
|
198 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("layer_name", "cannot be empty or unset"))?;
|
199 - | let layer_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
200 - | if layer_name.is_empty() {
|
201 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
202 - | "layer_name",
|
203 - | "cannot be empty or unset",
|
204 - | ));
|
205 - | }
|
206 - | let input_2 = &_input.version_number;
|
207 - | let input_2 = input_2
|
208 - | .as_ref()
|
209 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("version_number", "cannot be empty or unset"))?;
|
210 - | let mut version_number_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_2);
|
211 - | let version_number = version_number_encoder.encode();
|
212 - | if version_number.is_empty() {
|
213 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
214 - | "version_number",
|
215 - | "cannot be empty or unset",
|
216 - | ));
|
217 - | }
|
218 - | let input_3 = &_input.statement_id;
|
219 - | let input_3 = input_3
|
220 - | .as_ref()
|
221 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("statement_id", "cannot be empty or unset"))?;
|
222 - | let statement_id = ::aws_smithy_http::label::fmt_string(input_3, ::aws_smithy_http::label::EncodingStrategy::Default);
|
223 - | if statement_id.is_empty() {
|
224 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
225 - | "statement_id",
|
226 - | "cannot be empty or unset",
|
227 - | ));
|
228 - | }
|
229 - | ::std::write!(
|
230 - | output,
|
231 - | "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}",
|
232 - | LayerName = layer_name,
|
233 - | VersionNumber = version_number,
|
234 - | StatementId = statement_id
|
235 - | )
|
236 - | .expect("formatting should succeed");
|
237 - | ::std::result::Result::Ok(())
|
238 - | }
|
239 - | fn uri_query(
|
240 - | _input: &crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionInput,
|
241 - | mut output: &mut ::std::string::String,
|
242 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
243 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
244 - | if let ::std::option::Option::Some(inner_4) = &_input.revision_id {
|
245 - | {
|
246 - | query.push_kv("RevisionId", &::aws_smithy_http::query::fmt_string(inner_4));
|
247 - | }
|
248 - | }
|
249 - | ::std::result::Result::Ok(())
|
250 - | }
|
251 - | #[allow(clippy::unnecessary_wraps)]
|
252 - | fn update_http_builder(
|
253 - | input: &crate::operation::remove_layer_version_permission::RemoveLayerVersionPermissionInput,
|
254 - | builder: ::http_1x::request::Builder,
|
255 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
256 - | let mut uri = ::std::string::String::new();
|
257 - | uri_base(input, &mut uri)?;
|
258 - | uri_query(input, &mut uri)?;
|
259 - | ::std::result::Result::Ok(builder.method("DELETE").uri(uri))
|
260 - | }
|
261 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
262 - | builder
|
263 - | };
|
264 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
361 + | let protocol = _cfg
|
362 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
363 + | .expect("a SharedClientProtocol is required");
|
364 + | let mut request = protocol
|
365 + | .serialize_request(&input, RemoveLayerVersionPermission::INPUT_SCHEMA, "", _cfg)
|
366 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
265 367 |
|
266 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
368 + | return ::std::result::Result::Ok(request);
|
267 369 | }
|
268 370 | }
|
269 371 | #[derive(Debug)]
|
270 372 | struct RemoveLayerVersionPermissionEndpointParamsInterceptor;
|
271 373 |
|
272 374 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RemoveLayerVersionPermissionEndpointParamsInterceptor {
|
273 375 | fn name(&self) -> &'static str {
|
274 376 | "RemoveLayerVersionPermissionEndpointParamsInterceptor"
|
275 377 | }
|
276 378 |
|