7 7 | ) -> std::result::Result<
|
8 8 | crate::operation::get_delivery_destination::GetDeliveryDestinationOutput,
|
9 9 | crate::operation::get_delivery_destination::GetDeliveryDestinationError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | let error_code = match generic.code() {
|
17 17 | Some(code) => code,
|
18 18 | None => {
|
19 19 | return Err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled(
|
20 20 | generic,
|
21 21 | ))
|
22 22 | }
|
23 23 | };
|
24 24 |
|
25 25 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
26 26 | Err(match error_code {
|
27 27 | "ThrottlingException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ThrottlingException({
|
28 28 | #[allow(unused_mut)]
|
29 29 | let mut tmp = {
|
30 30 | #[allow(unused_mut)]
|
31 31 | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
32 32 | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
33 33 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
34 34 | let output = output.meta(generic);
|
35 35 | output.build()
|
36 36 | };
|
37 - | if tmp.message.is_none() {
|
38 - | tmp.message = _error_message;
|
39 - | }
|
40 37 | tmp
|
41 38 | }),
|
42 39 | "ValidationException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ValidationException({
|
43 40 | #[allow(unused_mut)]
|
44 41 | let mut tmp = {
|
45 42 | #[allow(unused_mut)]
|
46 43 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
47 44 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
48 45 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
49 46 | let output = output.meta(generic);
|
50 47 | output.build()
|
51 48 | };
|
52 - | if tmp.message.is_none() {
|
53 - | tmp.message = _error_message;
|
54 - | }
|
55 49 | tmp
|
56 50 | }),
|
57 51 | "ResourceNotFoundException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ResourceNotFoundException({
|
58 52 | #[allow(unused_mut)]
|
59 53 | let mut tmp = {
|
60 54 | #[allow(unused_mut)]
|
61 55 | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
62 56 | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
63 57 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
64 58 | let output = output.meta(generic);
|
65 59 | output.build()
|
66 60 | };
|
67 - | if tmp.message.is_none() {
|
68 - | tmp.message = _error_message;
|
69 - | }
|
70 61 | tmp
|
71 62 | }),
|
72 63 | "ServiceUnavailableException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ServiceUnavailableException({
|
73 64 | #[allow(unused_mut)]
|
74 65 | let mut tmp = {
|
75 66 | #[allow(unused_mut)]
|
76 67 | let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
|
77 68 | output =
|
78 69 | crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
|
79 70 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
80 71 | let output = output.meta(generic);
|
81 72 | output.build()
|
82 73 | };
|
83 - | if tmp.message.is_none() {
|
84 - | tmp.message = _error_message;
|
85 - | }
|
86 74 | tmp
|
87 75 | }),
|
88 76 | "ServiceQuotaExceededException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ServiceQuotaExceededException({
|
89 77 | #[allow(unused_mut)]
|
90 78 | let mut tmp = {
|
91 79 | #[allow(unused_mut)]
|
92 80 | let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
|
93 81 | output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
|
94 82 | _response_body,
|
95 83 | output,
|
96 84 | )
|
97 85 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
98 86 | let output = output.meta(generic);
|
99 87 | output.build()
|
100 88 | };
|
101 - | if tmp.message.is_none() {
|
102 - | tmp.message = _error_message;
|
103 - | }
|
104 89 | tmp
|
105 90 | }),
|
106 91 | _ => crate::operation::get_delivery_destination::GetDeliveryDestinationError::generic(generic),
|
107 92 | })
|
108 93 | }
|
109 94 |
|
110 95 | #[allow(clippy::unnecessary_wraps)]
|
111 96 | pub fn de_get_delivery_destination_http_response(
|
112 97 | _response_status: u16,
|
113 98 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
114 99 | _response_body: &[u8],
|
115 100 | ) -> std::result::Result<
|
116 101 | crate::operation::get_delivery_destination::GetDeliveryDestinationOutput,
|
117 102 | crate::operation::get_delivery_destination::GetDeliveryDestinationError,
|
118 103 | > {
|
119 104 | Ok({
|
120 105 | #[allow(unused_mut)]
|
121 106 | let mut output = crate::operation::get_delivery_destination::builders::GetDeliveryDestinationOutputBuilder::default();
|
122 107 | output = crate::protocol_serde::shape_get_delivery_destination::de_get_delivery_destination(_response_body, output)
|
123 108 | .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
|
124 109 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
125 110 | output.build()
|
126 111 | })
|
127 112 | }
|
128 113 |
|
129 114 | pub fn ser_get_delivery_destination_input(
|
130 115 | input: &crate::operation::get_delivery_destination::GetDeliveryDestinationInput,
|
131 116 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
132 117 | let mut out = String::new();
|
133 118 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|