aws_sdk_redshift/protocol_serde/
shape_create_snapshot_schedule_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub fn ser_create_snapshot_schedule_input_input_input(
3    input: &crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput,
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, "CreateSnapshotSchedule", "2012-12-01");
8    #[allow(unused_mut)]
9    let mut scope_1 = writer.prefix("ScheduleDefinitions");
10    if let Some(var_2) = &input.schedule_definitions {
11        let mut list_4 = scope_1.start_list(false, Some("ScheduleDefinition"));
12        for item_3 in var_2 {
13            #[allow(unused_mut)]
14            let mut entry_5 = list_4.entry();
15            entry_5.string(item_3);
16        }
17        list_4.finish();
18    }
19    #[allow(unused_mut)]
20    let mut scope_6 = writer.prefix("ScheduleIdentifier");
21    if let Some(var_7) = &input.schedule_identifier {
22        scope_6.string(var_7);
23    }
24    #[allow(unused_mut)]
25    let mut scope_8 = writer.prefix("ScheduleDescription");
26    if let Some(var_9) = &input.schedule_description {
27        scope_8.string(var_9);
28    }
29    #[allow(unused_mut)]
30    let mut scope_10 = writer.prefix("Tags");
31    if let Some(var_11) = &input.tags {
32        let mut list_13 = scope_10.start_list(false, Some("Tag"));
33        for item_12 in var_11 {
34            #[allow(unused_mut)]
35            let mut entry_14 = list_13.entry();
36            crate::protocol_serde::shape_tag::ser_tag(entry_14, item_12)?;
37        }
38        list_13.finish();
39    }
40    #[allow(unused_mut)]
41    let mut scope_15 = writer.prefix("DryRun");
42    if let Some(var_16) = &input.dry_run {
43        scope_15.boolean(*var_16);
44    }
45    #[allow(unused_mut)]
46    let mut scope_17 = writer.prefix("NextInvocations");
47    if let Some(var_18) = &input.next_invocations {
48        scope_17.number(
49            #[allow(clippy::useless_conversion)]
50            ::aws_smithy_types::Number::NegInt((*var_18).into()),
51        );
52    }
53    writer.finish();
54    Ok(::aws_smithy_types::body::SdkBody::from(out))
55}