Skip to main content

aws_sdk_glue/operation/
start_materialized_view_refresh_task_run.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `StartMaterializedViewRefreshTaskRun`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartMaterializedViewRefreshTaskRun;
6impl StartMaterializedViewRefreshTaskRun {
7    /// Creates a new `StartMaterializedViewRefreshTaskRun`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13        crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunInput,
20    ) -> ::std::result::Result<
21        crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError,
24            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25        >,
26    > {
27        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
28            ::aws_smithy_runtime_api::client::interceptors::context::Error,
29            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
30        >| {
31            err.map_service_error(|err| {
32                err.downcast::<crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError>()
33                    .expect("correct error type")
34            })
35        };
36        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
37            .await
38            .map_err(map_err)?;
39        let output = context.finalize().map_err(map_err)?;
40        ::std::result::Result::Ok(
41            output
42                .downcast::<crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunOutput>()
43                .expect("correct output type"),
44        )
45    }
46
47    pub(crate) async fn orchestrate_with_stop_point(
48        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
49        input: crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunInput,
50        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
51    ) -> ::std::result::Result<
52        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
53        ::aws_smithy_runtime_api::client::result::SdkError<
54            ::aws_smithy_runtime_api::client::interceptors::context::Error,
55            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
56        >,
57    > {
58        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
59        use ::tracing::Instrument;
60        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
61            "Glue",
62            "StartMaterializedViewRefreshTaskRun",
63            input,
64            runtime_plugins,
65            stop_point,
66        )
67        // Create a parent span for the entire operation. Includes a random, internal-only,
68        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
69        .instrument(::tracing::debug_span!(
70            "Glue.StartMaterializedViewRefreshTaskRun",
71            "rpc.service" = "Glue",
72            "rpc.method" = "StartMaterializedViewRefreshTaskRun",
73            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
74            "rpc.system" = "aws-api",
75        ))
76        .await
77    }
78
79    pub(crate) fn operation_runtime_plugins(
80        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
81        client_config: &crate::config::Config,
82        config_override: ::std::option::Option<crate::config::Builder>,
83    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
84        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
85
86        if let ::std::option::Option::Some(config_override) = config_override {
87            for plugin in config_override.runtime_plugins.iter().cloned() {
88                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
89            }
90            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
91                config_override,
92                client_config.config.clone(),
93                &client_config.runtime_components,
94            ));
95        }
96        runtime_plugins
97    }
98}
99/// Per-operation error registry. Contains an entry for every modeled
100/// error this operation can throw.
101///
102/// Used by the schema-serde error path as the operation-scoped lookup
103/// for registry-backed error reification: an error code that does not
104/// match one of the operation's modeled errors directly is resolved
105/// against this registry first, then widened to the service-wide error
106/// registry.
107pub(crate) mod error_registry {
108    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
109        ::aws_smithy_schema::registry::TypeRegistry::builder()
110                            .insert_error_shape(
111                        crate::types::error::AccessDeniedException::SCHEMA,
112                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
113                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::AccessDeniedException::deserialize(d)?))
114                        },
115                        |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> {
116                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::AccessDeniedException::deserialize(d)?))
117                        },
118                    )
119.insert_error_shape(
120                        crate::types::error::EntityNotFoundException::SCHEMA,
121                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
122                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
123                        },
124                        |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> {
125                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::EntityNotFoundException::deserialize(d)?))
126                        },
127                    )
128.insert_error_shape(
129                        crate::types::error::InvalidInputException::SCHEMA,
130                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
131                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidInputException::deserialize(d)?))
132                        },
133                        |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> {
134                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidInputException::deserialize(d)?))
135                        },
136                    )
137.insert_error_shape(
138                        crate::types::error::MaterializedViewRefreshTaskRunningException::SCHEMA,
139                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
140                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::MaterializedViewRefreshTaskRunningException::deserialize(d)?))
141                        },
142                        |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> {
143                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::MaterializedViewRefreshTaskRunningException::deserialize(d)?))
144                        },
145                    )
146.insert_error_shape(
147                        crate::types::error::OperationTimeoutException::SCHEMA,
148                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
149                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
150                        },
151                        |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> {
152                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::OperationTimeoutException::deserialize(d)?))
153                        },
154                    )
155.insert_error_shape(
156                        crate::types::error::ResourceNumberLimitExceededException::SCHEMA,
157                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
158                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ResourceNumberLimitExceededException::deserialize(d)?))
159                        },
160                        |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> {
161                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ResourceNumberLimitExceededException::deserialize(d)?))
162                        },
163                    )
164                            .build()
165    });
166}
167impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartMaterializedViewRefreshTaskRun {
168    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
169        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartMaterializedViewRefreshTaskRun");
170
171        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
172            StartMaterializedViewRefreshTaskRunRequestSerializer,
173        ));
174        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
175            StartMaterializedViewRefreshTaskRunResponseDeserializer,
176        ));
177
178        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
179            crate::config::auth::Params::builder()
180                .operation_name("StartMaterializedViewRefreshTaskRun")
181                .build()
182                .expect("required fields set"),
183        ));
184
185        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
186            "StartMaterializedViewRefreshTaskRun",
187            "Glue",
188        ));
189        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
190        signing_options.double_uri_encode = true;
191        signing_options.content_sha256_header = false;
192        signing_options.normalize_uri_path = true;
193        signing_options.payload_override = None;
194
195        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
196            signing_options,
197            ..::std::default::Default::default()
198        });
199
200        ::std::option::Option::Some(cfg.freeze())
201    }
202
203    fn runtime_components(
204        &self,
205        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
206    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
207        #[allow(unused_mut)]
208        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartMaterializedViewRefreshTaskRun")
209            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
210                StartMaterializedViewRefreshTaskRunTelemetryInputCaptureInterceptor,
211            ))
212            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
213                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
214            ))
215            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
216                StartMaterializedViewRefreshTaskRunEndpointParamsInterceptor,
217            ))
218            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
219                crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError,
220            >::new())
221            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
222                crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError,
223            >::new())
224            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
225                crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError,
226            >::new())
227            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
228                crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError,
229            >::new());
230
231        ::std::borrow::Cow::Owned(rcb)
232    }
233}
234
235#[derive(Debug)]
236struct StartMaterializedViewRefreshTaskRunTelemetryInputCaptureInterceptor;
237
238#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
239impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartMaterializedViewRefreshTaskRunTelemetryInputCaptureInterceptor {
240    fn name(&self) -> &'static str {
241        "StartMaterializedViewRefreshTaskRunTelemetryInputCaptureInterceptor"
242    }
243
244    fn read_before_execution(
245        &self,
246        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
247            '_,
248            ::aws_smithy_runtime_api::client::interceptors::context::Input,
249            ::aws_smithy_runtime_api::client::interceptors::context::Output,
250            ::aws_smithy_runtime_api::client::interceptors::context::Error,
251        >,
252        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
253    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
254        // Nothing to do unless the customer opted in by naming members to record.
255        let ::std::option::Option::Some(requested) = cfg
256            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
257            .filter(|r| !r.is_empty())
258        else {
259            return ::std::result::Result::Ok(());
260        };
261
262        let ::std::option::Option::Some(input) = context.input().downcast_ref::<StartMaterializedViewRefreshTaskRunInput>() else {
263            // A mismatched input is not this interceptor's concern; skip quietly.
264            return ::std::result::Result::Ok(());
265        };
266
267        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
268        if requested.should_capture("CatalogId") {
269            if let ::std::option::Option::Some(value) = input.catalog_id.as_deref() {
270                captured.insert("CatalogId", value);
271            }
272        }
273        if requested.should_capture("DatabaseName") {
274            if let ::std::option::Option::Some(value) = input.database_name.as_deref() {
275                captured.insert("DatabaseName", value);
276            }
277        }
278        if requested.should_capture("TableName") {
279            if let ::std::option::Option::Some(value) = input.table_name.as_deref() {
280                captured.insert("TableName", value);
281            }
282        }
283
284        cfg.interceptor_state().store_put(captured);
285        ::std::result::Result::Ok(())
286    }
287}
288#[derive(Debug)]
289struct StartMaterializedViewRefreshTaskRunResponseDeserializer;
290impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartMaterializedViewRefreshTaskRunResponseDeserializer {
291    fn deserialize_nonstreaming_with_config(
292        &self,
293        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
294        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
295    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
296        let (success, status) = (response.status().is_success(), response.status().as_u16());
297        // Load body and headers BEFORE BeforeParseResponse so customizations
298        // (e.g., S3's `body_is_error` check that detects errors returned with
299        // HTTP 200) can inspect them. The legacy non-streaming path also
300        // loads `body` before firing this hook.
301        #[allow(unused_variables)]
302        let body = response.body().bytes().expect("body loaded");
303        let headers = response.headers();
304        #[allow(unused_mut)]
305        let mut force_error = false;
306        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
307        if !success && status != 200 || force_error {
308            let protocol = _cfg
309                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
310                .expect("a SharedClientProtocol is required");
311            #[allow(unused_mut)]
312            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
313                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
314            })?;
315            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
316            let generic = generic_builder.build();
317            let error_code = match generic.code() {
318                ::std::option::Option::Some(code) => code,
319                ::std::option::Option::None => {
320                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
321                        ::aws_smithy_runtime_api::box_error::BoxError::from(
322                            crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::unhandled(generic),
323                        ),
324                    ))
325                }
326            };
327            let _error_message = generic.message().map(|msg| msg.to_owned());
328            let err = match error_code {
329"AccessDeniedException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::AccessDeniedException({
330let mut deser = protocol.deserialize_error_response(response, _cfg)
331                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
332                    let mut tmp = <crate::types::error::builders::AccessDeniedExceptionBuilder>::default();
333                    tmp.deserialize_members(&mut *deser)
334                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
335if tmp.message.is_none() {
336                                tmp.message = _error_message;
337                            }
338let tmp = tmp.meta(generic);
339tmp.build()
340}),
341"EntityNotFoundException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::EntityNotFoundException({
342let mut deser = protocol.deserialize_error_response(response, _cfg)
343                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
344                    let mut tmp = <crate::types::error::builders::EntityNotFoundExceptionBuilder>::default();
345                    tmp.deserialize_members(&mut *deser)
346                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
347if tmp.message.is_none() {
348                                tmp.message = _error_message;
349                            }
350let tmp = tmp.meta(generic);
351tmp.build()
352}),
353"InvalidInputException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::InvalidInputException({
354let mut deser = protocol.deserialize_error_response(response, _cfg)
355                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
356                    let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
357                    tmp.deserialize_members(&mut *deser)
358                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
359if tmp.message.is_none() {
360                                tmp.message = _error_message;
361                            }
362let tmp = tmp.meta(generic);
363tmp.build()
364}),
365"MaterializedViewRefreshTaskRunningException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::MaterializedViewRefreshTaskRunningException({
366let mut deser = protocol.deserialize_error_response(response, _cfg)
367                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
368                    let mut tmp = <crate::types::error::builders::MaterializedViewRefreshTaskRunningExceptionBuilder>::default();
369                    tmp.deserialize_members(&mut *deser)
370                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
371if tmp.message.is_none() {
372                                tmp.message = _error_message;
373                            }
374let tmp = tmp.meta(generic);
375tmp.build()
376}),
377"OperationTimeoutException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::OperationTimeoutException({
378let mut deser = protocol.deserialize_error_response(response, _cfg)
379                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
380                    let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
381                    tmp.deserialize_members(&mut *deser)
382                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
383if tmp.message.is_none() {
384                                tmp.message = _error_message;
385                            }
386let tmp = tmp.meta(generic);
387tmp.build()
388}),
389"ResourceNumberLimitExceededException" => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::ResourceNumberLimitExceededException({
390let mut deser = protocol.deserialize_error_response(response, _cfg)
391                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
392                    let mut tmp = <crate::types::error::builders::ResourceNumberLimitExceededExceptionBuilder>::default();
393                    tmp.deserialize_members(&mut *deser)
394                        .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
395if tmp.message.is_none() {
396                                tmp.message = _error_message;
397                            }
398let tmp = tmp.meta(generic);
399tmp.build()
400}),
401_ => {
402                    // Registry-backed, operation-scoped reification of an error whose
403                    // code this operation does not model directly: the operation's own
404                    // error registry is consulted first, then the lookup widens to the
405                    // service-wide error registry. On a hit, the reified error is attached
406                    // as the source of the returned unhandled error while its metadata
407                    // (code, message, request id) is preserved; on a miss the generic
408                    // error is returned unchanged.
409                    match protocol
410                        .deserialize_error_response(response, _cfg)
411                        .ok()
412                        .and_then(|mut deser| {
413                            ::aws_smithy_schema::registry::reify_error(
414                                crate::operation::start_materialized_view_refresh_task_run::error_registry::REGISTRY
415                                    .or(&crate::error_type_registry::REGISTRY),
416                                error_code,
417                                &mut *deser,
418                            )
419                        }) {
420                        ::std::option::Option::Some(source) => <crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
421                        ::std::option::Option::None => crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError::generic(generic),
422                    }
423                }
424};
425            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
426                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
427            ))
428        } else {
429            let protocol = _cfg
430                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
431                .expect("a SharedClientProtocol is required");
432            let mut deser = protocol
433                .deserialize_response(response, StartMaterializedViewRefreshTaskRun::OUTPUT_SCHEMA, _cfg)
434                .map_err(|e| {
435                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
436                })?;
437            // `headers` is already in scope from the top of the function; alias it as
438            // `_response_headers` so MutateOutput customizations have a stable name to
439            // read from.
440            let _response_headers = headers;
441            // `mut` is required because `deserialize_members` and the `MutateOutput`
442            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
443            // empty output has no members and no customizations to run.
444            #[allow(unused_mut)]
445            let mut output =
446                <crate::operation::start_materialized_view_refresh_task_run::builders::StartMaterializedViewRefreshTaskRunOutputBuilder>::default();
447            output.deserialize_members(&mut *deser).map_err(|e| {
448                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
449            })?;
450            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
451            let output = output.build();
452            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
453        }
454    }
455}
456#[derive(Debug)]
457struct StartMaterializedViewRefreshTaskRunRequestSerializer;
458impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartMaterializedViewRefreshTaskRunRequestSerializer {
459    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
460    fn serialize_input(
461        &self,
462        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
463        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
464    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
465        let input = input
466            .downcast::<crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunInput>()
467            .expect("correct type");
468
469        let protocol = _cfg
470            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
471            .expect("a SharedClientProtocol is required");
472        let mut request = protocol
473            .serialize_request(&input, StartMaterializedViewRefreshTaskRun::INPUT_SCHEMA, "/", _cfg)
474            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
475
476        return ::std::result::Result::Ok(request);
477    }
478}
479#[derive(Debug)]
480struct StartMaterializedViewRefreshTaskRunEndpointParamsInterceptor;
481
482#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
483impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartMaterializedViewRefreshTaskRunEndpointParamsInterceptor {
484    fn name(&self) -> &'static str {
485        "StartMaterializedViewRefreshTaskRunEndpointParamsInterceptor"
486    }
487
488    fn read_before_execution(
489        &self,
490        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
491            '_,
492            ::aws_smithy_runtime_api::client::interceptors::context::Input,
493            ::aws_smithy_runtime_api::client::interceptors::context::Output,
494            ::aws_smithy_runtime_api::client::interceptors::context::Error,
495        >,
496        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
497    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
498        let _input = context
499            .input()
500            .downcast_ref::<StartMaterializedViewRefreshTaskRunInput>()
501            .ok_or("failed to downcast to StartMaterializedViewRefreshTaskRunInput")?;
502
503        let params = crate::config::endpoint::Params::builder()
504            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
505            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
506            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
507            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
508            .build()
509            .map_err(|err| {
510                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
511            })?;
512        cfg.interceptor_state()
513            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
514        ::std::result::Result::Ok(())
515    }
516}
517
518// The get_* functions below are generated from JMESPath expressions in the
519// operationContextParams trait. They target the operation's input shape.
520
521/// Error type for the `StartMaterializedViewRefreshTaskRunError` operation.
522#[non_exhaustive]
523#[derive(::std::fmt::Debug)]
524pub enum StartMaterializedViewRefreshTaskRunError {
525    /// <p>Access to a resource was denied.</p>
526    AccessDeniedException(crate::types::error::AccessDeniedException),
527    /// <p>A specified entity does not exist</p>
528    EntityNotFoundException(crate::types::error::EntityNotFoundException),
529    /// <p>The input provided was not valid.</p>
530    InvalidInputException(crate::types::error::InvalidInputException),
531    /// <p>Exception thrown when a task is already in running state.</p>
532    MaterializedViewRefreshTaskRunningException(crate::types::error::MaterializedViewRefreshTaskRunningException),
533    /// <p>The operation timed out.</p>
534    OperationTimeoutException(crate::types::error::OperationTimeoutException),
535    /// <p>A resource numerical limit was exceeded.</p>
536    ResourceNumberLimitExceededException(crate::types::error::ResourceNumberLimitExceededException),
537    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
538    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
539    variable wildcard pattern and check `.code()`:
540     \
541    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
542     \
543    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartMaterializedViewRefreshTaskRunError) for what information is available for the error.")]
544    Unhandled(crate::error::sealed_unhandled::Unhandled),
545}
546impl StartMaterializedViewRefreshTaskRunError {
547    /// Creates the `StartMaterializedViewRefreshTaskRunError::Unhandled` variant from any error type.
548    pub fn unhandled(
549        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
550    ) -> Self {
551        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
552            source: err.into(),
553            meta: ::std::default::Default::default(),
554        })
555    }
556
557    /// Creates the `StartMaterializedViewRefreshTaskRunError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
558    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
559        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
560            source: err.clone().into(),
561            meta: err,
562        })
563    }
564    ///
565    /// Returns error metadata, which includes the error code, message,
566    /// request ID, and potentially additional information.
567    ///
568    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
569        match self {
570            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
571            Self::EntityNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
572            Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
573            Self::MaterializedViewRefreshTaskRunningException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
574            Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
575            Self::ResourceNumberLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
576            Self::Unhandled(e) => &e.meta,
577        }
578    }
579    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::AccessDeniedException`.
580    pub fn is_access_denied_exception(&self) -> bool {
581        matches!(self, Self::AccessDeniedException(_))
582    }
583    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::EntityNotFoundException`.
584    pub fn is_entity_not_found_exception(&self) -> bool {
585        matches!(self, Self::EntityNotFoundException(_))
586    }
587    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::InvalidInputException`.
588    pub fn is_invalid_input_exception(&self) -> bool {
589        matches!(self, Self::InvalidInputException(_))
590    }
591    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::MaterializedViewRefreshTaskRunningException`.
592    pub fn is_materialized_view_refresh_task_running_exception(&self) -> bool {
593        matches!(self, Self::MaterializedViewRefreshTaskRunningException(_))
594    }
595    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::OperationTimeoutException`.
596    pub fn is_operation_timeout_exception(&self) -> bool {
597        matches!(self, Self::OperationTimeoutException(_))
598    }
599    /// Returns `true` if the error kind is `StartMaterializedViewRefreshTaskRunError::ResourceNumberLimitExceededException`.
600    pub fn is_resource_number_limit_exceeded_exception(&self) -> bool {
601        matches!(self, Self::ResourceNumberLimitExceededException(_))
602    }
603}
604impl ::std::error::Error for StartMaterializedViewRefreshTaskRunError {
605    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
606        match self {
607            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
608            Self::EntityNotFoundException(_inner) => ::std::option::Option::Some(_inner),
609            Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
610            Self::MaterializedViewRefreshTaskRunningException(_inner) => ::std::option::Option::Some(_inner),
611            Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
612            Self::ResourceNumberLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
613            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
614        }
615    }
616}
617impl ::std::fmt::Display for StartMaterializedViewRefreshTaskRunError {
618    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
619        match self {
620            Self::AccessDeniedException(_inner) => _inner.fmt(f),
621            Self::EntityNotFoundException(_inner) => _inner.fmt(f),
622            Self::InvalidInputException(_inner) => _inner.fmt(f),
623            Self::MaterializedViewRefreshTaskRunningException(_inner) => _inner.fmt(f),
624            Self::OperationTimeoutException(_inner) => _inner.fmt(f),
625            Self::ResourceNumberLimitExceededException(_inner) => _inner.fmt(f),
626            Self::Unhandled(_inner) => {
627                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
628                    write!(f, "unhandled error ({code})")
629                } else {
630                    f.write_str("unhandled error")
631                }
632            }
633        }
634    }
635}
636impl ::aws_smithy_types::retry::ProvideErrorKind for StartMaterializedViewRefreshTaskRunError {
637    fn code(&self) -> ::std::option::Option<&str> {
638        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
639    }
640    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
641        ::std::option::Option::None
642    }
643}
644impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartMaterializedViewRefreshTaskRunError {
645    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
646        match self {
647            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
648            Self::EntityNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649            Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650            Self::MaterializedViewRefreshTaskRunningException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651            Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652            Self::ResourceNumberLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653            Self::Unhandled(_inner) => &_inner.meta,
654        }
655    }
656}
657impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartMaterializedViewRefreshTaskRunError {
658    fn create_unhandled_error(
659        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
660        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
661    ) -> Self {
662        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
663            source,
664            meta: meta.unwrap_or_default(),
665        })
666    }
667}
668impl ::aws_types::request_id::RequestId for crate::operation::start_materialized_view_refresh_task_run::StartMaterializedViewRefreshTaskRunError {
669    fn request_id(&self) -> Option<&str> {
670        self.meta().request_id()
671    }
672}
673
674pub use crate::operation::start_materialized_view_refresh_task_run::_start_materialized_view_refresh_task_run_input::StartMaterializedViewRefreshTaskRunInput;
675
676pub use crate::operation::start_materialized_view_refresh_task_run::_start_materialized_view_refresh_task_run_output::StartMaterializedViewRefreshTaskRunOutput;
677
678mod _start_materialized_view_refresh_task_run_input;
679
680mod _start_materialized_view_refresh_task_run_output;
681
682/// Builders
683pub mod builders;