83 92 | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
84 93 | }
|
85 94 | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
86 95 | config_override,
|
87 96 | client_config.config.clone(),
|
88 97 | &client_config.runtime_components,
|
89 98 | ));
|
90 99 | }
|
91 100 | runtime_plugins
|
92 101 | }
|
102 + | /* OperationGenerator.kt:85 */
|
93 103 | }
|
104 + | /* OperationRuntimePluginGenerator.kt:55 */
|
94 105 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetServerStatistics {
|
95 106 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
96 107 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetServerStatistics");
|
97 108 |
|
98 109 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
99 110 | GetServerStatisticsRequestSerializer,
|
100 111 | ));
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
102 113 | GetServerStatisticsResponseDeserializer,
|
103 114 | ));
|
104 115 |
|
105 116 | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
106 117 | ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
|
107 118 | ));
|
108 119 |
|
109 120 | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
110 121 | "GetServerStatistics",
|
111 122 | "PokemonService",
|
112 123 | ));
|
113 124 |
|
114 125 | ::std::option::Option::Some(cfg.freeze())
|
115 126 | }
|
116 127 |
|
117 128 | fn runtime_components(
|
118 129 | &self,
|
119 130 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
120 131 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
121 132 | #[allow(unused_mut)]
|
122 133 | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetServerStatistics")
|
123 134 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
124 135 | .with_interceptor(GetServerStatisticsEndpointParamsInterceptor)
|
125 136 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
126 137 | crate::operation::get_server_statistics::GetServerStatisticsError,
|
127 138 | >::new())
|
128 139 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
129 140 | crate::operation::get_server_statistics::GetServerStatisticsError,
|
130 141 | >::new());
|
131 142 |
|
132 143 | ::std::borrow::Cow::Owned(rcb)
|
133 144 | }
|
134 145 | }
|
135 146 |
|
147 + | /* ResponseDeserializerGenerator.kt:64 */
|
136 148 | #[derive(Debug)]
|
137 149 | struct GetServerStatisticsResponseDeserializer;
|
138 150 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetServerStatisticsResponseDeserializer {
|
139 151 | fn deserialize_nonstreaming(
|
140 152 | &self,
|
141 153 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
142 154 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
143 155 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
144 156 | let headers = response.headers();
|
145 157 | let body = response.body().bytes().expect("body loaded");
|
146 158 | #[allow(unused_mut)]
|
147 159 | let mut force_error = false;
|
148 160 |
|
149 161 | let parse_result = if !success && status != 200 || force_error {
|
150 162 | crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_error(status, headers, body)
|
151 163 | } else {
|
152 164 | crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_response(status, headers, body)
|
153 165 | };
|
154 166 | crate::protocol_serde::type_erase_result(parse_result)
|
155 167 | }
|
156 168 | }
|
169 + | /* RequestSerializerGenerator.kt:67 */
|
157 170 | #[derive(Debug)]
|
158 171 | struct GetServerStatisticsRequestSerializer;
|
159 172 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetServerStatisticsRequestSerializer {
|
160 173 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
161 174 | fn serialize_input(
|
162 175 | &self,
|
163 176 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
164 177 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
165 178 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
166 179 | let input = input
|
167 180 | .downcast::<crate::operation::get_server_statistics::GetServerStatisticsInput>()
|
168 181 | .expect("correct type");
|
169 182 | let _header_serialization_settings = _cfg
|
170 183 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
171 184 | .cloned()
|
172 185 | .unwrap_or_default();
|
173 186 | let mut request_builder = {
|
174 187 | fn uri_base(
|
175 188 | _input: &crate::operation::get_server_statistics::GetServerStatisticsInput,
|
176 189 | output: &mut ::std::string::String,
|
177 190 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
178 191 | use ::std::fmt::Write as _;
|
179 192 | ::std::write!(output, "/").expect("formatting should succeed");
|
180 193 | ::std::result::Result::Ok(())
|
181 194 | }
|
182 195 | #[allow(clippy::unnecessary_wraps)]
|
183 196 | fn update_http_builder(
|
184 197 | input: &crate::operation::get_server_statistics::GetServerStatisticsInput,
|
185 198 | builder: ::http::request::Builder,
|
186 199 | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
187 200 | let mut uri = ::std::string::String::new();
|
188 201 | uri_base(input, &mut uri)?;
|
189 202 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
190 203 | }
|
191 204 | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
192 205 | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
193 206 | builder = _header_serialization_settings.set_default_header(
|
194 207 | builder,
|
195 208 | ::http::header::HeaderName::from_static("x-amz-target"),
|
196 209 | "PokemonService.GetServerStatistics",
|
197 210 | );
|
198 211 | builder
|
199 212 | };
|
200 213 | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_input(
|
201 214 | &input,
|
202 215 | )?);
|
203 216 |
|
204 217 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
205 218 | }
|
206 219 | }
|
220 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
207 221 | #[derive(Debug)]
|
208 222 | struct GetServerStatisticsEndpointParamsInterceptor;
|
209 223 |
|
210 224 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetServerStatisticsEndpointParamsInterceptor {
|
211 225 | fn name(&self) -> &'static str {
|
212 226 | "GetServerStatisticsEndpointParamsInterceptor"
|
213 227 | }
|
214 228 |
|
215 229 | fn read_before_execution(
|
216 230 | &self,
|
217 231 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
218 232 | '_,
|
219 233 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
220 234 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
221 235 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
222 236 | >,
|
223 237 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
224 238 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
225 239 | let _input = context
|
226 240 | .input()
|
227 241 | .downcast_ref::<GetServerStatisticsInput>()
|
228 242 | .ok_or("failed to downcast to GetServerStatisticsInput")?;
|
229 243 |
|
230 244 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
231 245 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
232 246 | })?;
|
233 247 | cfg.interceptor_state()
|
234 248 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
235 249 | ::std::result::Result::Ok(())
|
236 250 | }
|
237 251 | }
|
238 252 |
|
239 253 | // The get_* functions below are generated from JMESPath expressions in the
|
240 254 | // operationContextParams trait. They target the operation's input shape.
|
241 255 |
|
256 + | /* OperationErrorGenerator.kt:79 */
|
242 257 | /// Error type for the `GetServerStatisticsError` operation.
|
258 + | /* RustType.kt:516 */
|
243 259 | #[non_exhaustive]
|
260 + | /* RustType.kt:516 */
|
244 261 | #[derive(::std::fmt::Debug)]
|
245 - | pub enum GetServerStatisticsError {
|
262 + | pub /* OperationErrorGenerator.kt:81 */ enum GetServerStatisticsError {
|
263 + | /* OperationErrorGenerator.kt:88 */
|
246 264 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
247 265 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
248 266 | variable wildcard pattern and check `.code()`:
|
249 267 | \
|
250 268 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
251 269 | \
|
252 270 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetServerStatisticsError) for what information is available for the error.")]
|
253 271 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
272 + | /* OperationErrorGenerator.kt:81 */
|
254 273 | }
|
274 + | /* OperationErrorGenerator.kt:218 */
|
255 275 | impl GetServerStatisticsError {
|
276 + | /* OperationErrorGenerator.kt:219 */
|
256 277 | /// Creates the `GetServerStatisticsError::Unhandled` variant from any error type.
|
257 278 | pub fn unhandled(
|
258 279 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
259 280 | ) -> Self {
|
260 281 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
261 282 | source: err.into(),
|
262 283 | meta: ::std::default::Default::default(),
|
263 284 | })
|
264 285 | }
|
265 286 |
|
266 287 | /// Creates the `GetServerStatisticsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
267 288 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
268 289 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
269 290 | source: err.clone().into(),
|
270 291 | meta: err,
|
271 292 | })
|
272 293 | }
|
273 - | ///
|
294 + | /// /* OperationErrorGenerator.kt:236 */
|
274 295 | /// Returns error metadata, which includes the error code, message,
|
275 296 | /// request ID, and potentially additional information.
|
276 297 | ///
|
298 + | /* OperationErrorGenerator.kt:242 */
|
277 299 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
300 + | /* OperationErrorGenerator.kt:243 */
|
278 301 | match self {
|
279 - | Self::Unhandled(e) => &e.meta,
|
302 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
303 + | /* OperationErrorGenerator.kt:243 */
|
280 304 | }
|
305 + | /* OperationErrorGenerator.kt:242 */
|
281 306 | }
|
307 + | /* OperationErrorGenerator.kt:218 */
|
282 308 | }
|
309 + | /* OperationErrorGenerator.kt:269 */
|
283 310 | impl ::std::error::Error for GetServerStatisticsError {
|
311 + | /* OperationErrorGenerator.kt:270 */
|
284 312 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
313 + | /* OperationErrorGenerator.kt:318 */
|
285 314 | match self {
|
286 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
315 + | /* OperationErrorGenerator.kt:326 */
|
316 + | Self::Unhandled(_inner) => {
|
317 + | /* OperationErrorGenerator.kt:279 */
|
318 + | ::std::option::Option::Some(&*_inner.source)
|
319 + | /* OperationErrorGenerator.kt:326 */
|
320 + | } /* OperationErrorGenerator.kt:318 */
|
287 321 | }
|
322 + | /* OperationErrorGenerator.kt:270 */
|
288 323 | }
|
324 + | /* OperationErrorGenerator.kt:269 */
|
289 325 | }
|
326 + | /* OperationErrorGenerator.kt:133 */
|
290 327 | impl ::std::fmt::Display for GetServerStatisticsError {
|
328 + | /* OperationErrorGenerator.kt:134 */
|
291 329 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
330 + | /* OperationErrorGenerator.kt:318 */
|
292 331 | match self {
|
332 + | /* OperationErrorGenerator.kt:326 */
|
293 333 | Self::Unhandled(_inner) => {
|
334 + | /* OperationErrorGenerator.kt:139 */
|
294 335 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
295 336 | write!(f, "unhandled error ({code})")
|
296 337 | } else {
|
297 338 | f.write_str("unhandled error")
|
298 339 | }
|
299 - | }
|
340 + | /* OperationErrorGenerator.kt:326 */
|
341 + | } /* OperationErrorGenerator.kt:318 */
|
300 342 | }
|
343 + | /* OperationErrorGenerator.kt:134 */
|
301 344 | }
|
345 + | /* OperationErrorGenerator.kt:133 */
|
302 346 | }
|
347 + | /* OperationErrorGenerator.kt:182 */
|
303 348 | impl ::aws_smithy_types::retry::ProvideErrorKind for GetServerStatisticsError {
|
349 + | /* OperationErrorGenerator.kt:186 */
|
304 350 | fn code(&self) -> ::std::option::Option<&str> {
|
351 + | /* OperationErrorGenerator.kt:187 */
|
305 352 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
353 + | /* OperationErrorGenerator.kt:186 */
|
306 354 | }
|
355 + | /* OperationErrorGenerator.kt:190 */
|
307 356 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
357 + | /* OperationErrorGenerator.kt:197 */
|
308 358 | ::std::option::Option::None
|
359 + | /* OperationErrorGenerator.kt:190 */
|
309 360 | }
|
361 + | /* OperationErrorGenerator.kt:182 */
|
310 362 | }
|
363 + | /* OperationErrorGenerator.kt:163 */
|
311 364 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetServerStatisticsError {
|
365 + | /* OperationErrorGenerator.kt:164 */
|
312 366 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
367 + | /* OperationErrorGenerator.kt:318 */
|
313 368 | match self {
|
314 - | Self::Unhandled(_inner) => &_inner.meta,
|
369 + | /* OperationErrorGenerator.kt:326 */
|
370 + | Self::Unhandled(_inner) => {
|
371 + | /* OperationErrorGenerator.kt:168 */
|
372 + | &_inner.meta
|
373 + | /* OperationErrorGenerator.kt:326 */
|
374 + | } /* OperationErrorGenerator.kt:318 */
|
315 375 | }
|
376 + | /* OperationErrorGenerator.kt:164 */
|
316 377 | }
|
378 + | /* OperationErrorGenerator.kt:163 */
|
317 379 | }
|
380 + | /* OperationErrorGenerator.kt:109 */
|
318 381 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetServerStatisticsError {
|
382 + | /* OperationErrorGenerator.kt:110 */
|
319 383 | fn create_unhandled_error(
|
320 384 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
321 385 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
322 386 | ) -> Self {
|
387 + | /* OperationErrorGenerator.kt:121 */
|
323 388 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
324 389 | source,
|
325 390 | meta: meta.unwrap_or_default(),
|
326 391 | })
|
392 + | /* OperationErrorGenerator.kt:110 */
|
327 393 | }
|
394 + | /* OperationErrorGenerator.kt:109 */
|
328 395 | }
|
329 396 |
|
397 + | /* CodegenDelegator.kt:255 */
|
330 398 | pub use crate::operation::get_server_statistics::_get_server_statistics_output::GetServerStatisticsOutput;
|
331 399 |
|
400 + | /* CodegenDelegator.kt:255 */
|
332 401 | pub use crate::operation::get_server_statistics::_get_server_statistics_input::GetServerStatisticsInput;
|
333 402 |
|
403 + | /* RustModule.kt:172 */
|
334 404 | mod _get_server_statistics_input;
|
335 405 |
|
406 + | /* RustModule.kt:172 */
|
336 407 | mod _get_server_statistics_output;
|
337 408 |
|
338 - | /// Builders
|
409 + | /// /* CodegenDelegator.kt:51 */Builders
|
339 410 | pub mod builders;
|