1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /// Orchestration and serialization glue logic for `CreateAssociation`.
|
3 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 + | #[non_exhaustive]
|
5 + | pub struct CreateAssociation;
|
6 + | impl CreateAssociation {
|
7 + | /// Creates a new `CreateAssociation`
|
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> = crate::operation::create_association::CreateAssociationInput::SCHEMA;
|
13 + | /// The schema for this operation's output shape.
|
14 + | pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::create_association::CreateAssociationOutput::SCHEMA;
|
15 + | pub(crate) async fn orchestrate(
|
16 + | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
17 + | input: crate::operation::create_association::CreateAssociationInput,
|
18 + | ) -> ::std::result::Result<
|
19 + | crate::operation::create_association::CreateAssociationOutput,
|
20 + | ::aws_smithy_runtime_api::client::result::SdkError<
|
21 + | crate::operation::create_association::CreateAssociationError,
|
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::create_association::CreateAssociationError>()
|
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::create_association::CreateAssociationOutput>()
|
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::create_association::CreateAssociationInput,
|
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("SSM", "CreateAssociation", input, runtime_plugins, stop_point)
|
59 + | // Create a parent span for the entire operation. Includes a random, internal-only,
|
60 + | // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
|
61 + | .instrument(::tracing::debug_span!(
|
62 + | "SSM.CreateAssociation",
|
63 + | "rpc.service" = "SSM",
|
64 + | "rpc.method" = "CreateAssociation",
|
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 + | }
|
91 + | /// Per-operation error registry. Contains an entry for every modeled
|
92 + | /// error this operation can throw.
|
93 + | ///
|
94 + | /// Used by the schema-serde error path as the operation-scoped lookup
|
95 + | /// for registry-backed error reification: an error code that does not
|
96 + | /// match one of the operation's modeled errors directly is resolved
|
97 + | /// against this registry first, then widened to the service-wide error
|
98 + | /// registry.
|
99 + | pub(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::AssociationAlreadyExists::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::AssociationAlreadyExists::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::AssociationAlreadyExists::deserialize(d)?))
|
109 + | },
|
110 + | )
|
111 + | .insert_error_shape(
|
112 + | crate::types::error::AssociationLimitExceeded::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::AssociationLimitExceeded::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::AssociationLimitExceeded::deserialize(d)?))
|
118 + | },
|
119 + | )
|
120 + | .insert_error_shape(
|
121 + | crate::types::error::InternalServerError::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::InternalServerError::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::InternalServerError::deserialize(d)?))
|
127 + | },
|
128 + | )
|
129 + | .insert_error_shape(
|
130 + | crate::types::error::InvalidDocument::SCHEMA,
|
131 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
132 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocument::deserialize(d)?))
|
133 + | },
|
134 + | |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> {
|
135 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocument::deserialize(d)?))
|
136 + | },
|
137 + | )
|
138 + | .insert_error_shape(
|
139 + | crate::types::error::InvalidDocumentVersion::SCHEMA,
|
140 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
141 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocumentVersion::deserialize(d)?))
|
142 + | },
|
143 + | |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> {
|
144 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocumentVersion::deserialize(d)?))
|
145 + | },
|
146 + | )
|
147 + | .insert_error_shape(
|
148 + | crate::types::error::InvalidInstanceId::SCHEMA,
|
149 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
150 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidInstanceId::deserialize(d)?))
|
151 + | },
|
152 + | |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> {
|
153 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidInstanceId::deserialize(d)?))
|
154 + | },
|
155 + | )
|
156 + | .insert_error_shape(
|
157 + | crate::types::error::InvalidOutputLocation::SCHEMA,
|
158 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
159 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidOutputLocation::deserialize(d)?))
|
160 + | },
|
161 + | |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> {
|
162 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidOutputLocation::deserialize(d)?))
|
163 + | },
|
164 + | )
|
165 + | .insert_error_shape(
|
166 + | crate::types::error::InvalidParameters::SCHEMA,
|
167 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
168 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidParameters::deserialize(d)?))
|
169 + | },
|
170 + | |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> {
|
171 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidParameters::deserialize(d)?))
|
172 + | },
|
173 + | )
|
174 + | .insert_error_shape(
|
175 + | crate::types::error::InvalidSchedule::SCHEMA,
|
176 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
177 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidSchedule::deserialize(d)?))
|
178 + | },
|
179 + | |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> {
|
180 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidSchedule::deserialize(d)?))
|
181 + | },
|
182 + | )
|
183 + | .insert_error_shape(
|
184 + | crate::types::error::InvalidTag::SCHEMA,
|
185 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
186 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidTag::deserialize(d)?))
|
187 + | },
|
188 + | |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> {
|
189 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidTag::deserialize(d)?))
|
190 + | },
|
191 + | )
|
192 + | .insert_error_shape(
|
193 + | crate::types::error::InvalidTarget::SCHEMA,
|
194 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
195 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidTarget::deserialize(d)?))
|
196 + | },
|
197 + | |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> {
|
198 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidTarget::deserialize(d)?))
|
199 + | },
|
200 + | )
|
201 + | .insert_error_shape(
|
202 + | crate::types::error::InvalidTargetMaps::SCHEMA,
|
203 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
204 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidTargetMaps::deserialize(d)?))
|
205 + | },
|
206 + | |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> {
|
207 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidTargetMaps::deserialize(d)?))
|
208 + | },
|
209 + | )
|
210 + | .insert_error_shape(
|
211 + | crate::types::error::UnsupportedPlatformType::SCHEMA,
|
212 + | |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
|
213 + | ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::UnsupportedPlatformType::deserialize(d)?))
|
214 + | },
|
215 + | |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> {
|
216 + | ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::UnsupportedPlatformType::deserialize(d)?))
|
217 + | },
|
218 + | )
|
219 + | .build()
|
220 + | });
|
221 + | }
|
222 + | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateAssociation {
|
223 + | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
224 + | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateAssociation");
|
225 + |
|
226 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
227 + | CreateAssociationRequestSerializer,
|
228 + | ));
|
229 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
230 + | CreateAssociationResponseDeserializer,
|
231 + | ));
|
232 + |
|
233 + | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
234 + | crate::config::auth::Params::builder()
|
235 + | .operation_name("CreateAssociation")
|
236 + | .build()
|
237 + | .expect("required fields set"),
|
238 + | ));
|
239 + |
|
240 + | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
|
241 + | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("CreateAssociation", "SSM"));
|
242 + | let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
|
243 + | signing_options.double_uri_encode = true;
|
244 + | signing_options.content_sha256_header = false;
|
245 + | signing_options.normalize_uri_path = true;
|
246 + | signing_options.payload_override = None;
|
247 + |
|
248 + | cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
|
249 + | signing_options,
|
250 + | ..::std::default::Default::default()
|
251 + | });
|
252 + |
|
253 + | ::std::option::Option::Some(cfg.freeze())
|
254 + | }
|
255 + |
|
256 + | fn runtime_components(
|
257 + | &self,
|
258 + | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
259 + | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
260 + | #[allow(unused_mut)]
|
261 + | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateAssociation")
|
262 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
263 + | CreateAssociationTelemetryInputCaptureInterceptor,
|
264 + | ))
|
265 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
266 + | ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
|
267 + | ))
|
268 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
269 + | CreateAssociationEndpointParamsInterceptor,
|
270 + | ))
|
271 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
272 + | crate::operation::create_association::CreateAssociationError,
|
273 + | >::new())
|
274 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
275 + | crate::operation::create_association::CreateAssociationError,
|
276 + | >::new())
|
277 + | .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
|
278 + | crate::operation::create_association::CreateAssociationError,
|
279 + | >::new())
|
280 + | .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
|
281 + | crate::operation::create_association::CreateAssociationError,
|
282 + | >::new());
|
283 + |
|
284 + | ::std::borrow::Cow::Owned(rcb)
|
285 + | }
|
286 + | }
|
287 + |
|
288 + | #[derive(Debug)]
|
289 + | struct CreateAssociationTelemetryInputCaptureInterceptor;
|
290 + |
|
291 + | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
292 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateAssociationTelemetryInputCaptureInterceptor {
|
293 + | fn name(&self) -> &'static str {
|
294 + | "CreateAssociationTelemetryInputCaptureInterceptor"
|
295 + | }
|
296 + |
|
297 + | fn read_before_execution(
|
298 + | &self,
|
299 + | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
300 + | '_,
|
301 + | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
302 + | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
303 + | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
304 + | >,
|
305 + | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
306 + | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
307 + | // Nothing to do unless the customer opted in by naming members to record.
|
308 + | let ::std::option::Option::Some(requested) = cfg
|
309 + | .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
|
310 + | .filter(|r| !r.is_empty())
|
311 + | else {
|
312 + | return ::std::result::Result::Ok(());
|
313 + | };
|
314 + |
|
315 + | let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateAssociationInput>() else {
|
316 + | // A mismatched input is not this interceptor's concern; skip quietly.
|
317 + | return ::std::result::Result::Ok(());
|
318 + | };
|
319 + |
|
320 + | let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
|
321 + | if requested.should_capture("Name") {
|
322 + | if let ::std::option::Option::Some(value) = input.name.as_deref() {
|
323 + | captured.insert("Name", value);
|
324 + | }
|
325 + | }
|
326 + | if requested.should_capture("DocumentVersion") {
|
327 + | if let ::std::option::Option::Some(value) = input.document_version.as_deref() {
|
328 + | captured.insert("DocumentVersion", value);
|
329 + | }
|
330 + | }
|
331 + | if requested.should_capture("InstanceId") {
|
332 + | if let ::std::option::Option::Some(value) = input.instance_id.as_deref() {
|
333 + | captured.insert("InstanceId", value);
|
334 + | }
|
335 + | }
|
336 + | if requested.should_capture("ScheduleExpression") {
|
337 + | if let ::std::option::Option::Some(value) = input.schedule_expression.as_deref() {
|
338 + | captured.insert("ScheduleExpression", value);
|
339 + | }
|
340 + | }
|
341 + | if requested.should_capture("AssociationName") {
|
342 + | if let ::std::option::Option::Some(value) = input.association_name.as_deref() {
|
343 + | captured.insert("AssociationName", value);
|
344 + | }
|
345 + | }
|
346 + | if requested.should_capture("AutomationTargetParameterName") {
|
347 + | if let ::std::option::Option::Some(value) = input.automation_target_parameter_name.as_deref() {
|
348 + | captured.insert("AutomationTargetParameterName", value);
|
349 + | }
|
350 + | }
|
351 + | if requested.should_capture("MaxErrors") {
|
352 + | if let ::std::option::Option::Some(value) = input.max_errors.as_deref() {
|
353 + | captured.insert("MaxErrors", value);
|
354 + | }
|
355 + | }
|
356 + | if requested.should_capture("MaxConcurrency") {
|
357 + | if let ::std::option::Option::Some(value) = input.max_concurrency.as_deref() {
|
358 + | captured.insert("MaxConcurrency", value);
|
359 + | }
|
360 + | }
|
361 + | if requested.should_capture("AssociationDispatchAssumeRole") {
|
362 + | if let ::std::option::Option::Some(value) = input.association_dispatch_assume_role.as_deref() {
|
363 + | captured.insert("AssociationDispatchAssumeRole", value);
|
364 + | }
|
365 + | }
|
366 + |
|
367 + | cfg.interceptor_state().store_put(captured);
|
368 + | ::std::result::Result::Ok(())
|
369 + | }
|
370 + | }
|
371 + | #[derive(Debug)]
|
372 + | struct CreateAssociationResponseDeserializer;
|
373 + | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateAssociationResponseDeserializer {
|
374 + | fn deserialize_nonstreaming_with_config(
|
375 + | &self,
|
376 + | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
377 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
378 + | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
379 + | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
380 + | // Load body and headers BEFORE BeforeParseResponse so customizations
|
381 + | // (e.g., S3's `body_is_error` check that detects errors returned with
|
382 + | // HTTP 200) can inspect them. The legacy non-streaming path also
|
383 + | // loads `body` before firing this hook.
|
384 + | let body = response.body().bytes().expect("body loaded");
|
385 + | let headers = response.headers();
|
386 + | #[allow(unused_mut)]
|
387 + | let mut force_error = false;
|
388 + | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
389 + | if !success && status != 200 || force_error {
|
390 + | let protocol = _cfg
|
391 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
392 + | .expect("a SharedClientProtocol is required");
|
393 + | #[allow(unused_mut)]
|
394 + | let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
|
395 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
396 + | })?;
|
397 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
398 + | let generic = generic_builder.build();
|
399 + | let error_code = match generic.code() {
|
400 + | ::std::option::Option::Some(code) => code,
|
401 + | ::std::option::Option::None => {
|
402 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
403 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::create_association::CreateAssociationError::unhandled(
|
404 + | generic,
|
405 + | )),
|
406 + | ))
|
407 + | }
|
408 + | };
|
409 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
410 + | let err = match error_code {
|
411 + | "AssociationAlreadyExists" => crate::operation::create_association::CreateAssociationError::AssociationAlreadyExists({
|
412 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
413 + | crate::types::error::AssociationAlreadyExists::deserialize_with_response(
|
414 + | &mut *deser,
|
415 + | response.headers(),
|
416 + | response.status().into(),
|
417 + | body,
|
418 + | )
|
419 + | }) {
|
420 + | ::std::result::Result::Ok(val) => val,
|
421 + | ::std::result::Result::Err(e) => {
|
422 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
423 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
424 + | ))
|
425 + | }
|
426 + | };
|
427 + | tmp.meta = generic;
|
428 + | if tmp.message.is_none() {
|
429 + | tmp.message = _error_message;
|
430 + | }
|
431 + | tmp
|
432 + | }),
|
433 + | "AssociationLimitExceeded" => crate::operation::create_association::CreateAssociationError::AssociationLimitExceeded({
|
434 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
435 + | crate::types::error::AssociationLimitExceeded::deserialize_with_response(
|
436 + | &mut *deser,
|
437 + | response.headers(),
|
438 + | response.status().into(),
|
439 + | body,
|
440 + | )
|
441 + | }) {
|
442 + | ::std::result::Result::Ok(val) => val,
|
443 + | ::std::result::Result::Err(e) => {
|
444 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
445 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
446 + | ))
|
447 + | }
|
448 + | };
|
449 + | tmp.meta = generic;
|
450 + | if tmp.message.is_none() {
|
451 + | tmp.message = _error_message;
|
452 + | }
|
453 + | tmp
|
454 + | }),
|
455 + | "InternalServerError" => crate::operation::create_association::CreateAssociationError::InternalServerError({
|
456 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
457 + | crate::types::error::InternalServerError::deserialize_with_response(
|
458 + | &mut *deser,
|
459 + | response.headers(),
|
460 + | response.status().into(),
|
461 + | body,
|
462 + | )
|
463 + | }) {
|
464 + | ::std::result::Result::Ok(val) => val,
|
465 + | ::std::result::Result::Err(e) => {
|
466 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
467 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
468 + | ))
|
469 + | }
|
470 + | };
|
471 + | tmp.meta = generic;
|
472 + | if tmp.message.is_none() {
|
473 + | tmp.message = _error_message;
|
474 + | }
|
475 + | tmp
|
476 + | }),
|
477 + | "InvalidDocument" => crate::operation::create_association::CreateAssociationError::InvalidDocument({
|
478 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
479 + | crate::types::error::InvalidDocument::deserialize_with_response(
|
480 + | &mut *deser,
|
481 + | response.headers(),
|
482 + | response.status().into(),
|
483 + | body,
|
484 + | )
|
485 + | }) {
|
486 + | ::std::result::Result::Ok(val) => val,
|
487 + | ::std::result::Result::Err(e) => {
|
488 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
489 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
490 + | ))
|
491 + | }
|
492 + | };
|
493 + | tmp.meta = generic;
|
494 + | if tmp.message.is_none() {
|
495 + | tmp.message = _error_message;
|
496 + | }
|
497 + | tmp
|
498 + | }),
|
499 + | "InvalidDocumentVersion" => crate::operation::create_association::CreateAssociationError::InvalidDocumentVersion({
|
500 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
501 + | crate::types::error::InvalidDocumentVersion::deserialize_with_response(
|
502 + | &mut *deser,
|
503 + | response.headers(),
|
504 + | response.status().into(),
|
505 + | body,
|
506 + | )
|
507 + | }) {
|
508 + | ::std::result::Result::Ok(val) => val,
|
509 + | ::std::result::Result::Err(e) => {
|
510 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
511 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
512 + | ))
|
513 + | }
|
514 + | };
|
515 + | tmp.meta = generic;
|
516 + | if tmp.message.is_none() {
|
517 + | tmp.message = _error_message;
|
518 + | }
|
519 + | tmp
|
520 + | }),
|
521 + | "InvalidInstanceId" => crate::operation::create_association::CreateAssociationError::InvalidInstanceId({
|
522 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
523 + | crate::types::error::InvalidInstanceId::deserialize_with_response(
|
524 + | &mut *deser,
|
525 + | response.headers(),
|
526 + | response.status().into(),
|
527 + | body,
|
528 + | )
|
529 + | }) {
|
530 + | ::std::result::Result::Ok(val) => val,
|
531 + | ::std::result::Result::Err(e) => {
|
532 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
533 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
534 + | ))
|
535 + | }
|
536 + | };
|
537 + | tmp.meta = generic;
|
538 + | if tmp.message.is_none() {
|
539 + | tmp.message = _error_message;
|
540 + | }
|
541 + | tmp
|
542 + | }),
|
543 + | "InvalidOutputLocation" => crate::operation::create_association::CreateAssociationError::InvalidOutputLocation({
|
544 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
545 + | crate::types::error::InvalidOutputLocation::deserialize_with_response(
|
546 + | &mut *deser,
|
547 + | response.headers(),
|
548 + | response.status().into(),
|
549 + | body,
|
550 + | )
|
551 + | }) {
|
552 + | ::std::result::Result::Ok(val) => val,
|
553 + | ::std::result::Result::Err(e) => {
|
554 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
555 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
556 + | ))
|
557 + | }
|
558 + | };
|
559 + | tmp.meta = generic;
|
560 + | if tmp.message.is_none() {
|
561 + | tmp.message = _error_message;
|
562 + | }
|
563 + | tmp
|
564 + | }),
|
565 + | "InvalidParameters" => crate::operation::create_association::CreateAssociationError::InvalidParameters({
|
566 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
567 + | crate::types::error::InvalidParameters::deserialize_with_response(
|
568 + | &mut *deser,
|
569 + | response.headers(),
|
570 + | response.status().into(),
|
571 + | body,
|
572 + | )
|
573 + | }) {
|
574 + | ::std::result::Result::Ok(val) => val,
|
575 + | ::std::result::Result::Err(e) => {
|
576 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
577 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
578 + | ))
|
579 + | }
|
580 + | };
|
581 + | tmp.meta = generic;
|
582 + | if tmp.message.is_none() {
|
583 + | tmp.message = _error_message;
|
584 + | }
|
585 + | tmp
|
586 + | }),
|
587 + | "InvalidSchedule" => crate::operation::create_association::CreateAssociationError::InvalidSchedule({
|
588 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
589 + | crate::types::error::InvalidSchedule::deserialize_with_response(
|
590 + | &mut *deser,
|
591 + | response.headers(),
|
592 + | response.status().into(),
|
593 + | body,
|
594 + | )
|
595 + | }) {
|
596 + | ::std::result::Result::Ok(val) => val,
|
597 + | ::std::result::Result::Err(e) => {
|
598 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
599 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
600 + | ))
|
601 + | }
|
602 + | };
|
603 + | tmp.meta = generic;
|
604 + | if tmp.message.is_none() {
|
605 + | tmp.message = _error_message;
|
606 + | }
|
607 + | tmp
|
608 + | }),
|
609 + | "InvalidTag" => crate::operation::create_association::CreateAssociationError::InvalidTag({
|
610 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
611 + | crate::types::error::InvalidTag::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
|
612 + | }) {
|
613 + | ::std::result::Result::Ok(val) => val,
|
614 + | ::std::result::Result::Err(e) => {
|
615 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
616 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
617 + | ))
|
618 + | }
|
619 + | };
|
620 + | tmp.meta = generic;
|
621 + | if tmp.message.is_none() {
|
622 + | tmp.message = _error_message;
|
623 + | }
|
624 + | tmp
|
625 + | }),
|
626 + | "InvalidTarget" => crate::operation::create_association::CreateAssociationError::InvalidTarget({
|
627 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
628 + | crate::types::error::InvalidTarget::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
|
629 + | }) {
|
630 + | ::std::result::Result::Ok(val) => val,
|
631 + | ::std::result::Result::Err(e) => {
|
632 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
633 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
634 + | ))
|
635 + | }
|
636 + | };
|
637 + | tmp.meta = generic;
|
638 + | if tmp.message.is_none() {
|
639 + | tmp.message = _error_message;
|
640 + | }
|
641 + | tmp
|
642 + | }),
|
643 + | "InvalidTargetMaps" => crate::operation::create_association::CreateAssociationError::InvalidTargetMaps({
|
644 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
645 + | crate::types::error::InvalidTargetMaps::deserialize_with_response(
|
646 + | &mut *deser,
|
647 + | response.headers(),
|
648 + | response.status().into(),
|
649 + | body,
|
650 + | )
|
651 + | }) {
|
652 + | ::std::result::Result::Ok(val) => val,
|
653 + | ::std::result::Result::Err(e) => {
|
654 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
655 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
656 + | ))
|
657 + | }
|
658 + | };
|
659 + | tmp.meta = generic;
|
660 + | if tmp.message.is_none() {
|
661 + | tmp.message = _error_message;
|
662 + | }
|
663 + | tmp
|
664 + | }),
|
665 + | "UnsupportedPlatformType" => crate::operation::create_association::CreateAssociationError::UnsupportedPlatformType({
|
666 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
667 + | crate::types::error::UnsupportedPlatformType::deserialize_with_response(
|
668 + | &mut *deser,
|
669 + | response.headers(),
|
670 + | response.status().into(),
|
671 + | body,
|
672 + | )
|
673 + | }) {
|
674 + | ::std::result::Result::Ok(val) => val,
|
675 + | ::std::result::Result::Err(e) => {
|
676 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
677 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
678 + | ))
|
679 + | }
|
680 + | };
|
681 + | tmp.meta = generic;
|
682 + | if tmp.message.is_none() {
|
683 + | tmp.message = _error_message;
|
684 + | }
|
685 + | tmp
|
686 + | }),
|
687 + | _ => {
|
688 + | // Registry-backed, operation-scoped reification of an error whose
|
689 + | // code this operation does not model directly: the operation's own
|
690 + | // error registry is consulted first, then the lookup widens to the
|
691 + | // service-wide error registry. On a hit, the reified error is attached
|
692 + | // as the source of the returned unhandled error while its metadata
|
693 + | // (code, message, request id) is preserved; on a miss the generic
|
694 + | // error is returned unchanged.
|
695 + | match protocol
|
696 + | .deserialize_error_response(response, _cfg)
|
697 + | .ok()
|
698 + | .and_then(|mut deser| {
|
699 + | ::aws_smithy_schema::registry::reify_error(
|
700 + | crate::operation::create_association::error_registry::REGISTRY
|
701 + | .or(&crate::error_type_registry::REGISTRY),
|
702 + | error_code,
|
703 + | &mut *deser,
|
704 + | )
|
705 + | }) {
|
706 + | ::std::option::Option::Some(source) => <crate::operation::create_association::CreateAssociationError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
|
707 + | ::std::option::Option::None => crate::operation::create_association::CreateAssociationError::generic(generic),
|
708 + | }
|
709 + | }
|
710 + | };
|
711 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
712 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
713 + | ))
|
714 + | } else {
|
715 + | let protocol = _cfg
|
716 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
717 + | .expect("a SharedClientProtocol is required");
|
718 + | let mut deser = protocol
|
719 + | .deserialize_response(response, CreateAssociation::OUTPUT_SCHEMA, _cfg)
|
720 + | .map_err(|e| {
|
721 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
722 + | })?;
|
723 + | // body and headers are already in scope from the top of the function;
|
724 + | // alias `headers` as `_response_headers` so MutateOutput
|
725 + | // customizations have a stable name to read from.
|
726 + | let _response_headers = headers;
|
727 + | #[allow(unused_mut)]
|
728 + | let mut output = crate::operation::create_association::CreateAssociationOutput::deserialize_with_response(
|
729 + | &mut *deser,
|
730 + | _response_headers,
|
731 + | response.status().into(),
|
732 + | body,
|
733 + | )
|
734 + | .map_err(|e| {
|
735 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
736 + | })?;
|
737 + | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
738 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
739 + | }
|
740 + | }
|
741 + | }
|
742 + | #[derive(Debug)]
|
743 + | struct CreateAssociationRequestSerializer;
|
744 + | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateAssociationRequestSerializer {
|
745 + | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
746 + | fn serialize_input(
|
747 + | &self,
|
748 + | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
749 + | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
750 + | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
751 + | let input = input
|
752 + | .downcast::<crate::operation::create_association::CreateAssociationInput>()
|
753 + | .expect("correct type");
|
754 + |
|
755 + | let protocol = _cfg
|
756 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
757 + | .expect("a SharedClientProtocol is required");
|
758 + | let mut request = protocol
|
759 + | .serialize_request(&input, CreateAssociation::INPUT_SCHEMA, "/", _cfg)
|
760 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
761 + |
|
762 + | return ::std::result::Result::Ok(request);
|
763 + | }
|
764 + | }
|
765 + | #[derive(Debug)]
|
766 + | struct CreateAssociationEndpointParamsInterceptor;
|
767 + |
|
768 + | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
769 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateAssociationEndpointParamsInterceptor {
|
770 + | fn name(&self) -> &'static str {
|
771 + | "CreateAssociationEndpointParamsInterceptor"
|
772 + | }
|
773 + |
|
774 + | fn read_before_execution(
|
775 + | &self,
|
776 + | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
777 + | '_,
|
778 + | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
779 + | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
780 + | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
781 + | >,
|
782 + | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
783 + | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
784 + | let _input = context
|
785 + | .input()
|
786 + | .downcast_ref::<CreateAssociationInput>()
|
787 + | .ok_or("failed to downcast to CreateAssociationInput")?;
|
788 + |
|
789 + | let params = crate::config::endpoint::Params::builder()
|
790 + | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
791 + | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
792 + | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
793 + | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
794 + | .build()
|
795 + | .map_err(|err| {
|
796 + | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
797 + | })?;
|
798 + | cfg.interceptor_state()
|
799 + | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
800 + | ::std::result::Result::Ok(())
|
801 + | }
|
802 + | }
|
803 + |
|
804 + | // The get_* functions below are generated from JMESPath expressions in the
|
805 + | // operationContextParams trait. They target the operation's input shape.
|
806 + |
|
807 + | /// Error type for the `CreateAssociationError` operation.
|
808 + | #[non_exhaustive]
|
809 + | #[derive(::std::fmt::Debug)]
|
810 + | pub enum CreateAssociationError {
|
811 + | /// <p>The specified association already exists.</p>
|
812 + | AssociationAlreadyExists(crate::types::error::AssociationAlreadyExists),
|
813 + | /// <p>You can have at most 2,000 active associations.</p>
|
814 + | AssociationLimitExceeded(crate::types::error::AssociationLimitExceeded),
|
815 + | /// <p>An error occurred on the server side.</p>
|
816 + | InternalServerError(crate::types::error::InternalServerError),
|
817 + | /// <p>The specified SSM document doesn't exist.</p>
|
818 + | InvalidDocument(crate::types::error::InvalidDocument),
|
819 + | /// <p>The document version isn't valid or doesn't exist.</p>
|
820 + | InvalidDocumentVersion(crate::types::error::InvalidDocumentVersion),
|
821 + | /// <p>The following problems can cause this exception:</p>
|
822 + | /// <ul>
|
823 + | /// <li>
|
824 + | /// <p>You don't have permission to access the managed node.</p></li>
|
825 + | /// <li>
|
826 + | /// <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p></li>
|
827 + | /// <li>
|
828 + | /// <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p></li>
|
829 + | /// <li>
|
830 + | /// <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p></li>
|
831 + | /// </ul>
|
832 + | InvalidInstanceId(crate::types::error::InvalidInstanceId),
|
833 + | /// <p>The output location isn't valid or doesn't exist.</p>
|
834 + | InvalidOutputLocation(crate::types::error::InvalidOutputLocation),
|
835 + | /// <p>You must specify values for all required parameters in the Amazon Web Services Systems Manager document (SSM document). You can only supply values to parameters defined in the SSM document.</p>
|
836 + | InvalidParameters(crate::types::error::InvalidParameters),
|
837 + | /// <p>The schedule is invalid. Verify your cron or rate expression and try again.</p>
|
838 + | InvalidSchedule(crate::types::error::InvalidSchedule),
|
839 + | /// <p>The specified tag key or value isn't valid.</p>
|
840 + | InvalidTag(crate::types::error::InvalidTag),
|
841 + | /// <p>The target isn't valid or doesn't exist. It might not be configured for Systems Manager or you might not have permission to perform the operation.</p>
|
842 + | InvalidTarget(crate::types::error::InvalidTarget),
|
843 + | /// <p>TargetMap parameter isn't valid.</p>
|
844 + | InvalidTargetMaps(crate::types::error::InvalidTargetMaps),
|
845 + | /// <p>The document doesn't support the platform type of the given managed node IDs. For example, you sent an document for a Windows managed node to a Linux node.</p>
|
846 + | UnsupportedPlatformType(crate::types::error::UnsupportedPlatformType),
|
847 + | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
848 + | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
849 + | variable wildcard pattern and check `.code()`:
|
850 + | \
|
851 + | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
852 + | \
|
853 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateAssociationError) for what information is available for the error.")]
|
854 + | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
855 + | }
|
856 + | impl CreateAssociationError {
|
857 + | /// Creates the `CreateAssociationError::Unhandled` variant from any error type.
|
858 + | pub fn unhandled(
|
859 + | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
860 + | ) -> Self {
|
861 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
862 + | source: err.into(),
|
863 + | meta: ::std::default::Default::default(),
|
864 + | })
|
865 + | }
|
866 + |
|
867 + | /// Creates the `CreateAssociationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
868 + | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
869 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
870 + | source: err.clone().into(),
|
871 + | meta: err,
|
872 + | })
|
873 + | }
|
874 + | ///
|
875 + | /// Returns error metadata, which includes the error code, message,
|
876 + | /// request ID, and potentially additional information.
|
877 + | ///
|
878 + | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
879 + | match self {
|
880 + | Self::AssociationAlreadyExists(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
881 + | Self::AssociationLimitExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
882 + | Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
883 + | Self::InvalidDocument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
884 + | Self::InvalidDocumentVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
885 + | Self::InvalidInstanceId(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
886 + | Self::InvalidOutputLocation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
887 + | Self::InvalidParameters(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
888 + | Self::InvalidSchedule(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
889 + | Self::InvalidTag(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
890 + | Self::InvalidTarget(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
891 + | Self::InvalidTargetMaps(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
892 + | Self::UnsupportedPlatformType(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
893 + | Self::Unhandled(e) => &e.meta,
|
894 + | }
|
895 + | }
|
896 + | /// Returns `true` if the error kind is `CreateAssociationError::AssociationAlreadyExists`.
|
897 + | pub fn is_association_already_exists(&self) -> bool {
|
898 + | matches!(self, Self::AssociationAlreadyExists(_))
|
899 + | }
|
900 + | /// Returns `true` if the error kind is `CreateAssociationError::AssociationLimitExceeded`.
|
901 + | pub fn is_association_limit_exceeded(&self) -> bool {
|
902 + | matches!(self, Self::AssociationLimitExceeded(_))
|
903 + | }
|
904 + | /// Returns `true` if the error kind is `CreateAssociationError::InternalServerError`.
|
905 + | pub fn is_internal_server_error(&self) -> bool {
|
906 + | matches!(self, Self::InternalServerError(_))
|
907 + | }
|
908 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidDocument`.
|
909 + | pub fn is_invalid_document(&self) -> bool {
|
910 + | matches!(self, Self::InvalidDocument(_))
|
911 + | }
|
912 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidDocumentVersion`.
|
913 + | pub fn is_invalid_document_version(&self) -> bool {
|
914 + | matches!(self, Self::InvalidDocumentVersion(_))
|
915 + | }
|
916 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidInstanceId`.
|
917 + | pub fn is_invalid_instance_id(&self) -> bool {
|
918 + | matches!(self, Self::InvalidInstanceId(_))
|
919 + | }
|
920 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidOutputLocation`.
|
921 + | pub fn is_invalid_output_location(&self) -> bool {
|
922 + | matches!(self, Self::InvalidOutputLocation(_))
|
923 + | }
|
924 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidParameters`.
|
925 + | pub fn is_invalid_parameters(&self) -> bool {
|
926 + | matches!(self, Self::InvalidParameters(_))
|
927 + | }
|
928 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidSchedule`.
|
929 + | pub fn is_invalid_schedule(&self) -> bool {
|
930 + | matches!(self, Self::InvalidSchedule(_))
|
931 + | }
|
932 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidTag`.
|
933 + | pub fn is_invalid_tag(&self) -> bool {
|
934 + | matches!(self, Self::InvalidTag(_))
|
935 + | }
|
936 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidTarget`.
|
937 + | pub fn is_invalid_target(&self) -> bool {
|
938 + | matches!(self, Self::InvalidTarget(_))
|
939 + | }
|
940 + | /// Returns `true` if the error kind is `CreateAssociationError::InvalidTargetMaps`.
|
941 + | pub fn is_invalid_target_maps(&self) -> bool {
|
942 + | matches!(self, Self::InvalidTargetMaps(_))
|
943 + | }
|
944 + | /// Returns `true` if the error kind is `CreateAssociationError::UnsupportedPlatformType`.
|
945 + | pub fn is_unsupported_platform_type(&self) -> bool {
|
946 + | matches!(self, Self::UnsupportedPlatformType(_))
|
947 + | }
|
948 + | }
|
949 + | impl ::std::error::Error for CreateAssociationError {
|
950 + | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
951 + | match self {
|
952 + | Self::AssociationAlreadyExists(_inner) => ::std::option::Option::Some(_inner),
|
953 + | Self::AssociationLimitExceeded(_inner) => ::std::option::Option::Some(_inner),
|
954 + | Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
|
955 + | Self::InvalidDocument(_inner) => ::std::option::Option::Some(_inner),
|
956 + | Self::InvalidDocumentVersion(_inner) => ::std::option::Option::Some(_inner),
|
957 + | Self::InvalidInstanceId(_inner) => ::std::option::Option::Some(_inner),
|
958 + | Self::InvalidOutputLocation(_inner) => ::std::option::Option::Some(_inner),
|
959 + | Self::InvalidParameters(_inner) => ::std::option::Option::Some(_inner),
|
960 + | Self::InvalidSchedule(_inner) => ::std::option::Option::Some(_inner),
|
961 + | Self::InvalidTag(_inner) => ::std::option::Option::Some(_inner),
|
962 + | Self::InvalidTarget(_inner) => ::std::option::Option::Some(_inner),
|
963 + | Self::InvalidTargetMaps(_inner) => ::std::option::Option::Some(_inner),
|
964 + | Self::UnsupportedPlatformType(_inner) => ::std::option::Option::Some(_inner),
|
965 + | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
966 + | }
|
967 + | }
|
968 + | }
|
969 + | impl ::std::fmt::Display for CreateAssociationError {
|
970 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
971 + | match self {
|
972 + | Self::AssociationAlreadyExists(_inner) => _inner.fmt(f),
|
973 + | Self::AssociationLimitExceeded(_inner) => _inner.fmt(f),
|
974 + | Self::InternalServerError(_inner) => _inner.fmt(f),
|
975 + | Self::InvalidDocument(_inner) => _inner.fmt(f),
|
976 + | Self::InvalidDocumentVersion(_inner) => _inner.fmt(f),
|
977 + | Self::InvalidInstanceId(_inner) => _inner.fmt(f),
|
978 + | Self::InvalidOutputLocation(_inner) => _inner.fmt(f),
|
979 + | Self::InvalidParameters(_inner) => _inner.fmt(f),
|
980 + | Self::InvalidSchedule(_inner) => _inner.fmt(f),
|
981 + | Self::InvalidTag(_inner) => _inner.fmt(f),
|
982 + | Self::InvalidTarget(_inner) => _inner.fmt(f),
|
983 + | Self::InvalidTargetMaps(_inner) => _inner.fmt(f),
|
984 + | Self::UnsupportedPlatformType(_inner) => _inner.fmt(f),
|
985 + | Self::Unhandled(_inner) => {
|
986 + | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
987 + | write!(f, "unhandled error ({code})")
|
988 + | } else {
|
989 + | f.write_str("unhandled error")
|
990 + | }
|
991 + | }
|
992 + | }
|
993 + | }
|
994 + | }
|
995 + | impl ::aws_smithy_types::retry::ProvideErrorKind for CreateAssociationError {
|
996 + | fn code(&self) -> ::std::option::Option<&str> {
|
997 + | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
998 + | }
|
999 + | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
1000 + | ::std::option::Option::None
|
1001 + | }
|
1002 + | }
|
1003 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateAssociationError {
|
1004 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
1005 + | match self {
|
1006 + | Self::AssociationAlreadyExists(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1007 + | Self::AssociationLimitExceeded(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1008 + | Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1009 + | Self::InvalidDocument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1010 + | Self::InvalidDocumentVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1011 + | Self::InvalidInstanceId(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1012 + | Self::InvalidOutputLocation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1013 + | Self::InvalidParameters(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1014 + | Self::InvalidSchedule(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1015 + | Self::InvalidTag(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1016 + | Self::InvalidTarget(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1017 + | Self::InvalidTargetMaps(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1018 + | Self::UnsupportedPlatformType(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
1019 + | Self::Unhandled(_inner) => &_inner.meta,
|
1020 + | }
|
1021 + | }
|
1022 + | }
|
1023 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateAssociationError {
|
1024 + | fn create_unhandled_error(
|
1025 + | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
1026 + | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
1027 + | ) -> Self {
|
1028 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
1029 + | source,
|
1030 + | meta: meta.unwrap_or_default(),
|
1031 + | })
|
1032 + | }
|
1033 + | }
|
1034 + | impl ::aws_types::request_id::RequestId for crate::operation::create_association::CreateAssociationError {
|
1035 + | fn request_id(&self) -> Option<&str> {
|
1036 + | self.meta().request_id()
|
1037 + | }
|
1038 + | }
|
1039 + |
|
1040 + | pub use crate::operation::create_association::_create_association_input::CreateAssociationInput;
|
1041 + |
|
1042 + | pub use crate::operation::create_association::_create_association_output::CreateAssociationOutput;
|
1043 + |
|
1044 + | mod _create_association_input;
|
1045 + |
|
1046 + | mod _create_association_output;
|
1047 + |
|
1048 + | /// Builders
|
1049 + | pub mod builders;
|