pub fn ser_end_point(
input: &crate::types::EndPoint,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
{
let mut inner_writer = scope.start_el("StreamType").finish();
inner_writer.data(input.stream_type.as_str());
}
if let Some(var_1) = &input.kinesis_stream_config {
let inner_writer = scope.start_el("KinesisStreamConfig");
crate::protocol_serde::shape_kinesis_stream_config::ser_kinesis_stream_config(var_1, inner_writer)?
}
scope.finish();
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_end_point(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::EndPoint, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::EndPoint::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("StreamType") => {
let var_2 =
Some(
Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_stream_type(var_2);
}
,
s if s.matches("KinesisStreamConfig") => {
let var_3 =
Some(
crate::protocol_serde::shape_kinesis_stream_config::de_kinesis_stream_config(&mut tag)
?
)
;
builder = builder.set_kinesis_stream_config(var_3);
}
,
_ => {}
}
}
Ok(crate::serde_util::end_point_correct_errors(builder)
.build()
.map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}