aws_sdk_rds/protocol_serde/
shape_describe_db_snapshot_tenant_databases.rs1#[allow(clippy::unnecessary_wraps)]
3pub fn de_describe_db_snapshot_tenant_databases_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::describe_db_snapshot_tenant_databases::DescribeDbSnapshotTenantDatabasesOutput,
9 crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError,
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::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::unhandled)?;
14 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
15 let generic = generic_builder.build();
16 let error_code = match generic.code() {
17 Some(code) => code,
18 None => return Err(crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::unhandled(generic)),
19 };
20
21 let _error_message = generic.message().map(|msg| msg.to_owned());
22 Err(match error_code {
23 "DBSnapshotNotFound" => {
24 crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::DbSnapshotNotFoundFault({
25 #[allow(unused_mut)]
26 let mut tmp = {
27 #[allow(unused_mut)]
28 let mut output = crate::types::error::builders::DbSnapshotNotFoundFaultBuilder::default();
29 output = crate::protocol_serde::shape_db_snapshot_not_found_fault::de_db_snapshot_not_found_fault_xml_err(_response_body, output)
30 .map_err(crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::unhandled)?;
31 let output = output.meta(generic);
32 output.build()
33 };
34 if tmp.message.is_none() {
35 tmp.message = _error_message;
36 }
37 tmp
38 })
39 }
40 _ => crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::generic(generic),
41 })
42}
43
44#[allow(clippy::unnecessary_wraps)]
45pub fn de_describe_db_snapshot_tenant_databases_http_response(
46 _response_status: u16,
47 _response_headers: &::aws_smithy_runtime_api::http::Headers,
48 _response_body: &[u8],
49) -> std::result::Result<
50 crate::operation::describe_db_snapshot_tenant_databases::DescribeDbSnapshotTenantDatabasesOutput,
51 crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError,
52> {
53 Ok({
54 #[allow(unused_mut)]
55 let mut output = crate::operation::describe_db_snapshot_tenant_databases::builders::DescribeDbSnapshotTenantDatabasesOutputBuilder::default();
56 output = crate::protocol_serde::shape_describe_db_snapshot_tenant_databases::de_describe_db_snapshot_tenant_databases(_response_body, output)
57 .map_err(crate::operation::describe_db_snapshot_tenant_databases::DescribeDBSnapshotTenantDatabasesError::unhandled)?;
58 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
59 output.build()
60 })
61}
62
63#[allow(unused_mut)]
64pub fn de_describe_db_snapshot_tenant_databases(
65 inp: &[u8],
66 mut builder: crate::operation::describe_db_snapshot_tenant_databases::builders::DescribeDbSnapshotTenantDatabasesOutputBuilder,
67) -> std::result::Result<
68 crate::operation::describe_db_snapshot_tenant_databases::builders::DescribeDbSnapshotTenantDatabasesOutputBuilder,
69 ::aws_smithy_xml::decode::XmlDecodeError,
70> {
71 let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
72
73 #[allow(unused_mut)]
74 let mut decoder = doc.root_element()?;
75 #[allow(unused_variables)]
76 let start_el = decoder.start_el();
77 if !(start_el.matches("DescribeDBSnapshotTenantDatabasesResponse")) {
78 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
79 "invalid root, expected DescribeDBSnapshotTenantDatabasesResponse got {start_el:?}"
80 )));
81 }
82 if let Some(mut result_tag) = decoder.next_tag() {
83 let start_el = result_tag.start_el();
84 if !(start_el.matches("DescribeDBSnapshotTenantDatabasesResult")) {
85 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
86 "invalid result, expected DescribeDBSnapshotTenantDatabasesResult got {start_el:?}"
87 )));
88 }
89 while let Some(mut tag) = result_tag.next_tag() {
90 match tag.start_el() {
91 s if s.matches("Marker") => {
92 let var_1 =
93 Some(
94 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
95 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
96 .into()
97 )
98 ?
99 )
100 ;
101 builder = builder.set_marker(var_1);
102 }
103 ,
104 s if s.matches("DBSnapshotTenantDatabases") => {
105 let var_2 =
106 Some(
107 crate::protocol_serde::shape_db_snapshot_tenant_databases_list::de_db_snapshot_tenant_databases_list(&mut tag)
108 ?
109 )
110 ;
111 builder = builder.set_db_snapshot_tenant_databases(var_2);
112 }
113 ,
114 _ => {}
115 }
116 }
117 } else {
118 return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(
119 "expected DescribeDBSnapshotTenantDatabasesResult tag",
120 ));
121 };
122 Ok(builder)
123}