#[allow(clippy::needless_question_mark)]
pub fn de_option_status(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
) -> ::std::result::Result<crate::types::OptionStatus, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::OptionStatus::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("CreationDate") => {
let var_1 =
Some(
::aws_smithy_types::DateTime::from_str(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudsearch#UpdateTimestamp`)"))
?
)
;
builder = builder.set_creation_date(var_1);
}
,
s if s.matches("UpdateDate") => {
let var_2 =
Some(
::aws_smithy_types::DateTime::from_str(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, ::aws_smithy_types::date_time::Format::DateTimeWithOffset
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.cloudsearch#UpdateTimestamp`)"))
?
)
;
builder = builder.set_update_date(var_2);
}
,
s if s.matches("UpdateVersion") => {
let var_3 =
Some(
{
<i32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudsearch#UIntValue`)"))
}
?
)
;
builder = builder.set_update_version(var_3);
}
,
s if s.matches("State") => {
let var_4 =
Some(
Result::<crate::types::OptionState, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::OptionState::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_state(var_4);
}
,
s if s.matches("PendingDeletion") => {
let var_5 =
Some(
{
<bool as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudsearch#Boolean`)"))
}
?
)
;
builder = builder.set_pending_deletion(var_5);
}
,
_ => {}
}
}
Ok(crate::serde_util::option_status_correct_errors(builder)
.build()
.map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}