aws_sdk_sagemaker/protocol_serde/
shape_desired_weight_and_capacity.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_desired_weight_and_capacity(
3    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4    input: &crate::types::DesiredWeightAndCapacity,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6    if let Some(var_1) = &input.variant_name {
7        object.key("VariantName").string(var_1.as_str());
8    }
9    if let Some(var_2) = &input.desired_weight {
10        object.key("DesiredWeight").number(
11            #[allow(clippy::useless_conversion)]
12            ::aws_smithy_types::Number::Float((*var_2).into()),
13        );
14    }
15    if let Some(var_3) = &input.desired_instance_count {
16        object.key("DesiredInstanceCount").number(
17            #[allow(clippy::useless_conversion)]
18            ::aws_smithy_types::Number::NegInt((*var_3).into()),
19        );
20    }
21    if let Some(var_4) = &input.serverless_update_config {
22        #[allow(unused_mut)]
23        let mut object_5 = object.key("ServerlessUpdateConfig").start_object();
24        crate::protocol_serde::shape_production_variant_serverless_update_config::ser_production_variant_serverless_update_config(
25            &mut object_5,
26            var_4,
27        )?;
28        object_5.finish();
29    }
30    Ok(())
31}