pub fn ser_create_stack_input_input_input(
input: &crate::operation::create_stack::CreateStackInput,
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
let mut out = String::new();
#[allow(unused_mut)]
let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "CreateStack", "2010-05-15");
#[allow(unused_mut)]
let mut scope_1 = writer.prefix("StackName");
if let Some(var_2) = &input.stack_name {
scope_1.string(var_2);
}
#[allow(unused_mut)]
let mut scope_3 = writer.prefix("TemplateBody");
if let Some(var_4) = &input.template_body {
scope_3.string(var_4);
}
#[allow(unused_mut)]
let mut scope_5 = writer.prefix("TemplateURL");
if let Some(var_6) = &input.template_url {
scope_5.string(var_6);
}
#[allow(unused_mut)]
let mut scope_7 = writer.prefix("Parameters");
if let Some(var_8) = &input.parameters {
let mut list_10 = scope_7.start_list(false, None);
for item_9 in var_8 {
#[allow(unused_mut)]
let mut entry_11 = list_10.entry();
crate::protocol_serde::shape_parameter::ser_parameter(entry_11, item_9)?;
}
list_10.finish();
}
#[allow(unused_mut)]
let mut scope_12 = writer.prefix("DisableRollback");
if let Some(var_13) = &input.disable_rollback {
scope_12.boolean(*var_13);
}
#[allow(unused_mut)]
let mut scope_14 = writer.prefix("RollbackConfiguration");
if let Some(var_15) = &input.rollback_configuration {
crate::protocol_serde::shape_rollback_configuration::ser_rollback_configuration(scope_14, var_15)?;
}
#[allow(unused_mut)]
let mut scope_16 = writer.prefix("TimeoutInMinutes");
if let Some(var_17) = &input.timeout_in_minutes {
scope_16.number(
#[allow(clippy::useless_conversion)]
::aws_smithy_types::Number::NegInt((*var_17).into()),
);
}
#[allow(unused_mut)]
let mut scope_18 = writer.prefix("NotificationARNs");
if let Some(var_19) = &input.notification_arns {
let mut list_21 = scope_18.start_list(false, None);
for item_20 in var_19 {
#[allow(unused_mut)]
let mut entry_22 = list_21.entry();
entry_22.string(item_20);
}
list_21.finish();
}
#[allow(unused_mut)]
let mut scope_23 = writer.prefix("Capabilities");
if let Some(var_24) = &input.capabilities {
let mut list_26 = scope_23.start_list(false, None);
for item_25 in var_24 {
#[allow(unused_mut)]
let mut entry_27 = list_26.entry();
entry_27.string(item_25.as_str());
}
list_26.finish();
}
#[allow(unused_mut)]
let mut scope_28 = writer.prefix("ResourceTypes");
if let Some(var_29) = &input.resource_types {
let mut list_31 = scope_28.start_list(false, None);
for item_30 in var_29 {
#[allow(unused_mut)]
let mut entry_32 = list_31.entry();
entry_32.string(item_30);
}
list_31.finish();
}
#[allow(unused_mut)]
let mut scope_33 = writer.prefix("RoleARN");
if let Some(var_34) = &input.role_arn {
scope_33.string(var_34);
}
#[allow(unused_mut)]
let mut scope_35 = writer.prefix("OnFailure");
if let Some(var_36) = &input.on_failure {
scope_35.string(var_36.as_str());
}
#[allow(unused_mut)]
let mut scope_37 = writer.prefix("StackPolicyBody");
if let Some(var_38) = &input.stack_policy_body {
scope_37.string(var_38);
}
#[allow(unused_mut)]
let mut scope_39 = writer.prefix("StackPolicyURL");
if let Some(var_40) = &input.stack_policy_url {
scope_39.string(var_40);
}
#[allow(unused_mut)]
let mut scope_41 = writer.prefix("Tags");
if let Some(var_42) = &input.tags {
let mut list_44 = scope_41.start_list(false, None);
for item_43 in var_42 {
#[allow(unused_mut)]
let mut entry_45 = list_44.entry();
crate::protocol_serde::shape_tag::ser_tag(entry_45, item_43)?;
}
list_44.finish();
}
#[allow(unused_mut)]
let mut scope_46 = writer.prefix("ClientRequestToken");
if let Some(var_47) = &input.client_request_token {
scope_46.string(var_47);
}
#[allow(unused_mut)]
let mut scope_48 = writer.prefix("EnableTerminationProtection");
if let Some(var_49) = &input.enable_termination_protection {
scope_48.boolean(*var_49);
}
#[allow(unused_mut)]
let mut scope_50 = writer.prefix("RetainExceptOnCreate");
if let Some(var_51) = &input.retain_except_on_create {
scope_50.boolean(*var_51);
}
writer.finish();
Ok(::aws_smithy_types::body::SdkBody::from(out))
}