AWS SDK

AWS SDK

rev. aa190e630077955f0bc8f58dee6a16530c1e0578

Files changed:

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

@@ -0,1 +0,159 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::delete_resource_policy::_delete_resource_policy_input::DeleteResourcePolicyInputBuilder;
           3  +
           4  +
pub use crate::operation::delete_resource_policy::_delete_resource_policy_output::DeleteResourcePolicyOutputBuilder;
           5  +
           6  +
impl crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::delete_resource_policy::DeleteResourcePolicyError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.delete_resource_policy();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DeleteResourcePolicy`.
          24  +
///
          25  +
/// <p>Deletes a Systems Manager resource policy. A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. The following resources support Systems Manager resource policies.</p>
          26  +
/// <ul>
          27  +
/// <li>
          28  +
/// <p><code>OpsItemGroup</code> - The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p></li>
          29  +
/// <li>
          30  +
/// <p><code>Parameter</code> - The resource policy is used to share a parameter with other accounts using Resource Access Manager (RAM). For more information about cross-account sharing of parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html">Working with shared parameters</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
          31  +
/// </ul>
          32  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          33  +
pub struct DeleteResourcePolicyFluentBuilder {
          34  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          35  +
    inner: crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder,
          36  +
    config_override: ::std::option::Option<crate::config::Builder>,
          37  +
}
          38  +
impl
          39  +
    crate::client::customize::internal::CustomizableSend<
          40  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyOutput,
          41  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyError,
          42  +
    > for DeleteResourcePolicyFluentBuilder
          43  +
{
          44  +
    fn send(
          45  +
        self,
          46  +
        config_override: crate::config::Builder,
          47  +
    ) -> crate::client::customize::internal::BoxFuture<
          48  +
        crate::client::customize::internal::SendResult<
          49  +
            crate::operation::delete_resource_policy::DeleteResourcePolicyOutput,
          50  +
            crate::operation::delete_resource_policy::DeleteResourcePolicyError,
          51  +
        >,
          52  +
    > {
          53  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          54  +
    }
          55  +
}
          56  +
impl DeleteResourcePolicyFluentBuilder {
          57  +
    /// Creates a new `DeleteResourcePolicyFluentBuilder`.
          58  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          59  +
        Self {
          60  +
            handle,
          61  +
            inner: ::std::default::Default::default(),
          62  +
            config_override: ::std::option::Option::None,
          63  +
        }
          64  +
    }
          65  +
    /// Access the DeleteResourcePolicy as a reference.
          66  +
    pub fn as_input(&self) -> &crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder {
          67  +
        &self.inner
          68  +
    }
          69  +
    /// Sends the request and returns the response.
          70  +
    ///
          71  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          72  +
    /// can be matched against.
          73  +
    ///
          74  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          75  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          76  +
    /// set when configuring the client.
          77  +
    pub async fn send(
          78  +
        self,
          79  +
    ) -> ::std::result::Result<
          80  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyOutput,
          81  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          82  +
            crate::operation::delete_resource_policy::DeleteResourcePolicyError,
          83  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          84  +
        >,
          85  +
    > {
          86  +
        let input = self
          87  +
            .inner
          88  +
            .build()
          89  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          90  +
        let runtime_plugins = crate::operation::delete_resource_policy::DeleteResourcePolicy::operation_runtime_plugins(
          91  +
            self.handle.runtime_plugins.clone(),
          92  +
            &self.handle.conf,
          93  +
            self.config_override,
          94  +
        );
          95  +
        crate::operation::delete_resource_policy::DeleteResourcePolicy::orchestrate(&runtime_plugins, input).await
          96  +
    }
          97  +
          98  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          99  +
    pub fn customize(
         100  +
        self,
         101  +
    ) -> crate::client::customize::CustomizableOperation<
         102  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyOutput,
         103  +
        crate::operation::delete_resource_policy::DeleteResourcePolicyError,
         104  +
        Self,
         105  +
    > {
         106  +
        crate::client::customize::CustomizableOperation::new(self)
         107  +
    }
         108  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         109  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         110  +
        self
         111  +
    }
         112  +
         113  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         114  +
        self.config_override = config_override;
         115  +
        self
         116  +
    }
         117  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         118  +
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.resource_arn(input.into());
         120  +
        self
         121  +
    }
         122  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         123  +
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.set_resource_arn(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         128  +
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_resource_arn()
         130  +
    }
         131  +
    /// <p>The policy ID.</p>
         132  +
    pub fn policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         133  +
        self.inner = self.inner.policy_id(input.into());
         134  +
        self
         135  +
    }
         136  +
    /// <p>The policy ID.</p>
         137  +
    pub fn set_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         138  +
        self.inner = self.inner.set_policy_id(input);
         139  +
        self
         140  +
    }
         141  +
    /// <p>The policy ID.</p>
         142  +
    pub fn get_policy_id(&self) -> &::std::option::Option<::std::string::String> {
         143  +
        self.inner.get_policy_id()
         144  +
    }
         145  +
    /// <p>ID of the current policy version. The hash helps to prevent multiple calls from attempting to overwrite a policy.</p>
         146  +
    pub fn policy_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         147  +
        self.inner = self.inner.policy_hash(input.into());
         148  +
        self
         149  +
    }
         150  +
    /// <p>ID of the current policy version. The hash helps to prevent multiple calls from attempting to overwrite a policy.</p>
         151  +
    pub fn set_policy_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         152  +
        self.inner = self.inner.set_policy_hash(input);
         153  +
        self
         154  +
    }
         155  +
    /// <p>ID of the current policy version. The hash helps to prevent multiple calls from attempting to overwrite a policy.</p>
         156  +
    pub fn get_policy_hash(&self) -> &::std::option::Option<::std::string::String> {
         157  +
        self.inner.get_policy_hash()
         158  +
    }
         159  +
}

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

@@ -0,1 +0,572 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DeregisterManagedInstance`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DeregisterManagedInstance;
           6  +
impl DeregisterManagedInstance {
           7  +
    /// Creates a new `DeregisterManagedInstance`
           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::deregister_managed_instance::DeregisterManagedInstanceInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput::SCHEMA;
          17  +
    pub(crate) async fn orchestrate(
          18  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          19  +
        input: crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput,
          20  +
    ) -> ::std::result::Result<
          21  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          22  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          23  +
            crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          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::deregister_managed_instance::DeregisterManagedInstanceError>()
          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::deregister_managed_instance::DeregisterManagedInstanceOutput>()
          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::deregister_managed_instance::DeregisterManagedInstanceInput,
          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", "DeregisterManagedInstance", 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.DeregisterManagedInstance",
          65  +
                "rpc.service" = "SSM",
          66  +
                "rpc.method" = "DeregisterManagedInstance",
          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::InvalidInstanceId::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::InvalidInstanceId::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::InvalidInstanceId::deserialize(d)?))
         120  +
                        },
         121  +
                    )
         122  +
                            .build()
         123  +
    });
         124  +
}
         125  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeregisterManagedInstance {
         126  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         127  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeregisterManagedInstance");
         128  +
         129  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         130  +
            DeregisterManagedInstanceRequestSerializer,
         131  +
        ));
         132  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         133  +
            DeregisterManagedInstanceResponseDeserializer,
         134  +
        ));
         135  +
         136  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         137  +
            crate::config::auth::Params::builder()
         138  +
                .operation_name("DeregisterManagedInstance")
         139  +
                .build()
         140  +
                .expect("required fields set"),
         141  +
        ));
         142  +
         143  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         144  +
            "DeregisterManagedInstance",
         145  +
            "SSM",
         146  +
        ));
         147  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         148  +
        signing_options.double_uri_encode = true;
         149  +
        signing_options.content_sha256_header = false;
         150  +
        signing_options.normalize_uri_path = true;
         151  +
        signing_options.payload_override = None;
         152  +
         153  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         154  +
            signing_options,
         155  +
            ..::std::default::Default::default()
         156  +
        });
         157  +
         158  +
        ::std::option::Option::Some(cfg.freeze())
         159  +
    }
         160  +
         161  +
    fn runtime_components(
         162  +
        &self,
         163  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         164  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         165  +
        #[allow(unused_mut)]
         166  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeregisterManagedInstance")
         167  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         168  +
                DeregisterManagedInstanceTelemetryInputCaptureInterceptor,
         169  +
            ))
         170  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         171  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         172  +
            ))
         173  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         174  +
                DeregisterManagedInstanceEndpointParamsInterceptor,
         175  +
            ))
         176  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         177  +
                crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
         178  +
            >::new())
         179  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         180  +
                crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
         181  +
            >::new())
         182  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         183  +
                crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
         184  +
            >::new())
         185  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         186  +
                crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
         187  +
            >::new());
         188  +
         189  +
        ::std::borrow::Cow::Owned(rcb)
         190  +
    }
         191  +
}
         192  +
         193  +
#[derive(Debug)]
         194  +
struct DeregisterManagedInstanceTelemetryInputCaptureInterceptor;
         195  +
         196  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         197  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeregisterManagedInstanceTelemetryInputCaptureInterceptor {
         198  +
    fn name(&self) -> &'static str {
         199  +
        "DeregisterManagedInstanceTelemetryInputCaptureInterceptor"
         200  +
    }
         201  +
         202  +
    fn read_before_execution(
         203  +
        &self,
         204  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         205  +
            '_,
         206  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         207  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         208  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         209  +
        >,
         210  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         211  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         212  +
        // Nothing to do unless the customer opted in by naming members to record.
         213  +
        let ::std::option::Option::Some(requested) = cfg
         214  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         215  +
            .filter(|r| !r.is_empty())
         216  +
        else {
         217  +
            return ::std::result::Result::Ok(());
         218  +
        };
         219  +
         220  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<DeregisterManagedInstanceInput>() else {
         221  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         222  +
            return ::std::result::Result::Ok(());
         223  +
        };
         224  +
         225  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         226  +
        if requested.should_capture("InstanceId") {
         227  +
            if let ::std::option::Option::Some(value) = input.instance_id.as_deref() {
         228  +
                captured.insert("InstanceId", value);
         229  +
            }
         230  +
        }
         231  +
         232  +
        cfg.interceptor_state().store_put(captured);
         233  +
        ::std::result::Result::Ok(())
         234  +
    }
         235  +
}
         236  +
#[derive(Debug)]
         237  +
struct DeregisterManagedInstanceResponseDeserializer;
         238  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeregisterManagedInstanceResponseDeserializer {
         239  +
    fn deserialize_nonstreaming_with_config(
         240  +
        &self,
         241  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         242  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         243  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         244  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         245  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         246  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         247  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         248  +
        // loads `body` before firing this hook.
         249  +
        let body = response.body().bytes().expect("body loaded");
         250  +
        let headers = response.headers();
         251  +
        #[allow(unused_mut)]
         252  +
        let mut force_error = false;
         253  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         254  +
        if !success && status != 200 || force_error {
         255  +
            let protocol = _cfg
         256  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         257  +
                .expect("a SharedClientProtocol is required");
         258  +
            #[allow(unused_mut)]
         259  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         260  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         261  +
            })?;
         262  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         263  +
            let generic = generic_builder.build();
         264  +
            let error_code = match generic.code() {
         265  +
                ::std::option::Option::Some(code) => code,
         266  +
                ::std::option::Option::None => {
         267  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         268  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         269  +
                            crate::operation::deregister_managed_instance::DeregisterManagedInstanceError::unhandled(generic),
         270  +
                        ),
         271  +
                    ))
         272  +
                }
         273  +
            };
         274  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         275  +
            let err = match error_code {
         276  +
                "InternalServerError" => crate::operation::deregister_managed_instance::DeregisterManagedInstanceError::InternalServerError({
         277  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         278  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         279  +
                            &mut *deser,
         280  +
                            response.headers(),
         281  +
                            response.status().into(),
         282  +
                            body,
         283  +
                        )
         284  +
                    }) {
         285  +
                        ::std::result::Result::Ok(val) => val,
         286  +
                        ::std::result::Result::Err(e) => {
         287  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         288  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         289  +
                            ))
         290  +
                        }
         291  +
                    };
         292  +
                    tmp.meta = generic;
         293  +
                    if tmp.message.is_none() {
         294  +
                        tmp.message = _error_message;
         295  +
                    }
         296  +
                    tmp
         297  +
                }),
         298  +
                "InvalidInstanceId" => crate::operation::deregister_managed_instance::DeregisterManagedInstanceError::InvalidInstanceId({
         299  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         300  +
                        crate::types::error::InvalidInstanceId::deserialize_with_response(
         301  +
                            &mut *deser,
         302  +
                            response.headers(),
         303  +
                            response.status().into(),
         304  +
                            body,
         305  +
                        )
         306  +
                    }) {
         307  +
                        ::std::result::Result::Ok(val) => val,
         308  +
                        ::std::result::Result::Err(e) => {
         309  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         310  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         311  +
                            ))
         312  +
                        }
         313  +
                    };
         314  +
                    tmp.meta = generic;
         315  +
                    if tmp.message.is_none() {
         316  +
                        tmp.message = _error_message;
         317  +
                    }
         318  +
                    tmp
         319  +
                }),
         320  +
                _ => {
         321  +
                    // Registry-backed, operation-scoped reification of an error whose
         322  +
                    // code this operation does not model directly: the operation's own
         323  +
                    // error registry is consulted first, then the lookup widens to the
         324  +
                    // service-wide error registry. On a hit, the reified error is attached
         325  +
                    // as the source of the returned unhandled error while its metadata
         326  +
                    // (code, message, request id) is preserved; on a miss the generic
         327  +
                    // error is returned unchanged.
         328  +
                    match protocol
         329  +
                        .deserialize_error_response(response, _cfg)
         330  +
                        .ok()
         331  +
                        .and_then(|mut deser| {
         332  +
                            ::aws_smithy_schema::registry::reify_error(
         333  +
                                crate::operation::deregister_managed_instance::error_registry::REGISTRY
         334  +
                                    .or(&crate::error_type_registry::REGISTRY),
         335  +
                                error_code,
         336  +
                                &mut *deser,
         337  +
                            )
         338  +
                        }) {
         339  +
                        ::std::option::Option::Some(source) => <crate::operation::deregister_managed_instance::DeregisterManagedInstanceError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         340  +
                        ::std::option::Option::None => crate::operation::deregister_managed_instance::DeregisterManagedInstanceError::generic(generic),
         341  +
                    }
         342  +
                }
         343  +
            };
         344  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         345  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         346  +
            ))
         347  +
        } else {
         348  +
            let protocol = _cfg
         349  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         350  +
                .expect("a SharedClientProtocol is required");
         351  +
            let mut deser = protocol
         352  +
                .deserialize_response(response, DeregisterManagedInstance::OUTPUT_SCHEMA, _cfg)
         353  +
                .map_err(|e| {
         354  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         355  +
                })?;
         356  +
            // body and headers are already in scope from the top of the function;
         357  +
            // alias `headers` as `_response_headers` so MutateOutput
         358  +
            // customizations have a stable name to read from.
         359  +
            let _response_headers = headers;
         360  +
            #[allow(unused_mut)]
         361  +
            let mut output = crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput::deserialize_with_response(
         362  +
                &mut *deser,
         363  +
                _response_headers,
         364  +
                response.status().into(),
         365  +
                body,
         366  +
            )
         367  +
            .map_err(|e| {
         368  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         369  +
            })?;
         370  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         371  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         372  +
        }
         373  +
    }
         374  +
}
         375  +
#[derive(Debug)]
         376  +
struct DeregisterManagedInstanceRequestSerializer;
         377  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeregisterManagedInstanceRequestSerializer {
         378  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         379  +
    fn serialize_input(
         380  +
        &self,
         381  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         382  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         383  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         384  +
        let input = input
         385  +
            .downcast::<crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput>()
         386  +
            .expect("correct type");
         387  +
         388  +
        let protocol = _cfg
         389  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         390  +
            .expect("a SharedClientProtocol is required");
         391  +
        let mut request = protocol
         392  +
            .serialize_request(&input, DeregisterManagedInstance::INPUT_SCHEMA, "/", _cfg)
         393  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         394  +
         395  +
        return ::std::result::Result::Ok(request);
         396  +
    }
         397  +
}
         398  +
#[derive(Debug)]
         399  +
struct DeregisterManagedInstanceEndpointParamsInterceptor;
         400  +
         401  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         402  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeregisterManagedInstanceEndpointParamsInterceptor {
         403  +
    fn name(&self) -> &'static str {
         404  +
        "DeregisterManagedInstanceEndpointParamsInterceptor"
         405  +
    }
         406  +
         407  +
    fn read_before_execution(
         408  +
        &self,
         409  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         410  +
            '_,
         411  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         412  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         413  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         414  +
        >,
         415  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         416  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         417  +
        let _input = context
         418  +
            .input()
         419  +
            .downcast_ref::<DeregisterManagedInstanceInput>()
         420  +
            .ok_or("failed to downcast to DeregisterManagedInstanceInput")?;
         421  +
         422  +
        let params = crate::config::endpoint::Params::builder()
         423  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         424  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         425  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         426  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         427  +
            .build()
         428  +
            .map_err(|err| {
         429  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         430  +
            })?;
         431  +
        cfg.interceptor_state()
         432  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         433  +
        ::std::result::Result::Ok(())
         434  +
    }
         435  +
}
         436  +
         437  +
// The get_* functions below are generated from JMESPath expressions in the
         438  +
// operationContextParams trait. They target the operation's input shape.
         439  +
         440  +
/// Error type for the `DeregisterManagedInstanceError` operation.
         441  +
#[non_exhaustive]
         442  +
#[derive(::std::fmt::Debug)]
         443  +
pub enum DeregisterManagedInstanceError {
         444  +
    /// <p>An error occurred on the server side.</p>
         445  +
    InternalServerError(crate::types::error::InternalServerError),
         446  +
    /// <p>The following problems can cause this exception:</p>
         447  +
    /// <ul>
         448  +
    /// <li>
         449  +
    /// <p>You don't have permission to access the managed node.</p></li>
         450  +
    /// <li>
         451  +
    /// <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p></li>
         452  +
    /// <li>
         453  +
    /// <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p></li>
         454  +
    /// <li>
         455  +
    /// <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p></li>
         456  +
    /// </ul>
         457  +
    InvalidInstanceId(crate::types::error::InvalidInstanceId),
         458  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         459  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         460  +
    variable wildcard pattern and check `.code()`:
         461  +
     \
         462  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         463  +
     \
         464  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeregisterManagedInstanceError) for what information is available for the error.")]
         465  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         466  +
}
         467  +
impl DeregisterManagedInstanceError {
         468  +
    /// Creates the `DeregisterManagedInstanceError::Unhandled` variant from any error type.
         469  +
    pub fn unhandled(
         470  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         471  +
    ) -> Self {
         472  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         473  +
            source: err.into(),
         474  +
            meta: ::std::default::Default::default(),
         475  +
        })
         476  +
    }
         477  +
         478  +
    /// Creates the `DeregisterManagedInstanceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         479  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         480  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         481  +
            source: err.clone().into(),
         482  +
            meta: err,
         483  +
        })
         484  +
    }
         485  +
    ///
         486  +
    /// Returns error metadata, which includes the error code, message,
         487  +
    /// request ID, and potentially additional information.
         488  +
    ///
         489  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         490  +
        match self {
         491  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         492  +
            Self::InvalidInstanceId(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         493  +
            Self::Unhandled(e) => &e.meta,
         494  +
        }
         495  +
    }
         496  +
    /// Returns `true` if the error kind is `DeregisterManagedInstanceError::InternalServerError`.
         497  +
    pub fn is_internal_server_error(&self) -> bool {
         498  +
        matches!(self, Self::InternalServerError(_))
         499  +
    }
         500  +
    /// Returns `true` if the error kind is `DeregisterManagedInstanceError::InvalidInstanceId`.
         501  +
    pub fn is_invalid_instance_id(&self) -> bool {
         502  +
        matches!(self, Self::InvalidInstanceId(_))
         503  +
    }
         504  +
}
         505  +
impl ::std::error::Error for DeregisterManagedInstanceError {
         506  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         507  +
        match self {
         508  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         509  +
            Self::InvalidInstanceId(_inner) => ::std::option::Option::Some(_inner),
         510  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         511  +
        }
         512  +
    }
         513  +
}
         514  +
impl ::std::fmt::Display for DeregisterManagedInstanceError {
         515  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         516  +
        match self {
         517  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         518  +
            Self::InvalidInstanceId(_inner) => _inner.fmt(f),
         519  +
            Self::Unhandled(_inner) => {
         520  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         521  +
                    write!(f, "unhandled error ({code})")
         522  +
                } else {
         523  +
                    f.write_str("unhandled error")
         524  +
                }
         525  +
            }
         526  +
        }
         527  +
    }
         528  +
}
         529  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DeregisterManagedInstanceError {
         530  +
    fn code(&self) -> ::std::option::Option<&str> {
         531  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         532  +
    }
         533  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         534  +
        ::std::option::Option::None
         535  +
    }
         536  +
}
         537  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeregisterManagedInstanceError {
         538  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         539  +
        match self {
         540  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         541  +
            Self::InvalidInstanceId(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         542  +
            Self::Unhandled(_inner) => &_inner.meta,
         543  +
        }
         544  +
    }
         545  +
}
         546  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeregisterManagedInstanceError {
         547  +
    fn create_unhandled_error(
         548  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         549  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         550  +
    ) -> Self {
         551  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         552  +
            source,
         553  +
            meta: meta.unwrap_or_default(),
         554  +
        })
         555  +
    }
         556  +
}
         557  +
impl ::aws_types::request_id::RequestId for crate::operation::deregister_managed_instance::DeregisterManagedInstanceError {
         558  +
    fn request_id(&self) -> Option<&str> {
         559  +
        self.meta().request_id()
         560  +
    }
         561  +
}
         562  +
         563  +
pub use crate::operation::deregister_managed_instance::_deregister_managed_instance_input::DeregisterManagedInstanceInput;
         564  +
         565  +
pub use crate::operation::deregister_managed_instance::_deregister_managed_instance_output::DeregisterManagedInstanceOutput;
         566  +
         567  +
mod _deregister_managed_instance_input;
         568  +
         569  +
mod _deregister_managed_instance_output;
         570  +
         571  +
/// Builders
         572  +
pub mod builders;

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

@@ -0,1 +0,134 @@
           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 DeregisterManagedInstanceInput {
           6  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
           7  +
    pub instance_id: ::std::option::Option<::std::string::String>,
           8  +
}
           9  +
impl DeregisterManagedInstanceInput {
          10  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
          11  +
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
          12  +
        self.instance_id.as_deref()
          13  +
    }
          14  +
}
          15  +
static DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          16  +
    ::aws_smithy_schema::ShapeId::from_parts(
          17  +
        "com.amazonaws.ssm.synthetic#DeregisterManagedInstanceInput$InstanceId",
          18  +
        "com.amazonaws.ssm.synthetic",
          19  +
        "DeregisterManagedInstanceInput",
          20  +
    ),
          21  +
    ::aws_smithy_schema::ShapeType::String,
          22  +
    "InstanceId",
          23  +
    0,
          24  +
);
          25  +
static DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          26  +
    ::aws_smithy_schema::ShapeId::from_parts(
          27  +
        "com.amazonaws.ssm.synthetic#DeregisterManagedInstanceInput",
          28  +
        "com.amazonaws.ssm.synthetic",
          29  +
        "DeregisterManagedInstanceInput",
          30  +
    ),
          31  +
    ::aws_smithy_schema::ShapeType::Structure,
          32  +
    &[&DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID],
          33  +
)
          34  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          35  +
.with_original_name("DeregisterManagedInstanceRequest");
          36  +
impl DeregisterManagedInstanceInput {
          37  +
    /// The schema for this shape.
          38  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA;
          39  +
}
          40  +
impl ::aws_smithy_schema::serde::SerializableStruct for DeregisterManagedInstanceInput {
          41  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          42  +
    fn serialize_members(
          43  +
        &self,
          44  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          45  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          46  +
        if let Some(ref val) = self.instance_id {
          47  +
            ser.write_string(&DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID, val)?;
          48  +
        }
          49  +
        Ok(())
          50  +
    }
          51  +
}
          52  +
impl DeregisterManagedInstanceInput {
          53  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        #[allow(unused_variables, unused_mut)]
          58  +
        let mut builder = Self::builder();
          59  +
        #[allow(
          60  +
            unused_variables,
          61  +
            unreachable_code,
          62  +
            clippy::single_match,
          63  +
            clippy::match_single_binding,
          64  +
            clippy::diverging_sub_expression
          65  +
        )]
          66  +
        deserializer.read_struct(&DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA, &mut |member, deser| {
          67  +
            match member.member_index() {
          68  +
                Some(0) => {
          69  +
                    if deser.is_null() {
          70  +
                        deser.read_null()?;
          71  +
                    } else {
          72  +
                        builder.instance_id = Some(deser.read_string(member)?);
          73  +
                    }
          74  +
                }
          75  +
                _ => {}
          76  +
            }
          77  +
            Ok(())
          78  +
        })?;
          79  +
        builder.instance_id = builder.instance_id.or(Some(String::new()));
          80  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          81  +
    }
          82  +
}
          83  +
impl DeregisterManagedInstanceInput {
          84  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          85  +
    pub fn deserialize_with_response(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        _body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        Self::deserialize(deserializer)
          92  +
    }
          93  +
}
          94  +
impl DeregisterManagedInstanceInput {
          95  +
    /// Creates a new builder-style object to manufacture [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
          96  +
    pub fn builder() -> crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder {
          97  +
        crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder::default()
          98  +
    }
          99  +
}
         100  +
         101  +
/// A builder for [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
         102  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         103  +
#[non_exhaustive]
         104  +
pub struct DeregisterManagedInstanceInputBuilder {
         105  +
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
         106  +
}
         107  +
impl DeregisterManagedInstanceInputBuilder {
         108  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         109  +
    /// This field is required.
         110  +
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         111  +
        self.instance_id = ::std::option::Option::Some(input.into());
         112  +
        self
         113  +
    }
         114  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         115  +
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         116  +
        self.instance_id = input;
         117  +
        self
         118  +
    }
         119  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         120  +
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
         121  +
        &self.instance_id
         122  +
    }
         123  +
    /// Consumes the builder and constructs a [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
         124  +
    pub fn build(
         125  +
        self,
         126  +
    ) -> ::std::result::Result<
         127  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput,
         128  +
        ::aws_smithy_types::error::operation::BuildError,
         129  +
    > {
         130  +
        ::std::result::Result::Ok(crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput {
         131  +
            instance_id: self.instance_id,
         132  +
        })
         133  +
    }
         134  +
}

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

@@ -0,1 +0,122 @@
           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 DeregisterManagedInstanceOutput {
           6  +
    _request_id: Option<String>,
           7  +
}
           8  +
static DEREGISTERMANAGEDINSTANCEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
           9  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          10  +
    ::aws_smithy_schema::ShapeType::String,
          11  +
    "request_id",
          12  +
    0,
          13  +
)
          14  +
.with_http_header("x-amzn-requestid");
          15  +
static DEREGISTERMANAGEDINSTANCEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          16  +
    ::aws_smithy_schema::ShapeId::from_parts(
          17  +
        "com.amazonaws.ssm.synthetic#DeregisterManagedInstanceOutput",
          18  +
        "com.amazonaws.ssm.synthetic",
          19  +
        "DeregisterManagedInstanceOutput",
          20  +
    ),
          21  +
    ::aws_smithy_schema::ShapeType::Structure,
          22  +
    &[&DEREGISTERMANAGEDINSTANCEOUTPUT_MEMBER__REQUEST_ID],
          23  +
)
          24  +
.with_original_name("DeregisterManagedInstanceResult");
          25  +
impl DeregisterManagedInstanceOutput {
          26  +
    /// The schema for this shape.
          27  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DEREGISTERMANAGEDINSTANCEOUTPUT_SCHEMA;
          28  +
}
          29  +
impl ::aws_smithy_schema::serde::SerializableStruct for DeregisterManagedInstanceOutput {
          30  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          31  +
    fn serialize_members(
          32  +
        &self,
          33  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          34  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          35  +
        Ok(())
          36  +
    }
          37  +
}
          38  +
impl DeregisterManagedInstanceOutput {
          39  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          40  +
    pub fn deserialize(
          41  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          42  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          43  +
        #[allow(unused_variables, unused_mut)]
          44  +
        let mut builder = Self::builder();
          45  +
        #[allow(
          46  +
            unused_variables,
          47  +
            unreachable_code,
          48  +
            clippy::single_match,
          49  +
            clippy::match_single_binding,
          50  +
            clippy::diverging_sub_expression
          51  +
        )]
          52  +
        deserializer.read_struct(&DEREGISTERMANAGEDINSTANCEOUTPUT_SCHEMA, &mut |member, deser| {
          53  +
            match member.member_index() {
          54  +
                Some(0) => {
          55  +
                    builder._request_id = Some(deser.read_string(member)?);
          56  +
                }
          57  +
                _ => {}
          58  +
            }
          59  +
            Ok(())
          60  +
        })?;
          61  +
        Ok(builder.build())
          62  +
    }
          63  +
}
          64  +
impl DeregisterManagedInstanceOutput {
          65  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          66  +
    /// Header-bound members are read directly from headers, avoiding runtime
          67  +
    /// member iteration overhead. Body members are read via the deserializer.
          68  +
    pub fn deserialize_with_response(
          69  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          70  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          71  +
        _status: u16,
          72  +
        _body: &[u8],
          73  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          74  +
        #[allow(unused_variables, unused_mut)]
          75  +
        let mut builder = Self::builder();
          76  +
        if let Some(val) = headers.get("x-amzn-requestid") {
          77  +
            builder._request_id = Some(val.to_string());
          78  +
        }
          79  +
        Ok(builder.build())
          80  +
    }
          81  +
}
          82  +
impl ::aws_types::request_id::RequestId for DeregisterManagedInstanceOutput {
          83  +
    fn request_id(&self) -> Option<&str> {
          84  +
        self._request_id.as_deref()
          85  +
    }
          86  +
}
          87  +
impl DeregisterManagedInstanceOutput {
          88  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
          89  +
        self._request_id = request_id;
          90  +
        self
          91  +
    }
          92  +
}
          93  +
impl DeregisterManagedInstanceOutput {
          94  +
    /// Creates a new builder-style object to manufacture [`DeregisterManagedInstanceOutput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput).
          95  +
    pub fn builder() -> crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceOutputBuilder {
          96  +
        crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceOutputBuilder::default()
          97  +
    }
          98  +
}
          99  +
         100  +
/// A builder for [`DeregisterManagedInstanceOutput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput).
         101  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         102  +
#[non_exhaustive]
         103  +
pub struct DeregisterManagedInstanceOutputBuilder {
         104  +
    _request_id: Option<String>,
         105  +
}
         106  +
impl DeregisterManagedInstanceOutputBuilder {
         107  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         108  +
        self._request_id = Some(request_id.into());
         109  +
        self
         110  +
    }
         111  +
         112  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         113  +
        self._request_id = request_id;
         114  +
        self
         115  +
    }
         116  +
    /// Consumes the builder and constructs a [`DeregisterManagedInstanceOutput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput).
         117  +
    pub fn build(self) -> crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput {
         118  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput {
         119  +
            _request_id: self._request_id,
         120  +
        }
         121  +
    }
         122  +
}

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

@@ -0,1 +0,126 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::deregister_managed_instance::_deregister_managed_instance_input::DeregisterManagedInstanceInputBuilder;
           3  +
           4  +
pub use crate::operation::deregister_managed_instance::_deregister_managed_instance_output::DeregisterManagedInstanceOutputBuilder;
           5  +
           6  +
impl crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.deregister_managed_instance();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DeregisterManagedInstance`.
          24  +
///
          25  +
/// <p>Removes the server or virtual machine from the list of registered servers.</p>
          26  +
/// <p>If you want to reregister an on-premises server, edge device, or VM, you must use a different Activation Code and Activation ID than used to register the machine previously. The Activation Code and Activation ID must not have already been used on the maximum number of activations specified when they were created. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-deregister-hybrid-nodes.html">Deregistering managed nodes in a hybrid and multicloud environment</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          27  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          28  +
pub struct DeregisterManagedInstanceFluentBuilder {
          29  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          30  +
    inner: crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder,
          31  +
    config_override: ::std::option::Option<crate::config::Builder>,
          32  +
}
          33  +
impl
          34  +
    crate::client::customize::internal::CustomizableSend<
          35  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          36  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          37  +
    > for DeregisterManagedInstanceFluentBuilder
          38  +
{
          39  +
    fn send(
          40  +
        self,
          41  +
        config_override: crate::config::Builder,
          42  +
    ) -> crate::client::customize::internal::BoxFuture<
          43  +
        crate::client::customize::internal::SendResult<
          44  +
            crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          45  +
            crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          46  +
        >,
          47  +
    > {
          48  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          49  +
    }
          50  +
}
          51  +
impl DeregisterManagedInstanceFluentBuilder {
          52  +
    /// Creates a new `DeregisterManagedInstanceFluentBuilder`.
          53  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          54  +
        Self {
          55  +
            handle,
          56  +
            inner: ::std::default::Default::default(),
          57  +
            config_override: ::std::option::Option::None,
          58  +
        }
          59  +
    }
          60  +
    /// Access the DeregisterManagedInstance as a reference.
          61  +
    pub fn as_input(&self) -> &crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder {
          62  +
        &self.inner
          63  +
    }
          64  +
    /// Sends the request and returns the response.
          65  +
    ///
          66  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          67  +
    /// can be matched against.
          68  +
    ///
          69  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          70  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          71  +
    /// set when configuring the client.
          72  +
    pub async fn send(
          73  +
        self,
          74  +
    ) -> ::std::result::Result<
          75  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          76  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          77  +
            crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          78  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          79  +
        >,
          80  +
    > {
          81  +
        let input = self
          82  +
            .inner
          83  +
            .build()
          84  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          85  +
        let runtime_plugins = crate::operation::deregister_managed_instance::DeregisterManagedInstance::operation_runtime_plugins(
          86  +
            self.handle.runtime_plugins.clone(),
          87  +
            &self.handle.conf,
          88  +
            self.config_override,
          89  +
        );
          90  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstance::orchestrate(&runtime_plugins, input).await
          91  +
    }
          92  +
          93  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          94  +
    pub fn customize(
          95  +
        self,
          96  +
    ) -> crate::client::customize::CustomizableOperation<
          97  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceOutput,
          98  +
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceError,
          99  +
        Self,
         100  +
    > {
         101  +
        crate::client::customize::CustomizableOperation::new(self)
         102  +
    }
         103  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         104  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         105  +
        self
         106  +
    }
         107  +
         108  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         109  +
        self.config_override = config_override;
         110  +
        self
         111  +
    }
         112  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         113  +
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         114  +
        self.inner = self.inner.instance_id(input.into());
         115  +
        self
         116  +
    }
         117  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         118  +
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.set_instance_id(input);
         120  +
        self
         121  +
    }
         122  +
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
         123  +
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
         124  +
        self.inner.get_instance_id()
         125  +
    }
         126  +
}