#[allow(unused_mut)]
pub fn ser_workmail_action(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::WorkmailAction,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("TopicArn");
if let Some(var_2) = &input.topic_arn {
scope_1.string(var_2);
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("OrganizationArn");
{
scope_3.string(&input.organization_arn);
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_workmail_action(
decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
depth: u32,
) -> ::std::result::Result<crate::types::WorkmailAction, ::aws_smithy_xml::decode::XmlDecodeError> {
if depth >= 128u32 {
return Err(::aws_smithy_xml::decode::XmlDecodeError::custom("maximum nesting depth exceeded"));
}
#[allow(unused_mut)]
let mut builder = crate::types::WorkmailAction::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("TopicArn") => {
let var_4 =
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_topic_arn(var_4);
}
,
s if s.matches("OrganizationArn") => {
let var_5 =
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_organization_arn(var_5);
}
,
_ => {}
}
}
Ok(crate::serde_util::workmail_action_correct_errors(builder)
.build()
.map_err(|_| ::aws_smithy_xml::decode::XmlDecodeError::custom("missing field"))?)
}