aws_sdk_ec2/protocol_serde/
shape_import_key_pair_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_import_key_pair_input_input_input(
3    input: &crate::operation::import_key_pair::ImportKeyPairInput,
4) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
5    let mut out = String::new();
6    #[allow(unused_mut)]
7    let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "ImportKeyPair", "2016-11-15");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("TagSpecification");
10    if let Some(var_2) = &input.tag_specifications {
11        if !var_2.is_empty() {
12            let mut list_4 = scope_1.start_list(true, Some("item"));
13            for item_3 in var_2 {
14                #[allow(unused_mut)]
15                let mut entry_5 = list_4.entry();
16                crate::protocol_serde::shape_tag_specification::ser_tag_specification(entry_5, item_3)?;
17            }
18            list_4.finish();
19        }
20    }
21    #[allow(unused_mut)]
22    let mut scope_6 = writer.prefix("DryRun");
23    if let Some(var_7) = &input.dry_run {
24        scope_6.boolean(*var_7);
25    }
26    #[allow(unused_mut)]
27    let mut scope_8 = writer.prefix("KeyName");
28    if let Some(var_9) = &input.key_name {
29        scope_8.string(var_9);
30    }
31    #[allow(unused_mut)]
32    let mut scope_10 = writer.prefix("PublicKeyMaterial");
33    if let Some(var_11) = &input.public_key_material {
34        scope_10.string(&::aws_smithy_types::base64::encode(var_11));
35    }
36    writer.finish();
37    Ok(::aws_smithy_types::body::SdkBody::from(out))
38}