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