1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StopCrawlerSchedule;
6impl StopCrawlerSchedule {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::stop_crawler_schedule::StopCrawlerScheduleInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
15 crate::operation::stop_crawler_schedule::StopCrawlerScheduleOutput::SCHEMA;
16 pub(crate) async fn orchestrate(
17 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
18 input: crate::operation::stop_crawler_schedule::StopCrawlerScheduleInput,
19 ) -> ::std::result::Result<
20 crate::operation::stop_crawler_schedule::StopCrawlerScheduleOutput,
21 ::aws_smithy_runtime_api::client::result::SdkError<
22 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >,
25 > {
26 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
27 ::aws_smithy_runtime_api::client::interceptors::context::Error,
28 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
29 >| {
30 err.map_service_error(|err| {
31 err.downcast::<crate::operation::stop_crawler_schedule::StopCrawlerScheduleError>()
32 .expect("correct error type")
33 })
34 };
35 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
36 .await
37 .map_err(map_err)?;
38 let output = context.finalize().map_err(map_err)?;
39 ::std::result::Result::Ok(
40 output
41 .downcast::<crate::operation::stop_crawler_schedule::StopCrawlerScheduleOutput>()
42 .expect("correct output type"),
43 )
44 }
45
46 pub(crate) async fn orchestrate_with_stop_point(
47 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
48 input: crate::operation::stop_crawler_schedule::StopCrawlerScheduleInput,
49 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
50 ) -> ::std::result::Result<
51 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
52 ::aws_smithy_runtime_api::client::result::SdkError<
53 ::aws_smithy_runtime_api::client::interceptors::context::Error,
54 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
55 >,
56 > {
57 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
58 use ::tracing::Instrument;
59 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Glue", "StopCrawlerSchedule", input, runtime_plugins, stop_point)
60 .instrument(::tracing::debug_span!(
63 "Glue.StopCrawlerSchedule",
64 "rpc.service" = "Glue",
65 "rpc.method" = "StopCrawlerSchedule",
66 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
67 "rpc.system" = "aws-api",
68 ))
69 .await
70 }
71
72 pub(crate) fn operation_runtime_plugins(
73 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
74 client_config: &crate::config::Config,
75 config_override: ::std::option::Option<crate::config::Builder>,
76 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
77 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
78
79 if let ::std::option::Option::Some(config_override) = config_override {
80 for plugin in config_override.runtime_plugins.iter().cloned() {
81 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
82 }
83 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
84 config_override,
85 client_config.config.clone(),
86 &client_config.runtime_components,
87 ));
88 }
89 runtime_plugins
90 }
91}
92pub(crate) mod error_registry {
101 pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
102 ::aws_smithy_schema::registry::TypeRegistry::builder()
103 .insert_error_shape(
104 crate::types::error::EntityNotFoundException::SCHEMA,
105 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
106 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
107 },
108 |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> {
109 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
110 },
111 )
112.insert_error_shape(
113 crate::types::error::OperationTimeoutException::SCHEMA,
114 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
115 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
116 },
117 |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> {
118 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
119 },
120 )
121.insert_error_shape(
122 crate::types::error::SchedulerNotRunningException::SCHEMA,
123 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
124 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::SchedulerNotRunningException::deserialize(d)?))
125 },
126 |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> {
127 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::SchedulerNotRunningException::deserialize(d)?))
128 },
129 )
130.insert_error_shape(
131 crate::types::error::SchedulerTransitioningException::SCHEMA,
132 |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
133 ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::SchedulerTransitioningException::deserialize(d)?))
134 },
135 |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> {
136 ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::SchedulerTransitioningException::deserialize(d)?))
137 },
138 )
139 .build()
140 });
141}
142impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StopCrawlerSchedule {
143 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
144 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StopCrawlerSchedule");
145
146 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
147 StopCrawlerScheduleRequestSerializer,
148 ));
149 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
150 StopCrawlerScheduleResponseDeserializer,
151 ));
152
153 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
154 crate::config::auth::Params::builder()
155 .operation_name("StopCrawlerSchedule")
156 .build()
157 .expect("required fields set"),
158 ));
159
160 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
161 "StopCrawlerSchedule",
162 "Glue",
163 ));
164 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
165 signing_options.double_uri_encode = true;
166 signing_options.content_sha256_header = false;
167 signing_options.normalize_uri_path = true;
168 signing_options.payload_override = None;
169
170 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
171 signing_options,
172 ..::std::default::Default::default()
173 });
174
175 ::std::option::Option::Some(cfg.freeze())
176 }
177
178 fn runtime_components(
179 &self,
180 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
181 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
182 #[allow(unused_mut)]
183 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StopCrawlerSchedule")
184 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
185 StopCrawlerScheduleTelemetryInputCaptureInterceptor,
186 ))
187 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
188 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
189 ))
190 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
191 StopCrawlerScheduleEndpointParamsInterceptor,
192 ))
193 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
194 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError,
195 >::new())
196 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
197 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError,
198 >::new())
199 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
200 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError,
201 >::new())
202 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
203 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError,
204 >::new());
205
206 ::std::borrow::Cow::Owned(rcb)
207 }
208}
209
210#[derive(Debug)]
211struct StopCrawlerScheduleTelemetryInputCaptureInterceptor;
212
213#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
214impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StopCrawlerScheduleTelemetryInputCaptureInterceptor {
215 fn name(&self) -> &'static str {
216 "StopCrawlerScheduleTelemetryInputCaptureInterceptor"
217 }
218
219 fn read_before_execution(
220 &self,
221 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
222 '_,
223 ::aws_smithy_runtime_api::client::interceptors::context::Input,
224 ::aws_smithy_runtime_api::client::interceptors::context::Output,
225 ::aws_smithy_runtime_api::client::interceptors::context::Error,
226 >,
227 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
228 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
229 let ::std::option::Option::Some(requested) = cfg
231 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
232 .filter(|r| !r.is_empty())
233 else {
234 return ::std::result::Result::Ok(());
235 };
236
237 let ::std::option::Option::Some(input) = context.input().downcast_ref::<StopCrawlerScheduleInput>() else {
238 return ::std::result::Result::Ok(());
240 };
241
242 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
243 if requested.should_capture("CrawlerName") {
244 if let ::std::option::Option::Some(value) = input.crawler_name.as_deref() {
245 captured.insert("CrawlerName", value);
246 }
247 }
248
249 cfg.interceptor_state().store_put(captured);
250 ::std::result::Result::Ok(())
251 }
252}
253#[derive(Debug)]
254struct StopCrawlerScheduleResponseDeserializer;
255impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StopCrawlerScheduleResponseDeserializer {
256 fn deserialize_nonstreaming_with_config(
257 &self,
258 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
259 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
260 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
261 let (success, status) = (response.status().is_success(), response.status().as_u16());
262 #[allow(unused_variables)]
267 let body = response.body().bytes().expect("body loaded");
268 let headers = response.headers();
269 #[allow(unused_mut)]
270 let mut force_error = false;
271 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
272 if !success && status != 200 || force_error {
273 let protocol = _cfg
274 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
275 .expect("a SharedClientProtocol is required");
276 #[allow(unused_mut)]
277 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
278 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
279 })?;
280 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
281 let generic = generic_builder.build();
282 let error_code = match generic.code() {
283 ::std::option::Option::Some(code) => code,
284 ::std::option::Option::None => {
285 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
286 ::aws_smithy_runtime_api::box_error::BoxError::from(
287 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::unhandled(generic),
288 ),
289 ))
290 }
291 };
292 let _error_message = generic.message().map(|msg| msg.to_owned());
293 let err = match error_code {
294 "EntityNotFoundException" => crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::EntityNotFoundException({
295 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
296 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
297 e,
298 ))
299 })?;
300 let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
301 tmp.deserialize_members(&mut *deser).map_err(|e| {
302 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
303 e,
304 ))
305 })?;
306 if tmp.message.is_none() {
307 tmp.message = _error_message;
308 }
309 let tmp = tmp.meta(generic);
310 tmp.build()
311 }),
312 "OperationTimeoutException" => crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::OperationTimeoutException({
313 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
314 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
315 e,
316 ))
317 })?;
318 let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
319 tmp.deserialize_members(&mut *deser).map_err(|e| {
320 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
321 e,
322 ))
323 })?;
324 if tmp.message.is_none() {
325 tmp.message = _error_message;
326 }
327 let tmp = tmp.meta(generic);
328 tmp.build()
329 }),
330 "SchedulerNotRunningException" => crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::SchedulerNotRunningException({
331 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
332 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
333 e,
334 ))
335 })?;
336 let mut tmp = <crate::types::error::builders::SchedulerNotRunningExceptionBuilder>::default();
337 tmp.deserialize_members(&mut *deser).map_err(|e| {
338 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
339 e,
340 ))
341 })?;
342 if tmp.message.is_none() {
343 tmp.message = _error_message;
344 }
345 let tmp = tmp.meta(generic);
346 tmp.build()
347 }),
348 "SchedulerTransitioningException" => {
349 crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::SchedulerTransitioningException({
350 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
351 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
352 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
353 )
354 })?;
355 let mut tmp = <crate::types::error::builders::SchedulerTransitioningExceptionBuilder>::default();
356 tmp.deserialize_members(&mut *deser).map_err(|e| {
357 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
358 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
359 )
360 })?;
361 if tmp.message.is_none() {
362 tmp.message = _error_message;
363 }
364 let tmp = tmp.meta(generic);
365 tmp.build()
366 })
367 }
368 _ => {
369 match protocol
377 .deserialize_error_response(response, _cfg)
378 .ok()
379 .and_then(|mut deser| {
380 ::aws_smithy_schema::registry::reify_error(
381 crate::operation::stop_crawler_schedule::error_registry::REGISTRY
382 .or(&crate::error_type_registry::REGISTRY),
383 error_code,
384 &mut *deser,
385 )
386 }) {
387 ::std::option::Option::Some(source) => <crate::operation::stop_crawler_schedule::StopCrawlerScheduleError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
388 ::std::option::Option::None => crate::operation::stop_crawler_schedule::StopCrawlerScheduleError::generic(generic),
389 }
390 }
391 };
392 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
393 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
394 ))
395 } else {
396 let protocol = _cfg
397 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
398 .expect("a SharedClientProtocol is required");
399 let mut deser = protocol
400 .deserialize_response(response, StopCrawlerSchedule::OUTPUT_SCHEMA, _cfg)
401 .map_err(|e| {
402 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
403 })?;
404 let _response_headers = headers;
408 #[allow(unused_mut)]
412 let mut output = <crate::operation::stop_crawler_schedule::builders::StopCrawlerScheduleOutputBuilder>::default();
413 output.deserialize_members(&mut *deser).map_err(|e| {
414 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
415 })?;
416 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
417 let output = output.build();
418 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
419 }
420 }
421}
422#[derive(Debug)]
423struct StopCrawlerScheduleRequestSerializer;
424impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StopCrawlerScheduleRequestSerializer {
425 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
426 fn serialize_input(
427 &self,
428 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
429 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
430 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
431 let input = input
432 .downcast::<crate::operation::stop_crawler_schedule::StopCrawlerScheduleInput>()
433 .expect("correct type");
434
435 let protocol = _cfg
436 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
437 .expect("a SharedClientProtocol is required");
438 let mut request = protocol
439 .serialize_request(&input, StopCrawlerSchedule::INPUT_SCHEMA, "/", _cfg)
440 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
441
442 return ::std::result::Result::Ok(request);
443 }
444}
445#[derive(Debug)]
446struct StopCrawlerScheduleEndpointParamsInterceptor;
447
448#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
449impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StopCrawlerScheduleEndpointParamsInterceptor {
450 fn name(&self) -> &'static str {
451 "StopCrawlerScheduleEndpointParamsInterceptor"
452 }
453
454 fn read_before_execution(
455 &self,
456 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
457 '_,
458 ::aws_smithy_runtime_api::client::interceptors::context::Input,
459 ::aws_smithy_runtime_api::client::interceptors::context::Output,
460 ::aws_smithy_runtime_api::client::interceptors::context::Error,
461 >,
462 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
463 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
464 let _input = context
465 .input()
466 .downcast_ref::<StopCrawlerScheduleInput>()
467 .ok_or("failed to downcast to StopCrawlerScheduleInput")?;
468
469 let params = crate::config::endpoint::Params::builder()
470 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
471 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
472 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
473 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
474 .build()
475 .map_err(|err| {
476 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
477 })?;
478 cfg.interceptor_state()
479 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
480 ::std::result::Result::Ok(())
481 }
482}
483
484#[non_exhaustive]
489#[derive(::std::fmt::Debug)]
490pub enum StopCrawlerScheduleError {
491 EntityNotFoundException(crate::types::error::EntityNotFoundException),
493 OperationTimeoutException(crate::types::error::OperationTimeoutException),
495 SchedulerNotRunningException(crate::types::error::SchedulerNotRunningException),
497 SchedulerTransitioningException(crate::types::error::SchedulerTransitioningException),
499 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
501 variable wildcard pattern and check `.code()`:
502 \
503 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
504 \
505 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StopCrawlerScheduleError) for what information is available for the error.")]
506 Unhandled(crate::error::sealed_unhandled::Unhandled),
507}
508impl StopCrawlerScheduleError {
509 pub fn unhandled(
511 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
512 ) -> Self {
513 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
514 source: err.into(),
515 meta: ::std::default::Default::default(),
516 })
517 }
518
519 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
521 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
522 source: err.clone().into(),
523 meta: err,
524 })
525 }
526 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
531 match self {
532 Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
533 Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
534 Self::SchedulerNotRunningException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
535 Self::SchedulerTransitioningException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
536 Self::Unhandled(e) => &e.meta,
537 }
538 }
539 pub fn is_entity_not_found_exception(&self) -> bool {
541 matches!(self, Self::EntityNotFoundException(_))
542 }
543 pub fn is_operation_timeout_exception(&self) -> bool {
545 matches!(self, Self::OperationTimeoutException(_))
546 }
547 pub fn is_scheduler_not_running_exception(&self) -> bool {
549 matches!(self, Self::SchedulerNotRunningException(_))
550 }
551 pub fn is_scheduler_transitioning_exception(&self) -> bool {
553 matches!(self, Self::SchedulerTransitioningException(_))
554 }
555}
556impl ::std::error::Error for StopCrawlerScheduleError {
557 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
558 match self {
559 Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
560 Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
561 Self::SchedulerNotRunningException(_inner) => ::std::option::Option::Some(_inner),
562 Self::SchedulerTransitioningException(_inner) => ::std::option::Option::Some(_inner),
563 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
564 }
565 }
566}
567impl ::std::fmt::Display for StopCrawlerScheduleError {
568 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
569 match self {
570 Self::EntityNotFoundException(_inner) => _inner.fmt(f),
571 Self::OperationTimeoutException(_inner) => _inner.fmt(f),
572 Self::SchedulerNotRunningException(_inner) => _inner.fmt(f),
573 Self::SchedulerTransitioningException(_inner) => _inner.fmt(f),
574 Self::Unhandled(_inner) => {
575 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
576 write!(f, "unhandled error ({code})")
577 } else {
578 f.write_str("unhandled error")
579 }
580 }
581 }
582 }
583}
584impl ::aws_smithy_types::retry::ProvideErrorKind for StopCrawlerScheduleError {
585 fn code(&self) -> ::std::option::Option<&str> {
586 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
587 }
588 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
589 ::std::option::Option::None
590 }
591}
592impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StopCrawlerScheduleError {
593 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
594 match self {
595 Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
596 Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
597 Self::SchedulerNotRunningException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
598 Self::SchedulerTransitioningException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
599 Self::Unhandled(_inner) => &_inner.meta,
600 }
601 }
602}
603impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StopCrawlerScheduleError {
604 fn create_unhandled_error(
605 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
606 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
607 ) -> Self {
608 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
609 source,
610 meta: meta.unwrap_or_default(),
611 })
612 }
613}
614impl ::aws_types::request_id::RequestId for crate::operation::stop_crawler_schedule::StopCrawlerScheduleError {
615 fn request_id(&self) -> Option<&str> {
616 self.meta().request_id()
617 }
618}
619
620pub use crate::operation::stop_crawler_schedule::_stop_crawler_schedule_input::StopCrawlerScheduleInput;
621
622pub use crate::operation::stop_crawler_schedule::_stop_crawler_schedule_output::StopCrawlerScheduleOutput;
623
624mod _stop_crawler_schedule_input;
625
626mod _stop_crawler_schedule_output;
627
628pub mod builders;