Skip to main content

aws_sdk_omics/operation/
create_workflow_version.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateWorkflowVersion`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateWorkflowVersion;
6impl CreateWorkflowVersion {
7    /// Creates a new `CreateWorkflowVersion`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13        input: crate::operation::create_workflow_version::CreateWorkflowVersionInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_workflow_version::CreateWorkflowVersionOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_workflow_version::CreateWorkflowVersionError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22            ::aws_smithy_runtime_api::client::interceptors::context::Error,
23            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24        >| {
25            err.map_service_error(|err| {
26                err.downcast::<crate::operation::create_workflow_version::CreateWorkflowVersionError>()
27                    .expect("correct error type")
28            })
29        };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::create_workflow_version::CreateWorkflowVersionOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::create_workflow_version::CreateWorkflowVersionInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Omics", "CreateWorkflowVersion", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "Omics.CreateWorkflowVersion",
59                "rpc.service" = "Omics",
60                "rpc.method" = "CreateWorkflowVersion",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73        runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
74            |token_provider, input| {
75                let input: &mut crate::operation::create_workflow_version::CreateWorkflowVersionInput = input.downcast_mut().expect("correct type");
76                if input.request_id.is_none() {
77                    input.request_id = ::std::option::Option::Some(token_provider.make_idempotency_token());
78                }
79            },
80        ));
81        if let ::std::option::Option::Some(config_override) = config_override {
82            for plugin in config_override.runtime_plugins.iter().cloned() {
83                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
84            }
85            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
86                config_override,
87                client_config.config.clone(),
88                &client_config.runtime_components,
89            ));
90        }
91        runtime_plugins
92    }
93}
94impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateWorkflowVersion {
95    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
96        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateWorkflowVersion");
97
98        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
99            CreateWorkflowVersionRequestSerializer,
100        ));
101        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
102            CreateWorkflowVersionResponseDeserializer,
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
106            crate::config::auth::Params::builder()
107                .operation_name("CreateWorkflowVersion")
108                .build()
109                .expect("required fields set"),
110        ));
111
112        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
113            "CreateWorkflowVersion",
114            "Omics",
115        ));
116        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
117        signing_options.double_uri_encode = true;
118        signing_options.content_sha256_header = false;
119        signing_options.normalize_uri_path = true;
120        signing_options.payload_override = None;
121
122        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
123            signing_options,
124            ..::std::default::Default::default()
125        });
126
127        ::std::option::Option::Some(cfg.freeze())
128    }
129
130    fn runtime_components(
131        &self,
132        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
133    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
134        #[allow(unused_mut)]
135        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateWorkflowVersion")
136            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
137                CreateWorkflowVersionTelemetryInputCaptureInterceptor,
138            ))
139            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
140                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
141            ))
142            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
143                CreateWorkflowVersionEndpointParamsInterceptor,
144            ))
145            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
146                crate::operation::create_workflow_version::CreateWorkflowVersionError,
147            >::new())
148            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
149                crate::operation::create_workflow_version::CreateWorkflowVersionError,
150            >::new())
151            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
152                crate::operation::create_workflow_version::CreateWorkflowVersionError,
153            >::new());
154
155        ::std::borrow::Cow::Owned(rcb)
156    }
157}
158
159#[derive(Debug)]
160struct CreateWorkflowVersionTelemetryInputCaptureInterceptor;
161
162#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
163impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateWorkflowVersionTelemetryInputCaptureInterceptor {
164    fn name(&self) -> &'static str {
165        "CreateWorkflowVersionTelemetryInputCaptureInterceptor"
166    }
167
168    fn read_before_execution(
169        &self,
170        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
171            '_,
172            ::aws_smithy_runtime_api::client::interceptors::context::Input,
173            ::aws_smithy_runtime_api::client::interceptors::context::Output,
174            ::aws_smithy_runtime_api::client::interceptors::context::Error,
175        >,
176        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
177    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
178        // Nothing to do unless the customer opted in by naming members to record.
179        let ::std::option::Option::Some(requested) = cfg
180            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
181            .filter(|r| !r.is_empty())
182        else {
183            return ::std::result::Result::Ok(());
184        };
185
186        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateWorkflowVersionInput>() else {
187            // A mismatched input is not this interceptor's concern; skip quietly.
188            return ::std::result::Result::Ok(());
189        };
190
191        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
192        if requested.should_capture("workflowId") {
193            if let ::std::option::Option::Some(value) = input.workflow_id.as_deref() {
194                captured.insert("workflowId", value);
195            }
196        }
197        if requested.should_capture("versionName") {
198            if let ::std::option::Option::Some(value) = input.version_name.as_deref() {
199                captured.insert("versionName", value);
200            }
201        }
202        if requested.should_capture("definitionUri") {
203            if let ::std::option::Option::Some(value) = input.definition_uri.as_deref() {
204                captured.insert("definitionUri", value);
205            }
206        }
207        if requested.should_capture("description") {
208            if let ::std::option::Option::Some(value) = input.description.as_deref() {
209                captured.insert("description", value);
210            }
211        }
212        if requested.should_capture("main") {
213            if let ::std::option::Option::Some(value) = input.main.as_deref() {
214                captured.insert("main", value);
215            }
216        }
217        if requested.should_capture("requestId") {
218            if let ::std::option::Option::Some(value) = input.request_id.as_deref() {
219                captured.insert("requestId", value);
220            }
221        }
222        if requested.should_capture("workflowBucketOwnerId") {
223            if let ::std::option::Option::Some(value) = input.workflow_bucket_owner_id.as_deref() {
224                captured.insert("workflowBucketOwnerId", value);
225            }
226        }
227        if requested.should_capture("containerRegistryMapUri") {
228            if let ::std::option::Option::Some(value) = input.container_registry_map_uri.as_deref() {
229                captured.insert("containerRegistryMapUri", value);
230            }
231        }
232        if requested.should_capture("readmeMarkdown") {
233            if let ::std::option::Option::Some(value) = input.readme_markdown.as_deref() {
234                captured.insert("readmeMarkdown", value);
235            }
236        }
237        if requested.should_capture("parameterTemplatePath") {
238            if let ::std::option::Option::Some(value) = input.parameter_template_path.as_deref() {
239                captured.insert("parameterTemplatePath", value);
240            }
241        }
242        if requested.should_capture("readmePath") {
243            if let ::std::option::Option::Some(value) = input.readme_path.as_deref() {
244                captured.insert("readmePath", value);
245            }
246        }
247        if requested.should_capture("readmeUri") {
248            if let ::std::option::Option::Some(value) = input.readme_uri.as_deref() {
249                captured.insert("readmeUri", value);
250            }
251        }
252
253        cfg.interceptor_state().store_put(captured);
254        ::std::result::Result::Ok(())
255    }
256}
257#[derive(Debug)]
258struct CreateWorkflowVersionResponseDeserializer;
259impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateWorkflowVersionResponseDeserializer {
260    fn deserialize_nonstreaming_with_config(
261        &self,
262        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
263        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
264    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
265        let (success, status) = (response.status().is_success(), response.status().as_u16());
266        let headers = response.headers();
267        let body = response.body().bytes().expect("body loaded");
268        #[allow(unused_mut)]
269        let mut force_error = false;
270        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
271        let parse_result = if !success && status != 201 || force_error {
272            crate::protocol_serde::shape_create_workflow_version::de_create_workflow_version_http_error(status, headers, body)
273        } else {
274            crate::protocol_serde::shape_create_workflow_version::de_create_workflow_version_http_response(status, headers, body)
275        };
276        crate::protocol_serde::type_erase_result(parse_result)
277    }
278}
279#[derive(Debug)]
280struct CreateWorkflowVersionRequestSerializer;
281impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateWorkflowVersionRequestSerializer {
282    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
283    fn serialize_input(
284        &self,
285        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
286        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
287    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
288        let input = input
289            .downcast::<crate::operation::create_workflow_version::CreateWorkflowVersionInput>()
290            .expect("correct type");
291        let _header_serialization_settings = _cfg
292            .load::<crate::serialization_settings::HeaderSerializationSettings>()
293            .cloned()
294            .unwrap_or_default();
295        let mut request_builder = {
296            #[allow(clippy::uninlined_format_args)]
297            fn uri_base(
298                _input: &crate::operation::create_workflow_version::CreateWorkflowVersionInput,
299                output: &mut ::std::string::String,
300            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
301                use ::std::fmt::Write as _;
302                let input_1 = &_input.workflow_id;
303                let input_1 = input_1
304                    .as_ref()
305                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("workflow_id", "cannot be empty or unset"))?;
306                let workflow_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
307                if workflow_id.is_empty() {
308                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
309                        "workflow_id",
310                        "cannot be empty or unset",
311                    ));
312                }
313                ::std::write!(output, "/workflow/{workflowId}/version", workflowId = workflow_id).expect("formatting should succeed");
314                ::std::result::Result::Ok(())
315            }
316            #[allow(clippy::unnecessary_wraps)]
317            fn update_http_builder(
318                input: &crate::operation::create_workflow_version::CreateWorkflowVersionInput,
319                builder: ::http_1x::request::Builder,
320            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
321                let mut uri = ::std::string::String::new();
322                uri_base(input, &mut uri)?;
323                ::std::result::Result::Ok(builder.method("POST").uri(uri))
324            }
325            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
326            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
327            builder
328        };
329        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_workflow_version::ser_create_workflow_version_input(
330            &input,
331        )?);
332        if let Some(content_length) = body.content_length() {
333            let content_length = content_length.to_string();
334            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
335        }
336        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
337    }
338}
339#[derive(Debug)]
340struct CreateWorkflowVersionEndpointParamsInterceptor;
341
342#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
343impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateWorkflowVersionEndpointParamsInterceptor {
344    fn name(&self) -> &'static str {
345        "CreateWorkflowVersionEndpointParamsInterceptor"
346    }
347
348    fn read_before_execution(
349        &self,
350        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
351            '_,
352            ::aws_smithy_runtime_api::client::interceptors::context::Input,
353            ::aws_smithy_runtime_api::client::interceptors::context::Output,
354            ::aws_smithy_runtime_api::client::interceptors::context::Error,
355        >,
356        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
357    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
358        let _input = context
359            .input()
360            .downcast_ref::<CreateWorkflowVersionInput>()
361            .ok_or("failed to downcast to CreateWorkflowVersionInput")?;
362
363        let endpoint_prefix = ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new("workflows-").map_err(|err| {
364            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err)
365        })?;
366        cfg.interceptor_state().store_put(endpoint_prefix);
367
368        let params = crate::config::endpoint::Params::builder()
369            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
370            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
371            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
372            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
373            .build()
374            .map_err(|err| {
375                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
376            })?;
377        cfg.interceptor_state()
378            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
379        ::std::result::Result::Ok(())
380    }
381}
382
383// The get_* functions below are generated from JMESPath expressions in the
384// operationContextParams trait. They target the operation's input shape.
385
386/// Error type for the `CreateWorkflowVersionError` operation.
387#[non_exhaustive]
388#[derive(::std::fmt::Debug)]
389pub enum CreateWorkflowVersionError {
390    /// <p>You do not have sufficient access to perform this action.</p>
391    AccessDeniedException(crate::types::error::AccessDeniedException),
392    /// <p>The request cannot be applied to the target resource in its current state.</p>
393    ConflictException(crate::types::error::ConflictException),
394    /// <p>An unexpected error occurred. Try the request again.</p>
395    InternalServerException(crate::types::error::InternalServerException),
396    /// <p>The request timed out.</p>
397    RequestTimeoutException(crate::types::error::RequestTimeoutException),
398    /// <p>The target resource was not found in the current Region.</p>
399    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
400    /// <p>The request exceeds a service quota.</p>
401    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
402    /// <p>The request was denied due to request throttling.</p>
403    ThrottlingException(crate::types::error::ThrottlingException),
404    /// <p>The input fails to satisfy the constraints specified by an AWS service.</p>
405    ValidationException(crate::types::error::ValidationException),
406    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
407    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
408    variable wildcard pattern and check `.code()`:
409     \
410    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
411     \
412    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateWorkflowVersionError) for what information is available for the error.")]
413    Unhandled(crate::error::sealed_unhandled::Unhandled),
414}
415impl CreateWorkflowVersionError {
416    /// Creates the `CreateWorkflowVersionError::Unhandled` variant from any error type.
417    pub fn unhandled(
418        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
419    ) -> Self {
420        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
421            source: err.into(),
422            meta: ::std::default::Default::default(),
423        })
424    }
425
426    /// Creates the `CreateWorkflowVersionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
427    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
428        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
429            source: err.clone().into(),
430            meta: err,
431        })
432    }
433    ///
434    /// Returns error metadata, which includes the error code, message,
435    /// request ID, and potentially additional information.
436    ///
437    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
438        match self {
439            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440            Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442            Self::RequestTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444            Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447            Self::Unhandled(e) => &e.meta,
448        }
449    }
450    /// Returns `true` if the error kind is `CreateWorkflowVersionError::AccessDeniedException`.
451    pub fn is_access_denied_exception(&self) -> bool {
452        matches!(self, Self::AccessDeniedException(_))
453    }
454    /// Returns `true` if the error kind is `CreateWorkflowVersionError::ConflictException`.
455    pub fn is_conflict_exception(&self) -> bool {
456        matches!(self, Self::ConflictException(_))
457    }
458    /// Returns `true` if the error kind is `CreateWorkflowVersionError::InternalServerException`.
459    pub fn is_internal_server_exception(&self) -> bool {
460        matches!(self, Self::InternalServerException(_))
461    }
462    /// Returns `true` if the error kind is `CreateWorkflowVersionError::RequestTimeoutException`.
463    pub fn is_request_timeout_exception(&self) -> bool {
464        matches!(self, Self::RequestTimeoutException(_))
465    }
466    /// Returns `true` if the error kind is `CreateWorkflowVersionError::ResourceNotFoundException`.
467    pub fn is_resource_not_found_exception(&self) -> bool {
468        matches!(self, Self::ResourceNotFoundException(_))
469    }
470    /// Returns `true` if the error kind is `CreateWorkflowVersionError::ServiceQuotaExceededException`.
471    pub fn is_service_quota_exceeded_exception(&self) -> bool {
472        matches!(self, Self::ServiceQuotaExceededException(_))
473    }
474    /// Returns `true` if the error kind is `CreateWorkflowVersionError::ThrottlingException`.
475    pub fn is_throttling_exception(&self) -> bool {
476        matches!(self, Self::ThrottlingException(_))
477    }
478    /// Returns `true` if the error kind is `CreateWorkflowVersionError::ValidationException`.
479    pub fn is_validation_exception(&self) -> bool {
480        matches!(self, Self::ValidationException(_))
481    }
482}
483impl ::std::error::Error for CreateWorkflowVersionError {
484    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
485        match self {
486            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
487            Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
488            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
489            Self::RequestTimeoutException(_inner) => ::std::option::Option::Some(_inner),
490            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
491            Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
492            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
493            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
494            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
495        }
496    }
497}
498impl ::std::fmt::Display for CreateWorkflowVersionError {
499    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
500        match self {
501            Self::AccessDeniedException(_inner) => _inner.fmt(f),
502            Self::ConflictException(_inner) => _inner.fmt(f),
503            Self::InternalServerException(_inner) => _inner.fmt(f),
504            Self::RequestTimeoutException(_inner) => _inner.fmt(f),
505            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
506            Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
507            Self::ThrottlingException(_inner) => _inner.fmt(f),
508            Self::ValidationException(_inner) => _inner.fmt(f),
509            Self::Unhandled(_inner) => {
510                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
511                    write!(f, "unhandled error ({code})")
512                } else {
513                    f.write_str("unhandled error")
514                }
515            }
516        }
517    }
518}
519impl ::aws_smithy_types::retry::ProvideErrorKind for CreateWorkflowVersionError {
520    fn code(&self) -> ::std::option::Option<&str> {
521        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
522    }
523    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
524        match self {
525            Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
526            Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
527            _ => ::std::option::Option::None,
528        }
529    }
530}
531impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateWorkflowVersionError {
532    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
533        match self {
534            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
535            Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
536            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
537            Self::RequestTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
538            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
539            Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
540            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
541            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
542            Self::Unhandled(_inner) => &_inner.meta,
543        }
544    }
545}
546impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateWorkflowVersionError {
547    fn create_unhandled_error(
548        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
549        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
550    ) -> Self {
551        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
552            source,
553            meta: meta.unwrap_or_default(),
554        })
555    }
556}
557impl ::aws_types::request_id::RequestId for crate::operation::create_workflow_version::CreateWorkflowVersionError {
558    fn request_id(&self) -> Option<&str> {
559        self.meta().request_id()
560    }
561}
562
563pub use crate::operation::create_workflow_version::_create_workflow_version_input::CreateWorkflowVersionInput;
564
565pub use crate::operation::create_workflow_version::_create_workflow_version_output::CreateWorkflowVersionOutput;
566
567mod _create_workflow_version_input;
568
569mod _create_workflow_version_output;
570
571/// Builders
572pub mod builders;