1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_update_delivery_configuration_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::update_delivery_configuration::UpdateDeliveryConfigurationOutput,
|
9 - | crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError,
|
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::update_delivery_configuration::UpdateDeliveryConfigurationError::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::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "AccessDeniedException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::AccessDeniedException({
|
24 - | #[allow(unused_mut)]
|
25 - | let mut tmp = {
|
26 - | #[allow(unused_mut)]
|
27 - | let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
|
28 - | output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
|
29 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
30 - | let output = output.meta(generic);
|
31 - | output.build()
|
32 - | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 - | tmp
|
37 - | }),
|
38 - | "ConflictException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ConflictException({
|
39 - | #[allow(unused_mut)]
|
40 - | let mut tmp = {
|
41 - | #[allow(unused_mut)]
|
42 - | let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
|
43 - | output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
|
44 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
45 - | let output = output.meta(generic);
|
46 - | output.build()
|
47 - | };
|
48 - | if tmp.message.is_none() {
|
49 - | tmp.message = _error_message;
|
50 - | }
|
51 - | tmp
|
52 - | }),
|
53 - | "ResourceNotFoundException" => {
|
54 - | crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ResourceNotFoundException({
|
55 - | #[allow(unused_mut)]
|
56 - | let mut tmp = {
|
57 - | #[allow(unused_mut)]
|
58 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
59 - | output =
|
60 - | crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
61 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
62 - | let output = output.meta(generic);
|
63 - | output.build()
|
64 - | };
|
65 - | if tmp.message.is_none() {
|
66 - | tmp.message = _error_message;
|
67 - | }
|
68 - | tmp
|
69 - | })
|
70 - | }
|
71 - | "ServiceUnavailableException" => {
|
72 - | crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ServiceUnavailableException({
|
73 - | #[allow(unused_mut)]
|
74 - | let mut tmp = {
|
75 - | #[allow(unused_mut)]
|
76 - | let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
|
77 - | output =
|
78 - | crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
|
79 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
80 - | let output = output.meta(generic);
|
81 - | output.build()
|
82 - | };
|
83 - | if tmp.message.is_none() {
|
84 - | tmp.message = _error_message;
|
85 - | }
|
86 - | tmp
|
87 - | })
|
88 - | }
|
89 - | "ThrottlingException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ThrottlingException({
|
90 - | #[allow(unused_mut)]
|
91 - | let mut tmp = {
|
92 - | #[allow(unused_mut)]
|
93 - | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
94 - | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
95 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
96 - | let output = output.meta(generic);
|
97 - | output.build()
|
98 - | };
|
99 - | if tmp.message.is_none() {
|
100 - | tmp.message = _error_message;
|
101 - | }
|
102 - | tmp
|
103 - | }),
|
104 - | "ValidationException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ValidationException({
|
105 - | #[allow(unused_mut)]
|
106 - | let mut tmp = {
|
107 - | #[allow(unused_mut)]
|
108 - | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
109 - | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
110 - | .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
|
111 - | let output = output.meta(generic);
|
112 - | output.build()
|
113 - | };
|
114 - | if tmp.message.is_none() {
|
115 - | tmp.message = _error_message;
|
116 - | }
|
117 - | tmp
|
118 - | }),
|
119 - | _ => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::generic(generic),
|
120 - | })
|
121 - | }
|
122 - |
|
123 - | #[allow(clippy::unnecessary_wraps)]
|
124 - | pub fn de_update_delivery_configuration_http_response(
|
125 - | _response_status: u16,
|
126 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
127 - | _response_body: &[u8],
|
128 - | ) -> std::result::Result<
|
129 - | crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationOutput,
|
130 - | crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError,
|
131 - | > {
|
132 - | Ok({
|
133 - | #[allow(unused_mut)]
|
134 - | let mut output = crate::operation::update_delivery_configuration::builders::UpdateDeliveryConfigurationOutputBuilder::default();
|
135 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
136 - | output.build()
|
137 - | })
|
138 - | }
|
139 - |
|
140 - | pub fn ser_update_delivery_configuration_input(
|
141 - | input: &crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationInput,
|
142 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
143 - | let mut out = String::new();
|
144 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
145 - | crate::protocol_serde::shape_update_delivery_configuration_input::ser_update_delivery_configuration_input_input(&mut object, input)?;
|
146 - | object.finish();
|
147 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
148 - | }
|