#[allow(unused_mut)]
pub fn ser_action(
mut writer: ::aws_smithy_query::QueryValueWriter,
input: &crate::types::Action,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("Type");
if let Some(var_2) = &input.r#type {
scope_1.string(var_2.as_str());
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("TargetGroupArn");
if let Some(var_4) = &input.target_group_arn {
scope_3.string(var_4);
}
#[allow(unused_mut)]
let mut scope_5 = writer.prefix("AuthenticateOidcConfig");
if let Some(var_6) = &input.authenticate_oidc_config {
crate::protocol_serde::shape_authenticate_oidc_action_config::ser_authenticate_oidc_action_config(scope_5, var_6)?;
}
#[allow(unused_mut)]
let mut scope_7 = writer.prefix("AuthenticateCognitoConfig");
if let Some(var_8) = &input.authenticate_cognito_config {
crate::protocol_serde::shape_authenticate_cognito_action_config::ser_authenticate_cognito_action_config(scope_7, var_8)?;
}
#[allow(unused_mut)]
let mut scope_9 = writer.prefix("Order");
if let Some(var_10) = &input.order {
scope_9.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_10).into()),
);
}
#[allow(unused_mut)]
let mut scope_11 = writer.prefix("RedirectConfig");
if let Some(var_12) = &input.redirect_config {
crate::protocol_serde::shape_redirect_action_config::ser_redirect_action_config(scope_11, var_12)?;
}
#[allow(unused_mut)]
let mut scope_13 = writer.prefix("FixedResponseConfig");
if let Some(var_14) = &input.fixed_response_config {
crate::protocol_serde::shape_fixed_response_action_config::ser_fixed_response_action_config(scope_13, var_14)?;
}
#[allow(unused_mut)]
let mut scope_15 = writer.prefix("ForwardConfig");
if let Some(var_16) = &input.forward_config {
crate::protocol_serde::shape_forward_action_config::ser_forward_action_config(scope_15, var_16)?;
}
Ok(())
}
#[allow(clippy::needless_question_mark)]
pub fn de_action(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Action, ::aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::types::Action::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Type") => {
let var_17 =
Some(
Result::<crate::types::ActionTypeEnum, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::types::ActionTypeEnum::from(
::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_type(var_17);
}
,
s if s.matches("TargetGroupArn") => {
let var_18 =
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_target_group_arn(var_18);
}
,
s if s.matches("AuthenticateOidcConfig") => {
let var_19 =
Some(
crate::protocol_serde::shape_authenticate_oidc_action_config::de_authenticate_oidc_action_config(&mut tag)
?
)
;
builder = builder.set_authenticate_oidc_config(var_19);
}
,
s if s.matches("AuthenticateCognitoConfig") => {
let var_20 =
Some(
crate::protocol_serde::shape_authenticate_cognito_action_config::de_authenticate_cognito_action_config(&mut tag)
?
)
;
builder = builder.set_authenticate_cognito_config(var_20);
}
,
s if s.matches("Order") => {
let var_21 =
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.elasticloadbalancingv2#ActionOrder`)"))
}
?
)
;
builder = builder.set_order(var_21);
}
,
s if s.matches("RedirectConfig") => {
let var_22 =
Some(
crate::protocol_serde::shape_redirect_action_config::de_redirect_action_config(&mut tag)
?
)
;
builder = builder.set_redirect_config(var_22);
}
,
s if s.matches("FixedResponseConfig") => {
let var_23 =
Some(
crate::protocol_serde::shape_fixed_response_action_config::de_fixed_response_action_config(&mut tag)
?
)
;
builder = builder.set_fixed_response_config(var_23);
}
,
s if s.matches("ForwardConfig") => {
let var_24 =
Some(
crate::protocol_serde::shape_forward_action_config::de_forward_action_config(&mut tag)
?
)
;
builder = builder.set_forward_config(var_24);
}
,
_ => {}
}
}
Ok(crate::serde_util::action_correct_errors(builder).build())
}