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