141 145 | ::std::borrow::Cow::Owned(rcb)
|
142 146 | }
|
143 147 | }
|
144 148 |
|
145 149 | #[derive(Debug)]
|
146 150 | struct PutDeliveryChannelResponseDeserializer;
|
147 151 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutDeliveryChannelResponseDeserializer {
|
148 152 | fn deserialize_nonstreaming(
|
149 153 | &self,
|
150 154 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
155 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
151 156 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
152 157 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
153 - | let headers = response.headers();
|
154 - | let body = response.body().bytes().expect("body loaded");
|
155 158 | #[allow(unused_mut)]
|
156 159 | let mut force_error = false;
|
157 160 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
158 - | let parse_result = if !success && status != 200 || force_error {
|
159 - | crate::protocol_serde::shape_put_delivery_channel::de_put_delivery_channel_http_error(status, headers, body)
|
161 + | if !success && status != 200 || force_error {
|
162 + | let headers = response.headers();
|
163 + | let body = response.body().bytes().expect("body loaded");
|
164 + | #[allow(unused_mut)]
|
165 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
166 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
167 + | })?;
|
168 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
169 + | let generic = generic_builder.build();
|
170 + | let error_code = match generic.code() {
|
171 + | ::std::option::Option::Some(code) => code,
|
172 + | ::std::option::Option::None => {
|
173 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
174 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
175 + | crate::operation::put_delivery_channel::PutDeliveryChannelError::unhandled(generic),
|
176 + | ),
|
177 + | ))
|
178 + | }
|
179 + | };
|
180 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
181 + | let protocol = _cfg
|
182 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
183 + | .expect("a SharedClientProtocol is required");
|
184 + | let err = match error_code {
|
185 + | "InsufficientDeliveryPolicyException" => {
|
186 + | crate::operation::put_delivery_channel::PutDeliveryChannelError::InsufficientDeliveryPolicyException({
|
187 + | let mut tmp = match protocol
|
188 + | .deserialize_response(response, crate::types::error::InsufficientDeliveryPolicyException::SCHEMA, _cfg)
|
189 + | .and_then(|mut deser| {
|
190 + | crate::types::error::InsufficientDeliveryPolicyException::deserialize_with_response(
|
191 + | &mut *deser,
|
192 + | response.headers(),
|
193 + | response.status().into(),
|
194 + | body,
|
195 + | )
|
196 + | }) {
|
197 + | ::std::result::Result::Ok(val) => val,
|
198 + | ::std::result::Result::Err(e) => {
|
199 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
200 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
201 + | ))
|
202 + | }
|
203 + | };
|
204 + | tmp.meta = generic;
|
205 + | if tmp.message.is_none() {
|
206 + | tmp.message = _error_message;
|
207 + | }
|
208 + | tmp
|
209 + | })
|
210 + | }
|
211 + | "InvalidDeliveryChannelNameException" => {
|
212 + | crate::operation::put_delivery_channel::PutDeliveryChannelError::InvalidDeliveryChannelNameException({
|
213 + | let mut tmp = match protocol
|
214 + | .deserialize_response(response, crate::types::error::InvalidDeliveryChannelNameException::SCHEMA, _cfg)
|
215 + | .and_then(|mut deser| {
|
216 + | crate::types::error::InvalidDeliveryChannelNameException::deserialize_with_response(
|
217 + | &mut *deser,
|
218 + | response.headers(),
|
219 + | response.status().into(),
|
220 + | body,
|
221 + | )
|
222 + | }) {
|
223 + | ::std::result::Result::Ok(val) => val,
|
224 + | ::std::result::Result::Err(e) => {
|
225 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
226 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
227 + | ))
|
228 + | }
|
229 + | };
|
230 + | tmp.meta = generic;
|
231 + | if tmp.message.is_none() {
|
232 + | tmp.message = _error_message;
|
233 + | }
|
234 + | tmp
|
235 + | })
|
236 + | }
|
237 + | "InvalidS3KeyPrefixException" => crate::operation::put_delivery_channel::PutDeliveryChannelError::InvalidS3KeyPrefixException({
|
238 + | let mut tmp = match protocol
|
239 + | .deserialize_response(response, crate::types::error::InvalidS3KeyPrefixException::SCHEMA, _cfg)
|
240 + | .and_then(|mut deser| {
|
241 + | crate::types::error::InvalidS3KeyPrefixException::deserialize_with_response(
|
242 + | &mut *deser,
|
243 + | response.headers(),
|
244 + | response.status().into(),
|
245 + | body,
|
246 + | )
|
247 + | }) {
|
248 + | ::std::result::Result::Ok(val) => val,
|
249 + | ::std::result::Result::Err(e) => {
|
250 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
251 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
252 + | ))
|
253 + | }
|
254 + | };
|
255 + | tmp.meta = generic;
|
256 + | if tmp.message.is_none() {
|
257 + | tmp.message = _error_message;
|
258 + | }
|
259 + | tmp
|
260 + | }),
|
261 + | "InvalidS3KmsKeyArnException" => crate::operation::put_delivery_channel::PutDeliveryChannelError::InvalidS3KmsKeyArnException({
|
262 + | let mut tmp = match protocol
|
263 + | .deserialize_response(response, crate::types::error::InvalidS3KmsKeyArnException::SCHEMA, _cfg)
|
264 + | .and_then(|mut deser| {
|
265 + | crate::types::error::InvalidS3KmsKeyArnException::deserialize_with_response(
|
266 + | &mut *deser,
|
267 + | response.headers(),
|
268 + | response.status().into(),
|
269 + | body,
|
270 + | )
|
271 + | }) {
|
272 + | ::std::result::Result::Ok(val) => val,
|
273 + | ::std::result::Result::Err(e) => {
|
274 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
275 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
276 + | ))
|
277 + | }
|
278 + | };
|
279 + | tmp.meta = generic;
|
280 + | if tmp.message.is_none() {
|
281 + | tmp.message = _error_message;
|
282 + | }
|
283 + | tmp
|
284 + | }),
|
285 + | "InvalidSNSTopicARNException" => crate::operation::put_delivery_channel::PutDeliveryChannelError::InvalidSnsTopicArnException({
|
286 + | let mut tmp = match protocol
|
287 + | .deserialize_response(response, crate::types::error::InvalidSnsTopicArnException::SCHEMA, _cfg)
|
288 + | .and_then(|mut deser| {
|
289 + | crate::types::error::InvalidSnsTopicArnException::deserialize_with_response(
|
290 + | &mut *deser,
|
291 + | response.headers(),
|
292 + | response.status().into(),
|
293 + | body,
|
294 + | )
|
295 + | }) {
|
296 + | ::std::result::Result::Ok(val) => val,
|
297 + | ::std::result::Result::Err(e) => {
|
298 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
299 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
300 + | ))
|
301 + | }
|
302 + | };
|
303 + | tmp.meta = generic;
|
304 + | if tmp.message.is_none() {
|
305 + | tmp.message = _error_message;
|
306 + | }
|
307 + | tmp
|
308 + | }),
|
309 + | "MaxNumberOfDeliveryChannelsExceededException" => {
|
310 + | crate::operation::put_delivery_channel::PutDeliveryChannelError::MaxNumberOfDeliveryChannelsExceededException({
|
311 + | let mut tmp = match protocol
|
312 + | .deserialize_response(response, crate::types::error::MaxNumberOfDeliveryChannelsExceededException::SCHEMA, _cfg)
|
313 + | .and_then(|mut deser| {
|
314 + | crate::types::error::MaxNumberOfDeliveryChannelsExceededException::deserialize_with_response(
|
315 + | &mut *deser,
|
316 + | response.headers(),
|
317 + | response.status().into(),
|
318 + | body,
|
319 + | )
|
320 + | }) {
|
321 + | ::std::result::Result::Ok(val) => val,
|
322 + | ::std::result::Result::Err(e) => {
|
323 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
324 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
325 + | ))
|
326 + | }
|
327 + | };
|
328 + | tmp.meta = generic;
|
329 + | if tmp.message.is_none() {
|
330 + | tmp.message = _error_message;
|
331 + | }
|
332 + | tmp
|
333 + | })
|
334 + | }
|
335 + | "NoAvailableConfigurationRecorderException" => {
|
336 + | crate::operation::put_delivery_channel::PutDeliveryChannelError::NoAvailableConfigurationRecorderException({
|
337 + | let mut tmp = match protocol
|
338 + | .deserialize_response(response, crate::types::error::NoAvailableConfigurationRecorderException::SCHEMA, _cfg)
|
339 + | .and_then(|mut deser| {
|
340 + | crate::types::error::NoAvailableConfigurationRecorderException::deserialize_with_response(
|
341 + | &mut *deser,
|
342 + | response.headers(),
|
343 + | response.status().into(),
|
344 + | body,
|
345 + | )
|
346 + | }) {
|
347 + | ::std::result::Result::Ok(val) => val,
|
348 + | ::std::result::Result::Err(e) => {
|
349 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
350 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
351 + | ))
|
352 + | }
|
353 + | };
|
354 + | tmp.meta = generic;
|
355 + | if tmp.message.is_none() {
|
356 + | tmp.message = _error_message;
|
357 + | }
|
358 + | tmp
|
359 + | })
|
360 + | }
|
361 + | "NoSuchBucketException" => crate::operation::put_delivery_channel::PutDeliveryChannelError::NoSuchBucketException({
|
362 + | let mut tmp = match protocol
|
363 + | .deserialize_response(response, crate::types::error::NoSuchBucketException::SCHEMA, _cfg)
|
364 + | .and_then(|mut deser| {
|
365 + | crate::types::error::NoSuchBucketException::deserialize_with_response(
|
366 + | &mut *deser,
|
367 + | response.headers(),
|
368 + | response.status().into(),
|
369 + | body,
|
370 + | )
|
371 + | }) {
|
372 + | ::std::result::Result::Ok(val) => val,
|
373 + | ::std::result::Result::Err(e) => {
|
374 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
375 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
376 + | ))
|
377 + | }
|
378 + | };
|
379 + | tmp.meta = generic;
|
380 + | if tmp.message.is_none() {
|
381 + | tmp.message = _error_message;
|
382 + | }
|
383 + | tmp
|
384 + | }),
|
385 + | _ => crate::operation::put_delivery_channel::PutDeliveryChannelError::generic(generic),
|
386 + | };
|
387 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
388 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
389 + | ))
|
160 390 | } else {
|
161 - | crate::protocol_serde::shape_put_delivery_channel::de_put_delivery_channel_http_response(status, headers, body)
|
162 - | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
391 + | let protocol = _cfg
|
392 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
393 + | .expect("a SharedClientProtocol is required");
|
394 + | let mut deser = protocol
|
395 + | .deserialize_response(response, PutDeliveryChannel::OUTPUT_SCHEMA, _cfg)
|
396 + | .map_err(|e| {
|
397 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
398 + | })?;
|
399 + | let body = response.body().bytes().expect("body loaded");
|
400 + | let output = crate::operation::put_delivery_channel::PutDeliveryChannelOutput::deserialize_with_response(
|
401 + | &mut *deser,
|
402 + | response.headers(),
|
403 + | response.status().into(),
|
404 + | body,
|
405 + | )
|
406 + | .map_err(|e| {
|
407 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
408 + | })?;
|
409 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
410 + | }
|
164 411 | }
|
165 412 | }
|
166 413 | #[derive(Debug)]
|
167 414 | struct PutDeliveryChannelRequestSerializer;
|
168 415 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PutDeliveryChannelRequestSerializer {
|
169 416 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 417 | fn serialize_input(
|
171 418 | &self,
|
172 419 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 420 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 421 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 422 | let input = input
|
176 423 | .downcast::<crate::operation::put_delivery_channel::PutDeliveryChannelInput>()
|
177 424 | .expect("correct type");
|
178 - | let _header_serialization_settings = _cfg
|
179 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
180 - | .cloned()
|
181 - | .unwrap_or_default();
|
182 - | let mut request_builder = {
|
183 - | #[allow(clippy::uninlined_format_args)]
|
184 - | fn uri_base(
|
185 - | _input: &crate::operation::put_delivery_channel::PutDeliveryChannelInput,
|
186 - | output: &mut ::std::string::String,
|
187 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
188 - | use ::std::fmt::Write as _;
|
189 - | ::std::write!(output, "/").expect("formatting should succeed");
|
190 - | ::std::result::Result::Ok(())
|
191 - | }
|
192 - | #[allow(clippy::unnecessary_wraps)]
|
193 - | fn update_http_builder(
|
194 - | input: &crate::operation::put_delivery_channel::PutDeliveryChannelInput,
|
195 - | builder: ::http_1x::request::Builder,
|
196 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
197 - | let mut uri = ::std::string::String::new();
|
198 - | uri_base(input, &mut uri)?;
|
199 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
200 - | }
|
201 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
202 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
203 - | builder = _header_serialization_settings.set_default_header(
|
204 - | builder,
|
205 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
206 - | "StarlingDoveService.PutDeliveryChannel",
|
207 - | );
|
208 - | builder
|
209 - | };
|
210 - | let body =
|
211 - | ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_put_delivery_channel::ser_put_delivery_channel_input(&input)?);
|
212 - | if let Some(content_length) = body.content_length() {
|
213 - | let content_length = content_length.to_string();
|
214 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
215 - | }
|
216 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
425 + | let protocol = _cfg
|
426 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
427 + | .expect("a SharedClientProtocol is required");
|
428 + | let mut request = protocol
|
429 + | .serialize_request(&input, PutDeliveryChannel::INPUT_SCHEMA, "", _cfg)
|
430 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
431 + |
|
432 + | return ::std::result::Result::Ok(request);
|
217 433 | }
|
218 434 | }
|
219 435 | #[derive(Debug)]
|
220 436 | struct PutDeliveryChannelEndpointParamsInterceptor;
|
221 437 |
|
222 438 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutDeliveryChannelEndpointParamsInterceptor {
|
223 439 | fn name(&self) -> &'static str {
|
224 440 | "PutDeliveryChannelEndpointParamsInterceptor"
|
225 441 | }
|
226 442 |
|