#[allow(clippy::needless_question_mark)]
pub fn de_geo_location(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::GeoLocation, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::GeoLocation::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("ContinentCode") => {
let var_1 =
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_continent_code(var_1);
}
,
s if s.matches("CountryCode") => {
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_country_code(var_2);
}
,
s if s.matches("SubdivisionCode") => {
let var_3 =
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_subdivision_code(var_3);
}
,
_ => {}
}
}
Ok(builder.build())
}
pub fn ser_geo_location(
input: &crate::types::GeoLocation,
writer: ::aws_smithy_xml::encode::ElWriter,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope = writer.finish();
if let Some(var_4) = &input.continent_code {
let mut inner_writer = scope.start_el("ContinentCode").finish();
inner_writer.data(var_4.as_str());
}
if let Some(var_5) = &input.country_code {
let mut inner_writer = scope.start_el("CountryCode").finish();
inner_writer.data(var_5.as_str());
}
if let Some(var_6) = &input.subdivision_code {
let mut inner_writer = scope.start_el("SubdivisionCode").finish();
inner_writer.data(var_6.as_str());
}
scope.finish();
Ok(())
}