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