Skip to main content

aws_sdk_codeartifact/operation/
get_package_version_asset.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `GetPackageVersionAsset`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetPackageVersionAsset;
6impl GetPackageVersionAsset {
7    /// Creates a new `GetPackageVersionAsset`
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::get_package_version_asset::GetPackageVersionAssetInput,
14    ) -> ::std::result::Result<
15        crate::operation::get_package_version_asset::GetPackageVersionAssetOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::get_package_version_asset::GetPackageVersionAssetError,
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::get_package_version_asset::GetPackageVersionAssetError>()
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::get_package_version_asset::GetPackageVersionAssetOutput>()
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::get_package_version_asset::GetPackageVersionAssetInput,
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(
55            "codeartifact",
56            "GetPackageVersionAsset",
57            input,
58            runtime_plugins,
59            stop_point,
60        )
61        // Create a parent span for the entire operation. Includes a random, internal-only,
62        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63        .instrument(::tracing::debug_span!(
64            "codeartifact.GetPackageVersionAsset",
65            "rpc.service" = "codeartifact",
66            "rpc.method" = "GetPackageVersionAsset",
67            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68            "rpc.system" = "aws-api",
69        ))
70        .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetPackageVersionAsset {
94    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
95        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetPackageVersionAsset");
96
97        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
98            GetPackageVersionAssetRequestSerializer,
99        ));
100        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
101            GetPackageVersionAssetResponseDeserializer,
102        ));
103
104        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
105            crate::config::auth::Params::builder()
106                .operation_name("GetPackageVersionAsset")
107                .build()
108                .expect("required fields set"),
109        ));
110
111        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
112            "GetPackageVersionAsset",
113            "codeartifact",
114        ));
115        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
116        signing_options.double_uri_encode = true;
117        signing_options.content_sha256_header = false;
118        signing_options.normalize_uri_path = true;
119        signing_options.payload_override = None;
120
121        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
122            signing_options,
123            ..::std::default::Default::default()
124        });
125
126        ::std::option::Option::Some(cfg.freeze())
127    }
128
129    fn runtime_components(
130        &self,
131        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
132    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
133        #[allow(unused_mut)]
134        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetPackageVersionAsset")
135            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
136                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
137            ))
138            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
139                GetPackageVersionAssetEndpointParamsInterceptor,
140            ))
141            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
142                crate::operation::get_package_version_asset::GetPackageVersionAssetError,
143            >::new())
144            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
145                crate::operation::get_package_version_asset::GetPackageVersionAssetError,
146            >::new())
147            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
148                crate::operation::get_package_version_asset::GetPackageVersionAssetError,
149            >::new());
150
151        ::std::borrow::Cow::Owned(rcb)
152    }
153}
154
155#[derive(Debug)]
156struct GetPackageVersionAssetResponseDeserializer;
157impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetPackageVersionAssetResponseDeserializer {
158    fn deserialize_streaming(
159        &self,
160        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
161    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
162        #[allow(unused_mut)]
163        let mut force_error = false;
164        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
165
166        // If this is an error, defer to the non-streaming parser
167        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
168            return ::std::option::Option::None;
169        }
170        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
171            crate::protocol_serde::shape_get_package_version_asset::de_get_package_version_asset_http_response(response),
172        ))
173    }
174
175    fn deserialize_nonstreaming_with_config(
176        &self,
177        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
178        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
179    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
180        // For streaming operations, we only hit this case if its an error
181        let body = response.body().bytes().expect("body loaded");
182        crate::protocol_serde::type_erase_result(
183            crate::protocol_serde::shape_get_package_version_asset::de_get_package_version_asset_http_error(
184                response.status().as_u16(),
185                response.headers(),
186                body,
187            ),
188        )
189    }
190}
191#[derive(Debug)]
192struct GetPackageVersionAssetRequestSerializer;
193impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetPackageVersionAssetRequestSerializer {
194    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
195    fn serialize_input(
196        &self,
197        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
198        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
199    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
200        let input = input
201            .downcast::<crate::operation::get_package_version_asset::GetPackageVersionAssetInput>()
202            .expect("correct type");
203        let _header_serialization_settings = _cfg
204            .load::<crate::serialization_settings::HeaderSerializationSettings>()
205            .cloned()
206            .unwrap_or_default();
207        let mut request_builder = {
208            #[allow(clippy::uninlined_format_args)]
209            fn uri_base(
210                _input: &crate::operation::get_package_version_asset::GetPackageVersionAssetInput,
211                output: &mut ::std::string::String,
212            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
213                use ::std::fmt::Write as _;
214                ::std::write!(output, "/v1/package/version/asset").expect("formatting should succeed");
215                ::std::result::Result::Ok(())
216            }
217            fn uri_query(
218                _input: &crate::operation::get_package_version_asset::GetPackageVersionAssetInput,
219                mut output: &mut ::std::string::String,
220            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
221                let mut query = ::aws_smithy_http::query::Writer::new(output);
222                let inner_1 = &_input.domain;
223                let inner_1 = inner_1
224                    .as_ref()
225                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("domain", "cannot be empty or unset"))?;
226                if inner_1.is_empty() {
227                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
228                        "domain",
229                        "cannot be empty or unset",
230                    ));
231                }
232                query.push_kv("domain", &::aws_smithy_http::query::fmt_string(inner_1));
233                if let ::std::option::Option::Some(inner_2) = &_input.domain_owner {
234                    {
235                        query.push_kv("domain-owner", &::aws_smithy_http::query::fmt_string(inner_2));
236                    }
237                }
238                let inner_3 = &_input.repository;
239                let inner_3 = inner_3
240                    .as_ref()
241                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("repository", "cannot be empty or unset"))?;
242                if inner_3.is_empty() {
243                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
244                        "repository",
245                        "cannot be empty or unset",
246                    ));
247                }
248                query.push_kv("repository", &::aws_smithy_http::query::fmt_string(inner_3));
249                let inner_4 = &_input.format;
250                let inner_4 = inner_4
251                    .as_ref()
252                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("format", "cannot be empty or unset"))?;
253                query.push_kv("format", &::aws_smithy_http::query::fmt_string(inner_4.as_str()));
254                if let ::std::option::Option::Some(inner_5) = &_input.namespace {
255                    {
256                        query.push_kv("namespace", &::aws_smithy_http::query::fmt_string(inner_5));
257                    }
258                }
259                let inner_6 = &_input.package;
260                let inner_6 = inner_6
261                    .as_ref()
262                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("package", "cannot be empty or unset"))?;
263                if inner_6.is_empty() {
264                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
265                        "package",
266                        "cannot be empty or unset",
267                    ));
268                }
269                query.push_kv("package", &::aws_smithy_http::query::fmt_string(inner_6));
270                let inner_7 = &_input.package_version;
271                let inner_7 = inner_7
272                    .as_ref()
273                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("package_version", "cannot be empty or unset"))?;
274                if inner_7.is_empty() {
275                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
276                        "package_version",
277                        "cannot be empty or unset",
278                    ));
279                }
280                query.push_kv("version", &::aws_smithy_http::query::fmt_string(inner_7));
281                let inner_8 = &_input.asset;
282                let inner_8 = inner_8
283                    .as_ref()
284                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("asset", "cannot be empty or unset"))?;
285                if inner_8.is_empty() {
286                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
287                        "asset",
288                        "cannot be empty or unset",
289                    ));
290                }
291                query.push_kv("asset", &::aws_smithy_http::query::fmt_string(inner_8));
292                if let ::std::option::Option::Some(inner_9) = &_input.package_version_revision {
293                    {
294                        query.push_kv("revision", &::aws_smithy_http::query::fmt_string(inner_9));
295                    }
296                }
297                ::std::result::Result::Ok(())
298            }
299            #[allow(clippy::unnecessary_wraps)]
300            fn update_http_builder(
301                input: &crate::operation::get_package_version_asset::GetPackageVersionAssetInput,
302                builder: ::http_1x::request::Builder,
303            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
304                let mut uri = ::std::string::String::new();
305                uri_base(input, &mut uri)?;
306                uri_query(input, &mut uri)?;
307                ::std::result::Result::Ok(builder.method("GET").uri(uri))
308            }
309            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
310            builder
311        };
312        let body = ::aws_smithy_types::body::SdkBody::from("");
313
314        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
315    }
316}
317#[derive(Debug)]
318struct GetPackageVersionAssetEndpointParamsInterceptor;
319
320#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
321impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetPackageVersionAssetEndpointParamsInterceptor {
322    fn name(&self) -> &'static str {
323        "GetPackageVersionAssetEndpointParamsInterceptor"
324    }
325
326    fn read_before_execution(
327        &self,
328        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
329            '_,
330            ::aws_smithy_runtime_api::client::interceptors::context::Input,
331            ::aws_smithy_runtime_api::client::interceptors::context::Output,
332            ::aws_smithy_runtime_api::client::interceptors::context::Error,
333        >,
334        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
335    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
336        let _input = context
337            .input()
338            .downcast_ref::<GetPackageVersionAssetInput>()
339            .ok_or("failed to downcast to GetPackageVersionAssetInput")?;
340
341        let params = crate::config::endpoint::Params::builder()
342            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
343            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
344            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
345            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
346            .build()
347            .map_err(|err| {
348                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
349            })?;
350        cfg.interceptor_state()
351            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
352        ::std::result::Result::Ok(())
353    }
354}
355
356// The get_* functions below are generated from JMESPath expressions in the
357// operationContextParams trait. They target the operation's input shape.
358
359/// Error type for the `GetPackageVersionAssetError` operation.
360#[non_exhaustive]
361#[derive(::std::fmt::Debug)]
362pub enum GetPackageVersionAssetError {
363    /// <p>The operation did not succeed because of an unauthorized access attempt.</p>
364    AccessDeniedException(crate::types::error::AccessDeniedException),
365    /// <p>The operation did not succeed because prerequisites are not met.</p>
366    ConflictException(crate::types::error::ConflictException),
367    /// <p>The operation did not succeed because of an error that occurred inside CodeArtifact.</p>
368    InternalServerException(crate::types::error::InternalServerException),
369    /// <p>The operation did not succeed because the resource requested is not found in the service.</p>
370    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
371    /// <p>The operation did not succeed because too many requests are sent to the service.</p>
372    ThrottlingException(crate::types::error::ThrottlingException),
373    /// <p>The operation did not succeed because a parameter in the request was sent with an invalid value.</p>
374    ValidationException(crate::types::error::ValidationException),
375    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
376    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
377    variable wildcard pattern and check `.code()`:
378     \
379    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
380     \
381    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetPackageVersionAssetError) for what information is available for the error.")]
382    Unhandled(crate::error::sealed_unhandled::Unhandled),
383}
384impl GetPackageVersionAssetError {
385    /// Creates the `GetPackageVersionAssetError::Unhandled` variant from any error type.
386    pub fn unhandled(
387        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
388    ) -> Self {
389        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
390            source: err.into(),
391            meta: ::std::default::Default::default(),
392        })
393    }
394
395    /// Creates the `GetPackageVersionAssetError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
396    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
397        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
398            source: err.clone().into(),
399            meta: err,
400        })
401    }
402    ///
403    /// Returns error metadata, which includes the error code, message,
404    /// request ID, and potentially additional information.
405    ///
406    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
407        match self {
408            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
409            Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
410            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
411            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
412            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414            Self::Unhandled(e) => &e.meta,
415        }
416    }
417    /// Returns `true` if the error kind is `GetPackageVersionAssetError::AccessDeniedException`.
418    pub fn is_access_denied_exception(&self) -> bool {
419        matches!(self, Self::AccessDeniedException(_))
420    }
421    /// Returns `true` if the error kind is `GetPackageVersionAssetError::ConflictException`.
422    pub fn is_conflict_exception(&self) -> bool {
423        matches!(self, Self::ConflictException(_))
424    }
425    /// Returns `true` if the error kind is `GetPackageVersionAssetError::InternalServerException`.
426    pub fn is_internal_server_exception(&self) -> bool {
427        matches!(self, Self::InternalServerException(_))
428    }
429    /// Returns `true` if the error kind is `GetPackageVersionAssetError::ResourceNotFoundException`.
430    pub fn is_resource_not_found_exception(&self) -> bool {
431        matches!(self, Self::ResourceNotFoundException(_))
432    }
433    /// Returns `true` if the error kind is `GetPackageVersionAssetError::ThrottlingException`.
434    pub fn is_throttling_exception(&self) -> bool {
435        matches!(self, Self::ThrottlingException(_))
436    }
437    /// Returns `true` if the error kind is `GetPackageVersionAssetError::ValidationException`.
438    pub fn is_validation_exception(&self) -> bool {
439        matches!(self, Self::ValidationException(_))
440    }
441}
442impl ::std::error::Error for GetPackageVersionAssetError {
443    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
444        match self {
445            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
446            Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
447            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
448            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
449            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
450            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
451            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
452        }
453    }
454}
455impl ::std::fmt::Display for GetPackageVersionAssetError {
456    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
457        match self {
458            Self::AccessDeniedException(_inner) => _inner.fmt(f),
459            Self::ConflictException(_inner) => _inner.fmt(f),
460            Self::InternalServerException(_inner) => _inner.fmt(f),
461            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
462            Self::ThrottlingException(_inner) => _inner.fmt(f),
463            Self::ValidationException(_inner) => _inner.fmt(f),
464            Self::Unhandled(_inner) => {
465                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
466                    write!(f, "unhandled error ({code})")
467                } else {
468                    f.write_str("unhandled error")
469                }
470            }
471        }
472    }
473}
474impl ::aws_smithy_types::retry::ProvideErrorKind for GetPackageVersionAssetError {
475    fn code(&self) -> ::std::option::Option<&str> {
476        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
477    }
478    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
479        ::std::option::Option::None
480    }
481}
482impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetPackageVersionAssetError {
483    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
484        match self {
485            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
486            Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
487            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
488            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
489            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
490            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
491            Self::Unhandled(_inner) => &_inner.meta,
492        }
493    }
494}
495impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetPackageVersionAssetError {
496    fn create_unhandled_error(
497        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
498        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
499    ) -> Self {
500        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
501            source,
502            meta: meta.unwrap_or_default(),
503        })
504    }
505}
506impl ::aws_types::request_id::RequestId for crate::operation::get_package_version_asset::GetPackageVersionAssetError {
507    fn request_id(&self) -> Option<&str> {
508        self.meta().request_id()
509    }
510}
511
512pub use crate::operation::get_package_version_asset::_get_package_version_asset_input::GetPackageVersionAssetInput;
513
514pub use crate::operation::get_package_version_asset::_get_package_version_asset_output::GetPackageVersionAssetOutput;
515
516mod _get_package_version_asset_input;
517
518mod _get_package_version_asset_output;
519
520/// Builders
521pub mod builders;