161 161 | }
|
162 162 | #[derive(Debug)]
|
163 163 | struct CapturePokemonRequestSerializer;
|
164 164 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CapturePokemonRequestSerializer {
|
165 165 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
166 166 | fn serialize_input(
|
167 167 | &self,
|
168 168 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
169 169 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
170 170 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
171 171 | let input = input
|
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 | ::std::write!(output, "/").expect("formatting should succeed");
|
186 186 | ::std::result::Result::Ok(())
|
187 187 | }
|
188 188 | #[allow(clippy::unnecessary_wraps)]
|
189 189 | fn update_http_builder(
|
190 190 | input: &crate::operation::capture_pokemon::CapturePokemonInput,
|
191 - | builder: ::http::request::Builder,
|
192 - | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
191 + | builder: ::http_1x::request::Builder,
|
192 + | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
193 193 | let mut uri = ::std::string::String::new();
|
194 194 | uri_base(input, &mut uri)?;
|
195 195 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
196 196 | }
|
197 - | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
198 - | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
197 + | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
198 + | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
199 199 | builder = _header_serialization_settings.set_default_header(
|
200 200 | builder,
|
201 - | ::http::header::HeaderName::from_static("x-amz-target"),
|
201 + | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
202 202 | "PokemonService.CapturePokemon",
|
203 203 | );
|
204 204 | builder
|
205 205 | };
|
206 206 | let body = ::aws_smithy_types::body::SdkBody::from({
|
207 207 | let error_marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventErrorMarshaller::new();
|
208 208 | let marshaller = crate::event_stream_serde::AttemptCapturingPokemonEventMarshaller::new();
|
209 209 | let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
|
210 210 | _cfg.interceptor_state().store_put(signer_sender);
|
211 211 | ::aws_smithy_types::body::SdkBody::from_body_0_4(::hyper::Body::wrap_stream(input.events.into_body_stream(
|
212 212 | marshaller,
|
213 213 | error_marshaller,
|
214 214 | signer,
|
215 215 | )))
|
216 216 | });
|
217 217 | if let Some(content_length) = body.content_length() {
|
218 218 | let content_length = content_length.to_string();
|
219 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
219 + | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
220 220 | }
|
221 221 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
222 222 | }
|
223 223 | }
|
224 224 | #[derive(Debug)]
|
225 225 | struct CapturePokemonEndpointParamsInterceptor;
|
226 226 |
|
227 227 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CapturePokemonEndpointParamsInterceptor {
|
228 228 | fn name(&self) -> &'static str {
|
229 229 | "CapturePokemonEndpointParamsInterceptor"
|
230 230 | }
|
231 231 |
|
232 232 | fn read_before_execution(
|
233 233 | &self,
|
234 234 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
235 235 | '_,
|
236 236 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
237 237 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
238 238 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
239 239 | >,
|
240 240 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
241 241 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
242 242 | let _input = context
|
243 243 | .input()
|
244 244 | .downcast_ref::<CapturePokemonInput>()
|
245 245 | .ok_or("failed to downcast to CapturePokemonInput")?;
|
246 246 |
|
247 247 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
248 248 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
249 249 | })?;
|