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