AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/unlabel_parameter_version.rs

@@ -0,1 +0,646 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `UnlabelParameterVersion`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct UnlabelParameterVersion;
           6  +
impl UnlabelParameterVersion {
           7  +
    /// Creates a new `UnlabelParameterVersion`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          13  +
        crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput::SCHEMA;
          17  +
    pub(crate) async fn orchestrate(
          18  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          19  +
        input: crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput,
          20  +
    ) -> ::std::result::Result<
          21  +
        crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput,
          22  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          23  +
            crate::operation::unlabel_parameter_version::UnlabelParameterVersionError,
          24  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          25  +
        >,
          26  +
    > {
          27  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          28  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          29  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          30  +
        >| {
          31  +
            err.map_service_error(|err| {
          32  +
                err.downcast::<crate::operation::unlabel_parameter_version::UnlabelParameterVersionError>()
          33  +
                    .expect("correct error type")
          34  +
            })
          35  +
        };
          36  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          37  +
            .await
          38  +
            .map_err(map_err)?;
          39  +
        let output = context.finalize().map_err(map_err)?;
          40  +
        ::std::result::Result::Ok(
          41  +
            output
          42  +
                .downcast::<crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput>()
          43  +
                .expect("correct output type"),
          44  +
        )
          45  +
    }
          46  +
          47  +
    pub(crate) async fn orchestrate_with_stop_point(
          48  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          49  +
        input: crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput,
          50  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          51  +
    ) -> ::std::result::Result<
          52  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          53  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          54  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          55  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          56  +
        >,
          57  +
    > {
          58  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          59  +
        use ::tracing::Instrument;
          60  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("SSM", "UnlabelParameterVersion", input, runtime_plugins, stop_point)
          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  +
                "SSM.UnlabelParameterVersion",
          65  +
                "rpc.service" = "SSM",
          66  +
                "rpc.method" = "UnlabelParameterVersion",
          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  +
}
          93  +
/// Per-operation error registry. Contains an entry for every modeled
          94  +
/// error this operation can throw.
          95  +
///
          96  +
/// Used by the schema-serde error path as the operation-scoped lookup
          97  +
/// for registry-backed error reification: an error code that does not
          98  +
/// match one of the operation's modeled errors directly is resolved
          99  +
/// against this registry first, then widened to the service-wide error
         100  +
/// registry.
         101  +
pub(crate) mod error_registry {
         102  +
    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
         103  +
        ::aws_smithy_schema::registry::TypeRegistry::builder()
         104  +
                            .insert_error_shape(
         105  +
                        crate::types::error::InternalServerError::SCHEMA,
         106  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         107  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServerError::deserialize(d)?))
         108  +
                        },
         109  +
                        |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> {
         110  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServerError::deserialize(d)?))
         111  +
                        },
         112  +
                    )
         113  +
.insert_error_shape(
         114  +
                        crate::types::error::ParameterNotFound::SCHEMA,
         115  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         116  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ParameterNotFound::deserialize(d)?))
         117  +
                        },
         118  +
                        |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> {
         119  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ParameterNotFound::deserialize(d)?))
         120  +
                        },
         121  +
                    )
         122  +
.insert_error_shape(
         123  +
                        crate::types::error::ParameterVersionNotFound::SCHEMA,
         124  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         125  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::ParameterVersionNotFound::deserialize(d)?))
         126  +
                        },
         127  +
                        |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> {
         128  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::ParameterVersionNotFound::deserialize(d)?))
         129  +
                        },
         130  +
                    )
         131  +
.insert_error_shape(
         132  +
                        crate::types::error::TooManyUpdates::SCHEMA,
         133  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         134  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::TooManyUpdates::deserialize(d)?))
         135  +
                        },
         136  +
                        |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> {
         137  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::TooManyUpdates::deserialize(d)?))
         138  +
                        },
         139  +
                    )
         140  +
                            .build()
         141  +
    });
         142  +
}
         143  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UnlabelParameterVersion {
         144  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         145  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UnlabelParameterVersion");
         146  +
         147  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         148  +
            UnlabelParameterVersionRequestSerializer,
         149  +
        ));
         150  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         151  +
            UnlabelParameterVersionResponseDeserializer,
         152  +
        ));
         153  +
         154  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         155  +
            crate::config::auth::Params::builder()
         156  +
                .operation_name("UnlabelParameterVersion")
         157  +
                .build()
         158  +
                .expect("required fields set"),
         159  +
        ));
         160  +
         161  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         162  +
            "UnlabelParameterVersion",
         163  +
            "SSM",
         164  +
        ));
         165  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         166  +
        signing_options.double_uri_encode = true;
         167  +
        signing_options.content_sha256_header = false;
         168  +
        signing_options.normalize_uri_path = true;
         169  +
        signing_options.payload_override = None;
         170  +
         171  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         172  +
            signing_options,
         173  +
            ..::std::default::Default::default()
         174  +
        });
         175  +
         176  +
        ::std::option::Option::Some(cfg.freeze())
         177  +
    }
         178  +
         179  +
    fn runtime_components(
         180  +
        &self,
         181  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         182  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         183  +
        #[allow(unused_mut)]
         184  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UnlabelParameterVersion")
         185  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         186  +
                UnlabelParameterVersionTelemetryInputCaptureInterceptor,
         187  +
            ))
         188  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         189  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         190  +
            ))
         191  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         192  +
                UnlabelParameterVersionEndpointParamsInterceptor,
         193  +
            ))
         194  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         195  +
                crate::operation::unlabel_parameter_version::UnlabelParameterVersionError,
         196  +
            >::new())
         197  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         198  +
                crate::operation::unlabel_parameter_version::UnlabelParameterVersionError,
         199  +
            >::new())
         200  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         201  +
                crate::operation::unlabel_parameter_version::UnlabelParameterVersionError,
         202  +
            >::new())
         203  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         204  +
                crate::operation::unlabel_parameter_version::UnlabelParameterVersionError,
         205  +
            >::new());
         206  +
         207  +
        ::std::borrow::Cow::Owned(rcb)
         208  +
    }
         209  +
}
         210  +
         211  +
#[derive(Debug)]
         212  +
struct UnlabelParameterVersionTelemetryInputCaptureInterceptor;
         213  +
         214  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         215  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UnlabelParameterVersionTelemetryInputCaptureInterceptor {
         216  +
    fn name(&self) -> &'static str {
         217  +
        "UnlabelParameterVersionTelemetryInputCaptureInterceptor"
         218  +
    }
         219  +
         220  +
    fn read_before_execution(
         221  +
        &self,
         222  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         223  +
            '_,
         224  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         225  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         226  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         227  +
        >,
         228  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         229  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         230  +
        // Nothing to do unless the customer opted in by naming members to record.
         231  +
        let ::std::option::Option::Some(requested) = cfg
         232  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         233  +
            .filter(|r| !r.is_empty())
         234  +
        else {
         235  +
            return ::std::result::Result::Ok(());
         236  +
        };
         237  +
         238  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<UnlabelParameterVersionInput>() else {
         239  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         240  +
            return ::std::result::Result::Ok(());
         241  +
        };
         242  +
         243  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         244  +
        if requested.should_capture("Name") {
         245  +
            if let ::std::option::Option::Some(value) = input.name.as_deref() {
         246  +
                captured.insert("Name", value);
         247  +
            }
         248  +
        }
         249  +
         250  +
        cfg.interceptor_state().store_put(captured);
         251  +
        ::std::result::Result::Ok(())
         252  +
    }
         253  +
}
         254  +
#[derive(Debug)]
         255  +
struct UnlabelParameterVersionResponseDeserializer;
         256  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UnlabelParameterVersionResponseDeserializer {
         257  +
    fn deserialize_nonstreaming_with_config(
         258  +
        &self,
         259  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         260  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         261  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         262  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         263  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         264  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         265  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         266  +
        // loads `body` before firing this hook.
         267  +
        let body = response.body().bytes().expect("body loaded");
         268  +
        let headers = response.headers();
         269  +
        #[allow(unused_mut)]
         270  +
        let mut force_error = false;
         271  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         272  +
        if !success && status != 200 || force_error {
         273  +
            let protocol = _cfg
         274  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         275  +
                .expect("a SharedClientProtocol is required");
         276  +
            #[allow(unused_mut)]
         277  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         278  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         279  +
            })?;
         280  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         281  +
            let generic = generic_builder.build();
         282  +
            let error_code = match generic.code() {
         283  +
                ::std::option::Option::Some(code) => code,
         284  +
                ::std::option::Option::None => {
         285  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         286  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         287  +
                            crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::unhandled(generic),
         288  +
                        ),
         289  +
                    ))
         290  +
                }
         291  +
            };
         292  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         293  +
            let err = match error_code {
         294  +
                "InternalServerError" => crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::InternalServerError({
         295  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         296  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         297  +
                            &mut *deser,
         298  +
                            response.headers(),
         299  +
                            response.status().into(),
         300  +
                            body,
         301  +
                        )
         302  +
                    }) {
         303  +
                        ::std::result::Result::Ok(val) => val,
         304  +
                        ::std::result::Result::Err(e) => {
         305  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         306  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         307  +
                            ))
         308  +
                        }
         309  +
                    };
         310  +
                    tmp.meta = generic;
         311  +
                    if tmp.message.is_none() {
         312  +
                        tmp.message = _error_message;
         313  +
                    }
         314  +
                    tmp
         315  +
                }),
         316  +
                "ParameterNotFound" => crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::ParameterNotFound({
         317  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         318  +
                        crate::types::error::ParameterNotFound::deserialize_with_response(
         319  +
                            &mut *deser,
         320  +
                            response.headers(),
         321  +
                            response.status().into(),
         322  +
                            body,
         323  +
                        )
         324  +
                    }) {
         325  +
                        ::std::result::Result::Ok(val) => val,
         326  +
                        ::std::result::Result::Err(e) => {
         327  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         328  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         329  +
                            ))
         330  +
                        }
         331  +
                    };
         332  +
                    tmp.meta = generic;
         333  +
                    if tmp.message.is_none() {
         334  +
                        tmp.message = _error_message;
         335  +
                    }
         336  +
                    tmp
         337  +
                }),
         338  +
                "ParameterVersionNotFound" => crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::ParameterVersionNotFound({
         339  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         340  +
                        crate::types::error::ParameterVersionNotFound::deserialize_with_response(
         341  +
                            &mut *deser,
         342  +
                            response.headers(),
         343  +
                            response.status().into(),
         344  +
                            body,
         345  +
                        )
         346  +
                    }) {
         347  +
                        ::std::result::Result::Ok(val) => val,
         348  +
                        ::std::result::Result::Err(e) => {
         349  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         350  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         351  +
                            ))
         352  +
                        }
         353  +
                    };
         354  +
                    tmp.meta = generic;
         355  +
                    if tmp.message.is_none() {
         356  +
                        tmp.message = _error_message;
         357  +
                    }
         358  +
                    tmp
         359  +
                }),
         360  +
                "TooManyUpdates" => crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::TooManyUpdates({
         361  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         362  +
                        crate::types::error::TooManyUpdates::deserialize_with_response(
         363  +
                            &mut *deser,
         364  +
                            response.headers(),
         365  +
                            response.status().into(),
         366  +
                            body,
         367  +
                        )
         368  +
                    }) {
         369  +
                        ::std::result::Result::Ok(val) => val,
         370  +
                        ::std::result::Result::Err(e) => {
         371  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         372  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         373  +
                            ))
         374  +
                        }
         375  +
                    };
         376  +
                    tmp.meta = generic;
         377  +
                    if tmp.message.is_none() {
         378  +
                        tmp.message = _error_message;
         379  +
                    }
         380  +
                    tmp
         381  +
                }),
         382  +
                _ => {
         383  +
                    // Registry-backed, operation-scoped reification of an error whose
         384  +
                    // code this operation does not model directly: the operation's own
         385  +
                    // error registry is consulted first, then the lookup widens to the
         386  +
                    // service-wide error registry. On a hit, the reified error is attached
         387  +
                    // as the source of the returned unhandled error while its metadata
         388  +
                    // (code, message, request id) is preserved; on a miss the generic
         389  +
                    // error is returned unchanged.
         390  +
                    match protocol
         391  +
                        .deserialize_error_response(response, _cfg)
         392  +
                        .ok()
         393  +
                        .and_then(|mut deser| {
         394  +
                            ::aws_smithy_schema::registry::reify_error(
         395  +
                                crate::operation::unlabel_parameter_version::error_registry::REGISTRY
         396  +
                                    .or(&crate::error_type_registry::REGISTRY),
         397  +
                                error_code,
         398  +
                                &mut *deser,
         399  +
                            )
         400  +
                        }) {
         401  +
                        ::std::option::Option::Some(source) => <crate::operation::unlabel_parameter_version::UnlabelParameterVersionError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         402  +
                        ::std::option::Option::None => crate::operation::unlabel_parameter_version::UnlabelParameterVersionError::generic(generic),
         403  +
                    }
         404  +
                }
         405  +
            };
         406  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         407  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         408  +
            ))
         409  +
        } else {
         410  +
            let protocol = _cfg
         411  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         412  +
                .expect("a SharedClientProtocol is required");
         413  +
            let mut deser = protocol
         414  +
                .deserialize_response(response, UnlabelParameterVersion::OUTPUT_SCHEMA, _cfg)
         415  +
                .map_err(|e| {
         416  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         417  +
                })?;
         418  +
            // body and headers are already in scope from the top of the function;
         419  +
            // alias `headers` as `_response_headers` so MutateOutput
         420  +
            // customizations have a stable name to read from.
         421  +
            let _response_headers = headers;
         422  +
            #[allow(unused_mut)]
         423  +
            let mut output = crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput::deserialize_with_response(
         424  +
                &mut *deser,
         425  +
                _response_headers,
         426  +
                response.status().into(),
         427  +
                body,
         428  +
            )
         429  +
            .map_err(|e| {
         430  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         431  +
            })?;
         432  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         433  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         434  +
        }
         435  +
    }
         436  +
}
         437  +
#[derive(Debug)]
         438  +
struct UnlabelParameterVersionRequestSerializer;
         439  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UnlabelParameterVersionRequestSerializer {
         440  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         441  +
    fn serialize_input(
         442  +
        &self,
         443  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         444  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         445  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         446  +
        let input = input
         447  +
            .downcast::<crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput>()
         448  +
            .expect("correct type");
         449  +
         450  +
        let protocol = _cfg
         451  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         452  +
            .expect("a SharedClientProtocol is required");
         453  +
        let mut request = protocol
         454  +
            .serialize_request(&input, UnlabelParameterVersion::INPUT_SCHEMA, "/", _cfg)
         455  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         456  +
         457  +
        return ::std::result::Result::Ok(request);
         458  +
    }
         459  +
}
         460  +
#[derive(Debug)]
         461  +
struct UnlabelParameterVersionEndpointParamsInterceptor;
         462  +
         463  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         464  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UnlabelParameterVersionEndpointParamsInterceptor {
         465  +
    fn name(&self) -> &'static str {
         466  +
        "UnlabelParameterVersionEndpointParamsInterceptor"
         467  +
    }
         468  +
         469  +
    fn read_before_execution(
         470  +
        &self,
         471  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         472  +
            '_,
         473  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         474  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         475  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         476  +
        >,
         477  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         478  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         479  +
        let _input = context
         480  +
            .input()
         481  +
            .downcast_ref::<UnlabelParameterVersionInput>()
         482  +
            .ok_or("failed to downcast to UnlabelParameterVersionInput")?;
         483  +
         484  +
        let params = crate::config::endpoint::Params::builder()
         485  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         486  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         487  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         488  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         489  +
            .build()
         490  +
            .map_err(|err| {
         491  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         492  +
            })?;
         493  +
        cfg.interceptor_state()
         494  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         495  +
        ::std::result::Result::Ok(())
         496  +
    }
         497  +
}
         498  +
         499  +
// The get_* functions below are generated from JMESPath expressions in the
         500  +
// operationContextParams trait. They target the operation's input shape.
         501  +
         502  +
/// Error type for the `UnlabelParameterVersionError` operation.
         503  +
#[non_exhaustive]
         504  +
#[derive(::std::fmt::Debug)]
         505  +
pub enum UnlabelParameterVersionError {
         506  +
    /// <p>An error occurred on the server side.</p>
         507  +
    InternalServerError(crate::types::error::InternalServerError),
         508  +
    /// <p>The parameter couldn't be found. Verify the name and try again.</p><note>
         509  +
    /// <p>For the <code>DeleteParameter</code> and <code>GetParameter</code> actions, if the specified parameter doesn't exist, the <code>ParameterNotFound</code> exception is <i>not</i> recorded in CloudTrail event logs.</p>
         510  +
    /// </note>
         511  +
    ParameterNotFound(crate::types::error::ParameterNotFound),
         512  +
    /// <p>The specified parameter version wasn't found. Verify the parameter name and version, and try again.</p>
         513  +
    ParameterVersionNotFound(crate::types::error::ParameterVersionNotFound),
         514  +
    /// <p>There are concurrent updates for a resource that supports one update at a time.</p>
         515  +
    TooManyUpdates(crate::types::error::TooManyUpdates),
         516  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         517  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         518  +
    variable wildcard pattern and check `.code()`:
         519  +
     \
         520  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         521  +
     \
         522  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UnlabelParameterVersionError) for what information is available for the error.")]
         523  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         524  +
}
         525  +
impl UnlabelParameterVersionError {
         526  +
    /// Creates the `UnlabelParameterVersionError::Unhandled` variant from any error type.
         527  +
    pub fn unhandled(
         528  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         529  +
    ) -> Self {
         530  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         531  +
            source: err.into(),
         532  +
            meta: ::std::default::Default::default(),
         533  +
        })
         534  +
    }
         535  +
         536  +
    /// Creates the `UnlabelParameterVersionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         537  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         538  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         539  +
            source: err.clone().into(),
         540  +
            meta: err,
         541  +
        })
         542  +
    }
         543  +
    ///
         544  +
    /// Returns error metadata, which includes the error code, message,
         545  +
    /// request ID, and potentially additional information.
         546  +
    ///
         547  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         548  +
        match self {
         549  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         550  +
            Self::ParameterNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         551  +
            Self::ParameterVersionNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         552  +
            Self::TooManyUpdates(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         553  +
            Self::Unhandled(e) => &e.meta,
         554  +
        }
         555  +
    }
         556  +
    /// Returns `true` if the error kind is `UnlabelParameterVersionError::InternalServerError`.
         557  +
    pub fn is_internal_server_error(&self) -> bool {
         558  +
        matches!(self, Self::InternalServerError(_))
         559  +
    }
         560  +
    /// Returns `true` if the error kind is `UnlabelParameterVersionError::ParameterNotFound`.
         561  +
    pub fn is_parameter_not_found(&self) -> bool {
         562  +
        matches!(self, Self::ParameterNotFound(_))
         563  +
    }
         564  +
    /// Returns `true` if the error kind is `UnlabelParameterVersionError::ParameterVersionNotFound`.
         565  +
    pub fn is_parameter_version_not_found(&self) -> bool {
         566  +
        matches!(self, Self::ParameterVersionNotFound(_))
         567  +
    }
         568  +
    /// Returns `true` if the error kind is `UnlabelParameterVersionError::TooManyUpdates`.
         569  +
    pub fn is_too_many_updates(&self) -> bool {
         570  +
        matches!(self, Self::TooManyUpdates(_))
         571  +
    }
         572  +
}
         573  +
impl ::std::error::Error for UnlabelParameterVersionError {
         574  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         575  +
        match self {
         576  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         577  +
            Self::ParameterNotFound(_inner) => ::std::option::Option::Some(_inner),
         578  +
            Self::ParameterVersionNotFound(_inner) => ::std::option::Option::Some(_inner),
         579  +
            Self::TooManyUpdates(_inner) => ::std::option::Option::Some(_inner),
         580  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         581  +
        }
         582  +
    }
         583  +
}
         584  +
impl ::std::fmt::Display for UnlabelParameterVersionError {
         585  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         586  +
        match self {
         587  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         588  +
            Self::ParameterNotFound(_inner) => _inner.fmt(f),
         589  +
            Self::ParameterVersionNotFound(_inner) => _inner.fmt(f),
         590  +
            Self::TooManyUpdates(_inner) => _inner.fmt(f),
         591  +
            Self::Unhandled(_inner) => {
         592  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         593  +
                    write!(f, "unhandled error ({code})")
         594  +
                } else {
         595  +
                    f.write_str("unhandled error")
         596  +
                }
         597  +
            }
         598  +
        }
         599  +
    }
         600  +
}
         601  +
impl ::aws_smithy_types::retry::ProvideErrorKind for UnlabelParameterVersionError {
         602  +
    fn code(&self) -> ::std::option::Option<&str> {
         603  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         604  +
    }
         605  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         606  +
        ::std::option::Option::None
         607  +
    }
         608  +
}
         609  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UnlabelParameterVersionError {
         610  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         611  +
        match self {
         612  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         613  +
            Self::ParameterNotFound(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         614  +
            Self::ParameterVersionNotFound(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         615  +
            Self::TooManyUpdates(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         616  +
            Self::Unhandled(_inner) => &_inner.meta,
         617  +
        }
         618  +
    }
         619  +
}
         620  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UnlabelParameterVersionError {
         621  +
    fn create_unhandled_error(
         622  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         623  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         624  +
    ) -> Self {
         625  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         626  +
            source,
         627  +
            meta: meta.unwrap_or_default(),
         628  +
        })
         629  +
    }
         630  +
}
         631  +
impl ::aws_types::request_id::RequestId for crate::operation::unlabel_parameter_version::UnlabelParameterVersionError {
         632  +
    fn request_id(&self) -> Option<&str> {
         633  +
        self.meta().request_id()
         634  +
    }
         635  +
}
         636  +
         637  +
pub use crate::operation::unlabel_parameter_version::_unlabel_parameter_version_input::UnlabelParameterVersionInput;
         638  +
         639  +
pub use crate::operation::unlabel_parameter_version::_unlabel_parameter_version_output::UnlabelParameterVersionOutput;
         640  +
         641  +
mod _unlabel_parameter_version_input;
         642  +
         643  +
mod _unlabel_parameter_version_output;
         644  +
         645  +
/// Builders
         646  +
pub mod builders;

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/unlabel_parameter_version/_unlabel_parameter_version_input.rs

@@ -0,1 +0,258 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct UnlabelParameterVersionInput {
           6  +
    /// <p>The name of the parameter from which you want to delete one or more labels.</p><note>
           7  +
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
           8  +
    /// </note>
           9  +
    pub name: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The specific version of the parameter which you want to delete one or more labels from. If it isn't present, the call will fail.</p>
          11  +
    pub parameter_version: ::std::option::Option<i64>,
          12  +
    /// <p>One or more labels to delete from the specified parameter version.</p>
          13  +
    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          14  +
}
          15  +
impl UnlabelParameterVersionInput {
          16  +
    /// <p>The name of the parameter from which you want to delete one or more labels.</p><note>
          17  +
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
          18  +
    /// </note>
          19  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          20  +
        self.name.as_deref()
          21  +
    }
          22  +
    /// <p>The specific version of the parameter which you want to delete one or more labels from. If it isn't present, the call will fail.</p>
          23  +
    pub fn parameter_version(&self) -> ::std::option::Option<i64> {
          24  +
        self.parameter_version
          25  +
    }
          26  +
    /// <p>One or more labels to delete from the specified parameter version.</p>
          27  +
    ///
          28  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
          29  +
    pub fn labels(&self) -> &[::std::string::String] {
          30  +
        self.labels.as_deref().unwrap_or_default()
          31  +
    }
          32  +
}
          33  +
static UNLABELPARAMETERVERSIONINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionInput$Name",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "UnlabelParameterVersionInput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "Name",
          41  +
    0,
          42  +
);
          43  +
static UNLABELPARAMETERVERSIONINPUT_MEMBER_PARAMETER_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts(
          45  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionInput$ParameterVersion",
          46  +
        "com.amazonaws.ssm.synthetic",
          47  +
        "UnlabelParameterVersionInput",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::Long,
          50  +
    "ParameterVersion",
          51  +
    1,
          52  +
);
          53  +
static UNLABELPARAMETERVERSIONINPUT_MEMBER_LABELS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ParameterLabelList$member", "com.amazonaws.ssm", "ParameterLabelList"),
          55  +
    ::aws_smithy_schema::ShapeType::String,
          56  +
    "member",
          57  +
    0,
          58  +
);
          59  +
static UNLABELPARAMETERVERSIONINPUT_MEMBER_LABELS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          60  +
    ::aws_smithy_schema::ShapeId::from_parts(
          61  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionInput$Labels",
          62  +
        "com.amazonaws.ssm.synthetic",
          63  +
        "UnlabelParameterVersionInput",
          64  +
    ),
          65  +
    ::aws_smithy_schema::ShapeType::List,
          66  +
    "Labels",
          67  +
    2,
          68  +
)
          69  +
.with_list_member(&UNLABELPARAMETERVERSIONINPUT_MEMBER_LABELS_MEMBER);
          70  +
static UNLABELPARAMETERVERSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          71  +
    ::aws_smithy_schema::ShapeId::from_parts(
          72  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionInput",
          73  +
        "com.amazonaws.ssm.synthetic",
          74  +
        "UnlabelParameterVersionInput",
          75  +
    ),
          76  +
    ::aws_smithy_schema::ShapeType::Structure,
          77  +
    &[
          78  +
        &UNLABELPARAMETERVERSIONINPUT_MEMBER_NAME,
          79  +
        &UNLABELPARAMETERVERSIONINPUT_MEMBER_PARAMETER_VERSION,
          80  +
        &UNLABELPARAMETERVERSIONINPUT_MEMBER_LABELS,
          81  +
    ],
          82  +
)
          83  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          84  +
.with_original_name("UnlabelParameterVersionRequest");
          85  +
impl UnlabelParameterVersionInput {
          86  +
    /// The schema for this shape.
          87  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UNLABELPARAMETERVERSIONINPUT_SCHEMA;
          88  +
}
          89  +
impl ::aws_smithy_schema::serde::SerializableStruct for UnlabelParameterVersionInput {
          90  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          91  +
    fn serialize_members(
          92  +
        &self,
          93  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          94  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          95  +
        if let Some(ref val) = self.name {
          96  +
            ser.write_string(&UNLABELPARAMETERVERSIONINPUT_MEMBER_NAME, val)?;
          97  +
        }
          98  +
        if let Some(ref val) = self.parameter_version {
          99  +
            ser.write_long(&UNLABELPARAMETERVERSIONINPUT_MEMBER_PARAMETER_VERSION, *val)?;
         100  +
        }
         101  +
        if let Some(ref val) = self.labels {
         102  +
            ser.write_list(
         103  +
                &UNLABELPARAMETERVERSIONINPUT_MEMBER_LABELS,
         104  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         105  +
                    for item in val {
         106  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         107  +
                    }
         108  +
                    Ok(())
         109  +
                },
         110  +
            )?;
         111  +
        }
         112  +
        Ok(())
         113  +
    }
         114  +
}
         115  +
impl UnlabelParameterVersionInput {
         116  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         117  +
    pub fn deserialize(
         118  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         119  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         120  +
        #[allow(unused_variables, unused_mut)]
         121  +
        let mut builder = Self::builder();
         122  +
        #[allow(
         123  +
            unused_variables,
         124  +
            unreachable_code,
         125  +
            clippy::single_match,
         126  +
            clippy::match_single_binding,
         127  +
            clippy::diverging_sub_expression
         128  +
        )]
         129  +
        deserializer.read_struct(&UNLABELPARAMETERVERSIONINPUT_SCHEMA, &mut |member, deser| {
         130  +
            match member.member_index() {
         131  +
                Some(0) => {
         132  +
                    if deser.is_null() {
         133  +
                        deser.read_null()?;
         134  +
                    } else {
         135  +
                        builder.name = Some(deser.read_string(member)?);
         136  +
                    }
         137  +
                }
         138  +
                Some(1) => {
         139  +
                    if deser.is_null() {
         140  +
                        deser.read_null()?;
         141  +
                    } else {
         142  +
                        builder.parameter_version = Some(deser.read_long(member)?);
         143  +
                    }
         144  +
                }
         145  +
                Some(2) => {
         146  +
                    if deser.is_null() {
         147  +
                        deser.read_null()?;
         148  +
                    } else {
         149  +
                        builder.labels = Some(deser.read_string_list(member)?);
         150  +
                    }
         151  +
                }
         152  +
                _ => {}
         153  +
            }
         154  +
            Ok(())
         155  +
        })?;
         156  +
        builder.name = builder.name.or(Some(String::new()));
         157  +
        builder.parameter_version = builder.parameter_version.or(Some(0i64));
         158  +
        builder.labels = builder.labels.or(Some(Vec::new()));
         159  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         160  +
    }
         161  +
}
         162  +
impl UnlabelParameterVersionInput {
         163  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         164  +
    pub fn deserialize_with_response(
         165  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         166  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         167  +
        _status: u16,
         168  +
        _body: &[u8],
         169  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         170  +
        Self::deserialize(deserializer)
         171  +
    }
         172  +
}
         173  +
impl UnlabelParameterVersionInput {
         174  +
    /// Creates a new builder-style object to manufacture [`UnlabelParameterVersionInput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput).
         175  +
    pub fn builder() -> crate::operation::unlabel_parameter_version::builders::UnlabelParameterVersionInputBuilder {
         176  +
        crate::operation::unlabel_parameter_version::builders::UnlabelParameterVersionInputBuilder::default()
         177  +
    }
         178  +
}
         179  +
         180  +
/// A builder for [`UnlabelParameterVersionInput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput).
         181  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         182  +
#[non_exhaustive]
         183  +
pub struct UnlabelParameterVersionInputBuilder {
         184  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         185  +
    pub(crate) parameter_version: ::std::option::Option<i64>,
         186  +
    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         187  +
}
         188  +
impl UnlabelParameterVersionInputBuilder {
         189  +
    /// <p>The name of the parameter from which you want to delete one or more labels.</p><note>
         190  +
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
         191  +
    /// </note>
         192  +
    /// This field is required.
         193  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         194  +
        self.name = ::std::option::Option::Some(input.into());
         195  +
        self
         196  +
    }
         197  +
    /// <p>The name of the parameter from which you want to delete one or more labels.</p><note>
         198  +
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
         199  +
    /// </note>
         200  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         201  +
        self.name = input;
         202  +
        self
         203  +
    }
         204  +
    /// <p>The name of the parameter from which you want to delete one or more labels.</p><note>
         205  +
    /// <p>You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.</p>
         206  +
    /// </note>
         207  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         208  +
        &self.name
         209  +
    }
         210  +
    /// <p>The specific version of the parameter which you want to delete one or more labels from. If it isn't present, the call will fail.</p>
         211  +
    /// This field is required.
         212  +
    pub fn parameter_version(mut self, input: i64) -> Self {
         213  +
        self.parameter_version = ::std::option::Option::Some(input);
         214  +
        self
         215  +
    }
         216  +
    /// <p>The specific version of the parameter which you want to delete one or more labels from. If it isn't present, the call will fail.</p>
         217  +
    pub fn set_parameter_version(mut self, input: ::std::option::Option<i64>) -> Self {
         218  +
        self.parameter_version = input;
         219  +
        self
         220  +
    }
         221  +
    /// <p>The specific version of the parameter which you want to delete one or more labels from. If it isn't present, the call will fail.</p>
         222  +
    pub fn get_parameter_version(&self) -> &::std::option::Option<i64> {
         223  +
        &self.parameter_version
         224  +
    }
         225  +
    /// Appends an item to `labels`.
         226  +
    ///
         227  +
    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
         228  +
    ///
         229  +
    /// <p>One or more labels to delete from the specified parameter version.</p>
         230  +
    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         231  +
        let mut v = self.labels.unwrap_or_default();
         232  +
        v.push(input.into());
         233  +
        self.labels = ::std::option::Option::Some(v);
         234  +
        self
         235  +
    }
         236  +
    /// <p>One or more labels to delete from the specified parameter version.</p>
         237  +
    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         238  +
        self.labels = input;
         239  +
        self
         240  +
    }
         241  +
    /// <p>One or more labels to delete from the specified parameter version.</p>
         242  +
    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         243  +
        &self.labels
         244  +
    }
         245  +
    /// Consumes the builder and constructs a [`UnlabelParameterVersionInput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput).
         246  +
    pub fn build(
         247  +
        self,
         248  +
    ) -> ::std::result::Result<
         249  +
        crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput,
         250  +
        ::aws_smithy_types::error::operation::BuildError,
         251  +
    > {
         252  +
        ::std::result::Result::Ok(crate::operation::unlabel_parameter_version::UnlabelParameterVersionInput {
         253  +
            name: self.name,
         254  +
            parameter_version: self.parameter_version,
         255  +
            labels: self.labels,
         256  +
        })
         257  +
    }
         258  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/unlabel_parameter_version/_unlabel_parameter_version_output.rs

@@ -0,1 +0,278 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct UnlabelParameterVersionOutput {
           6  +
    /// <p>A list of all labels deleted from the parameter.</p>
           7  +
    pub removed_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
           8  +
    /// <p>The labels that aren't attached to the given parameter version.</p>
           9  +
    pub invalid_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl UnlabelParameterVersionOutput {
          13  +
    /// <p>A list of all labels deleted from the parameter.</p>
          14  +
    ///
          15  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.removed_labels.is_none()`.
          16  +
    pub fn removed_labels(&self) -> &[::std::string::String] {
          17  +
        self.removed_labels.as_deref().unwrap_or_default()
          18  +
    }
          19  +
    /// <p>The labels that aren't attached to the given parameter version.</p>
          20  +
    ///
          21  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.invalid_labels.is_none()`.
          22  +
    pub fn invalid_labels(&self) -> &[::std::string::String] {
          23  +
        self.invalid_labels.as_deref().unwrap_or_default()
          24  +
    }
          25  +
}
          26  +
static UNLABELPARAMETERVERSIONOUTPUT_MEMBER_REMOVED_LABELS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          27  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ParameterLabelList$member", "com.amazonaws.ssm", "ParameterLabelList"),
          28  +
    ::aws_smithy_schema::ShapeType::String,
          29  +
    "member",
          30  +
    0,
          31  +
);
          32  +
static UNLABELPARAMETERVERSIONOUTPUT_MEMBER_REMOVED_LABELS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_parts(
          34  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionOutput$RemovedLabels",
          35  +
        "com.amazonaws.ssm.synthetic",
          36  +
        "UnlabelParameterVersionOutput",
          37  +
    ),
          38  +
    ::aws_smithy_schema::ShapeType::List,
          39  +
    "RemovedLabels",
          40  +
    0,
          41  +
)
          42  +
.with_list_member(&UNLABELPARAMETERVERSIONOUTPUT_MEMBER_REMOVED_LABELS_MEMBER);
          43  +
static UNLABELPARAMETERVERSIONOUTPUT_MEMBER_INVALID_LABELS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ParameterLabelList$member", "com.amazonaws.ssm", "ParameterLabelList"),
          45  +
    ::aws_smithy_schema::ShapeType::String,
          46  +
    "member",
          47  +
    0,
          48  +
);
          49  +
static UNLABELPARAMETERVERSIONOUTPUT_MEMBER_INVALID_LABELS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          50  +
    ::aws_smithy_schema::ShapeId::from_parts(
          51  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionOutput$InvalidLabels",
          52  +
        "com.amazonaws.ssm.synthetic",
          53  +
        "UnlabelParameterVersionOutput",
          54  +
    ),
          55  +
    ::aws_smithy_schema::ShapeType::List,
          56  +
    "InvalidLabels",
          57  +
    1,
          58  +
)
          59  +
.with_list_member(&UNLABELPARAMETERVERSIONOUTPUT_MEMBER_INVALID_LABELS_MEMBER);
          60  +
static UNLABELPARAMETERVERSIONOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          62  +
    ::aws_smithy_schema::ShapeType::String,
          63  +
    "request_id",
          64  +
    2,
          65  +
)
          66  +
.with_http_header("x-amzn-requestid");
          67  +
static UNLABELPARAMETERVERSIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          68  +
    ::aws_smithy_schema::ShapeId::from_parts(
          69  +
        "com.amazonaws.ssm.synthetic#UnlabelParameterVersionOutput",
          70  +
        "com.amazonaws.ssm.synthetic",
          71  +
        "UnlabelParameterVersionOutput",
          72  +
    ),
          73  +
    ::aws_smithy_schema::ShapeType::Structure,
          74  +
    &[
          75  +
        &UNLABELPARAMETERVERSIONOUTPUT_MEMBER_REMOVED_LABELS,
          76  +
        &UNLABELPARAMETERVERSIONOUTPUT_MEMBER_INVALID_LABELS,
          77  +
        &UNLABELPARAMETERVERSIONOUTPUT_MEMBER__REQUEST_ID,
          78  +
    ],
          79  +
)
          80  +
.with_original_name("UnlabelParameterVersionResult");
          81  +
impl UnlabelParameterVersionOutput {
          82  +
    /// The schema for this shape.
          83  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UNLABELPARAMETERVERSIONOUTPUT_SCHEMA;
          84  +
}
          85  +
impl ::aws_smithy_schema::serde::SerializableStruct for UnlabelParameterVersionOutput {
          86  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          87  +
    fn serialize_members(
          88  +
        &self,
          89  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          90  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          91  +
        if let Some(ref val) = self.removed_labels {
          92  +
            ser.write_list(
          93  +
                &UNLABELPARAMETERVERSIONOUTPUT_MEMBER_REMOVED_LABELS,
          94  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          95  +
                    for item in val {
          96  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          97  +
                    }
          98  +
                    Ok(())
          99  +
                },
         100  +
            )?;
         101  +
        }
         102  +
        if let Some(ref val) = self.invalid_labels {
         103  +
            ser.write_list(
         104  +
                &UNLABELPARAMETERVERSIONOUTPUT_MEMBER_INVALID_LABELS,
         105  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         106  +
                    for item in val {
         107  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         108  +
                    }
         109  +
                    Ok(())
         110  +
                },
         111  +
            )?;
         112  +
        }
         113  +
        Ok(())
         114  +
    }
         115  +
}
         116  +
impl UnlabelParameterVersionOutput {
         117  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         118  +
    pub fn deserialize(
         119  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        #[allow(unused_variables, unused_mut)]
         122  +
        let mut builder = Self::builder();
         123  +
        #[allow(
         124  +
            unused_variables,
         125  +
            unreachable_code,
         126  +
            clippy::single_match,
         127  +
            clippy::match_single_binding,
         128  +
            clippy::diverging_sub_expression
         129  +
        )]
         130  +
        deserializer.read_struct(&UNLABELPARAMETERVERSIONOUTPUT_SCHEMA, &mut |member, deser| {
         131  +
            match member.member_index() {
         132  +
                Some(0) => {
         133  +
                    if deser.is_null() {
         134  +
                        deser.read_null()?;
         135  +
                    } else {
         136  +
                        builder.removed_labels = Some(deser.read_string_list(member)?);
         137  +
                    }
         138  +
                }
         139  +
                Some(1) => {
         140  +
                    if deser.is_null() {
         141  +
                        deser.read_null()?;
         142  +
                    } else {
         143  +
                        builder.invalid_labels = Some(deser.read_string_list(member)?);
         144  +
                    }
         145  +
                }
         146  +
                Some(2) => {
         147  +
                    builder._request_id = Some(deser.read_string(member)?);
         148  +
                }
         149  +
                _ => {}
         150  +
            }
         151  +
            Ok(())
         152  +
        })?;
         153  +
        Ok(builder.build())
         154  +
    }
         155  +
}
         156  +
impl UnlabelParameterVersionOutput {
         157  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         158  +
    /// Header-bound members are read directly from headers, avoiding runtime
         159  +
    /// member iteration overhead. Body members are read via the deserializer.
         160  +
    pub fn deserialize_with_response(
         161  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         162  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         163  +
        _status: u16,
         164  +
        _body: &[u8],
         165  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         166  +
        #[allow(unused_variables, unused_mut)]
         167  +
        let mut builder = Self::builder();
         168  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         169  +
            builder._request_id = Some(val.to_string());
         170  +
        }
         171  +
         172  +
        #[allow(
         173  +
            unused_variables,
         174  +
            unreachable_code,
         175  +
            clippy::single_match,
         176  +
            clippy::match_single_binding,
         177  +
            clippy::diverging_sub_expression
         178  +
        )]
         179  +
        deserializer.read_struct(&UNLABELPARAMETERVERSIONOUTPUT_SCHEMA, &mut |member, deser| {
         180  +
            match member.member_index() {
         181  +
                Some(0) => {
         182  +
                    builder.removed_labels = Some(deser.read_string_list(member)?);
         183  +
                }
         184  +
                Some(1) => {
         185  +
                    builder.invalid_labels = Some(deser.read_string_list(member)?);
         186  +
                }
         187  +
                _ => {}
         188  +
            }
         189  +
            Ok(())
         190  +
        })?;
         191  +
        Ok(builder.build())
         192  +
    }
         193  +
}
         194  +
impl ::aws_types::request_id::RequestId for UnlabelParameterVersionOutput {
         195  +
    fn request_id(&self) -> Option<&str> {
         196  +
        self._request_id.as_deref()
         197  +
    }
         198  +
}
         199  +
impl UnlabelParameterVersionOutput {
         200  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         201  +
        self._request_id = request_id;
         202  +
        self
         203  +
    }
         204  +
}
         205  +
impl UnlabelParameterVersionOutput {
         206  +
    /// Creates a new builder-style object to manufacture [`UnlabelParameterVersionOutput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput).
         207  +
    pub fn builder() -> crate::operation::unlabel_parameter_version::builders::UnlabelParameterVersionOutputBuilder {
         208  +
        crate::operation::unlabel_parameter_version::builders::UnlabelParameterVersionOutputBuilder::default()
         209  +
    }
         210  +
}
         211  +
         212  +
/// A builder for [`UnlabelParameterVersionOutput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput).
         213  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         214  +
#[non_exhaustive]
         215  +
pub struct UnlabelParameterVersionOutputBuilder {
         216  +
    pub(crate) removed_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         217  +
    pub(crate) invalid_labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         218  +
    _request_id: Option<String>,
         219  +
}
         220  +
impl UnlabelParameterVersionOutputBuilder {
         221  +
    /// Appends an item to `removed_labels`.
         222  +
    ///
         223  +
    /// To override the contents of this collection use [`set_removed_labels`](Self::set_removed_labels).
         224  +
    ///
         225  +
    /// <p>A list of all labels deleted from the parameter.</p>
         226  +
    pub fn removed_labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         227  +
        let mut v = self.removed_labels.unwrap_or_default();
         228  +
        v.push(input.into());
         229  +
        self.removed_labels = ::std::option::Option::Some(v);
         230  +
        self
         231  +
    }
         232  +
    /// <p>A list of all labels deleted from the parameter.</p>
         233  +
    pub fn set_removed_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         234  +
        self.removed_labels = input;
         235  +
        self
         236  +
    }
         237  +
    /// <p>A list of all labels deleted from the parameter.</p>
         238  +
    pub fn get_removed_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         239  +
        &self.removed_labels
         240  +
    }
         241  +
    /// Appends an item to `invalid_labels`.
         242  +
    ///
         243  +
    /// To override the contents of this collection use [`set_invalid_labels`](Self::set_invalid_labels).
         244  +
    ///
         245  +
    /// <p>The labels that aren't attached to the given parameter version.</p>
         246  +
    pub fn invalid_labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         247  +
        let mut v = self.invalid_labels.unwrap_or_default();
         248  +
        v.push(input.into());
         249  +
        self.invalid_labels = ::std::option::Option::Some(v);
         250  +
        self
         251  +
    }
         252  +
    /// <p>The labels that aren't attached to the given parameter version.</p>
         253  +
    pub fn set_invalid_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         254  +
        self.invalid_labels = input;
         255  +
        self
         256  +
    }
         257  +
    /// <p>The labels that aren't attached to the given parameter version.</p>
         258  +
    pub fn get_invalid_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         259  +
        &self.invalid_labels
         260  +
    }
         261  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         262  +
        self._request_id = Some(request_id.into());
         263  +
        self
         264  +
    }
         265  +
         266  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         267  +
        self._request_id = request_id;
         268  +
        self
         269  +
    }
         270  +
    /// Consumes the builder and constructs a [`UnlabelParameterVersionOutput`](crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput).
         271  +
    pub fn build(self) -> crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput {
         272  +
        crate::operation::unlabel_parameter_version::UnlabelParameterVersionOutput {
         273  +
            removed_labels: self.removed_labels,
         274  +
            invalid_labels: self.invalid_labels,
         275  +
            _request_id: self._request_id,
         276  +
        }
         277  +
    }
         278  +
}