aws_sdk_licensemanager/protocol_serde/
shape_create_license_configuration_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_create_license_configuration_input_input(
3    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4    input: &crate::operation::create_license_configuration::CreateLicenseConfigurationInput,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6    if let Some(var_1) = &input.name {
7        object.key("Name").string(var_1.as_str());
8    }
9    if let Some(var_2) = &input.description {
10        object.key("Description").string(var_2.as_str());
11    }
12    if let Some(var_3) = &input.license_counting_type {
13        object.key("LicenseCountingType").string(var_3.as_str());
14    }
15    if let Some(var_4) = &input.license_count {
16        object.key("LicenseCount").number(
17            #[allow(clippy::useless_conversion)]
18            ::aws_smithy_types::Number::NegInt((*var_4).into()),
19        );
20    }
21    if let Some(var_5) = &input.license_count_hard_limit {
22        object.key("LicenseCountHardLimit").boolean(*var_5);
23    }
24    if let Some(var_6) = &input.license_rules {
25        let mut array_7 = object.key("LicenseRules").start_array();
26        for item_8 in var_6 {
27            {
28                array_7.value().string(item_8.as_str());
29            }
30        }
31        array_7.finish();
32    }
33    if let Some(var_9) = &input.tags {
34        let mut array_10 = object.key("Tags").start_array();
35        for item_11 in var_9 {
36            {
37                #[allow(unused_mut)]
38                let mut object_12 = array_10.value().start_object();
39                crate::protocol_serde::shape_tag::ser_tag(&mut object_12, item_11)?;
40                object_12.finish();
41            }
42        }
43        array_10.finish();
44    }
45    if let Some(var_13) = &input.disassociate_when_not_found {
46        object.key("DisassociateWhenNotFound").boolean(*var_13);
47    }
48    if let Some(var_14) = &input.product_information_list {
49        let mut array_15 = object.key("ProductInformationList").start_array();
50        for item_16 in var_14 {
51            {
52                #[allow(unused_mut)]
53                let mut object_17 = array_15.value().start_object();
54                crate::protocol_serde::shape_product_information::ser_product_information(&mut object_17, item_16)?;
55                object_17.finish();
56            }
57        }
58        array_15.finish();
59    }
60    if let Some(var_18) = &input.license_expiry {
61        object.key("LicenseExpiry").number(
62            #[allow(clippy::useless_conversion)]
63            ::aws_smithy_types::Number::NegInt((*var_18).into()),
64        );
65    }
66    Ok(())
67}