1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetCrawlerMetrics;
6impl GetCrawlerMetrics {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_crawler_metrics::GetCrawlerMetricsInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_crawler_metrics::GetCrawlerMetricsOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::get_crawler_metrics::GetCrawlerMetricsInput,
18 ) -> ::std::result::Result<
19 crate::operation::get_crawler_metrics::GetCrawlerMetricsOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::get_crawler_metrics::GetCrawlerMetricsError,
22 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
23 >,
24 > {
25 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
26 ::aws_smithy_runtime_api::client::interceptors::context::Error,
27 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
28 >| {
29 err.map_service_error(|err| {
30 err.downcast::<crate::operation::get_crawler_metrics::GetCrawlerMetricsError>()
31 .expect("correct error type")
32 })
33 };
34 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
35 .await
36 .map_err(map_err)?;
37 let output = context.finalize().map_err(map_err)?;
38 ::std::result::Result::Ok(
39 output
40 .downcast::<crate::operation::get_crawler_metrics::GetCrawlerMetricsOutput>()
41 .expect("correct output type"),
42 )
43 }
44
45 pub(crate) async fn orchestrate_with_stop_point(
46 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
47 input: crate::operation::get_crawler_metrics::GetCrawlerMetricsInput,
48 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
49 ) -> ::std::result::Result<
50 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
51 ::aws_smithy_runtime_api::client::result::SdkError<
52 ::aws_smithy_runtime_api::client::interceptors::context::Error,
53 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
54 >,
55 > {
56 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
57 use ::tracing::Instrument;
58 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Glue", "GetCrawlerMetrics", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Glue.GetCrawlerMetrics",
63 "rpc.service" = "Glue",
64 "rpc.method" = "GetCrawlerMetrics",
65 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
66 "rpc.system" = "aws-api",
67 ))
68 .await
69 }
70
71 pub(crate) fn operation_runtime_plugins(
72 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
73 client_config: &crate::config::Config,
74 config_override: ::std::option::Option<crate::config::Builder>,
75 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
76 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
77
78 if let ::std::option::Option::Some(config_override) = config_override {
79 for plugin in config_override.runtime_plugins.iter().cloned() {
80 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
81 }
82 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
83 config_override,
84 client_config.config.clone(),
85 &client_config.runtime_components,
86 ));
87 }
88 runtime_plugins
89 }
90}
91pub(crate) mod error_registry {
100 pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
101 ::aws_smithy_schema::registry::TypeRegistry::builder()
102 .insert_error_shape(
103 crate::types::error::OperationTimeoutException::SCHEMA,
104 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
105 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
106 },
107 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
108 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
109 },
110 )
111 .build()
112 });
113}
114impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCrawlerMetrics {
115 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
116 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetCrawlerMetrics");
117
118 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
119 GetCrawlerMetricsRequestSerializer,
120 ));
121 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
122 GetCrawlerMetricsResponseDeserializer,
123 ));
124
125 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
126 crate::config::auth::Params::builder()
127 .operation_name("GetCrawlerMetrics")
128 .build()
129 .expect("required fields set"),
130 ));
131
132 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetCrawlerMetrics", "Glue"));
133 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
134 signing_options.double_uri_encode = true;
135 signing_options.content_sha256_header = false;
136 signing_options.normalize_uri_path = true;
137 signing_options.payload_override = None;
138
139 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
140 signing_options,
141 ..::std::default::Default::default()
142 });
143
144 ::std::option::Option::Some(cfg.freeze())
145 }
146
147 fn runtime_components(
148 &self,
149 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
150 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
151 #[allow(unused_mut)]
152 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetCrawlerMetrics")
153 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
154 GetCrawlerMetricsTelemetryInputCaptureInterceptor,
155 ))
156 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
157 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
158 ))
159 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
160 GetCrawlerMetricsEndpointParamsInterceptor,
161 ))
162 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
163 crate::operation::get_crawler_metrics::GetCrawlerMetricsError,
164 >::new())
165 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
166 crate::operation::get_crawler_metrics::GetCrawlerMetricsError,
167 >::new())
168 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
169 crate::operation::get_crawler_metrics::GetCrawlerMetricsError,
170 >::new())
171 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
172 crate::operation::get_crawler_metrics::GetCrawlerMetricsError,
173 >::new());
174
175 ::std::borrow::Cow::Owned(rcb)
176 }
177}
178
179#[derive(Debug)]
180struct GetCrawlerMetricsTelemetryInputCaptureInterceptor;
181
182#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
183impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetCrawlerMetricsTelemetryInputCaptureInterceptor {
184 fn name(&self) -> &'static str {
185 "GetCrawlerMetricsTelemetryInputCaptureInterceptor"
186 }
187
188 fn read_before_execution(
189 &self,
190 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
191 '_,
192 ::aws_smithy_runtime_api::client::interceptors::context::Input,
193 ::aws_smithy_runtime_api::client::interceptors::context::Output,
194 ::aws_smithy_runtime_api::client::interceptors::context::Error,
195 >,
196 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
197 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
198 let ::std::option::Option::Some(requested) = cfg
200 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
201 .filter(|r| !r.is_empty())
202 else {
203 return ::std::result::Result::Ok(());
204 };
205
206 let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetCrawlerMetricsInput>() else {
207 return ::std::result::Result::Ok(());
209 };
210
211 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
212 if requested.should_capture("NextToken") {
213 if let ::std::option::Option::Some(value) = input.next_token.as_deref() {
214 captured.insert("NextToken", value);
215 }
216 }
217
218 cfg.interceptor_state().store_put(captured);
219 ::std::result::Result::Ok(())
220 }
221}
222#[derive(Debug)]
223struct GetCrawlerMetricsResponseDeserializer;
224impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetCrawlerMetricsResponseDeserializer {
225 fn deserialize_nonstreaming_with_config(
226 &self,
227 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
228 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
229 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
230 let (success, status) = (response.status().is_success(), response.status().as_u16());
231 #[allow(unused_variables)]
236 let body = response.body().bytes().expect("body loaded");
237 let headers = response.headers();
238 #[allow(unused_mut)]
239 let mut force_error = false;
240 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
241 if !success && status != 200 || force_error {
242 let protocol = _cfg
243 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
244 .expect("a SharedClientProtocol is required");
245 #[allow(unused_mut)]
246 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
247 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
248 })?;
249 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
250 let generic = generic_builder.build();
251 let error_code = match generic.code() {
252 ::std::option::Option::Some(code) => code,
253 ::std::option::Option::None => {
254 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
255 ::aws_smithy_runtime_api::box_error::BoxError::from(
256 crate::operation::get_crawler_metrics::GetCrawlerMetricsError::unhandled(generic),
257 ),
258 ))
259 }
260 };
261 let _error_message = generic.message().map(|msg| msg.to_owned());
262 let err = match error_code {
263 "OperationTimeoutException" => crate::operation::get_crawler_metrics::GetCrawlerMetricsError::OperationTimeoutException({
264 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
265 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
266 e,
267 ))
268 })?;
269 let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
270 tmp.deserialize_members(&mut *deser).map_err(|e| {
271 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
272 e,
273 ))
274 })?;
275 if tmp.message.is_none() {
276 tmp.message = _error_message;
277 }
278 let tmp = tmp.meta(generic);
279 tmp.build()
280 }),
281 _ => {
282 match protocol
290 .deserialize_error_response(response, _cfg)
291 .ok()
292 .and_then(|mut deser| {
293 ::aws_smithy_schema::registry::reify_error(
294 crate::operation::get_crawler_metrics::error_registry::REGISTRY
295 .or(&crate::error_type_registry::REGISTRY),
296 error_code,
297 &mut *deser,
298 )
299 }) {
300 ::std::option::Option::Some(source) => <crate::operation::get_crawler_metrics::GetCrawlerMetricsError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
301 ::std::option::Option::None => crate::operation::get_crawler_metrics::GetCrawlerMetricsError::generic(generic),
302 }
303 }
304 };
305 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
306 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
307 ))
308 } else {
309 let protocol = _cfg
310 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
311 .expect("a SharedClientProtocol is required");
312 let mut deser = protocol
313 .deserialize_response(response, GetCrawlerMetrics::OUTPUT_SCHEMA, _cfg)
314 .map_err(|e| {
315 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
316 })?;
317 let _response_headers = headers;
321 #[allow(unused_mut)]
325 let mut output = <crate::operation::get_crawler_metrics::builders::GetCrawlerMetricsOutputBuilder>::default();
326 output.deserialize_members(&mut *deser).map_err(|e| {
327 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
328 })?;
329 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
330 let output = output.build();
331 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
332 }
333 }
334}
335#[derive(Debug)]
336struct GetCrawlerMetricsRequestSerializer;
337impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetCrawlerMetricsRequestSerializer {
338 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
339 fn serialize_input(
340 &self,
341 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
342 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
343 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
344 let input = input
345 .downcast::<crate::operation::get_crawler_metrics::GetCrawlerMetricsInput>()
346 .expect("correct type");
347
348 let protocol = _cfg
349 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
350 .expect("a SharedClientProtocol is required");
351 let mut request = protocol
352 .serialize_request(&input, GetCrawlerMetrics::INPUT_SCHEMA, "/", _cfg)
353 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
354
355 return ::std::result::Result::Ok(request);
356 }
357}
358#[derive(Debug)]
359struct GetCrawlerMetricsEndpointParamsInterceptor;
360
361#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
362impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetCrawlerMetricsEndpointParamsInterceptor {
363 fn name(&self) -> &'static str {
364 "GetCrawlerMetricsEndpointParamsInterceptor"
365 }
366
367 fn read_before_execution(
368 &self,
369 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
370 '_,
371 ::aws_smithy_runtime_api::client::interceptors::context::Input,
372 ::aws_smithy_runtime_api::client::interceptors::context::Output,
373 ::aws_smithy_runtime_api::client::interceptors::context::Error,
374 >,
375 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
376 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
377 let _input = context
378 .input()
379 .downcast_ref::<GetCrawlerMetricsInput>()
380 .ok_or("failed to downcast to GetCrawlerMetricsInput")?;
381
382 let params = crate::config::endpoint::Params::builder()
383 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
384 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
385 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
386 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
387 .build()
388 .map_err(|err| {
389 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
390 })?;
391 cfg.interceptor_state()
392 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
393 ::std::result::Result::Ok(())
394 }
395}
396
397#[non_exhaustive]
402#[derive(::std::fmt::Debug)]
403pub enum GetCrawlerMetricsError {
404 OperationTimeoutException(crate::types::error::OperationTimeoutException),
406 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
408 variable wildcard pattern and check `.code()`:
409 \
410 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
411 \
412 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetCrawlerMetricsError) for what information is available for the error.")]
413 Unhandled(crate::error::sealed_unhandled::Unhandled),
414}
415impl GetCrawlerMetricsError {
416 pub fn unhandled(
418 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
419 ) -> Self {
420 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
421 source: err.into(),
422 meta: ::std::default::Default::default(),
423 })
424 }
425
426 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
428 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
429 source: err.clone().into(),
430 meta: err,
431 })
432 }
433 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
438 match self {
439 Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::Unhandled(e) => &e.meta,
441 }
442 }
443 pub fn is_operation_timeout_exception(&self) -> bool {
445 matches!(self, Self::OperationTimeoutException(_))
446 }
447}
448impl ::std::error::Error for GetCrawlerMetricsError {
449 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
450 match self {
451 Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
452 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
453 }
454 }
455}
456impl ::std::fmt::Display for GetCrawlerMetricsError {
457 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
458 match self {
459 Self::OperationTimeoutException(_inner) => _inner.fmt(f),
460 Self::Unhandled(_inner) => {
461 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
462 write!(f, "unhandled error ({code})")
463 } else {
464 f.write_str("unhandled error")
465 }
466 }
467 }
468 }
469}
470impl ::aws_smithy_types::retry::ProvideErrorKind for GetCrawlerMetricsError {
471 fn code(&self) -> ::std::option::Option<&str> {
472 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
473 }
474 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
475 ::std::option::Option::None
476 }
477}
478impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetCrawlerMetricsError {
479 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
480 match self {
481 Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
482 Self::Unhandled(_inner) => &_inner.meta,
483 }
484 }
485}
486impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetCrawlerMetricsError {
487 fn create_unhandled_error(
488 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
489 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
490 ) -> Self {
491 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
492 source,
493 meta: meta.unwrap_or_default(),
494 })
495 }
496}
497impl ::aws_types::request_id::RequestId for crate::operation::get_crawler_metrics::GetCrawlerMetricsError {
498 fn request_id(&self) -> Option<&str> {
499 self.meta().request_id()
500 }
501}
502
503pub use crate::operation::get_crawler_metrics::_get_crawler_metrics_input::GetCrawlerMetricsInput;
504
505pub use crate::operation::get_crawler_metrics::_get_crawler_metrics_output::GetCrawlerMetricsOutput;
506
507mod _get_crawler_metrics_input;
508
509mod _get_crawler_metrics_output;
510
511pub mod builders;
513
514pub mod paginator;