130 134 | crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersError,
|
131 135 | >::new());
|
132 136 |
|
133 137 | ::std::borrow::Cow::Owned(rcb)
|
134 138 | }
|
135 139 | }
|
136 140 |
|
137 141 | #[derive(Debug)]
|
138 142 | struct HttpEmptyPrefixHeadersResponseDeserializer;
|
139 143 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpEmptyPrefixHeadersResponseDeserializer {
|
140 - | fn deserialize_nonstreaming(
|
144 + | fn deserialize_nonstreaming_with_config(
|
141 145 | &self,
|
142 146 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
147 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
143 148 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
144 149 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
150 + | #[allow(unused_mut)]
|
151 + | let mut force_error = false;
|
152 + |
|
153 + | if !success && status != 200 || force_error {
|
145 154 | let headers = response.headers();
|
146 155 | let body = response.body().bytes().expect("body loaded");
|
147 156 | #[allow(unused_mut)]
|
148 - | let mut force_error = false;
|
157 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
158 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
159 + | })?;
|
149 160 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_http_empty_prefix_headers::de_http_empty_prefix_headers_http_error(status, headers, body)
|
161 + | let generic = generic_builder.build();
|
162 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
163 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
|
164 + | crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersError::generic(generic),
|
165 + | ),
|
166 + | ))
|
152 167 | } else {
|
153 - | crate::protocol_serde::shape_http_empty_prefix_headers::de_http_empty_prefix_headers_http_response(status, headers, body)
|
154 - | };
|
155 - | crate::protocol_serde::type_erase_result(parse_result)
|
168 + | let protocol = _cfg
|
169 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
170 + | .expect("a SharedClientProtocol is required");
|
171 + | let mut deser = protocol
|
172 + | .deserialize_response(response, HttpEmptyPrefixHeaders::OUTPUT_SCHEMA, _cfg)
|
173 + | .map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | let body = response.body().bytes().expect("body loaded");
|
177 + | let output = crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersOutput::deserialize_with_response(
|
178 + | &mut *deser,
|
179 + | response.headers(),
|
180 + | response.status().into(),
|
181 + | body,
|
182 + | )
|
183 + | .map_err(|e| {
|
184 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
185 + | })?;
|
186 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
187 + | }
|
156 188 | }
|
157 189 | }
|
158 190 | #[derive(Debug)]
|
159 191 | struct HttpEmptyPrefixHeadersRequestSerializer;
|
160 192 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpEmptyPrefixHeadersRequestSerializer {
|
161 193 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
162 194 | fn serialize_input(
|
163 195 | &self,
|
164 196 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
165 197 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
166 198 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
167 199 | let input = input
|
168 200 | .downcast::<crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersInput>()
|
169 201 | .expect("correct type");
|
170 - | let _header_serialization_settings = _cfg
|
171 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
172 - | .cloned()
|
173 - | .unwrap_or_default();
|
174 - | let mut request_builder = {
|
175 - | #[allow(clippy::uninlined_format_args)]
|
176 - | fn uri_base(
|
177 - | _input: &crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | ::std::write!(output, "/HttpEmptyPrefixHeaders").expect("formatting should succeed");
|
182 - | ::std::result::Result::Ok(())
|
183 - | }
|
184 - | #[allow(clippy::unnecessary_wraps)]
|
185 - | fn update_http_builder(
|
186 - | input: &crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersInput,
|
187 - | builder: ::http_1x::request::Builder,
|
188 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
189 - | let mut uri = ::std::string::String::new();
|
190 - | uri_base(input, &mut uri)?;
|
191 - | let builder = crate::protocol_serde::shape_http_empty_prefix_headers::ser_http_empty_prefix_headers_headers(input, builder)?;
|
192 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
193 - | }
|
194 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
195 - | builder
|
196 - | };
|
197 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
202 + | let protocol = _cfg
|
203 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
204 + | .expect("a SharedClientProtocol is required");
|
205 + | let mut request = protocol
|
206 + | .serialize_request(&input, HttpEmptyPrefixHeaders::INPUT_SCHEMA, "", _cfg)
|
207 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
198 208 |
|
199 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
209 + | return ::std::result::Result::Ok(request);
|
200 210 | }
|
201 211 | }
|
202 212 | #[derive(Debug)]
|
203 213 | struct HttpEmptyPrefixHeadersEndpointParamsInterceptor;
|
204 214 |
|
205 215 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpEmptyPrefixHeadersEndpointParamsInterceptor {
|
206 216 | fn name(&self) -> &'static str {
|
207 217 | "HttpEmptyPrefixHeadersEndpointParamsInterceptor"
|
208 218 | }
|
209 219 |
|
210 220 | fn read_before_execution(
|
211 221 | &self,
|
212 222 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
213 223 | '_,
|
214 224 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
215 225 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
216 226 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
217 227 | >,
|
218 228 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
219 229 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
220 230 | let _input = context
|
221 231 | .input()
|
222 232 | .downcast_ref::<HttpEmptyPrefixHeadersInput>()
|
223 233 | .ok_or("failed to downcast to HttpEmptyPrefixHeadersInput")?;
|
224 234 |
|
225 235 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
226 236 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
227 237 | })?;
|
228 238 | cfg.interceptor_state()
|
229 239 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
230 240 | ::std::result::Result::Ok(())
|
231 241 | }
|
232 242 | }
|
233 243 |
|
234 244 | // The get_* functions below are generated from JMESPath expressions in the
|
235 245 | // operationContextParams trait. They target the operation's input shape.
|
236 246 |
|
237 247 | #[allow(unreachable_code, unused_variables)]
|
238 248 | #[cfg(test)]
|
239 249 | mod http_empty_prefix_headers_test {
|
240 250 |
|
241 251 | /// Serializes all request headers, using specific when present
|
242 252 | /// Test ID: RestJsonHttpEmptyPrefixHeadersRequestClient
|
243 253 | #[::tokio::test]
|
244 254 | #[::tracing_test::traced_test]
|
245 - | #[should_panic]
|
246 255 | async fn rest_json_http_empty_prefix_headers_request_client_request() {
|
247 256 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
248 257 | let config_builder = crate::config::Config::builder()
|
249 258 | .with_test_defaults()
|
250 259 | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
251 260 | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
252 261 | .allow_no_auth()
|
253 262 | .endpoint_url("https://example.com");
|
254 263 |
|
255 264 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|