aws_sdk_kafka/protocol_serde/
shape_mutable_cluster_info.rs1pub(crate) fn de_mutable_cluster_info<'a, I>(
3 tokens: &mut ::std::iter::Peekable<I>,
4) -> ::std::result::Result<Option<crate::types::MutableClusterInfo>, ::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::MutableClusterInfoBuilder::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, .. }) => match key.to_unescaped()?.as_ref() {
17 "brokerEBSVolumeInfo" => {
18 builder = builder.set_broker_ebs_volume_info(
19 crate::protocol_serde::shape_list_of_broker_ebs_volume_info::de_list_of_broker_ebs_volume_info(tokens)?,
20 );
21 }
22 "configurationInfo" => {
23 builder = builder.set_configuration_info(crate::protocol_serde::shape_configuration_info::de_configuration_info(tokens)?);
24 }
25 "numberOfBrokerNodes" => {
26 builder = builder.set_number_of_broker_nodes(
27 ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
28 .map(i32::try_from)
29 .transpose()?,
30 );
31 }
32 "enhancedMonitoring" => {
33 builder = builder.set_enhanced_monitoring(
34 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
35 .map(|s| s.to_unescaped().map(|u| crate::types::EnhancedMonitoring::from(u.as_ref())))
36 .transpose()?,
37 );
38 }
39 "openMonitoring" => {
40 builder = builder.set_open_monitoring(crate::protocol_serde::shape_open_monitoring::de_open_monitoring(tokens)?);
41 }
42 "kafkaVersion" => {
43 builder = builder.set_kafka_version(
44 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
45 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
46 .transpose()?,
47 );
48 }
49 "loggingInfo" => {
50 builder = builder.set_logging_info(crate::protocol_serde::shape_logging_info::de_logging_info(tokens)?);
51 }
52 "instanceType" => {
53 builder = builder.set_instance_type(
54 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
55 .map(|s| s.to_unescaped().map(|u| u.into_owned()))
56 .transpose()?,
57 );
58 }
59 "clientAuthentication" => {
60 builder = builder
61 .set_client_authentication(crate::protocol_serde::shape_client_authentication::de_client_authentication(tokens)?);
62 }
63 "encryptionInfo" => {
64 builder = builder.set_encryption_info(crate::protocol_serde::shape_encryption_info::de_encryption_info(tokens)?);
65 }
66 "connectivityInfo" => {
67 builder = builder.set_connectivity_info(crate::protocol_serde::shape_connectivity_info::de_connectivity_info(tokens)?);
68 }
69 "storageMode" => {
70 builder = builder.set_storage_mode(
71 ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
72 .map(|s| s.to_unescaped().map(|u| crate::types::StorageMode::from(u.as_ref())))
73 .transpose()?,
74 );
75 }
76 "brokerCountUpdateInfo" => {
77 builder = builder.set_broker_count_update_info(
78 crate::protocol_serde::shape_broker_count_update_info::de_broker_count_update_info(tokens)?,
79 );
80 }
81 _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
82 },
83 other => {
84 return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
85 "expected object key or end object, found: {:?}",
86 other
87 )))
88 }
89 }
90 }
91 Ok(Some(builder.build()))
92 }
93 _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
94 "expected start object or null",
95 )),
96 }
97}