1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /// Orchestration and serialization glue logic for `StartAssociationsOnce`.
|
3 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 + | #[non_exhaustive]
|
5 + | pub struct StartAssociationsOnce;
|
6 + | impl StartAssociationsOnce {
|
7 + | /// Creates a new `StartAssociationsOnce`
|
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_associations_once::StartAssociationsOnceInput::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_associations_once::StartAssociationsOnceOutput::SCHEMA;
|
17 + | pub(crate) async fn orchestrate(
|
18 + | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
19 + | input: crate::operation::start_associations_once::StartAssociationsOnceInput,
|
20 + | ) -> ::std::result::Result<
|
21 + | crate::operation::start_associations_once::StartAssociationsOnceOutput,
|
22 + | ::aws_smithy_runtime_api::client::result::SdkError<
|
23 + | crate::operation::start_associations_once::StartAssociationsOnceError,
|
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_associations_once::StartAssociationsOnceError>()
|
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_associations_once::StartAssociationsOnceOutput>()
|
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_associations_once::StartAssociationsOnceInput,
|
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("SSM", "StartAssociationsOnce", input, runtime_plugins, stop_point)
|
61 + | // Create a parent span for the entire operation. Includes a random, internal-only,
|
62 + | // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
|
63 + | .instrument(::tracing::debug_span!(
|
64 + | "SSM.StartAssociationsOnce",
|
65 + | "rpc.service" = "SSM",
|
66 + | "rpc.method" = "StartAssociationsOnce",
|
67 + | "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
|
68 + | "rpc.system" = "aws-api",
|
69 + | ))
|
70 + | .await
|
71 + | }
|
72 + |
|
73 + | pub(crate) fn operation_runtime_plugins(
|
74 + | client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
75 + | client_config: &crate::config::Config,
|
76 + | config_override: ::std::option::Option<crate::config::Builder>,
|
77 + | ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
|
78 + | let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
|
79 + |
|
80 + | if let ::std::option::Option::Some(config_override) = config_override {
|
81 + | for plugin in config_override.runtime_plugins.iter().cloned() {
|
82 + | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
83 + | }
|
84 + | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
85 + | config_override,
|
86 + | client_config.config.clone(),
|
87 + | &client_config.runtime_components,
|
88 + | ));
|
89 + | }
|
90 + | runtime_plugins
|
91 + | }
|
92 + | }
|
93 + | /// Per-operation error registry. Contains an entry for every modeled
|
94 + | /// error this operation can throw.
|
95 + | ///
|
96 + | /// Used by the schema-serde error path as the operation-scoped lookup
|
97 + | /// for registry-backed error reification: an error code that does not
|
98 + | /// match one of the operation's modeled errors directly is resolved
|
99 + | /// against this registry first, then widened to the service-wide error
|
100 + | /// registry.
|
101 + | pub(crate) mod error_registry {
|
102 + | pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
|
103 + | ::aws_smithy_schema::registry::TypeRegistry::builder()
|
104 + | .insert_error_shape(
|
105 + | crate::types::error::AssociationDoesNotExist::SCHEMA,
|
106 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
107 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::AssociationDoesNotExist::deserialize(d)?))
|
108 + | },
|
109 + | |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> {
|
110 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::AssociationDoesNotExist::deserialize(d)?))
|
111 + | },
|
112 + | )
|
113 + | .insert_error_shape(
|
114 + | crate::types::error::InvalidAssociation::SCHEMA,
|
115 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
116 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidAssociation::deserialize(d)?))
|
117 + | },
|
118 + | |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> {
|
119 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidAssociation::deserialize(d)?))
|
120 + | },
|
121 + | )
|
122 + | .build()
|
123 + | });
|
124 + | }
|
125 + | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartAssociationsOnce {
|
126 + | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
127 + | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartAssociationsOnce");
|
128 + |
|
129 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
130 + | StartAssociationsOnceRequestSerializer,
|
131 + | ));
|
132 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
133 + | StartAssociationsOnceResponseDeserializer,
|
134 + | ));
|
135 + |
|
136 + | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
137 + | crate::config::auth::Params::builder()
|
138 + | .operation_name("StartAssociationsOnce")
|
139 + | .build()
|
140 + | .expect("required fields set"),
|
141 + | ));
|
142 + |
|
143 + | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
144 + | "StartAssociationsOnce",
|
145 + | "SSM",
|
146 + | ));
|
147 + | let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
|
148 + | signing_options.double_uri_encode = true;
|
149 + | signing_options.content_sha256_header = false;
|
150 + | signing_options.normalize_uri_path = true;
|
151 + | signing_options.payload_override = None;
|
152 + |
|
153 + | cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
|
154 + | signing_options,
|
155 + | ..::std::default::Default::default()
|
156 + | });
|
157 + |
|
158 + | ::std::option::Option::Some(cfg.freeze())
|
159 + | }
|
160 + |
|
161 + | fn runtime_components(
|
162 + | &self,
|
163 + | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
164 + | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
165 + | #[allow(unused_mut)]
|
166 + | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartAssociationsOnce")
|
167 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
168 + | ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
|
169 + | ))
|
170 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
171 + | StartAssociationsOnceEndpointParamsInterceptor,
|
172 + | ))
|
173 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
174 + | crate::operation::start_associations_once::StartAssociationsOnceError,
|
175 + | >::new())
|
176 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
177 + | crate::operation::start_associations_once::StartAssociationsOnceError,
|
178 + | >::new())
|
179 + | .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
|
180 + | crate::operation::start_associations_once::StartAssociationsOnceError,
|
181 + | >::new())
|
182 + | .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
|
183 + | crate::operation::start_associations_once::StartAssociationsOnceError,
|
184 + | >::new());
|
185 + |
|
186 + | ::std::borrow::Cow::Owned(rcb)
|
187 + | }
|
188 + | }
|
189 + |
|
190 + | #[derive(Debug)]
|
191 + | struct StartAssociationsOnceResponseDeserializer;
|
192 + | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartAssociationsOnceResponseDeserializer {
|
193 + | fn deserialize_nonstreaming_with_config(
|
194 + | &self,
|
195 + | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
196 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
197 + | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
198 + | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
199 + | // Load body and headers BEFORE BeforeParseResponse so customizations
|
200 + | // (e.g., S3's `body_is_error` check that detects errors returned with
|
201 + | // HTTP 200) can inspect them. The legacy non-streaming path also
|
202 + | // loads `body` before firing this hook.
|
203 + | let body = response.body().bytes().expect("body loaded");
|
204 + | let headers = response.headers();
|
205 + | #[allow(unused_mut)]
|
206 + | let mut force_error = false;
|
207 + | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
208 + | if !success && status != 200 || force_error {
|
209 + | let protocol = _cfg
|
210 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
211 + | .expect("a SharedClientProtocol is required");
|
212 + | #[allow(unused_mut)]
|
213 + | let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
|
214 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
215 + | })?;
|
216 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
217 + | let generic = generic_builder.build();
|
218 + | let error_code = match generic.code() {
|
219 + | ::std::option::Option::Some(code) => code,
|
220 + | ::std::option::Option::None => {
|
221 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
222 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
223 + | crate::operation::start_associations_once::StartAssociationsOnceError::unhandled(generic),
|
224 + | ),
|
225 + | ))
|
226 + | }
|
227 + | };
|
228 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
229 + | let err = match error_code {
|
230 + | "AssociationDoesNotExist" => crate::operation::start_associations_once::StartAssociationsOnceError::AssociationDoesNotExist({
|
231 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
232 + | crate::types::error::AssociationDoesNotExist::deserialize_with_response(
|
233 + | &mut *deser,
|
234 + | response.headers(),
|
235 + | response.status().into(),
|
236 + | body,
|
237 + | )
|
238 + | }) {
|
239 + | ::std::result::Result::Ok(val) => val,
|
240 + | ::std::result::Result::Err(e) => {
|
241 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
242 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
243 + | ))
|
244 + | }
|
245 + | };
|
246 + | tmp.meta = generic;
|
247 + | if tmp.message.is_none() {
|
248 + | tmp.message = _error_message;
|
249 + | }
|
250 + | tmp
|
251 + | }),
|
252 + | "InvalidAssociation" => crate::operation::start_associations_once::StartAssociationsOnceError::InvalidAssociation({
|
253 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
254 + | crate::types::error::InvalidAssociation::deserialize_with_response(
|
255 + | &mut *deser,
|
256 + | response.headers(),
|
257 + | response.status().into(),
|
258 + | body,
|
259 + | )
|
260 + | }) {
|
261 + | ::std::result::Result::Ok(val) => val,
|
262 + | ::std::result::Result::Err(e) => {
|
263 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
264 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
265 + | ))
|
266 + | }
|
267 + | };
|
268 + | tmp.meta = generic;
|
269 + | if tmp.message.is_none() {
|
270 + | tmp.message = _error_message;
|
271 + | }
|
272 + | tmp
|
273 + | }),
|
274 + | _ => {
|
275 + | // Registry-backed, operation-scoped reification of an error whose
|
276 + | // code this operation does not model directly: the operation's own
|
277 + | // error registry is consulted first, then the lookup widens to the
|
278 + | // service-wide error registry. On a hit, the reified error is attached
|
279 + | // as the source of the returned unhandled error while its metadata
|
280 + | // (code, message, request id) is preserved; on a miss the generic
|
281 + | // error is returned unchanged.
|
282 + | match protocol
|
283 + | .deserialize_error_response(response, _cfg)
|
284 + | .ok()
|
285 + | .and_then(|mut deser| {
|
286 + | ::aws_smithy_schema::registry::reify_error(
|
287 + | crate::operation::start_associations_once::error_registry::REGISTRY
|
288 + | .or(&crate::error_type_registry::REGISTRY),
|
289 + | error_code,
|
290 + | &mut *deser,
|
291 + | )
|
292 + | }) {
|
293 + | ::std::option::Option::Some(source) => <crate::operation::start_associations_once::StartAssociationsOnceError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
|
294 + | ::std::option::Option::None => crate::operation::start_associations_once::StartAssociationsOnceError::generic(generic),
|
295 + | }
|
296 + | }
|
297 + | };
|
298 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
299 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
300 + | ))
|
301 + | } else {
|
302 + | let protocol = _cfg
|
303 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
304 + | .expect("a SharedClientProtocol is required");
|
305 + | let mut deser = protocol
|
306 + | .deserialize_response(response, StartAssociationsOnce::OUTPUT_SCHEMA, _cfg)
|
307 + | .map_err(|e| {
|
308 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
309 + | })?;
|
310 + | // body and headers are already in scope from the top of the function;
|
311 + | // alias `headers` as `_response_headers` so MutateOutput
|
312 + | // customizations have a stable name to read from.
|
313 + | let _response_headers = headers;
|
314 + | #[allow(unused_mut)]
|
315 + | let mut output = crate::operation::start_associations_once::StartAssociationsOnceOutput::deserialize_with_response(
|
316 + | &mut *deser,
|
317 + | _response_headers,
|
318 + | response.status().into(),
|
319 + | body,
|
320 + | )
|
321 + | .map_err(|e| {
|
322 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
323 + | })?;
|
324 + | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
325 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
326 + | }
|
327 + | }
|
328 + | }
|
329 + | #[derive(Debug)]
|
330 + | struct StartAssociationsOnceRequestSerializer;
|
331 + | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartAssociationsOnceRequestSerializer {
|
332 + | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
333 + | fn serialize_input(
|
334 + | &self,
|
335 + | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
336 + | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
337 + | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
338 + | let input = input
|
339 + | .downcast::<crate::operation::start_associations_once::StartAssociationsOnceInput>()
|
340 + | .expect("correct type");
|
341 + |
|
342 + | let protocol = _cfg
|
343 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
344 + | .expect("a SharedClientProtocol is required");
|
345 + | let mut request = protocol
|
346 + | .serialize_request(&input, StartAssociationsOnce::INPUT_SCHEMA, "/", _cfg)
|
347 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
348 + |
|
349 + | return ::std::result::Result::Ok(request);
|
350 + | }
|
351 + | }
|
352 + | #[derive(Debug)]
|
353 + | struct StartAssociationsOnceEndpointParamsInterceptor;
|
354 + |
|
355 + | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
356 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartAssociationsOnceEndpointParamsInterceptor {
|
357 + | fn name(&self) -> &'static str {
|
358 + | "StartAssociationsOnceEndpointParamsInterceptor"
|
359 + | }
|
360 + |
|
361 + | fn read_before_execution(
|
362 + | &self,
|
363 + | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
364 + | '_,
|
365 + | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
366 + | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
367 + | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
368 + | >,
|
369 + | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
370 + | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
371 + | let _input = context
|
372 + | .input()
|
373 + | .downcast_ref::<StartAssociationsOnceInput>()
|
374 + | .ok_or("failed to downcast to StartAssociationsOnceInput")?;
|
375 + |
|
376 + | let params = crate::config::endpoint::Params::builder()
|
377 + | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
378 + | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
379 + | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
380 + | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
381 + | .build()
|
382 + | .map_err(|err| {
|
383 + | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
384 + | })?;
|
385 + | cfg.interceptor_state()
|
386 + | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
387 + | ::std::result::Result::Ok(())
|
388 + | }
|
389 + | }
|
390 + |
|
391 + | // The get_* functions below are generated from JMESPath expressions in the
|
392 + | // operationContextParams trait. They target the operation's input shape.
|
393 + |
|
394 + | /// Error type for the `StartAssociationsOnceError` operation.
|
395 + | #[non_exhaustive]
|
396 + | #[derive(::std::fmt::Debug)]
|
397 + | pub enum StartAssociationsOnceError {
|
398 + | /// <p>The specified association doesn't exist.</p>
|
399 + | AssociationDoesNotExist(crate::types::error::AssociationDoesNotExist),
|
400 + | /// <p>The association isn't valid or doesn't exist.</p>
|
401 + | InvalidAssociation(crate::types::error::InvalidAssociation),
|
402 + | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
403 + | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
404 + | variable wildcard pattern and check `.code()`:
|
405 + | \
|
406 + | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
407 + | \
|
408 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartAssociationsOnceError) for what information is available for the error.")]
|
409 + | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
410 + | }
|
411 + | impl StartAssociationsOnceError {
|
412 + | /// Creates the `StartAssociationsOnceError::Unhandled` variant from any error type.
|
413 + | pub fn unhandled(
|
414 + | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
415 + | ) -> Self {
|
416 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
417 + | source: err.into(),
|
418 + | meta: ::std::default::Default::default(),
|
419 + | })
|
420 + | }
|
421 + |
|
422 + | /// Creates the `StartAssociationsOnceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
423 + | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
424 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
425 + | source: err.clone().into(),
|
426 + | meta: err,
|
427 + | })
|
428 + | }
|
429 + | ///
|
430 + | /// Returns error metadata, which includes the error code, message,
|
431 + | /// request ID, and potentially additional information.
|
432 + | ///
|
433 + | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
434 + | match self {
|
435 + | Self::AssociationDoesNotExist(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
436 + | Self::InvalidAssociation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
437 + | Self::Unhandled(e) => &e.meta,
|
438 + | }
|
439 + | }
|
440 + | /// Returns `true` if the error kind is `StartAssociationsOnceError::AssociationDoesNotExist`.
|
441 + | pub fn is_association_does_not_exist(&self) -> bool {
|
442 + | matches!(self, Self::AssociationDoesNotExist(_))
|
443 + | }
|
444 + | /// Returns `true` if the error kind is `StartAssociationsOnceError::InvalidAssociation`.
|
445 + | pub fn is_invalid_association(&self) -> bool {
|
446 + | matches!(self, Self::InvalidAssociation(_))
|
447 + | }
|
448 + | }
|
449 + | impl ::std::error::Error for StartAssociationsOnceError {
|
450 + | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
451 + | match self {
|
452 + | Self::AssociationDoesNotExist(_inner) => ::std::option::Option::Some(_inner),
|
453 + | Self::InvalidAssociation(_inner) => ::std::option::Option::Some(_inner),
|
454 + | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
455 + | }
|
456 + | }
|
457 + | }
|
458 + | impl ::std::fmt::Display for StartAssociationsOnceError {
|
459 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
460 + | match self {
|
461 + | Self::AssociationDoesNotExist(_inner) => _inner.fmt(f),
|
462 + | Self::InvalidAssociation(_inner) => _inner.fmt(f),
|
463 + | Self::Unhandled(_inner) => {
|
464 + | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
465 + | write!(f, "unhandled error ({code})")
|
466 + | } else {
|
467 + | f.write_str("unhandled error")
|
468 + | }
|
469 + | }
|
470 + | }
|
471 + | }
|
472 + | }
|
473 + | impl ::aws_smithy_types::retry::ProvideErrorKind for StartAssociationsOnceError {
|
474 + | fn code(&self) -> ::std::option::Option<&str> {
|
475 + | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
476 + | }
|
477 + | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
478 + | ::std::option::Option::None
|
479 + | }
|
480 + | }
|
481 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartAssociationsOnceError {
|
482 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
483 + | match self {
|
484 + | Self::AssociationDoesNotExist(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
485 + | Self::InvalidAssociation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
486 + | Self::Unhandled(_inner) => &_inner.meta,
|
487 + | }
|
488 + | }
|
489 + | }
|
490 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartAssociationsOnceError {
|
491 + | fn create_unhandled_error(
|
492 + | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
493 + | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
494 + | ) -> Self {
|
495 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
496 + | source,
|
497 + | meta: meta.unwrap_or_default(),
|
498 + | })
|
499 + | }
|
500 + | }
|
501 + | impl ::aws_types::request_id::RequestId for crate::operation::start_associations_once::StartAssociationsOnceError {
|
502 + | fn request_id(&self) -> Option<&str> {
|
503 + | self.meta().request_id()
|
504 + | }
|
505 + | }
|
506 + |
|
507 + | pub use crate::operation::start_associations_once::_start_associations_once_input::StartAssociationsOnceInput;
|
508 + |
|
509 + | pub use crate::operation::start_associations_once::_start_associations_once_output::StartAssociationsOnceOutput;
|
510 + |
|
511 + | mod _start_associations_once_input;
|
512 + |
|
513 + | mod _start_associations_once_output;
|
514 + |
|
515 + | /// Builders
|
516 + | pub mod builders;
|