aws_sdk_kafkaconnect/protocol_serde/
shape_worker_log_delivery_description.rs1pub(crate) fn de_worker_log_delivery_description<'a, I>(
3 tokens: &mut ::std::iter::Peekable<I>,
4) -> ::std::result::Result<Option<crate::types::WorkerLogDeliveryDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
5where
6 I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
7{
8 match tokens.next().transpose()? {
9 Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
10 Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
11 #[allow(unused_mut)]
12 let mut builder = crate::types::builders::WorkerLogDeliveryDescriptionBuilder::default();
13 loop {
14 match tokens.next().transpose()? {
15 Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
16 Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
17 match key.to_unescaped()?.as_ref() {
18 "cloudWatchLogs" => {
19 builder = builder.set_cloud_watch_logs(
20 crate::protocol_serde::shape_cloud_watch_logs_log_delivery_description::de_cloud_watch_logs_log_delivery_description(tokens)?
21 );
22 }
23 "firehose" => {
24 builder = builder.set_firehose(
25 crate::protocol_serde::shape_firehose_log_delivery_description::de_firehose_log_delivery_description(tokens)?,
26 );
27 }
28 "s3" => {
29 builder = builder.set_s3(crate::protocol_serde::shape_s3_log_delivery_description::de_s3_log_delivery_description(
30 tokens,
31 )?);
32 }
33 _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
34 }
35 }
36 other => {
37 return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
38 "expected object key or end object, found: {other:?}"
39 )))
40 }
41 }
42 }
43 Ok(Some(builder.build()))
44 }
45 _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
46 "expected start object or null",
47 )),
48 }
49}