AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0

Files changed:

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

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

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

@@ -0,1 +0,220 @@
           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 StartExecutionPreviewInput {
           6  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
           7  +
    pub document_name: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
           9  +
    pub document_version: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
          11  +
    pub execution_inputs: ::std::option::Option<crate::types::ExecutionInputs>,
          12  +
}
          13  +
impl StartExecutionPreviewInput {
          14  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
          15  +
    pub fn document_name(&self) -> ::std::option::Option<&str> {
          16  +
        self.document_name.as_deref()
          17  +
    }
          18  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
          19  +
    pub fn document_version(&self) -> ::std::option::Option<&str> {
          20  +
        self.document_version.as_deref()
          21  +
    }
          22  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
          23  +
    pub fn execution_inputs(&self) -> ::std::option::Option<&crate::types::ExecutionInputs> {
          24  +
        self.execution_inputs.as_ref()
          25  +
    }
          26  +
}
          27  +
static STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          28  +
    ::aws_smithy_schema::ShapeId::from_parts(
          29  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$DocumentName",
          30  +
        "com.amazonaws.ssm.synthetic",
          31  +
        "StartExecutionPreviewInput",
          32  +
    ),
          33  +
    ::aws_smithy_schema::ShapeType::String,
          34  +
    "DocumentName",
          35  +
    0,
          36  +
);
          37  +
static STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          38  +
    ::aws_smithy_schema::ShapeId::from_parts(
          39  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$DocumentVersion",
          40  +
        "com.amazonaws.ssm.synthetic",
          41  +
        "StartExecutionPreviewInput",
          42  +
    ),
          43  +
    ::aws_smithy_schema::ShapeType::String,
          44  +
    "DocumentVersion",
          45  +
    1,
          46  +
);
          47  +
static STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          48  +
    ::aws_smithy_schema::ShapeId::from_parts(
          49  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$ExecutionInputs",
          50  +
        "com.amazonaws.ssm.synthetic",
          51  +
        "StartExecutionPreviewInput",
          52  +
    ),
          53  +
    ::aws_smithy_schema::ShapeType::Union,
          54  +
    "ExecutionInputs",
          55  +
    2,
          56  +
);
          57  +
static STARTEXECUTIONPREVIEWINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          58  +
    ::aws_smithy_schema::ShapeId::from_parts(
          59  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput",
          60  +
        "com.amazonaws.ssm.synthetic",
          61  +
        "StartExecutionPreviewInput",
          62  +
    ),
          63  +
    ::aws_smithy_schema::ShapeType::Structure,
          64  +
    &[
          65  +
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME,
          66  +
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION,
          67  +
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS,
          68  +
    ],
          69  +
)
          70  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          71  +
.with_original_name("StartExecutionPreviewRequest");
          72  +
impl StartExecutionPreviewInput {
          73  +
    /// The schema for this shape.
          74  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTEXECUTIONPREVIEWINPUT_SCHEMA;
          75  +
}
          76  +
impl ::aws_smithy_schema::serde::SerializableStruct for StartExecutionPreviewInput {
          77  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          78  +
    fn serialize_members(
          79  +
        &self,
          80  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          81  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          82  +
        if let Some(ref val) = self.document_name {
          83  +
            ser.write_string(&STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME, val)?;
          84  +
        }
          85  +
        if let Some(ref val) = self.document_version {
          86  +
            ser.write_string(&STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION, val)?;
          87  +
        }
          88  +
        if let Some(ref val) = self.execution_inputs {
          89  +
            ser.write_struct(&STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS, val)?;
          90  +
        }
          91  +
        Ok(())
          92  +
    }
          93  +
}
          94  +
impl StartExecutionPreviewInput {
          95  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          96  +
    pub fn deserialize(
          97  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          98  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          99  +
        #[allow(unused_variables, unused_mut)]
         100  +
        let mut builder = Self::builder();
         101  +
        #[allow(
         102  +
            unused_variables,
         103  +
            unreachable_code,
         104  +
            clippy::single_match,
         105  +
            clippy::match_single_binding,
         106  +
            clippy::diverging_sub_expression
         107  +
        )]
         108  +
        deserializer.read_struct(&STARTEXECUTIONPREVIEWINPUT_SCHEMA, &mut |member, deser| {
         109  +
            match member.member_index() {
         110  +
                Some(0) => {
         111  +
                    if deser.is_null() {
         112  +
                        deser.read_null()?;
         113  +
                    } else {
         114  +
                        builder.document_name = Some(deser.read_string(member)?);
         115  +
                    }
         116  +
                }
         117  +
                Some(1) => {
         118  +
                    if deser.is_null() {
         119  +
                        deser.read_null()?;
         120  +
                    } else {
         121  +
                        builder.document_version = Some(deser.read_string(member)?);
         122  +
                    }
         123  +
                }
         124  +
                Some(2) => {
         125  +
                    if deser.is_null() {
         126  +
                        deser.read_null()?;
         127  +
                    } else {
         128  +
                        builder.execution_inputs = Some(crate::types::ExecutionInputs::deserialize(deser)?);
         129  +
                    }
         130  +
                }
         131  +
                _ => {}
         132  +
            }
         133  +
            Ok(())
         134  +
        })?;
         135  +
        builder.document_name = builder.document_name.or(Some(String::new()));
         136  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         137  +
    }
         138  +
}
         139  +
impl StartExecutionPreviewInput {
         140  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         141  +
    pub fn deserialize_with_response(
         142  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         143  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         144  +
        _status: u16,
         145  +
        _body: &[u8],
         146  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         147  +
        Self::deserialize(deserializer)
         148  +
    }
         149  +
}
         150  +
impl StartExecutionPreviewInput {
         151  +
    /// Creates a new builder-style object to manufacture [`StartExecutionPreviewInput`](crate::operation::start_execution_preview::StartExecutionPreviewInput).
         152  +
    pub fn builder() -> crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder {
         153  +
        crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder::default()
         154  +
    }
         155  +
}
         156  +
         157  +
/// A builder for [`StartExecutionPreviewInput`](crate::operation::start_execution_preview::StartExecutionPreviewInput).
         158  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         159  +
#[non_exhaustive]
         160  +
pub struct StartExecutionPreviewInputBuilder {
         161  +
    pub(crate) document_name: ::std::option::Option<::std::string::String>,
         162  +
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
         163  +
    pub(crate) execution_inputs: ::std::option::Option<crate::types::ExecutionInputs>,
         164  +
}
         165  +
impl StartExecutionPreviewInputBuilder {
         166  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         167  +
    /// This field is required.
         168  +
    pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         169  +
        self.document_name = ::std::option::Option::Some(input.into());
         170  +
        self
         171  +
    }
         172  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         173  +
    pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         174  +
        self.document_name = input;
         175  +
        self
         176  +
    }
         177  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         178  +
    pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
         179  +
        &self.document_name
         180  +
    }
         181  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         182  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         183  +
        self.document_version = ::std::option::Option::Some(input.into());
         184  +
        self
         185  +
    }
         186  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         187  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         188  +
        self.document_version = input;
         189  +
        self
         190  +
    }
         191  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         192  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         193  +
        &self.document_version
         194  +
    }
         195  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         196  +
    pub fn execution_inputs(mut self, input: crate::types::ExecutionInputs) -> Self {
         197  +
        self.execution_inputs = ::std::option::Option::Some(input);
         198  +
        self
         199  +
    }
         200  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         201  +
    pub fn set_execution_inputs(mut self, input: ::std::option::Option<crate::types::ExecutionInputs>) -> Self {
         202  +
        self.execution_inputs = input;
         203  +
        self
         204  +
    }
         205  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         206  +
    pub fn get_execution_inputs(&self) -> &::std::option::Option<crate::types::ExecutionInputs> {
         207  +
        &self.execution_inputs
         208  +
    }
         209  +
    /// Consumes the builder and constructs a [`StartExecutionPreviewInput`](crate::operation::start_execution_preview::StartExecutionPreviewInput).
         210  +
    pub fn build(
         211  +
        self,
         212  +
    ) -> ::std::result::Result<crate::operation::start_execution_preview::StartExecutionPreviewInput, ::aws_smithy_types::error::operation::BuildError>
         213  +
    {
         214  +
        ::std::result::Result::Ok(crate::operation::start_execution_preview::StartExecutionPreviewInput {
         215  +
            document_name: self.document_name,
         216  +
            document_version: self.document_version,
         217  +
            execution_inputs: self.execution_inputs,
         218  +
        })
         219  +
    }
         220  +
}

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

@@ -0,1 +0,186 @@
           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 StartExecutionPreviewOutput {
           6  +
    /// <p>The ID of the execution preview generated by the system.</p>
           7  +
    pub execution_preview_id: ::std::option::Option<::std::string::String>,
           8  +
    _request_id: Option<String>,
           9  +
}
          10  +
impl StartExecutionPreviewOutput {
          11  +
    /// <p>The ID of the execution preview generated by the system.</p>
          12  +
    pub fn execution_preview_id(&self) -> ::std::option::Option<&str> {
          13  +
        self.execution_preview_id.as_deref()
          14  +
    }
          15  +
}
          16  +
static STARTEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          17  +
    ::aws_smithy_schema::ShapeId::from_parts(
          18  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewOutput$ExecutionPreviewId",
          19  +
        "com.amazonaws.ssm.synthetic",
          20  +
        "StartExecutionPreviewOutput",
          21  +
    ),
          22  +
    ::aws_smithy_schema::ShapeType::String,
          23  +
    "ExecutionPreviewId",
          24  +
    0,
          25  +
);
          26  +
static STARTEXECUTIONPREVIEWOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          27  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          28  +
    ::aws_smithy_schema::ShapeType::String,
          29  +
    "request_id",
          30  +
    1,
          31  +
)
          32  +
.with_http_header("x-amzn-requestid");
          33  +
static STARTEXECUTIONPREVIEWOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewOutput",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "StartExecutionPreviewOutput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::Structure,
          40  +
    &[
          41  +
        &STARTEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID,
          42  +
        &STARTEXECUTIONPREVIEWOUTPUT_MEMBER__REQUEST_ID,
          43  +
    ],
          44  +
)
          45  +
.with_original_name("StartExecutionPreviewResponse");
          46  +
impl StartExecutionPreviewOutput {
          47  +
    /// The schema for this shape.
          48  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTEXECUTIONPREVIEWOUTPUT_SCHEMA;
          49  +
}
          50  +
impl ::aws_smithy_schema::serde::SerializableStruct for StartExecutionPreviewOutput {
          51  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          52  +
    fn serialize_members(
          53  +
        &self,
          54  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          55  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          56  +
        if let Some(ref val) = self.execution_preview_id {
          57  +
            ser.write_string(&STARTEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID, val)?;
          58  +
        }
          59  +
        Ok(())
          60  +
    }
          61  +
}
          62  +
impl StartExecutionPreviewOutput {
          63  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          64  +
    pub fn deserialize(
          65  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          66  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          67  +
        #[allow(unused_variables, unused_mut)]
          68  +
        let mut builder = Self::builder();
          69  +
        #[allow(
          70  +
            unused_variables,
          71  +
            unreachable_code,
          72  +
            clippy::single_match,
          73  +
            clippy::match_single_binding,
          74  +
            clippy::diverging_sub_expression
          75  +
        )]
          76  +
        deserializer.read_struct(&STARTEXECUTIONPREVIEWOUTPUT_SCHEMA, &mut |member, deser| {
          77  +
            match member.member_index() {
          78  +
                Some(0) => {
          79  +
                    if deser.is_null() {
          80  +
                        deser.read_null()?;
          81  +
                    } else {
          82  +
                        builder.execution_preview_id = Some(deser.read_string(member)?);
          83  +
                    }
          84  +
                }
          85  +
                Some(1) => {
          86  +
                    builder._request_id = Some(deser.read_string(member)?);
          87  +
                }
          88  +
                _ => {}
          89  +
            }
          90  +
            Ok(())
          91  +
        })?;
          92  +
        Ok(builder.build())
          93  +
    }
          94  +
}
          95  +
impl StartExecutionPreviewOutput {
          96  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          97  +
    /// Header-bound members are read directly from headers, avoiding runtime
          98  +
    /// member iteration overhead. Body members are read via the deserializer.
          99  +
    pub fn deserialize_with_response(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         101  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         102  +
        _status: u16,
         103  +
        _body: &[u8],
         104  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         105  +
        #[allow(unused_variables, unused_mut)]
         106  +
        let mut builder = Self::builder();
         107  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         108  +
            builder._request_id = Some(val.to_string());
         109  +
        }
         110  +
         111  +
        #[allow(
         112  +
            unused_variables,
         113  +
            unreachable_code,
         114  +
            clippy::single_match,
         115  +
            clippy::match_single_binding,
         116  +
            clippy::diverging_sub_expression
         117  +
        )]
         118  +
        deserializer.read_struct(&STARTEXECUTIONPREVIEWOUTPUT_SCHEMA, &mut |member, deser| {
         119  +
            match member.member_index() {
         120  +
                Some(0) => {
         121  +
                    builder.execution_preview_id = Some(deser.read_string(member)?);
         122  +
                }
         123  +
                _ => {}
         124  +
            }
         125  +
            Ok(())
         126  +
        })?;
         127  +
        Ok(builder.build())
         128  +
    }
         129  +
}
         130  +
impl ::aws_types::request_id::RequestId for StartExecutionPreviewOutput {
         131  +
    fn request_id(&self) -> Option<&str> {
         132  +
        self._request_id.as_deref()
         133  +
    }
         134  +
}
         135  +
impl StartExecutionPreviewOutput {
         136  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         137  +
        self._request_id = request_id;
         138  +
        self
         139  +
    }
         140  +
}
         141  +
impl StartExecutionPreviewOutput {
         142  +
    /// Creates a new builder-style object to manufacture [`StartExecutionPreviewOutput`](crate::operation::start_execution_preview::StartExecutionPreviewOutput).
         143  +
    pub fn builder() -> crate::operation::start_execution_preview::builders::StartExecutionPreviewOutputBuilder {
         144  +
        crate::operation::start_execution_preview::builders::StartExecutionPreviewOutputBuilder::default()
         145  +
    }
         146  +
}
         147  +
         148  +
/// A builder for [`StartExecutionPreviewOutput`](crate::operation::start_execution_preview::StartExecutionPreviewOutput).
         149  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         150  +
#[non_exhaustive]
         151  +
pub struct StartExecutionPreviewOutputBuilder {
         152  +
    pub(crate) execution_preview_id: ::std::option::Option<::std::string::String>,
         153  +
    _request_id: Option<String>,
         154  +
}
         155  +
impl StartExecutionPreviewOutputBuilder {
         156  +
    /// <p>The ID of the execution preview generated by the system.</p>
         157  +
    pub fn execution_preview_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         158  +
        self.execution_preview_id = ::std::option::Option::Some(input.into());
         159  +
        self
         160  +
    }
         161  +
    /// <p>The ID of the execution preview generated by the system.</p>
         162  +
    pub fn set_execution_preview_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         163  +
        self.execution_preview_id = input;
         164  +
        self
         165  +
    }
         166  +
    /// <p>The ID of the execution preview generated by the system.</p>
         167  +
    pub fn get_execution_preview_id(&self) -> &::std::option::Option<::std::string::String> {
         168  +
        &self.execution_preview_id
         169  +
    }
         170  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         171  +
        self._request_id = Some(request_id.into());
         172  +
        self
         173  +
    }
         174  +
         175  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         176  +
        self._request_id = request_id;
         177  +
        self
         178  +
    }
         179  +
    /// Consumes the builder and constructs a [`StartExecutionPreviewOutput`](crate::operation::start_execution_preview::StartExecutionPreviewOutput).
         180  +
    pub fn build(self) -> crate::operation::start_execution_preview::StartExecutionPreviewOutput {
         181  +
        crate::operation::start_execution_preview::StartExecutionPreviewOutput {
         182  +
            execution_preview_id: self.execution_preview_id,
         183  +
            _request_id: self._request_id,
         184  +
        }
         185  +
    }
         186  +
}

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

@@ -0,1 +0,153 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::start_execution_preview::_start_execution_preview_input::StartExecutionPreviewInputBuilder;
           3  +
           4  +
pub use crate::operation::start_execution_preview::_start_execution_preview_output::StartExecutionPreviewOutputBuilder;
           5  +
           6  +
impl crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder {
           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::start_execution_preview::StartExecutionPreviewOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::start_execution_preview::StartExecutionPreviewError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.start_execution_preview();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `StartExecutionPreview`.
          24  +
///
          25  +
/// <p>Initiates the process of creating a preview showing the effects that running a specified Automation runbook would have on the targeted resources.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct StartExecutionPreviewFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::start_execution_preview::StartExecutionPreviewOutput,
          35  +
        crate::operation::start_execution_preview::StartExecutionPreviewError,
          36  +
    > for StartExecutionPreviewFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::start_execution_preview::StartExecutionPreviewOutput,
          44  +
            crate::operation::start_execution_preview::StartExecutionPreviewError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl StartExecutionPreviewFluentBuilder {
          51  +
    /// Creates a new `StartExecutionPreviewFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the StartExecutionPreview as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::start_execution_preview::StartExecutionPreviewOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::start_execution_preview::StartExecutionPreviewError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::start_execution_preview::StartExecutionPreview::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::start_execution_preview::StartExecutionPreview::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::start_execution_preview::StartExecutionPreviewOutput,
          97  +
        crate::operation::start_execution_preview::StartExecutionPreviewError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         112  +
    pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.inner = self.inner.document_name(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         117  +
    pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.inner = self.inner.set_document_name(input);
         119  +
        self
         120  +
    }
         121  +
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
         122  +
    pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        self.inner.get_document_name()
         124  +
    }
         125  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         126  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         127  +
        self.inner = self.inner.document_version(input.into());
         128  +
        self
         129  +
    }
         130  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         131  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         132  +
        self.inner = self.inner.set_document_version(input);
         133  +
        self
         134  +
    }
         135  +
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
         136  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         137  +
        self.inner.get_document_version()
         138  +
    }
         139  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         140  +
    pub fn execution_inputs(mut self, input: crate::types::ExecutionInputs) -> Self {
         141  +
        self.inner = self.inner.execution_inputs(input);
         142  +
        self
         143  +
    }
         144  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         145  +
    pub fn set_execution_inputs(mut self, input: ::std::option::Option<crate::types::ExecutionInputs>) -> Self {
         146  +
        self.inner = self.inner.set_execution_inputs(input);
         147  +
        self
         148  +
    }
         149  +
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
         150  +
    pub fn get_execution_inputs(&self) -> &::std::option::Option<crate::types::ExecutionInputs> {
         151  +
        self.inner.get_execution_inputs()
         152  +
    }
         153  +
}