aws_sdk_ecs/protocol_serde/
shape_update_task_protection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_update_task_protection_input_input(
3    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4    input: &crate::operation::update_task_protection::UpdateTaskProtectionInput,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6    if let Some(var_1) = &input.cluster {
7        object.key("cluster").string(var_1.as_str());
8    }
9    if let Some(var_2) = &input.tasks {
10        let mut array_3 = object.key("tasks").start_array();
11        for item_4 in var_2 {
12            {
13                array_3.value().string(item_4.as_str());
14            }
15        }
16        array_3.finish();
17    }
18    if let Some(var_5) = &input.protection_enabled {
19        object.key("protectionEnabled").boolean(*var_5);
20    }
21    if let Some(var_6) = &input.expires_in_minutes {
22        object.key("expiresInMinutes").number(
23            #[allow(clippy::useless_conversion)]
24            ::aws_smithy_types::Number::NegInt((*var_6).into()),
25        );
26    }
27    Ok(())
28}