aws-sdk-licensemanager 1.95.0

AWS SDK for AWS License Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_create_license_configuration_input_input(
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::operation::create_license_configuration::CreateLicenseConfigurationInput,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    if let Some(var_1) = &input.name {
        object.key("Name").string(var_1.as_str());
    }
    if let Some(var_2) = &input.description {
        object.key("Description").string(var_2.as_str());
    }
    if let Some(var_3) = &input.license_counting_type {
        object.key("LicenseCountingType").string(var_3.as_str());
    }
    if let Some(var_4) = &input.license_count {
        object.key("LicenseCount").number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_4).into()),
        );
    }
    if let Some(var_5) = &input.license_count_hard_limit {
        object.key("LicenseCountHardLimit").boolean(*var_5);
    }
    if let Some(var_6) = &input.license_rules {
        let mut array_7 = object.key("LicenseRules").start_array();
        for item_8 in var_6 {
            {
                array_7.value().string(item_8.as_str());
            }
        }
        array_7.finish();
    }
    if let Some(var_9) = &input.tags {
        let mut array_10 = object.key("Tags").start_array();
        for item_11 in var_9 {
            {
                #[allow(unused_mut)]
                let mut object_12 = array_10.value().start_object();
                crate::protocol_serde::shape_tag::ser_tag(&mut object_12, item_11)?;
                object_12.finish();
            }
        }
        array_10.finish();
    }
    if let Some(var_13) = &input.disassociate_when_not_found {
        object.key("DisassociateWhenNotFound").boolean(*var_13);
    }
    if let Some(var_14) = &input.product_information_list {
        let mut array_15 = object.key("ProductInformationList").start_array();
        for item_16 in var_14 {
            {
                #[allow(unused_mut)]
                let mut object_17 = array_15.value().start_object();
                crate::protocol_serde::shape_product_information::ser_product_information(&mut object_17, item_16)?;
                object_17.finish();
            }
        }
        array_15.finish();
    }
    if let Some(var_18) = &input.license_expiry {
        object.key("LicenseExpiry").number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_18).into()),
        );
    }
    Ok(())
}