1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /// Orchestration and serialization glue logic for `SendCommand`.
|
3 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 + | #[non_exhaustive]
|
5 + | pub struct SendCommand;
|
6 + | impl SendCommand {
|
7 + | /// Creates a new `SendCommand`
|
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::send_command::SendCommandInput::SCHEMA;
|
13 + | /// The schema for this operation's output shape.
|
14 + | pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::send_command::SendCommandOutput::SCHEMA;
|
15 + | pub(crate) async fn orchestrate(
|
16 + | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
17 + | input: crate::operation::send_command::SendCommandInput,
|
18 + | ) -> ::std::result::Result<
|
19 + | crate::operation::send_command::SendCommandOutput,
|
20 + | ::aws_smithy_runtime_api::client::result::SdkError<
|
21 + | crate::operation::send_command::SendCommandError,
|
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::send_command::SendCommandError>()
|
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::send_command::SendCommandOutput>()
|
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::send_command::SendCommandInput,
|
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", "SendCommand", 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.SendCommand",
|
63 + | "rpc.service" = "SSM",
|
64 + | "rpc.method" = "SendCommand",
|
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::DuplicateInstanceId::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::DuplicateInstanceId::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::DuplicateInstanceId::deserialize(d)?))
|
109 + | },
|
110 + | )
|
111 + | .insert_error_shape(
|
112 + | crate::types::error::InternalServerError::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::InternalServerError::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::InternalServerError::deserialize(d)?))
|
118 + | },
|
119 + | )
|
120 + | .insert_error_shape(
|
121 + | crate::types::error::InvalidDocument::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::InvalidDocument::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::InvalidDocument::deserialize(d)?))
|
127 + | },
|
128 + | )
|
129 + | .insert_error_shape(
|
130 + | crate::types::error::InvalidDocumentVersion::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::InvalidDocumentVersion::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::InvalidDocumentVersion::deserialize(d)?))
|
136 + | },
|
137 + | )
|
138 + | .insert_error_shape(
|
139 + | crate::types::error::InvalidInstanceId::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::InvalidInstanceId::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::InvalidInstanceId::deserialize(d)?))
|
145 + | },
|
146 + | )
|
147 + | .insert_error_shape(
|
148 + | crate::types::error::InvalidNotificationConfig::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::InvalidNotificationConfig::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::InvalidNotificationConfig::deserialize(d)?))
|
154 + | },
|
155 + | )
|
156 + | .insert_error_shape(
|
157 + | crate::types::error::InvalidOutputFolder::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::InvalidOutputFolder::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::InvalidOutputFolder::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::InvalidRole::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::InvalidRole::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::InvalidRole::deserialize(d)?))
|
181 + | },
|
182 + | )
|
183 + | .insert_error_shape(
|
184 + | crate::types::error::MaxDocumentSizeExceeded::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::MaxDocumentSizeExceeded::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::MaxDocumentSizeExceeded::deserialize(d)?))
|
190 + | },
|
191 + | )
|
192 + | .insert_error_shape(
|
193 + | crate::types::error::UnsupportedPlatformType::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::UnsupportedPlatformType::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::UnsupportedPlatformType::deserialize(d)?))
|
199 + | },
|
200 + | )
|
201 + | .build()
|
202 + | });
|
203 + | }
|
204 + | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SendCommand {
|
205 + | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
206 + | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SendCommand");
|
207 + |
|
208 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
209 + | SendCommandRequestSerializer,
|
210 + | ));
|
211 + | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
212 + | SendCommandResponseDeserializer,
|
213 + | ));
|
214 + |
|
215 + | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
216 + | crate::config::auth::Params::builder()
|
217 + | .operation_name("SendCommand")
|
218 + | .build()
|
219 + | .expect("required fields set"),
|
220 + | ));
|
221 + |
|
222 + | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
|
223 + | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("SendCommand", "SSM"));
|
224 + | let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
|
225 + | signing_options.double_uri_encode = true;
|
226 + | signing_options.content_sha256_header = false;
|
227 + | signing_options.normalize_uri_path = true;
|
228 + | signing_options.payload_override = None;
|
229 + |
|
230 + | cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
|
231 + | signing_options,
|
232 + | ..::std::default::Default::default()
|
233 + | });
|
234 + |
|
235 + | ::std::option::Option::Some(cfg.freeze())
|
236 + | }
|
237 + |
|
238 + | fn runtime_components(
|
239 + | &self,
|
240 + | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
241 + | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
242 + | #[allow(unused_mut)]
|
243 + | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SendCommand")
|
244 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
245 + | SendCommandTelemetryInputCaptureInterceptor,
|
246 + | ))
|
247 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
248 + | ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
|
249 + | ))
|
250 + | .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
|
251 + | SendCommandEndpointParamsInterceptor,
|
252 + | ))
|
253 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
254 + | crate::operation::send_command::SendCommandError,
|
255 + | >::new())
|
256 + | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
257 + | crate::operation::send_command::SendCommandError,
|
258 + | >::new())
|
259 + | .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
|
260 + | crate::operation::send_command::SendCommandError,
|
261 + | >::new())
|
262 + | .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
|
263 + | crate::operation::send_command::SendCommandError,
|
264 + | >::new());
|
265 + |
|
266 + | ::std::borrow::Cow::Owned(rcb)
|
267 + | }
|
268 + | }
|
269 + |
|
270 + | #[derive(Debug)]
|
271 + | struct SendCommandTelemetryInputCaptureInterceptor;
|
272 + |
|
273 + | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
274 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SendCommandTelemetryInputCaptureInterceptor {
|
275 + | fn name(&self) -> &'static str {
|
276 + | "SendCommandTelemetryInputCaptureInterceptor"
|
277 + | }
|
278 + |
|
279 + | fn read_before_execution(
|
280 + | &self,
|
281 + | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
282 + | '_,
|
283 + | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
284 + | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
285 + | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
286 + | >,
|
287 + | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
288 + | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
289 + | // Nothing to do unless the customer opted in by naming members to record.
|
290 + | let ::std::option::Option::Some(requested) = cfg
|
291 + | .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
|
292 + | .filter(|r| !r.is_empty())
|
293 + | else {
|
294 + | return ::std::result::Result::Ok(());
|
295 + | };
|
296 + |
|
297 + | let ::std::option::Option::Some(input) = context.input().downcast_ref::<SendCommandInput>() else {
|
298 + | // A mismatched input is not this interceptor's concern; skip quietly.
|
299 + | return ::std::result::Result::Ok(());
|
300 + | };
|
301 + |
|
302 + | let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
|
303 + | if requested.should_capture("DocumentName") {
|
304 + | if let ::std::option::Option::Some(value) = input.document_name.as_deref() {
|
305 + | captured.insert("DocumentName", value);
|
306 + | }
|
307 + | }
|
308 + | if requested.should_capture("DocumentVersion") {
|
309 + | if let ::std::option::Option::Some(value) = input.document_version.as_deref() {
|
310 + | captured.insert("DocumentVersion", value);
|
311 + | }
|
312 + | }
|
313 + | if requested.should_capture("DocumentHash") {
|
314 + | if let ::std::option::Option::Some(value) = input.document_hash.as_deref() {
|
315 + | captured.insert("DocumentHash", value);
|
316 + | }
|
317 + | }
|
318 + | if requested.should_capture("Comment") {
|
319 + | if let ::std::option::Option::Some(value) = input.comment.as_deref() {
|
320 + | captured.insert("Comment", value);
|
321 + | }
|
322 + | }
|
323 + | if requested.should_capture("OutputS3Region") {
|
324 + | if let ::std::option::Option::Some(value) = input.output_s3_region.as_deref() {
|
325 + | captured.insert("OutputS3Region", value);
|
326 + | }
|
327 + | }
|
328 + | if requested.should_capture("OutputS3BucketName") {
|
329 + | if let ::std::option::Option::Some(value) = input.output_s3_bucket_name.as_deref() {
|
330 + | captured.insert("OutputS3BucketName", value);
|
331 + | }
|
332 + | }
|
333 + | if requested.should_capture("OutputS3KeyPrefix") {
|
334 + | if let ::std::option::Option::Some(value) = input.output_s3_key_prefix.as_deref() {
|
335 + | captured.insert("OutputS3KeyPrefix", value);
|
336 + | }
|
337 + | }
|
338 + | if requested.should_capture("MaxConcurrency") {
|
339 + | if let ::std::option::Option::Some(value) = input.max_concurrency.as_deref() {
|
340 + | captured.insert("MaxConcurrency", value);
|
341 + | }
|
342 + | }
|
343 + | if requested.should_capture("MaxErrors") {
|
344 + | if let ::std::option::Option::Some(value) = input.max_errors.as_deref() {
|
345 + | captured.insert("MaxErrors", value);
|
346 + | }
|
347 + | }
|
348 + | if requested.should_capture("ServiceRoleArn") {
|
349 + | if let ::std::option::Option::Some(value) = input.service_role_arn.as_deref() {
|
350 + | captured.insert("ServiceRoleArn", value);
|
351 + | }
|
352 + | }
|
353 + |
|
354 + | cfg.interceptor_state().store_put(captured);
|
355 + | ::std::result::Result::Ok(())
|
356 + | }
|
357 + | }
|
358 + | #[derive(Debug)]
|
359 + | struct SendCommandResponseDeserializer;
|
360 + | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SendCommandResponseDeserializer {
|
361 + | fn deserialize_nonstreaming_with_config(
|
362 + | &self,
|
363 + | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
364 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
365 + | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
366 + | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
367 + | // Load body and headers BEFORE BeforeParseResponse so customizations
|
368 + | // (e.g., S3's `body_is_error` check that detects errors returned with
|
369 + | // HTTP 200) can inspect them. The legacy non-streaming path also
|
370 + | // loads `body` before firing this hook.
|
371 + | let body = response.body().bytes().expect("body loaded");
|
372 + | let headers = response.headers();
|
373 + | #[allow(unused_mut)]
|
374 + | let mut force_error = false;
|
375 + | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
376 + | if !success && status != 200 || force_error {
|
377 + | let protocol = _cfg
|
378 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
379 + | .expect("a SharedClientProtocol is required");
|
380 + | #[allow(unused_mut)]
|
381 + | let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
|
382 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
383 + | })?;
|
384 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
385 + | let generic = generic_builder.build();
|
386 + | let error_code = match generic.code() {
|
387 + | ::std::option::Option::Some(code) => code,
|
388 + | ::std::option::Option::None => {
|
389 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
390 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::send_command::SendCommandError::unhandled(generic)),
|
391 + | ))
|
392 + | }
|
393 + | };
|
394 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
395 + | let err = match error_code {
|
396 + | "DuplicateInstanceId" => crate::operation::send_command::SendCommandError::DuplicateInstanceId({
|
397 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
398 + | crate::types::error::DuplicateInstanceId::deserialize_with_response(
|
399 + | &mut *deser,
|
400 + | response.headers(),
|
401 + | response.status().into(),
|
402 + | body,
|
403 + | )
|
404 + | }) {
|
405 + | ::std::result::Result::Ok(val) => val,
|
406 + | ::std::result::Result::Err(e) => {
|
407 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
408 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
409 + | ))
|
410 + | }
|
411 + | };
|
412 + | tmp.meta = generic;
|
413 + | if tmp.message.is_none() {
|
414 + | tmp.message = _error_message;
|
415 + | }
|
416 + | tmp
|
417 + | }),
|
418 + | "InternalServerError" => crate::operation::send_command::SendCommandError::InternalServerError({
|
419 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
420 + | crate::types::error::InternalServerError::deserialize_with_response(
|
421 + | &mut *deser,
|
422 + | response.headers(),
|
423 + | response.status().into(),
|
424 + | body,
|
425 + | )
|
426 + | }) {
|
427 + | ::std::result::Result::Ok(val) => val,
|
428 + | ::std::result::Result::Err(e) => {
|
429 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
430 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
431 + | ))
|
432 + | }
|
433 + | };
|
434 + | tmp.meta = generic;
|
435 + | if tmp.message.is_none() {
|
436 + | tmp.message = _error_message;
|
437 + | }
|
438 + | tmp
|
439 + | }),
|
440 + | "InvalidDocument" => crate::operation::send_command::SendCommandError::InvalidDocument({
|
441 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
442 + | crate::types::error::InvalidDocument::deserialize_with_response(
|
443 + | &mut *deser,
|
444 + | response.headers(),
|
445 + | response.status().into(),
|
446 + | body,
|
447 + | )
|
448 + | }) {
|
449 + | ::std::result::Result::Ok(val) => val,
|
450 + | ::std::result::Result::Err(e) => {
|
451 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
452 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
453 + | ))
|
454 + | }
|
455 + | };
|
456 + | tmp.meta = generic;
|
457 + | if tmp.message.is_none() {
|
458 + | tmp.message = _error_message;
|
459 + | }
|
460 + | tmp
|
461 + | }),
|
462 + | "InvalidDocumentVersion" => crate::operation::send_command::SendCommandError::InvalidDocumentVersion({
|
463 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
464 + | crate::types::error::InvalidDocumentVersion::deserialize_with_response(
|
465 + | &mut *deser,
|
466 + | response.headers(),
|
467 + | response.status().into(),
|
468 + | body,
|
469 + | )
|
470 + | }) {
|
471 + | ::std::result::Result::Ok(val) => val,
|
472 + | ::std::result::Result::Err(e) => {
|
473 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
474 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
475 + | ))
|
476 + | }
|
477 + | };
|
478 + | tmp.meta = generic;
|
479 + | if tmp.message.is_none() {
|
480 + | tmp.message = _error_message;
|
481 + | }
|
482 + | tmp
|
483 + | }),
|
484 + | "InvalidInstanceId" => crate::operation::send_command::SendCommandError::InvalidInstanceId({
|
485 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
486 + | crate::types::error::InvalidInstanceId::deserialize_with_response(
|
487 + | &mut *deser,
|
488 + | response.headers(),
|
489 + | response.status().into(),
|
490 + | body,
|
491 + | )
|
492 + | }) {
|
493 + | ::std::result::Result::Ok(val) => val,
|
494 + | ::std::result::Result::Err(e) => {
|
495 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
496 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
497 + | ))
|
498 + | }
|
499 + | };
|
500 + | tmp.meta = generic;
|
501 + | if tmp.message.is_none() {
|
502 + | tmp.message = _error_message;
|
503 + | }
|
504 + | tmp
|
505 + | }),
|
506 + | "InvalidNotificationConfig" => crate::operation::send_command::SendCommandError::InvalidNotificationConfig({
|
507 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
508 + | crate::types::error::InvalidNotificationConfig::deserialize_with_response(
|
509 + | &mut *deser,
|
510 + | response.headers(),
|
511 + | response.status().into(),
|
512 + | body,
|
513 + | )
|
514 + | }) {
|
515 + | ::std::result::Result::Ok(val) => val,
|
516 + | ::std::result::Result::Err(e) => {
|
517 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
518 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
519 + | ))
|
520 + | }
|
521 + | };
|
522 + | tmp.meta = generic;
|
523 + | if tmp.message.is_none() {
|
524 + | tmp.message = _error_message;
|
525 + | }
|
526 + | tmp
|
527 + | }),
|
528 + | "InvalidOutputFolder" => crate::operation::send_command::SendCommandError::InvalidOutputFolder({
|
529 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
530 + | crate::types::error::InvalidOutputFolder::deserialize_with_response(
|
531 + | &mut *deser,
|
532 + | response.headers(),
|
533 + | response.status().into(),
|
534 + | body,
|
535 + | )
|
536 + | }) {
|
537 + | ::std::result::Result::Ok(val) => val,
|
538 + | ::std::result::Result::Err(e) => {
|
539 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
540 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
541 + | ))
|
542 + | }
|
543 + | };
|
544 + | tmp.meta = generic;
|
545 + | if tmp.message.is_none() {
|
546 + | tmp.message = _error_message;
|
547 + | }
|
548 + | tmp
|
549 + | }),
|
550 + | "InvalidParameters" => crate::operation::send_command::SendCommandError::InvalidParameters({
|
551 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
552 + | crate::types::error::InvalidParameters::deserialize_with_response(
|
553 + | &mut *deser,
|
554 + | response.headers(),
|
555 + | response.status().into(),
|
556 + | body,
|
557 + | )
|
558 + | }) {
|
559 + | ::std::result::Result::Ok(val) => val,
|
560 + | ::std::result::Result::Err(e) => {
|
561 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
562 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
563 + | ))
|
564 + | }
|
565 + | };
|
566 + | tmp.meta = generic;
|
567 + | if tmp.message.is_none() {
|
568 + | tmp.message = _error_message;
|
569 + | }
|
570 + | tmp
|
571 + | }),
|
572 + | "InvalidRole" => crate::operation::send_command::SendCommandError::InvalidRole({
|
573 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
574 + | crate::types::error::InvalidRole::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
|
575 + | }) {
|
576 + | ::std::result::Result::Ok(val) => val,
|
577 + | ::std::result::Result::Err(e) => {
|
578 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
579 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
580 + | ))
|
581 + | }
|
582 + | };
|
583 + | tmp.meta = generic;
|
584 + | if tmp.message.is_none() {
|
585 + | tmp.message = _error_message;
|
586 + | }
|
587 + | tmp
|
588 + | }),
|
589 + | "MaxDocumentSizeExceeded" => crate::operation::send_command::SendCommandError::MaxDocumentSizeExceeded({
|
590 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
591 + | crate::types::error::MaxDocumentSizeExceeded::deserialize_with_response(
|
592 + | &mut *deser,
|
593 + | response.headers(),
|
594 + | response.status().into(),
|
595 + | body,
|
596 + | )
|
597 + | }) {
|
598 + | ::std::result::Result::Ok(val) => val,
|
599 + | ::std::result::Result::Err(e) => {
|
600 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
601 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
602 + | ))
|
603 + | }
|
604 + | };
|
605 + | tmp.meta = generic;
|
606 + | if tmp.message.is_none() {
|
607 + | tmp.message = _error_message;
|
608 + | }
|
609 + | tmp
|
610 + | }),
|
611 + | "UnsupportedPlatformType" => crate::operation::send_command::SendCommandError::UnsupportedPlatformType({
|
612 + | let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
|
613 + | crate::types::error::UnsupportedPlatformType::deserialize_with_response(
|
614 + | &mut *deser,
|
615 + | response.headers(),
|
616 + | response.status().into(),
|
617 + | body,
|
618 + | )
|
619 + | }) {
|
620 + | ::std::result::Result::Ok(val) => val,
|
621 + | ::std::result::Result::Err(e) => {
|
622 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
623 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
624 + | ))
|
625 + | }
|
626 + | };
|
627 + | tmp.meta = generic;
|
628 + | if tmp.message.is_none() {
|
629 + | tmp.message = _error_message;
|
630 + | }
|
631 + | tmp
|
632 + | }),
|
633 + | _ => {
|
634 + | // Registry-backed, operation-scoped reification of an error whose
|
635 + | // code this operation does not model directly: the operation's own
|
636 + | // error registry is consulted first, then the lookup widens to the
|
637 + | // service-wide error registry. On a hit, the reified error is attached
|
638 + | // as the source of the returned unhandled error while its metadata
|
639 + | // (code, message, request id) is preserved; on a miss the generic
|
640 + | // error is returned unchanged.
|
641 + | match protocol
|
642 + | .deserialize_error_response(response, _cfg)
|
643 + | .ok()
|
644 + | .and_then(|mut deser| {
|
645 + | ::aws_smithy_schema::registry::reify_error(
|
646 + | crate::operation::send_command::error_registry::REGISTRY
|
647 + | .or(&crate::error_type_registry::REGISTRY),
|
648 + | error_code,
|
649 + | &mut *deser,
|
650 + | )
|
651 + | }) {
|
652 + | ::std::option::Option::Some(source) => <crate::operation::send_command::SendCommandError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
|
653 + | ::std::option::Option::None => crate::operation::send_command::SendCommandError::generic(generic),
|
654 + | }
|
655 + | }
|
656 + | };
|
657 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
658 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
659 + | ))
|
660 + | } else {
|
661 + | let protocol = _cfg
|
662 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
663 + | .expect("a SharedClientProtocol is required");
|
664 + | let mut deser = protocol.deserialize_response(response, SendCommand::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
665 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
666 + | })?;
|
667 + | // body and headers are already in scope from the top of the function;
|
668 + | // alias `headers` as `_response_headers` so MutateOutput
|
669 + | // customizations have a stable name to read from.
|
670 + | let _response_headers = headers;
|
671 + | #[allow(unused_mut)]
|
672 + | let mut output = crate::operation::send_command::SendCommandOutput::deserialize_with_response(
|
673 + | &mut *deser,
|
674 + | _response_headers,
|
675 + | response.status().into(),
|
676 + | body,
|
677 + | )
|
678 + | .map_err(|e| {
|
679 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
680 + | })?;
|
681 + | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
682 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
683 + | }
|
684 + | }
|
685 + | }
|
686 + | #[derive(Debug)]
|
687 + | struct SendCommandRequestSerializer;
|
688 + | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SendCommandRequestSerializer {
|
689 + | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
690 + | fn serialize_input(
|
691 + | &self,
|
692 + | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
693 + | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
694 + | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
695 + | let input = input
|
696 + | .downcast::<crate::operation::send_command::SendCommandInput>()
|
697 + | .expect("correct type");
|
698 + |
|
699 + | let protocol = _cfg
|
700 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
701 + | .expect("a SharedClientProtocol is required");
|
702 + | let mut request = protocol
|
703 + | .serialize_request(&input, SendCommand::INPUT_SCHEMA, "/", _cfg)
|
704 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
705 + |
|
706 + | return ::std::result::Result::Ok(request);
|
707 + | }
|
708 + | }
|
709 + | #[derive(Debug)]
|
710 + | struct SendCommandEndpointParamsInterceptor;
|
711 + |
|
712 + | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
713 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SendCommandEndpointParamsInterceptor {
|
714 + | fn name(&self) -> &'static str {
|
715 + | "SendCommandEndpointParamsInterceptor"
|
716 + | }
|
717 + |
|
718 + | fn read_before_execution(
|
719 + | &self,
|
720 + | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
721 + | '_,
|
722 + | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
723 + | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
724 + | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
725 + | >,
|
726 + | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
727 + | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
728 + | let _input = context
|
729 + | .input()
|
730 + | .downcast_ref::<SendCommandInput>()
|
731 + | .ok_or("failed to downcast to SendCommandInput")?;
|
732 + |
|
733 + | let params = crate::config::endpoint::Params::builder()
|
734 + | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
735 + | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
736 + | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
737 + | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
738 + | .build()
|
739 + | .map_err(|err| {
|
740 + | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
741 + | })?;
|
742 + | cfg.interceptor_state()
|
743 + | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
744 + | ::std::result::Result::Ok(())
|
745 + | }
|
746 + | }
|
747 + |
|
748 + | // The get_* functions below are generated from JMESPath expressions in the
|
749 + | // operationContextParams trait. They target the operation's input shape.
|
750 + |
|
751 + | /// Error type for the `SendCommandError` operation.
|
752 + | #[non_exhaustive]
|
753 + | #[derive(::std::fmt::Debug)]
|
754 + | pub enum SendCommandError {
|
755 + | /// <p>You can't specify a managed node ID in more than one association.</p>
|
756 + | DuplicateInstanceId(crate::types::error::DuplicateInstanceId),
|
757 + | /// <p>An error occurred on the server side.</p>
|
758 + | InternalServerError(crate::types::error::InternalServerError),
|
759 + | /// <p>The specified SSM document doesn't exist.</p>
|
760 + | InvalidDocument(crate::types::error::InvalidDocument),
|
761 + | /// <p>The document version isn't valid or doesn't exist.</p>
|
762 + | InvalidDocumentVersion(crate::types::error::InvalidDocumentVersion),
|
763 + | /// <p>The following problems can cause this exception:</p>
|
764 + | /// <ul>
|
765 + | /// <li>
|
766 + | /// <p>You don't have permission to access the managed node.</p></li>
|
767 + | /// <li>
|
768 + | /// <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p></li>
|
769 + | /// <li>
|
770 + | /// <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p></li>
|
771 + | /// <li>
|
772 + | /// <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>
|
773 + | /// </ul>
|
774 + | InvalidInstanceId(crate::types::error::InvalidInstanceId),
|
775 + | /// <p>One or more configuration items isn't valid. Verify that a valid Amazon Resource Name (ARN) was provided for an Amazon Simple Notification Service topic.</p>
|
776 + | InvalidNotificationConfig(crate::types::error::InvalidNotificationConfig),
|
777 + | /// <p>The S3 bucket doesn't exist.</p>
|
778 + | InvalidOutputFolder(crate::types::error::InvalidOutputFolder),
|
779 + | /// <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>
|
780 + | InvalidParameters(crate::types::error::InvalidParameters),
|
781 + | /// <p>The role name can't contain invalid characters. Also verify that you specified an IAM role for notifications that includes the required trust policy. For information about configuring the IAM role for Run Command notifications, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html">Monitoring Systems Manager status changes using Amazon SNS notifications</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
|
782 + | InvalidRole(crate::types::error::InvalidRole),
|
783 + | /// <p>The size limit of a document is 64 KB.</p>
|
784 + | MaxDocumentSizeExceeded(crate::types::error::MaxDocumentSizeExceeded),
|
785 + | /// <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>
|
786 + | UnsupportedPlatformType(crate::types::error::UnsupportedPlatformType),
|
787 + | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
788 + | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
789 + | variable wildcard pattern and check `.code()`:
|
790 + | \
|
791 + | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
792 + | \
|
793 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SendCommandError) for what information is available for the error.")]
|
794 + | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
795 + | }
|
796 + | impl SendCommandError {
|
797 + | /// Creates the `SendCommandError::Unhandled` variant from any error type.
|
798 + | pub fn unhandled(
|
799 + | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
800 + | ) -> Self {
|
801 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
802 + | source: err.into(),
|
803 + | meta: ::std::default::Default::default(),
|
804 + | })
|
805 + | }
|
806 + |
|
807 + | /// Creates the `SendCommandError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
808 + | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
809 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
810 + | source: err.clone().into(),
|
811 + | meta: err,
|
812 + | })
|
813 + | }
|
814 + | ///
|
815 + | /// Returns error metadata, which includes the error code, message,
|
816 + | /// request ID, and potentially additional information.
|
817 + | ///
|
818 + | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
819 + | match self {
|
820 + | Self::DuplicateInstanceId(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
821 + | Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
822 + | Self::InvalidDocument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
823 + | Self::InvalidDocumentVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
824 + | Self::InvalidInstanceId(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
825 + | Self::InvalidNotificationConfig(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
826 + | Self::InvalidOutputFolder(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
827 + | Self::InvalidParameters(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
828 + | Self::InvalidRole(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
829 + | Self::MaxDocumentSizeExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
830 + | Self::UnsupportedPlatformType(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
831 + | Self::Unhandled(e) => &e.meta,
|
832 + | }
|
833 + | }
|
834 + | /// Returns `true` if the error kind is `SendCommandError::DuplicateInstanceId`.
|
835 + | pub fn is_duplicate_instance_id(&self) -> bool {
|
836 + | matches!(self, Self::DuplicateInstanceId(_))
|
837 + | }
|
838 + | /// Returns `true` if the error kind is `SendCommandError::InternalServerError`.
|
839 + | pub fn is_internal_server_error(&self) -> bool {
|
840 + | matches!(self, Self::InternalServerError(_))
|
841 + | }
|
842 + | /// Returns `true` if the error kind is `SendCommandError::InvalidDocument`.
|
843 + | pub fn is_invalid_document(&self) -> bool {
|
844 + | matches!(self, Self::InvalidDocument(_))
|
845 + | }
|
846 + | /// Returns `true` if the error kind is `SendCommandError::InvalidDocumentVersion`.
|
847 + | pub fn is_invalid_document_version(&self) -> bool {
|
848 + | matches!(self, Self::InvalidDocumentVersion(_))
|
849 + | }
|
850 + | /// Returns `true` if the error kind is `SendCommandError::InvalidInstanceId`.
|
851 + | pub fn is_invalid_instance_id(&self) -> bool {
|
852 + | matches!(self, Self::InvalidInstanceId(_))
|
853 + | }
|
854 + | /// Returns `true` if the error kind is `SendCommandError::InvalidNotificationConfig`.
|
855 + | pub fn is_invalid_notification_config(&self) -> bool {
|
856 + | matches!(self, Self::InvalidNotificationConfig(_))
|
857 + | }
|
858 + | /// Returns `true` if the error kind is `SendCommandError::InvalidOutputFolder`.
|
859 + | pub fn is_invalid_output_folder(&self) -> bool {
|
860 + | matches!(self, Self::InvalidOutputFolder(_))
|
861 + | }
|
862 + | /// Returns `true` if the error kind is `SendCommandError::InvalidParameters`.
|
863 + | pub fn is_invalid_parameters(&self) -> bool {
|
864 + | matches!(self, Self::InvalidParameters(_))
|
865 + | }
|
866 + | /// Returns `true` if the error kind is `SendCommandError::InvalidRole`.
|
867 + | pub fn is_invalid_role(&self) -> bool {
|
868 + | matches!(self, Self::InvalidRole(_))
|
869 + | }
|
870 + | /// Returns `true` if the error kind is `SendCommandError::MaxDocumentSizeExceeded`.
|
871 + | pub fn is_max_document_size_exceeded(&self) -> bool {
|
872 + | matches!(self, Self::MaxDocumentSizeExceeded(_))
|
873 + | }
|
874 + | /// Returns `true` if the error kind is `SendCommandError::UnsupportedPlatformType`.
|
875 + | pub fn is_unsupported_platform_type(&self) -> bool {
|
876 + | matches!(self, Self::UnsupportedPlatformType(_))
|
877 + | }
|
878 + | }
|
879 + | impl ::std::error::Error for SendCommandError {
|
880 + | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
881 + | match self {
|
882 + | Self::DuplicateInstanceId(_inner) => ::std::option::Option::Some(_inner),
|
883 + | Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
|
884 + | Self::InvalidDocument(_inner) => ::std::option::Option::Some(_inner),
|
885 + | Self::InvalidDocumentVersion(_inner) => ::std::option::Option::Some(_inner),
|
886 + | Self::InvalidInstanceId(_inner) => ::std::option::Option::Some(_inner),
|
887 + | Self::InvalidNotificationConfig(_inner) => ::std::option::Option::Some(_inner),
|
888 + | Self::InvalidOutputFolder(_inner) => ::std::option::Option::Some(_inner),
|
889 + | Self::InvalidParameters(_inner) => ::std::option::Option::Some(_inner),
|
890 + | Self::InvalidRole(_inner) => ::std::option::Option::Some(_inner),
|
891 + | Self::MaxDocumentSizeExceeded(_inner) => ::std::option::Option::Some(_inner),
|
892 + | Self::UnsupportedPlatformType(_inner) => ::std::option::Option::Some(_inner),
|
893 + | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
894 + | }
|
895 + | }
|
896 + | }
|
897 + | impl ::std::fmt::Display for SendCommandError {
|
898 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
899 + | match self {
|
900 + | Self::DuplicateInstanceId(_inner) => _inner.fmt(f),
|
901 + | Self::InternalServerError(_inner) => _inner.fmt(f),
|
902 + | Self::InvalidDocument(_inner) => _inner.fmt(f),
|
903 + | Self::InvalidDocumentVersion(_inner) => _inner.fmt(f),
|
904 + | Self::InvalidInstanceId(_inner) => _inner.fmt(f),
|
905 + | Self::InvalidNotificationConfig(_inner) => _inner.fmt(f),
|
906 + | Self::InvalidOutputFolder(_inner) => _inner.fmt(f),
|
907 + | Self::InvalidParameters(_inner) => _inner.fmt(f),
|
908 + | Self::InvalidRole(_inner) => _inner.fmt(f),
|
909 + | Self::MaxDocumentSizeExceeded(_inner) => _inner.fmt(f),
|
910 + | Self::UnsupportedPlatformType(_inner) => _inner.fmt(f),
|
911 + | Self::Unhandled(_inner) => {
|
912 + | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
913 + | write!(f, "unhandled error ({code})")
|
914 + | } else {
|
915 + | f.write_str("unhandled error")
|
916 + | }
|
917 + | }
|
918 + | }
|
919 + | }
|
920 + | }
|
921 + | impl ::aws_smithy_types::retry::ProvideErrorKind for SendCommandError {
|
922 + | fn code(&self) -> ::std::option::Option<&str> {
|
923 + | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
924 + | }
|
925 + | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
926 + | ::std::option::Option::None
|
927 + | }
|
928 + | }
|
929 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SendCommandError {
|
930 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
931 + | match self {
|
932 + | Self::DuplicateInstanceId(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
933 + | Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
934 + | Self::InvalidDocument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
935 + | Self::InvalidDocumentVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
936 + | Self::InvalidInstanceId(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
937 + | Self::InvalidNotificationConfig(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
938 + | Self::InvalidOutputFolder(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
939 + | Self::InvalidParameters(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
940 + | Self::InvalidRole(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
941 + | Self::MaxDocumentSizeExceeded(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
942 + | Self::UnsupportedPlatformType(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
943 + | Self::Unhandled(_inner) => &_inner.meta,
|
944 + | }
|
945 + | }
|
946 + | }
|
947 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SendCommandError {
|
948 + | fn create_unhandled_error(
|
949 + | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
950 + | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
951 + | ) -> Self {
|
952 + | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
953 + | source,
|
954 + | meta: meta.unwrap_or_default(),
|
955 + | })
|
956 + | }
|
957 + | }
|
958 + | impl ::aws_types::request_id::RequestId for crate::operation::send_command::SendCommandError {
|
959 + | fn request_id(&self) -> Option<&str> {
|
960 + | self.meta().request_id()
|
961 + | }
|
962 + | }
|
963 + |
|
964 + | pub use crate::operation::send_command::_send_command_input::SendCommandInput;
|
965 + |
|
966 + | pub use crate::operation::send_command::_send_command_output::SendCommandOutput;
|
967 + |
|
968 + | mod _send_command_input;
|
969 + |
|
970 + | mod _send_command_output;
|
971 + |
|
972 + | /// Builders
|
973 + | pub mod builders;
|