aws_sdk_sts/protocol_serde/
shape_assume_role_input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_assume_role_input_input_input(
    input: &crate::operation::assume_role::AssumeRoleInput,
) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
    let mut out = String::new();
    #[allow(unused_mut)]
    let mut writer = ::aws_smithy_query::QueryWriter::new(&mut out, "AssumeRole", "2011-06-15");
    #[allow(unused_mut)]
    let mut scope_1 = writer.prefix("RoleArn");
    if let Some(var_2) = &input.role_arn {
        scope_1.string(var_2);
    }
    #[allow(unused_mut)]
    let mut scope_3 = writer.prefix("RoleSessionName");
    if let Some(var_4) = &input.role_session_name {
        scope_3.string(var_4);
    }
    #[allow(unused_mut)]
    let mut scope_5 = writer.prefix("PolicyArns");
    if let Some(var_6) = &input.policy_arns {
        let mut list_8 = scope_5.start_list(false, None);
        for item_7 in var_6 {
            #[allow(unused_mut)]
            let mut entry_9 = list_8.entry();
            crate::protocol_serde::shape_policy_descriptor_type::ser_policy_descriptor_type(entry_9, item_7)?;
        }
        list_8.finish();
    }
    #[allow(unused_mut)]
    let mut scope_10 = writer.prefix("Policy");
    if let Some(var_11) = &input.policy {
        scope_10.string(var_11);
    }
    #[allow(unused_mut)]
    let mut scope_12 = writer.prefix("DurationSeconds");
    if let Some(var_13) = &input.duration_seconds {
        scope_12.number(
            #[allow(clippy::useless_conversion)]
            ::aws_smithy_types::Number::NegInt((*var_13).into()),
        );
    }
    #[allow(unused_mut)]
    let mut scope_14 = writer.prefix("Tags");
    if let Some(var_15) = &input.tags {
        let mut list_17 = scope_14.start_list(false, None);
        for item_16 in var_15 {
            #[allow(unused_mut)]
            let mut entry_18 = list_17.entry();
            crate::protocol_serde::shape_tag::ser_tag(entry_18, item_16)?;
        }
        list_17.finish();
    }
    #[allow(unused_mut)]
    let mut scope_19 = writer.prefix("TransitiveTagKeys");
    if let Some(var_20) = &input.transitive_tag_keys {
        let mut list_22 = scope_19.start_list(false, None);
        for item_21 in var_20 {
            #[allow(unused_mut)]
            let mut entry_23 = list_22.entry();
            entry_23.string(item_21);
        }
        list_22.finish();
    }
    #[allow(unused_mut)]
    let mut scope_24 = writer.prefix("ExternalId");
    if let Some(var_25) = &input.external_id {
        scope_24.string(var_25);
    }
    #[allow(unused_mut)]
    let mut scope_26 = writer.prefix("SerialNumber");
    if let Some(var_27) = &input.serial_number {
        scope_26.string(var_27);
    }
    #[allow(unused_mut)]
    let mut scope_28 = writer.prefix("TokenCode");
    if let Some(var_29) = &input.token_code {
        scope_28.string(var_29);
    }
    #[allow(unused_mut)]
    let mut scope_30 = writer.prefix("SourceIdentity");
    if let Some(var_31) = &input.source_identity {
        scope_30.string(var_31);
    }
    #[allow(unused_mut)]
    let mut scope_32 = writer.prefix("ProvidedContexts");
    if let Some(var_33) = &input.provided_contexts {
        let mut list_35 = scope_32.start_list(false, None);
        for item_34 in var_33 {
            #[allow(unused_mut)]
            let mut entry_36 = list_35.entry();
            crate::protocol_serde::shape_provided_context::ser_provided_context(entry_36, item_34)?;
        }
        list_35.finish();
    }
    writer.finish();
    Ok(::aws_smithy_types::body::SdkBody::from(out))
}