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