172 172 | .downcast::<crate::operation::capture_pokemon::CapturePokemonInput>()
|
173 173 | .expect("correct type");
|
174 174 | let _header_serialization_settings = _cfg
|
175 175 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
176 176 | .cloned()
|
177 177 | .unwrap_or_default();
|
178 178 | let mut request_builder = {
|
179 179 | #[allow(clippy::uninlined_format_args)]
|
180 180 | fn uri_base(
|
181 181 | _input: &crate::operation::capture_pokemon::CapturePokemonInput,
|
182 182 | output: &mut ::std::string::String,
|
183 183 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
184 184 | use ::std::fmt::Write as _;
|
185 185 | let input_1 = &_input.region;
|
186 186 | let input_1 = input_1
|
187 187 | .as_ref()
|
188 188 | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("region", "cannot be empty or unset"))?;
|
189 189 | let region = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
190 190 | if region.is_empty() {
|
191 191 | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
192 192 | "region",
|
193 193 | "cannot be empty or unset",
|
194 194 | ));
|
195 195 | }
|
196 196 | ::std::write!(output, "/capture-pokemon-event/{region}", region = region).expect("formatting should succeed");
|
197 197 | ::std::result::Result::Ok(())
|
198 198 | }
|
199 199 | #[allow(clippy::unnecessary_wraps)]
|
200 200 | fn update_http_builder(
|
201 201 | input: &crate::operation::capture_pokemon::CapturePokemonInput,
|
202 - | builder: ::http::request::Builder,
|
203 - | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
202 + | builder: ::http_1x::request::Builder,
|
203 + | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
204 204 | let mut uri = ::std::string::String::new();
|
205 205 | uri_base(input, &mut uri)?;
|
206 206 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
207 207 | }
|
208 - | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
209 - | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
|
208 + | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
209 + | builder =
|
210 + | _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
|
210 211 | builder
|
211 212 | };
|
212 213 | let body = ::aws_smithy_types::body::SdkBody::from({
|
213 214 | let error_marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventErrorMarshaller::new();
|
214 215 | let marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventMarshaller::new();
|
215 216 | let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
|
216 217 | _cfg.interceptor_state().store_put(signer_sender);
|
217 218 | ::aws_smithy_types::body::SdkBody::from_body_0_4(::hyper::Body::wrap_stream(input.events.into_body_stream(
|
218 219 | marshaller,
|
219 220 | error_marshaller,
|
220 221 | signer,
|
221 222 | )))
|
222 223 | });
|
223 224 | if let Some(content_length) = body.content_length() {
|
224 225 | let content_length = content_length.to_string();
|
225 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
226 + | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
226 227 | }
|
227 228 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
228 229 | }
|
229 230 | }
|
230 231 | #[derive(Debug)]
|
231 232 | struct CapturePokemonEndpointParamsInterceptor;
|
232 233 |
|
233 234 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CapturePokemonEndpointParamsInterceptor {
|
234 235 | fn name(&self) -> &'static str {
|
235 236 | "CapturePokemonEndpointParamsInterceptor"
|
236 237 | }
|
237 238 |
|
238 239 | fn read_before_execution(
|
239 240 | &self,
|
240 241 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
241 242 | '_,
|
242 243 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
243 244 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
244 245 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
245 246 | >,
|
246 247 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
247 248 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
248 249 | let _input = context
|
249 250 | .input()
|
250 251 | .downcast_ref::<CapturePokemonInput>()
|
251 252 | .ok_or("failed to downcast to CapturePokemonInput")?;
|
252 253 |
|
253 254 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
254 255 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
255 256 | })?;
|