124 128 | crate::operation::malformed_byte::MalformedByteError,
|
125 129 | >::new());
|
126 130 |
|
127 131 | ::std::borrow::Cow::Owned(rcb)
|
128 132 | }
|
129 133 | }
|
130 134 |
|
131 135 | #[derive(Debug)]
|
132 136 | struct MalformedByteResponseDeserializer;
|
133 137 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedByteResponseDeserializer {
|
134 - | fn deserialize_nonstreaming(
|
138 + | fn deserialize_nonstreaming_with_config(
|
135 139 | &self,
|
136 140 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
141 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
137 142 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
138 143 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
139 - | let headers = response.headers();
|
140 - | let body = response.body().bytes().expect("body loaded");
|
141 144 | #[allow(unused_mut)]
|
142 145 | let mut force_error = false;
|
143 146 |
|
144 - | let parse_result = if !success && status != 200 || force_error {
|
145 - | crate::protocol_serde::shape_malformed_byte::de_malformed_byte_http_error(status, headers, body)
|
147 + | if !success && status != 200 || force_error {
|
148 + | let headers = response.headers();
|
149 + | let body = response.body().bytes().expect("body loaded");
|
150 + | #[allow(unused_mut)]
|
151 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
152 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
153 + | })?;
|
154 + |
|
155 + | let generic = generic_builder.build();
|
156 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
157 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::malformed_byte::MalformedByteError::generic(
|
158 + | generic,
|
159 + | )),
|
160 + | ))
|
146 161 | } else {
|
147 - | crate::protocol_serde::shape_malformed_byte::de_malformed_byte_http_response(status, headers, body)
|
148 - | };
|
149 - | crate::protocol_serde::type_erase_result(parse_result)
|
162 + | let protocol = _cfg
|
163 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
164 + | .expect("a SharedClientProtocol is required");
|
165 + | let mut deser = protocol.deserialize_response(response, MalformedByte::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
166 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
167 + | })?;
|
168 + | let body = response.body().bytes().expect("body loaded");
|
169 + | let output = crate::operation::malformed_byte::MalformedByteOutput::deserialize_with_response(
|
170 + | &mut *deser,
|
171 + | response.headers(),
|
172 + | response.status().into(),
|
173 + | body,
|
174 + | )
|
175 + | .map_err(|e| {
|
176 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
177 + | })?;
|
178 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
179 + | }
|
150 180 | }
|
151 181 | }
|
152 182 | #[derive(Debug)]
|
153 183 | struct MalformedByteRequestSerializer;
|
154 184 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedByteRequestSerializer {
|
155 185 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
156 186 | fn serialize_input(
|
157 187 | &self,
|
158 188 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
159 189 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
160 190 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
161 191 | let input = input
|
162 192 | .downcast::<crate::operation::malformed_byte::MalformedByteInput>()
|
163 193 | .expect("correct type");
|
164 - | let _header_serialization_settings = _cfg
|
165 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
166 - | .cloned()
|
167 - | .unwrap_or_default();
|
168 - | let mut request_builder = {
|
169 - | #[allow(clippy::uninlined_format_args)]
|
170 - | fn uri_base(
|
171 - | _input: &crate::operation::malformed_byte::MalformedByteInput,
|
172 - | output: &mut ::std::string::String,
|
173 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
174 - | use ::std::fmt::Write as _;
|
175 - | let input_1 = &_input.byte_in_path;
|
176 - | let input_1 = input_1
|
177 - | .as_ref()
|
178 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("byte_in_path", "cannot be empty or unset"))?;
|
179 - | let mut byte_in_path_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_1);
|
180 - | let byte_in_path = byte_in_path_encoder.encode();
|
181 - | if byte_in_path.is_empty() {
|
182 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
183 - | "byte_in_path",
|
184 - | "cannot be empty or unset",
|
185 - | ));
|
186 - | }
|
187 - | ::std::write!(output, "/MalformedByte/{byteInPath}", byteInPath = byte_in_path).expect("formatting should succeed");
|
188 - | ::std::result::Result::Ok(())
|
189 - | }
|
190 - | fn uri_query(
|
191 - | _input: &crate::operation::malformed_byte::MalformedByteInput,
|
192 - | mut output: &mut ::std::string::String,
|
193 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
194 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
195 - | if let ::std::option::Option::Some(inner_2) = &_input.byte_in_query {
|
196 - | {
|
197 - | query.push_kv("byteInQuery", ::aws_smithy_types::primitive::Encoder::from(*inner_2).encode());
|
198 - | }
|
199 - | }
|
200 - | ::std::result::Result::Ok(())
|
201 - | }
|
202 - | #[allow(clippy::unnecessary_wraps)]
|
203 - | fn update_http_builder(
|
204 - | input: &crate::operation::malformed_byte::MalformedByteInput,
|
205 - | builder: ::http_1x::request::Builder,
|
206 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
207 - | let mut uri = ::std::string::String::new();
|
208 - | uri_base(input, &mut uri)?;
|
209 - | uri_query(input, &mut uri)?;
|
210 - | let builder = crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_headers(input, builder)?;
|
211 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
212 - | }
|
213 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
214 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
|
215 - | builder
|
216 - | };
|
217 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_input(&input)?);
|
218 - | if let Some(content_length) = body.content_length() {
|
219 - | let content_length = content_length.to_string();
|
220 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
221 - | }
|
222 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
194 + | let protocol = _cfg
|
195 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
196 + | .expect("a SharedClientProtocol is required");
|
197 + | let mut request = protocol
|
198 + | .serialize_request(&input, MalformedByte::INPUT_SCHEMA, "", _cfg)
|
199 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
200 + |
|
201 + | return ::std::result::Result::Ok(request);
|
223 202 | }
|
224 203 | }
|
225 204 | #[derive(Debug)]
|
226 205 | struct MalformedByteEndpointParamsInterceptor;
|
227 206 |
|
228 207 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedByteEndpointParamsInterceptor {
|
229 208 | fn name(&self) -> &'static str {
|
230 209 | "MalformedByteEndpointParamsInterceptor"
|
231 210 | }
|
232 211 |
|