aws-sdk-cloudformation 1.117.0

AWS SDK for AWS CloudFormation
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(unused_mut)]
pub fn ser_deployment_config(
    mut writer: ::aws_smithy_query::QueryValueWriter,
    input: &crate::types::DeploymentConfig,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("Mode");
    if let Some(var_2) = &input.mode {
        scope_1.string(var_2.as_str());
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("DisableRollback");
    if let Some(var_4) = &input.disable_rollback {
        scope_3.boolean(*var_4);
    }
    Ok(())
}

#[allow(clippy::needless_question_mark)]
pub fn de_deployment_config(
    decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
    depth: u32,
) -> ::std::result::Result<crate::types::DeploymentConfig, ::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::DeploymentConfig::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("Mode") /* Mode com.amazonaws.cloudformation#DeploymentConfig$Mode */ =>  {
                let var_5 =
                    Some(
                        Result::<crate::types::DeploymentConfigMode, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::types::DeploymentConfigMode::from(
                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_mode(var_5);
            }
            ,
            s if s.matches("DisableRollback") /* DisableRollback com.amazonaws.cloudformation#DeploymentConfig$DisableRollback */ =>  {
                let var_6 =
                    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.cloudformation#DisableRollback`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_disable_rollback(var_6);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}