1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateCrawler;
6impl UpdateCrawler {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::update_crawler::UpdateCrawlerInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::update_crawler::UpdateCrawlerOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::update_crawler::UpdateCrawlerInput,
18 ) -> ::std::result::Result<
19 crate::operation::update_crawler::UpdateCrawlerOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::update_crawler::UpdateCrawlerError,
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::update_crawler::UpdateCrawlerError>()
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::update_crawler::UpdateCrawlerOutput>()
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::update_crawler::UpdateCrawlerInput,
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", "UpdateCrawler", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Glue.UpdateCrawler",
63 "rpc.service" = "Glue",
64 "rpc.method" = "UpdateCrawler",
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::CrawlerRunningException::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::CrawlerRunningException::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::CrawlerRunningException::deserialize(d)?))
109 },
110 )
111.insert_error_shape(
112 crate::types::error::EntityNotFoundException::SCHEMA,
113 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
114 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
115 },
116 |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> {
117 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
118 },
119 )
120.insert_error_shape(
121 crate::types::error::InvalidInputException::SCHEMA,
122 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
123 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidInputException::deserialize(d)?))
124 },
125 |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> {
126 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidInputException::deserialize(d)?))
127 },
128 )
129.insert_error_shape(
130 crate::types::error::OperationTimeoutException::SCHEMA,
131 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
132 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
133 },
134 |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> {
135 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
136 },
137 )
138.insert_error_shape(
139 crate::types::error::VersionMismatchException::SCHEMA,
140 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
141 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::VersionMismatchException::deserialize(d)?))
142 },
143 |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> {
144 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::VersionMismatchException::deserialize(d)?))
145 },
146 )
147 .build()
148 });
149}
150impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateCrawler {
151 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
152 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateCrawler");
153
154 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
155 UpdateCrawlerRequestSerializer,
156 ));
157 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
158 UpdateCrawlerResponseDeserializer,
159 ));
160
161 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
162 crate::config::auth::Params::builder()
163 .operation_name("UpdateCrawler")
164 .build()
165 .expect("required fields set"),
166 ));
167
168 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("UpdateCrawler", "Glue"));
169 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
170 signing_options.double_uri_encode = true;
171 signing_options.content_sha256_header = false;
172 signing_options.normalize_uri_path = true;
173 signing_options.payload_override = None;
174
175 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
176 signing_options,
177 ..::std::default::Default::default()
178 });
179
180 ::std::option::Option::Some(cfg.freeze())
181 }
182
183 fn runtime_components(
184 &self,
185 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
186 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
187 #[allow(unused_mut)]
188 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateCrawler")
189 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
190 UpdateCrawlerTelemetryInputCaptureInterceptor,
191 ))
192 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
193 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
194 ))
195 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
196 UpdateCrawlerEndpointParamsInterceptor,
197 ))
198 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
199 crate::operation::update_crawler::UpdateCrawlerError,
200 >::new())
201 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
202 crate::operation::update_crawler::UpdateCrawlerError,
203 >::new())
204 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
205 crate::operation::update_crawler::UpdateCrawlerError,
206 >::new())
207 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
208 crate::operation::update_crawler::UpdateCrawlerError,
209 >::new());
210
211 ::std::borrow::Cow::Owned(rcb)
212 }
213}
214
215#[derive(Debug)]
216struct UpdateCrawlerTelemetryInputCaptureInterceptor;
217
218#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
219impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateCrawlerTelemetryInputCaptureInterceptor {
220 fn name(&self) -> &'static str {
221 "UpdateCrawlerTelemetryInputCaptureInterceptor"
222 }
223
224 fn read_before_execution(
225 &self,
226 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
227 '_,
228 ::aws_smithy_runtime_api::client::interceptors::context::Input,
229 ::aws_smithy_runtime_api::client::interceptors::context::Output,
230 ::aws_smithy_runtime_api::client::interceptors::context::Error,
231 >,
232 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
233 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
234 let ::std::option::Option::Some(requested) = cfg
236 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
237 .filter(|r| !r.is_empty())
238 else {
239 return ::std::result::Result::Ok(());
240 };
241
242 let ::std::option::Option::Some(input) = context.input().downcast_ref::<UpdateCrawlerInput>() else {
243 return ::std::result::Result::Ok(());
245 };
246
247 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
248 if requested.should_capture("Name") {
249 if let ::std::option::Option::Some(value) = input.name.as_deref() {
250 captured.insert("Name", value);
251 }
252 }
253 if requested.should_capture("Role") {
254 if let ::std::option::Option::Some(value) = input.role.as_deref() {
255 captured.insert("Role", value);
256 }
257 }
258 if requested.should_capture("DatabaseName") {
259 if let ::std::option::Option::Some(value) = input.database_name.as_deref() {
260 captured.insert("DatabaseName", value);
261 }
262 }
263 if requested.should_capture("Description") {
264 if let ::std::option::Option::Some(value) = input.description.as_deref() {
265 captured.insert("Description", value);
266 }
267 }
268 if requested.should_capture("Schedule") {
269 if let ::std::option::Option::Some(value) = input.schedule.as_deref() {
270 captured.insert("Schedule", value);
271 }
272 }
273 if requested.should_capture("TablePrefix") {
274 if let ::std::option::Option::Some(value) = input.table_prefix.as_deref() {
275 captured.insert("TablePrefix", value);
276 }
277 }
278 if requested.should_capture("Configuration") {
279 if let ::std::option::Option::Some(value) = input.configuration.as_deref() {
280 captured.insert("Configuration", value);
281 }
282 }
283 if requested.should_capture("CrawlerSecurityConfiguration") {
284 if let ::std::option::Option::Some(value) = input.crawler_security_configuration.as_deref() {
285 captured.insert("CrawlerSecurityConfiguration", value);
286 }
287 }
288 if requested.should_capture("CatalogId") {
289 if let ::std::option::Option::Some(value) = input.catalog_id.as_deref() {
290 captured.insert("CatalogId", value);
291 }
292 }
293
294 cfg.interceptor_state().store_put(captured);
295 ::std::result::Result::Ok(())
296 }
297}
298#[derive(Debug)]
299struct UpdateCrawlerResponseDeserializer;
300impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateCrawlerResponseDeserializer {
301 fn deserialize_nonstreaming_with_config(
302 &self,
303 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
304 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
305 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
306 let (success, status) = (response.status().is_success(), response.status().as_u16());
307 #[allow(unused_variables)]
312 let body = response.body().bytes().expect("body loaded");
313 let headers = response.headers();
314 #[allow(unused_mut)]
315 let mut force_error = false;
316 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
317 if !success && status != 200 || force_error {
318 let protocol = _cfg
319 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
320 .expect("a SharedClientProtocol is required");
321 #[allow(unused_mut)]
322 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
323 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
324 })?;
325 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
326 let generic = generic_builder.build();
327 let error_code = match generic.code() {
328 ::std::option::Option::Some(code) => code,
329 ::std::option::Option::None => {
330 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
331 ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::update_crawler::UpdateCrawlerError::unhandled(generic)),
332 ))
333 }
334 };
335 let _error_message = generic.message().map(|msg| msg.to_owned());
336 let err = match error_code {
337 "CrawlerRunningException" => crate::operation::update_crawler::UpdateCrawlerError::CrawlerRunningException({
338 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
339 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
340 e,
341 ))
342 })?;
343 let mut tmp = <crate::types::error::builders::CrawlerRunningExceptionBuilder>::default();
344 tmp.deserialize_members(&mut *deser).map_err(|e| {
345 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
346 e,
347 ))
348 })?;
349 if tmp.message.is_none() {
350 tmp.message = _error_message;
351 }
352 let tmp = tmp.meta(generic);
353 tmp.build()
354 }),
355 "EntityNotFoundException" => crate::operation::update_crawler::UpdateCrawlerError::EntityNotFoundException({
356 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
357 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
358 e,
359 ))
360 })?;
361 let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
362 tmp.deserialize_members(&mut *deser).map_err(|e| {
363 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
364 e,
365 ))
366 })?;
367 if tmp.message.is_none() {
368 tmp.message = _error_message;
369 }
370 let tmp = tmp.meta(generic);
371 tmp.build()
372 }),
373 "InvalidInputException" => crate::operation::update_crawler::UpdateCrawlerError::InvalidInputException({
374 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
375 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
376 e,
377 ))
378 })?;
379 let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
380 tmp.deserialize_members(&mut *deser).map_err(|e| {
381 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
382 e,
383 ))
384 })?;
385 if tmp.message.is_none() {
386 tmp.message = _error_message;
387 }
388 let tmp = tmp.meta(generic);
389 tmp.build()
390 }),
391 "OperationTimeoutException" => crate::operation::update_crawler::UpdateCrawlerError::OperationTimeoutException({
392 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
393 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
394 e,
395 ))
396 })?;
397 let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
398 tmp.deserialize_members(&mut *deser).map_err(|e| {
399 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
400 e,
401 ))
402 })?;
403 if tmp.message.is_none() {
404 tmp.message = _error_message;
405 }
406 let tmp = tmp.meta(generic);
407 tmp.build()
408 }),
409 "VersionMismatchException" => crate::operation::update_crawler::UpdateCrawlerError::VersionMismatchException({
410 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
411 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
412 e,
413 ))
414 })?;
415 let mut tmp = <crate::types::error::builders::VersionMismatchExceptionBuilder>::default();
416 tmp.deserialize_members(&mut *deser).map_err(|e| {
417 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
418 e,
419 ))
420 })?;
421 if tmp.message.is_none() {
422 tmp.message = _error_message;
423 }
424 let tmp = tmp.meta(generic);
425 tmp.build()
426 }),
427 _ => {
428 match protocol
436 .deserialize_error_response(response, _cfg)
437 .ok()
438 .and_then(|mut deser| {
439 ::aws_smithy_schema::registry::reify_error(
440 crate::operation::update_crawler::error_registry::REGISTRY
441 .or(&crate::error_type_registry::REGISTRY),
442 error_code,
443 &mut *deser,
444 )
445 }) {
446 ::std::option::Option::Some(source) => <crate::operation::update_crawler::UpdateCrawlerError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
447 ::std::option::Option::None => crate::operation::update_crawler::UpdateCrawlerError::generic(generic),
448 }
449 }
450 };
451 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
452 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
453 ))
454 } else {
455 let protocol = _cfg
456 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
457 .expect("a SharedClientProtocol is required");
458 let mut deser = protocol.deserialize_response(response, UpdateCrawler::OUTPUT_SCHEMA, _cfg).map_err(|e| {
459 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
460 })?;
461 let _response_headers = headers;
465 #[allow(unused_mut)]
469 let mut output = <crate::operation::update_crawler::builders::UpdateCrawlerOutputBuilder>::default();
470 output.deserialize_members(&mut *deser).map_err(|e| {
471 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
472 })?;
473 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
474 let output = output.build();
475 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
476 }
477 }
478}
479#[derive(Debug)]
480struct UpdateCrawlerRequestSerializer;
481impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateCrawlerRequestSerializer {
482 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
483 fn serialize_input(
484 &self,
485 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
486 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
487 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
488 let input = input
489 .downcast::<crate::operation::update_crawler::UpdateCrawlerInput>()
490 .expect("correct type");
491
492 let protocol = _cfg
493 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
494 .expect("a SharedClientProtocol is required");
495 let mut request = protocol
496 .serialize_request(&input, UpdateCrawler::INPUT_SCHEMA, "/", _cfg)
497 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
498
499 return ::std::result::Result::Ok(request);
500 }
501}
502#[derive(Debug)]
503struct UpdateCrawlerEndpointParamsInterceptor;
504
505#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
506impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateCrawlerEndpointParamsInterceptor {
507 fn name(&self) -> &'static str {
508 "UpdateCrawlerEndpointParamsInterceptor"
509 }
510
511 fn read_before_execution(
512 &self,
513 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
514 '_,
515 ::aws_smithy_runtime_api::client::interceptors::context::Input,
516 ::aws_smithy_runtime_api::client::interceptors::context::Output,
517 ::aws_smithy_runtime_api::client::interceptors::context::Error,
518 >,
519 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
520 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
521 let _input = context
522 .input()
523 .downcast_ref::<UpdateCrawlerInput>()
524 .ok_or("failed to downcast to UpdateCrawlerInput")?;
525
526 let params = crate::config::endpoint::Params::builder()
527 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
528 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
529 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
530 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
531 .build()
532 .map_err(|err| {
533 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
534 })?;
535 cfg.interceptor_state()
536 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
537 ::std::result::Result::Ok(())
538 }
539}
540
541#[non_exhaustive]
546#[derive(::std::fmt::Debug)]
547pub enum UpdateCrawlerError {
548 CrawlerRunningException(crate::types::error::CrawlerRunningException),
550 EntityNotFoundException(crate::types::error::EntityNotFoundException),
552 InvalidInputException(crate::types::error::InvalidInputException),
554 OperationTimeoutException(crate::types::error::OperationTimeoutException),
556 VersionMismatchException(crate::types::error::VersionMismatchException),
558 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
560 variable wildcard pattern and check `.code()`:
561 \
562 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
563 \
564 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateCrawlerError) for what information is available for the error.")]
565 Unhandled(crate::error::sealed_unhandled::Unhandled),
566}
567impl UpdateCrawlerError {
568 pub fn unhandled(
570 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
571 ) -> Self {
572 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
573 source: err.into(),
574 meta: ::std::default::Default::default(),
575 })
576 }
577
578 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
580 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
581 source: err.clone().into(),
582 meta: err,
583 })
584 }
585 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
590 match self {
591 Self::CrawlerRunningException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
592 Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
593 Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
594 Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
595 Self::VersionMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
596 Self::Unhandled(e) => &e.meta,
597 }
598 }
599 pub fn is_crawler_running_exception(&self) -> bool {
601 matches!(self, Self::CrawlerRunningException(_))
602 }
603 pub fn is_entity_not_found_exception(&self) -> bool {
605 matches!(self, Self::EntityNotFoundException(_))
606 }
607 pub fn is_invalid_input_exception(&self) -> bool {
609 matches!(self, Self::InvalidInputException(_))
610 }
611 pub fn is_operation_timeout_exception(&self) -> bool {
613 matches!(self, Self::OperationTimeoutException(_))
614 }
615 pub fn is_version_mismatch_exception(&self) -> bool {
617 matches!(self, Self::VersionMismatchException(_))
618 }
619}
620impl ::std::error::Error for UpdateCrawlerError {
621 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
622 match self {
623 Self::CrawlerRunningException(_inner) => ::std::option::Option::Some(_inner),
624 Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
625 Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
626 Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
627 Self::VersionMismatchException(_inner) => ::std::option::Option::Some(_inner),
628 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
629 }
630 }
631}
632impl ::std::fmt::Display for UpdateCrawlerError {
633 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
634 match self {
635 Self::CrawlerRunningException(_inner) => _inner.fmt(f),
636 Self::EntityNotFoundException(_inner) => _inner.fmt(f),
637 Self::InvalidInputException(_inner) => _inner.fmt(f),
638 Self::OperationTimeoutException(_inner) => _inner.fmt(f),
639 Self::VersionMismatchException(_inner) => _inner.fmt(f),
640 Self::Unhandled(_inner) => {
641 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
642 write!(f, "unhandled error ({code})")
643 } else {
644 f.write_str("unhandled error")
645 }
646 }
647 }
648 }
649}
650impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateCrawlerError {
651 fn code(&self) -> ::std::option::Option<&str> {
652 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
653 }
654 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
655 ::std::option::Option::None
656 }
657}
658impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateCrawlerError {
659 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
660 match self {
661 Self::CrawlerRunningException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
662 Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
663 Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
664 Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
665 Self::VersionMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
666 Self::Unhandled(_inner) => &_inner.meta,
667 }
668 }
669}
670impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateCrawlerError {
671 fn create_unhandled_error(
672 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
673 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
674 ) -> Self {
675 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
676 source,
677 meta: meta.unwrap_or_default(),
678 })
679 }
680}
681impl ::aws_types::request_id::RequestId for crate::operation::update_crawler::UpdateCrawlerError {
682 fn request_id(&self) -> Option<&str> {
683 self.meta().request_id()
684 }
685}
686
687pub use crate::operation::update_crawler::_update_crawler_input::UpdateCrawlerInput;
688
689pub use crate::operation::update_crawler::_update_crawler_output::UpdateCrawlerOutput;
690
691mod _update_crawler_input;
692
693mod _update_crawler_output;
694
695pub mod builders;