1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetCrawlers;
6impl GetCrawlers {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_crawlers::GetCrawlersInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_crawlers::GetCrawlersOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::get_crawlers::GetCrawlersInput,
18 ) -> ::std::result::Result<
19 crate::operation::get_crawlers::GetCrawlersOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::get_crawlers::GetCrawlersError,
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_crawlers::GetCrawlersError>()
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_crawlers::GetCrawlersOutput>()
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_crawlers::GetCrawlersInput,
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", "GetCrawlers", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Glue.GetCrawlers",
63 "rpc.service" = "Glue",
64 "rpc.method" = "GetCrawlers",
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 GetCrawlers {
115 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
116 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetCrawlers");
117
118 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
119 GetCrawlersRequestSerializer,
120 ));
121 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
122 GetCrawlersResponseDeserializer,
123 ));
124
125 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
126 crate::config::auth::Params::builder()
127 .operation_name("GetCrawlers")
128 .build()
129 .expect("required fields set"),
130 ));
131
132 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetCrawlers", "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("GetCrawlers")
153 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
154 GetCrawlersTelemetryInputCaptureInterceptor,
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 GetCrawlersEndpointParamsInterceptor,
161 ))
162 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
163 crate::operation::get_crawlers::GetCrawlersError,
164 >::new())
165 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
166 crate::operation::get_crawlers::GetCrawlersError,
167 >::new())
168 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
169 crate::operation::get_crawlers::GetCrawlersError,
170 >::new())
171 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
172 crate::operation::get_crawlers::GetCrawlersError,
173 >::new());
174
175 ::std::borrow::Cow::Owned(rcb)
176 }
177}
178
179#[derive(Debug)]
180struct GetCrawlersTelemetryInputCaptureInterceptor;
181
182#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
183impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetCrawlersTelemetryInputCaptureInterceptor {
184 fn name(&self) -> &'static str {
185 "GetCrawlersTelemetryInputCaptureInterceptor"
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::<GetCrawlersInput>() 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 GetCrawlersResponseDeserializer;
224impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetCrawlersResponseDeserializer {
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(crate::operation::get_crawlers::GetCrawlersError::unhandled(generic)),
256 ))
257 }
258 };
259 let _error_message = generic.message().map(|msg| msg.to_owned());
260 let err = match error_code {
261 "OperationTimeoutException" => crate::operation::get_crawlers::GetCrawlersError::OperationTimeoutException({
262 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
263 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
264 e,
265 ))
266 })?;
267 let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
268 tmp.deserialize_members(&mut *deser).map_err(|e| {
269 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
270 e,
271 ))
272 })?;
273 if tmp.message.is_none() {
274 tmp.message = _error_message;
275 }
276 let tmp = tmp.meta(generic);
277 tmp.build()
278 }),
279 _ => {
280 match protocol
288 .deserialize_error_response(response, _cfg)
289 .ok()
290 .and_then(|mut deser| {
291 ::aws_smithy_schema::registry::reify_error(
292 crate::operation::get_crawlers::error_registry::REGISTRY
293 .or(&crate::error_type_registry::REGISTRY),
294 error_code,
295 &mut *deser,
296 )
297 }) {
298 ::std::option::Option::Some(source) => <crate::operation::get_crawlers::GetCrawlersError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
299 ::std::option::Option::None => crate::operation::get_crawlers::GetCrawlersError::generic(generic),
300 }
301 }
302 };
303 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
304 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
305 ))
306 } else {
307 let protocol = _cfg
308 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
309 .expect("a SharedClientProtocol is required");
310 let mut deser = protocol.deserialize_response(response, GetCrawlers::OUTPUT_SCHEMA, _cfg).map_err(|e| {
311 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
312 })?;
313 let _response_headers = headers;
317 #[allow(unused_mut)]
321 let mut output = <crate::operation::get_crawlers::builders::GetCrawlersOutputBuilder>::default();
322 output.deserialize_members(&mut *deser).map_err(|e| {
323 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
324 })?;
325 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
326 let output = output.build();
327 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
328 }
329 }
330}
331#[derive(Debug)]
332struct GetCrawlersRequestSerializer;
333impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetCrawlersRequestSerializer {
334 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
335 fn serialize_input(
336 &self,
337 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
338 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
339 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
340 let input = input
341 .downcast::<crate::operation::get_crawlers::GetCrawlersInput>()
342 .expect("correct type");
343
344 let protocol = _cfg
345 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
346 .expect("a SharedClientProtocol is required");
347 let mut request = protocol
348 .serialize_request(&input, GetCrawlers::INPUT_SCHEMA, "/", _cfg)
349 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
350
351 return ::std::result::Result::Ok(request);
352 }
353}
354#[derive(Debug)]
355struct GetCrawlersEndpointParamsInterceptor;
356
357#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
358impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetCrawlersEndpointParamsInterceptor {
359 fn name(&self) -> &'static str {
360 "GetCrawlersEndpointParamsInterceptor"
361 }
362
363 fn read_before_execution(
364 &self,
365 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
366 '_,
367 ::aws_smithy_runtime_api::client::interceptors::context::Input,
368 ::aws_smithy_runtime_api::client::interceptors::context::Output,
369 ::aws_smithy_runtime_api::client::interceptors::context::Error,
370 >,
371 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
372 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
373 let _input = context
374 .input()
375 .downcast_ref::<GetCrawlersInput>()
376 .ok_or("failed to downcast to GetCrawlersInput")?;
377
378 let params = crate::config::endpoint::Params::builder()
379 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
380 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
381 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
382 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
383 .build()
384 .map_err(|err| {
385 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
386 })?;
387 cfg.interceptor_state()
388 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
389 ::std::result::Result::Ok(())
390 }
391}
392
393#[non_exhaustive]
398#[derive(::std::fmt::Debug)]
399pub enum GetCrawlersError {
400 OperationTimeoutException(crate::types::error::OperationTimeoutException),
402 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
404 variable wildcard pattern and check `.code()`:
405 \
406 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
407 \
408 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetCrawlersError) for what information is available for the error.")]
409 Unhandled(crate::error::sealed_unhandled::Unhandled),
410}
411impl GetCrawlersError {
412 pub fn unhandled(
414 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
415 ) -> Self {
416 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
417 source: err.into(),
418 meta: ::std::default::Default::default(),
419 })
420 }
421
422 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
424 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
425 source: err.clone().into(),
426 meta: err,
427 })
428 }
429 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
434 match self {
435 Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::Unhandled(e) => &e.meta,
437 }
438 }
439 pub fn is_operation_timeout_exception(&self) -> bool {
441 matches!(self, Self::OperationTimeoutException(_))
442 }
443}
444impl ::std::error::Error for GetCrawlersError {
445 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
446 match self {
447 Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
448 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
449 }
450 }
451}
452impl ::std::fmt::Display for GetCrawlersError {
453 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
454 match self {
455 Self::OperationTimeoutException(_inner) => _inner.fmt(f),
456 Self::Unhandled(_inner) => {
457 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
458 write!(f, "unhandled error ({code})")
459 } else {
460 f.write_str("unhandled error")
461 }
462 }
463 }
464 }
465}
466impl ::aws_smithy_types::retry::ProvideErrorKind for GetCrawlersError {
467 fn code(&self) -> ::std::option::Option<&str> {
468 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
469 }
470 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
471 ::std::option::Option::None
472 }
473}
474impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetCrawlersError {
475 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
476 match self {
477 Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
478 Self::Unhandled(_inner) => &_inner.meta,
479 }
480 }
481}
482impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetCrawlersError {
483 fn create_unhandled_error(
484 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
485 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
486 ) -> Self {
487 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
488 source,
489 meta: meta.unwrap_or_default(),
490 })
491 }
492}
493impl ::aws_types::request_id::RequestId for crate::operation::get_crawlers::GetCrawlersError {
494 fn request_id(&self) -> Option<&str> {
495 self.meta().request_id()
496 }
497}
498
499pub use crate::operation::get_crawlers::_get_crawlers_input::GetCrawlersInput;
500
501pub use crate::operation::get_crawlers::_get_crawlers_output::GetCrawlersOutput;
502
503mod _get_crawlers_input;
504
505mod _get_crawlers_output;
506
507pub mod builders;
509
510pub mod paginator;