pub(crate) fn de_channel_summary<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::ChannelSummary>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::types::builders::ChannelSummaryBuilder::default();
loop {
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
"arn" => {
builder = builder.set_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"cdiInputSpecification" => {
builder = builder.set_cdi_input_specification(
crate::protocol_serde::shape_cdi_input_specification::de_cdi_input_specification(tokens)?,
);
}
"channelClass" => {
builder = builder.set_channel_class(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::ChannelClass::from(u.as_ref())))
.transpose()?,
);
}
"destinations" => {
builder = builder.set_destinations(
crate::protocol_serde::shape_list_of_output_destination::de_list_of_output_destination(tokens)?,
);
}
"egressEndpoints" => {
builder = builder.set_egress_endpoints(
crate::protocol_serde::shape_list_of_channel_egress_endpoint::de_list_of_channel_egress_endpoint(tokens)?,
);
}
"id" => {
builder = builder.set_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"inputAttachments" => {
builder = builder.set_input_attachments(
crate::protocol_serde::shape_list_of_input_attachment::de_list_of_input_attachment(tokens)?,
);
}
"inputSpecification" => {
builder =
builder.set_input_specification(crate::protocol_serde::shape_input_specification::de_input_specification(tokens)?);
}
"logLevel" => {
builder = builder.set_log_level(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::LogLevel::from(u.as_ref())))
.transpose()?,
);
}
"maintenance" => {
builder = builder.set_maintenance(crate::protocol_serde::shape_maintenance_status::de_maintenance_status(tokens)?);
}
"name" => {
builder = builder.set_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"pipelinesRunningCount" => {
builder = builder.set_pipelines_running_count(
::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
.map(i32::try_from)
.transpose()?,
);
}
"roleArn" => {
builder = builder.set_role_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"state" => {
builder = builder.set_state(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::ChannelState::from(u.as_ref())))
.transpose()?,
);
}
"tags" => {
builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens)?);
}
"vpc" => {
builder = builder
.set_vpc(crate::protocol_serde::shape_vpc_output_settings_description::de_vpc_output_settings_description(tokens)?);
}
_ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
},
other => {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)))
}
}
}
Ok(Some(builder.build()))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}