aws_sdk_sts/
sdk_feature_tracker.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

#[allow(dead_code)]
pub(crate) mod rpc_v2_cbor {
    use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
    use aws_smithy_runtime_api::box_error::BoxError;
    use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut;
    use aws_smithy_runtime_api::client::interceptors::Intercept;
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
    use aws_smithy_types::config_bag::ConfigBag;

    #[derive(Debug)]
    pub(crate) struct RpcV2CborFeatureTrackerInterceptor;

    impl RpcV2CborFeatureTrackerInterceptor {
        pub(crate) fn new() -> Self {
            Self
        }
    }

    impl Intercept for RpcV2CborFeatureTrackerInterceptor {
        fn name(&self) -> &'static str {
            "RpcV2CborFeatureTrackerInterceptor"
        }

        fn modify_before_serialization(
            &self,
            _context: &mut BeforeSerializationInterceptorContextMut<'_>,
            _runtime_components: &RuntimeComponents,
            cfg: &mut ConfigBag,
        ) -> Result<(), BoxError> {
            cfg.interceptor_state()
                .store_append::<SmithySdkFeature>(SmithySdkFeature::ProtocolRpcV2Cbor);
            Ok(())
        }
    }
}

#[allow(dead_code)]
pub(crate) mod paginator {
    use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
    use aws_smithy_runtime_api::box_error::BoxError;
    use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut;
    use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor};
    use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder};
    use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
    use aws_smithy_types::config_bag::ConfigBag;
    use std::borrow::Cow;

    #[derive(Debug)]
    struct PaginatorFeatureTrackerInterceptor;

    impl PaginatorFeatureTrackerInterceptor {
        pub(crate) fn new() -> Self {
            Self
        }
    }

    impl Intercept for PaginatorFeatureTrackerInterceptor {
        fn name(&self) -> &'static str {
            "PaginatorFeatureTrackerInterceptor"
        }

        fn modify_before_serialization(
            &self,
            _context: &mut BeforeSerializationInterceptorContextMut<'_>,
            _runtime_components: &RuntimeComponents,
            cfg: &mut ConfigBag,
        ) -> Result<(), BoxError> {
            cfg.interceptor_state().store_append::<SmithySdkFeature>(SmithySdkFeature::Paginator);
            Ok(())
        }
    }

    #[derive(Debug)]
    pub(crate) struct PaginatorFeatureTrackerRuntimePlugin {
        runtime_components: RuntimeComponentsBuilder,
    }

    impl PaginatorFeatureTrackerRuntimePlugin {
        pub(crate) fn new() -> Self {
            Self {
                runtime_components: RuntimeComponentsBuilder::new("PaginatorFeatureTrackerRuntimePlugin")
                    .with_interceptor(SharedInterceptor::new(PaginatorFeatureTrackerInterceptor::new())),
            }
        }
    }

    impl RuntimePlugin for PaginatorFeatureTrackerRuntimePlugin {
        fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> {
            Cow::Borrowed(&self.runtime_components)
        }
    }
}

#[allow(dead_code)]
pub(crate) mod waiter {
    use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
    use aws_smithy_runtime_api::box_error::BoxError;
    use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut;
    use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor};
    use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder};
    use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
    use aws_smithy_types::config_bag::ConfigBag;
    use std::borrow::Cow;

    #[derive(Debug)]
    struct WaiterFeatureTrackerInterceptor;

    impl WaiterFeatureTrackerInterceptor {
        pub(crate) fn new() -> Self {
            Self
        }
    }

    impl Intercept for WaiterFeatureTrackerInterceptor {
        fn name(&self) -> &'static str {
            "WaiterFeatureTrackerInterceptor"
        }

        fn modify_before_serialization(
            &self,
            _context: &mut BeforeSerializationInterceptorContextMut<'_>,
            _runtime_components: &RuntimeComponents,
            cfg: &mut ConfigBag,
        ) -> Result<(), BoxError> {
            cfg.interceptor_state().store_append::<SmithySdkFeature>(SmithySdkFeature::Waiter);
            Ok(())
        }
    }

    #[derive(Debug)]
    pub(crate) struct WaiterFeatureTrackerRuntimePlugin {
        runtime_components: RuntimeComponentsBuilder,
    }

    impl WaiterFeatureTrackerRuntimePlugin {
        pub(crate) fn new() -> Self {
            Self {
                runtime_components: RuntimeComponentsBuilder::new("WaiterFeatureTrackerRuntimePlugin")
                    .with_interceptor(SharedInterceptor::new(WaiterFeatureTrackerInterceptor::new())),
            }
        }
    }

    impl RuntimePlugin for WaiterFeatureTrackerRuntimePlugin {
        fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> {
            Cow::Borrowed(&self.runtime_components)
        }
    }
}

#[allow(dead_code)]
pub(crate) mod retry_mode {
    use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
    use aws_smithy_runtime_api::box_error::BoxError;
    use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef;
    use aws_smithy_runtime_api::client::interceptors::Intercept;
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
    use aws_smithy_types::config_bag::ConfigBag;
    use aws_smithy_types::retry::{RetryConfig, RetryMode};

    #[derive(Debug)]
    pub(crate) struct RetryModeFeatureTrackerInterceptor;

    impl RetryModeFeatureTrackerInterceptor {
        pub(crate) fn new() -> Self {
            Self
        }
    }

    impl Intercept for RetryModeFeatureTrackerInterceptor {
        fn name(&self) -> &'static str {
            "RetryModeFeatureTrackerInterceptor"
        }

        fn read_before_serialization(
            &self,
            _context: &BeforeSerializationInterceptorContextRef<'_>,
            _runtime_components: &RuntimeComponents,
            cfg: &mut ConfigBag,
        ) -> Result<(), BoxError> {
            cfg.load::<RetryConfig>()
                .map(|retry_config| match retry_config.mode() {
                    RetryMode::Standard => SmithySdkFeature::RetryModeStandard,
                    RetryMode::Adaptive => SmithySdkFeature::RetryModeAdaptive,
                    _ => unreachable!("retry mode must be standard or adaptive"),
                })
                .map(|feature| cfg.interceptor_state().store_append::<SmithySdkFeature>(feature));

            Ok(())
        }
    }
}