aws_sdk_ec2/protocol_serde/
shape_modify_fpga_image_attribute.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_modify_fpga_image_attribute_http_error(
4 _response_status: u16,
5 _response_headers: &::aws_smithy_runtime_api::http::Headers,
6 _response_body: &[u8],
7) -> std::result::Result<
8 crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeOutput,
9 crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeError,
10> {
11 #[allow(unused_mut)]
12 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
13 .map_err(crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeError::unhandled)?;
14 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
15 let generic = generic_builder.build();
16 Err(crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeError::generic(
17 generic,
18 ))
19}
20
21#[allow(clippy::unnecessary_wraps)]
22pub fn de_modify_fpga_image_attribute_http_response(
23 _response_status: u16,
24 _response_headers: &::aws_smithy_runtime_api::http::Headers,
25 _response_body: &[u8],
26) -> std::result::Result<
27 crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeOutput,
28 crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeError,
29> {
30 Ok({
31 #[allow(unused_mut)]
32 let mut output = crate::operation::modify_fpga_image_attribute::builders::ModifyFpgaImageAttributeOutputBuilder::default();
33 output = crate::protocol_serde::shape_modify_fpga_image_attribute::de_modify_fpga_image_attribute(_response_body, output)
34 .map_err(crate::operation::modify_fpga_image_attribute::ModifyFpgaImageAttributeError::unhandled)?;
35 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
36 output.build()
37 })
38}
39
40#[allow(unused_mut)]
41pub fn de_modify_fpga_image_attribute(
42 inp: &[u8],
43 mut builder: crate::operation::modify_fpga_image_attribute::builders::ModifyFpgaImageAttributeOutputBuilder,
44) -> std::result::Result<
45 crate::operation::modify_fpga_image_attribute::builders::ModifyFpgaImageAttributeOutputBuilder,
46 ::aws_smithy_xml::decode::XmlDecodeError,
47> {
48 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
49
50 #[allow(unused_mut)]
51 let mut decoder = doc.root_element()?;
52 #[allow(unused_variables)]
53 let start_el = decoder.start_el();
54 if !(start_el.matches("ModifyFpgaImageAttributeResponse")) {
55 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
56 "invalid root, expected ModifyFpgaImageAttributeResponse got {:?}",
57 start_el
58 )));
59 }
60 while let Some(mut tag) = decoder.next_tag() {
61 match tag.start_el() {
62 s if s.matches("fpgaImageAttribute") => {
63 let var_1 =
64 Some(
65 crate::protocol_serde::shape_fpga_image_attribute::de_fpga_image_attribute(&mut tag)
66 ?
67 )
68 ;
69 builder = builder.set_fpga_image_attribute(var_1);
70 }
71 ,
72 _ => {}
73 }
74 }
75 Ok(builder)
76}