1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateMLTransform;
6impl CreateMLTransform {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::create_ml_transform::CreateMlTransformInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::create_ml_transform::CreateMlTransformOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::create_ml_transform::CreateMlTransformInput,
18 ) -> ::std::result::Result<
19 crate::operation::create_ml_transform::CreateMlTransformOutput,
20 ::aws_smithy_runtime_api::client::result::SdkError<
21 crate::operation::create_ml_transform::CreateMLTransformError,
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_ml_transform::CreateMLTransformError>()
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_ml_transform::CreateMlTransformOutput>()
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_ml_transform::CreateMlTransformInput,
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("Glue", "CreateMLTransform", input, runtime_plugins, stop_point)
59 .instrument(::tracing::debug_span!(
62 "Glue.CreateMLTransform",
63 "rpc.service" = "Glue",
64 "rpc.method" = "CreateMLTransform",
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}
91pub(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::AccessDeniedException::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::AccessDeniedException::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::AccessDeniedException::deserialize(d)?))
109 },
110 )
111.insert_error_shape(
112 crate::types::error::AlreadyExistsException::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::AlreadyExistsException::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::AlreadyExistsException::deserialize(d)?))
118 },
119 )
120.insert_error_shape(
121 crate::types::error::IdempotentParameterMismatchException::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::IdempotentParameterMismatchException::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::IdempotentParameterMismatchException::deserialize(d)?))
127 },
128 )
129.insert_error_shape(
130 crate::types::error::InternalServiceException::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::InternalServiceException::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::InternalServiceException::deserialize(d)?))
136 },
137 )
138.insert_error_shape(
139 crate::types::error::InvalidInputException::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::InvalidInputException::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::InvalidInputException::deserialize(d)?))
145 },
146 )
147.insert_error_shape(
148 crate::types::error::OperationTimeoutException::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::OperationTimeoutException::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::OperationTimeoutException::deserialize(d)?))
154 },
155 )
156.insert_error_shape(
157 crate::types::error::ResourceNumberLimitExceededException::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::ResourceNumberLimitExceededException::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::ResourceNumberLimitExceededException::deserialize(d)?))
163 },
164 )
165 .build()
166 });
167}
168impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateMLTransform {
169 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
170 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateMLTransform");
171
172 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
173 CreateMLTransformRequestSerializer,
174 ));
175 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
176 CreateMLTransformResponseDeserializer,
177 ));
178
179 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
180 crate::config::auth::Params::builder()
181 .operation_name("CreateMLTransform")
182 .build()
183 .expect("required fields set"),
184 ));
185
186 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("CreateMLTransform", "Glue"));
187 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
188 signing_options.double_uri_encode = true;
189 signing_options.content_sha256_header = false;
190 signing_options.normalize_uri_path = true;
191 signing_options.payload_override = None;
192
193 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
194 signing_options,
195 ..::std::default::Default::default()
196 });
197
198 ::std::option::Option::Some(cfg.freeze())
199 }
200
201 fn runtime_components(
202 &self,
203 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
204 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
205 #[allow(unused_mut)]
206 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateMLTransform")
207 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
208 CreateMLTransformTelemetryInputCaptureInterceptor,
209 ))
210 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
211 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
212 ))
213 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
214 CreateMLTransformEndpointParamsInterceptor,
215 ))
216 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
217 crate::operation::create_ml_transform::CreateMLTransformError,
218 >::new())
219 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
220 crate::operation::create_ml_transform::CreateMLTransformError,
221 >::new())
222 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
223 crate::operation::create_ml_transform::CreateMLTransformError,
224 >::new())
225 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
226 crate::operation::create_ml_transform::CreateMLTransformError,
227 >::new());
228
229 ::std::borrow::Cow::Owned(rcb)
230 }
231}
232
233#[derive(Debug)]
234struct CreateMLTransformTelemetryInputCaptureInterceptor;
235
236#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
237impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateMLTransformTelemetryInputCaptureInterceptor {
238 fn name(&self) -> &'static str {
239 "CreateMLTransformTelemetryInputCaptureInterceptor"
240 }
241
242 fn read_before_execution(
243 &self,
244 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
245 '_,
246 ::aws_smithy_runtime_api::client::interceptors::context::Input,
247 ::aws_smithy_runtime_api::client::interceptors::context::Output,
248 ::aws_smithy_runtime_api::client::interceptors::context::Error,
249 >,
250 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
251 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
252 let ::std::option::Option::Some(requested) = cfg
254 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
255 .filter(|r| !r.is_empty())
256 else {
257 return ::std::result::Result::Ok(());
258 };
259
260 let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateMlTransformInput>() else {
261 return ::std::result::Result::Ok(());
263 };
264
265 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
266 if requested.should_capture("Name") {
267 if let ::std::option::Option::Some(value) = input.name.as_deref() {
268 captured.insert("Name", value);
269 }
270 }
271 if requested.should_capture("Description") {
272 if let ::std::option::Option::Some(value) = input.description.as_deref() {
273 captured.insert("Description", value);
274 }
275 }
276 if requested.should_capture("Role") {
277 if let ::std::option::Option::Some(value) = input.role.as_deref() {
278 captured.insert("Role", value);
279 }
280 }
281 if requested.should_capture("GlueVersion") {
282 if let ::std::option::Option::Some(value) = input.glue_version.as_deref() {
283 captured.insert("GlueVersion", value);
284 }
285 }
286
287 cfg.interceptor_state().store_put(captured);
288 ::std::result::Result::Ok(())
289 }
290}
291#[derive(Debug)]
292struct CreateMLTransformResponseDeserializer;
293impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateMLTransformResponseDeserializer {
294 fn deserialize_nonstreaming_with_config(
295 &self,
296 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
297 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
298 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
299 let (success, status) = (response.status().is_success(), response.status().as_u16());
300 #[allow(unused_variables)]
305 let body = response.body().bytes().expect("body loaded");
306 let headers = response.headers();
307 #[allow(unused_mut)]
308 let mut force_error = false;
309 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
310 if !success && status != 200 || force_error {
311 let protocol = _cfg
312 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
313 .expect("a SharedClientProtocol is required");
314 #[allow(unused_mut)]
315 let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
316 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
317 })?;
318 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
319 let generic = generic_builder.build();
320 let error_code = match generic.code() {
321 ::std::option::Option::Some(code) => code,
322 ::std::option::Option::None => {
323 return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
324 ::aws_smithy_runtime_api::box_error::BoxError::from(
325 crate::operation::create_ml_transform::CreateMLTransformError::unhandled(generic),
326 ),
327 ))
328 }
329 };
330 let _error_message = generic.message().map(|msg| msg.to_owned());
331 let err = match error_code {
332 "AccessDeniedException" => crate::operation::create_ml_transform::CreateMLTransformError::AccessDeniedException({
333 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
334 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
335 e,
336 ))
337 })?;
338 let mut tmp = <crate::types::error::builders::AccessDeniedExceptionBuilder>::default();
339 tmp.deserialize_members(&mut *deser).map_err(|e| {
340 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
341 e,
342 ))
343 })?;
344 if tmp.message.is_none() {
345 tmp.message = _error_message;
346 }
347 let tmp = tmp.meta(generic);
348 tmp.build()
349 }),
350 "AlreadyExistsException" => crate::operation::create_ml_transform::CreateMLTransformError::AlreadyExistsException({
351 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
352 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
353 e,
354 ))
355 })?;
356 let mut tmp = <crate::types::error::builders::AlreadyExistsExceptionBuilder>::default();
357 tmp.deserialize_members(&mut *deser).map_err(|e| {
358 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
359 e,
360 ))
361 })?;
362 if tmp.message.is_none() {
363 tmp.message = _error_message;
364 }
365 let tmp = tmp.meta(generic);
366 tmp.build()
367 }),
368 "IdempotentParameterMismatchException" => {
369 crate::operation::create_ml_transform::CreateMLTransformError::IdempotentParameterMismatchException({
370 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
371 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
372 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
373 )
374 })?;
375 let mut tmp = <crate::types::error::builders::IdempotentParameterMismatchExceptionBuilder>::default();
376 tmp.deserialize_members(&mut *deser).map_err(|e| {
377 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
378 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
379 )
380 })?;
381 if tmp.message.is_none() {
382 tmp.message = _error_message;
383 }
384 let tmp = tmp.meta(generic);
385 tmp.build()
386 })
387 }
388 "InternalServiceException" => crate::operation::create_ml_transform::CreateMLTransformError::InternalServiceException({
389 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
390 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
391 e,
392 ))
393 })?;
394 let mut tmp = <crate::types::error::builders::InternalServiceExceptionBuilder>::default();
395 tmp.deserialize_members(&mut *deser).map_err(|e| {
396 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
397 e,
398 ))
399 })?;
400 if tmp.message.is_none() {
401 tmp.message = _error_message;
402 }
403 let tmp = tmp.meta(generic);
404 tmp.build()
405 }),
406 "InvalidInputException" => crate::operation::create_ml_transform::CreateMLTransformError::InvalidInputException({
407 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
408 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
409 e,
410 ))
411 })?;
412 let mut tmp = <crate::types::error::builders::InvalidInputExceptionBuilder>::default();
413 tmp.deserialize_members(&mut *deser).map_err(|e| {
414 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
415 e,
416 ))
417 })?;
418 if tmp.message.is_none() {
419 tmp.message = _error_message;
420 }
421 let tmp = tmp.meta(generic);
422 tmp.build()
423 }),
424 "OperationTimeoutException" => crate::operation::create_ml_transform::CreateMLTransformError::OperationTimeoutException({
425 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
426 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
427 e,
428 ))
429 })?;
430 let mut tmp = <crate::types::error::builders::OperationTimeoutExceptionBuilder>::default();
431 tmp.deserialize_members(&mut *deser).map_err(|e| {
432 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
433 e,
434 ))
435 })?;
436 if tmp.message.is_none() {
437 tmp.message = _error_message;
438 }
439 let tmp = tmp.meta(generic);
440 tmp.build()
441 }),
442 "ResourceNumberLimitExceededException" => {
443 crate::operation::create_ml_transform::CreateMLTransformError::ResourceNumberLimitExceededException({
444 let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
445 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
446 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
447 )
448 })?;
449 let mut tmp = <crate::types::error::builders::ResourceNumberLimitExceededExceptionBuilder>::default();
450 tmp.deserialize_members(&mut *deser).map_err(|e| {
451 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
452 ::aws_smithy_runtime_api::box_error::BoxError::from(e),
453 )
454 })?;
455 if tmp.message.is_none() {
456 tmp.message = _error_message;
457 }
458 let tmp = tmp.meta(generic);
459 tmp.build()
460 })
461 }
462 _ => {
463 match protocol
471 .deserialize_error_response(response, _cfg)
472 .ok()
473 .and_then(|mut deser| {
474 ::aws_smithy_schema::registry::reify_error(
475 crate::operation::create_ml_transform::error_registry::REGISTRY
476 .or(&crate::error_type_registry::REGISTRY),
477 error_code,
478 &mut *deser,
479 )
480 }) {
481 ::std::option::Option::Some(source) => <crate::operation::create_ml_transform::CreateMLTransformError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
482 ::std::option::Option::None => crate::operation::create_ml_transform::CreateMLTransformError::generic(generic),
483 }
484 }
485 };
486 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
487 ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
488 ))
489 } else {
490 let protocol = _cfg
491 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
492 .expect("a SharedClientProtocol is required");
493 let mut deser = protocol
494 .deserialize_response(response, CreateMLTransform::OUTPUT_SCHEMA, _cfg)
495 .map_err(|e| {
496 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
497 })?;
498 let _response_headers = headers;
502 #[allow(unused_mut)]
506 let mut output = <crate::operation::create_ml_transform::builders::CreateMlTransformOutputBuilder>::default();
507 output.deserialize_members(&mut *deser).map_err(|e| {
508 ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
509 })?;
510 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
511 let output = output.build();
512 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
513 }
514 }
515}
516#[derive(Debug)]
517struct CreateMLTransformRequestSerializer;
518impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateMLTransformRequestSerializer {
519 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
520 fn serialize_input(
521 &self,
522 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
523 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
524 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
525 let input = input
526 .downcast::<crate::operation::create_ml_transform::CreateMlTransformInput>()
527 .expect("correct type");
528
529 let protocol = _cfg
530 .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
531 .expect("a SharedClientProtocol is required");
532 let mut request = protocol
533 .serialize_request(&input, CreateMLTransform::INPUT_SCHEMA, "/", _cfg)
534 .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
535
536 return ::std::result::Result::Ok(request);
537 }
538}
539#[derive(Debug)]
540struct CreateMLTransformEndpointParamsInterceptor;
541
542#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
543impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateMLTransformEndpointParamsInterceptor {
544 fn name(&self) -> &'static str {
545 "CreateMLTransformEndpointParamsInterceptor"
546 }
547
548 fn read_before_execution(
549 &self,
550 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
551 '_,
552 ::aws_smithy_runtime_api::client::interceptors::context::Input,
553 ::aws_smithy_runtime_api::client::interceptors::context::Output,
554 ::aws_smithy_runtime_api::client::interceptors::context::Error,
555 >,
556 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
557 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
558 let _input = context
559 .input()
560 .downcast_ref::<CreateMlTransformInput>()
561 .ok_or("failed to downcast to CreateMlTransformInput")?;
562
563 let params = crate::config::endpoint::Params::builder()
564 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
565 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
566 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
567 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
568 .build()
569 .map_err(|err| {
570 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
571 })?;
572 cfg.interceptor_state()
573 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
574 ::std::result::Result::Ok(())
575 }
576}
577
578#[non_exhaustive]
583#[derive(::std::fmt::Debug)]
584pub enum CreateMLTransformError {
585 AccessDeniedException(crate::types::error::AccessDeniedException),
587 AlreadyExistsException(crate::types::error::AlreadyExistsException),
589 IdempotentParameterMismatchException(crate::types::error::IdempotentParameterMismatchException),
591 InternalServiceException(crate::types::error::InternalServiceException),
593 InvalidInputException(crate::types::error::InvalidInputException),
595 OperationTimeoutException(crate::types::error::OperationTimeoutException),
597 ResourceNumberLimitExceededException(crate::types::error::ResourceNumberLimitExceededException),
599 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
601 variable wildcard pattern and check `.code()`:
602 \
603 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
604 \
605 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateMLTransformError) for what information is available for the error.")]
606 Unhandled(crate::error::sealed_unhandled::Unhandled),
607}
608impl CreateMLTransformError {
609 pub fn unhandled(
611 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
612 ) -> Self {
613 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
614 source: err.into(),
615 meta: ::std::default::Default::default(),
616 })
617 }
618
619 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
621 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
622 source: err.clone().into(),
623 meta: err,
624 })
625 }
626 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
631 match self {
632 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
633 Self::AlreadyExistsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
634 Self::IdempotentParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
635 Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
636 Self::InvalidInputException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
637 Self::OperationTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
638 Self::ResourceNumberLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
639 Self::Unhandled(e) => &e.meta,
640 }
641 }
642 pub fn is_access_denied_exception(&self) -> bool {
644 matches!(self, Self::AccessDeniedException(_))
645 }
646 pub fn is_already_exists_exception(&self) -> bool {
648 matches!(self, Self::AlreadyExistsException(_))
649 }
650 pub fn is_idempotent_parameter_mismatch_exception(&self) -> bool {
652 matches!(self, Self::IdempotentParameterMismatchException(_))
653 }
654 pub fn is_internal_service_exception(&self) -> bool {
656 matches!(self, Self::InternalServiceException(_))
657 }
658 pub fn is_invalid_input_exception(&self) -> bool {
660 matches!(self, Self::InvalidInputException(_))
661 }
662 pub fn is_operation_timeout_exception(&self) -> bool {
664 matches!(self, Self::OperationTimeoutException(_))
665 }
666 pub fn is_resource_number_limit_exceeded_exception(&self) -> bool {
668 matches!(self, Self::ResourceNumberLimitExceededException(_))
669 }
670}
671impl ::std::error::Error for CreateMLTransformError {
672 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
673 match self {
674 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
675 Self::AlreadyExistsException(_inner) => ::std::option::Option::Some(_inner),
676 Self::IdempotentParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
677 Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
678 Self::InvalidInputException(_inner) => ::std::option::Option::Some(_inner),
679 Self::OperationTimeoutException(_inner) => ::std::option::Option::Some(_inner),
680 Self::ResourceNumberLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
681 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
682 }
683 }
684}
685impl ::std::fmt::Display for CreateMLTransformError {
686 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
687 match self {
688 Self::AccessDeniedException(_inner) => _inner.fmt(f),
689 Self::AlreadyExistsException(_inner) => _inner.fmt(f),
690 Self::IdempotentParameterMismatchException(_inner) => _inner.fmt(f),
691 Self::InternalServiceException(_inner) => _inner.fmt(f),
692 Self::InvalidInputException(_inner) => _inner.fmt(f),
693 Self::OperationTimeoutException(_inner) => _inner.fmt(f),
694 Self::ResourceNumberLimitExceededException(_inner) => _inner.fmt(f),
695 Self::Unhandled(_inner) => {
696 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
697 write!(f, "unhandled error ({code})")
698 } else {
699 f.write_str("unhandled error")
700 }
701 }
702 }
703 }
704}
705impl ::aws_smithy_types::retry::ProvideErrorKind for CreateMLTransformError {
706 fn code(&self) -> ::std::option::Option<&str> {
707 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
708 }
709 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
710 ::std::option::Option::None
711 }
712}
713impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateMLTransformError {
714 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
715 match self {
716 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
717 Self::AlreadyExistsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
718 Self::IdempotentParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
719 Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
720 Self::InvalidInputException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
721 Self::OperationTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
722 Self::ResourceNumberLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
723 Self::Unhandled(_inner) => &_inner.meta,
724 }
725 }
726}
727impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateMLTransformError {
728 fn create_unhandled_error(
729 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
730 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
731 ) -> Self {
732 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
733 source,
734 meta: meta.unwrap_or_default(),
735 })
736 }
737}
738impl ::aws_types::request_id::RequestId for crate::operation::create_ml_transform::CreateMLTransformError {
739 fn request_id(&self) -> Option<&str> {
740 self.meta().request_id()
741 }
742}
743
744pub use crate::operation::create_ml_transform::_create_ml_transform_input::CreateMlTransformInput;
745
746pub use crate::operation::create_ml_transform::_create_ml_transform_output::CreateMlTransformOutput;
747
748mod _create_ml_transform_input;
749
750mod _create_ml_transform_output;
751
752pub mod builders;