AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3

Files changed:

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

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

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

@@ -0,1 +0,337 @@
           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 StartSessionInput {
           6  +
    /// <p>The managed node to connect to for the session.</p>
           7  +
    pub target: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
           9  +
    pub document_name: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p>
          11  +
    pub reason: ::std::option::Option<::std::string::String>,
          12  +
    /// <p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          13  +
    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
          14  +
}
          15  +
impl StartSessionInput {
          16  +
    /// <p>The managed node to connect to for the session.</p>
          17  +
    pub fn target(&self) -> ::std::option::Option<&str> {
          18  +
        self.target.as_deref()
          19  +
    }
          20  +
    /// <p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          21  +
    pub fn document_name(&self) -> ::std::option::Option<&str> {
          22  +
        self.document_name.as_deref()
          23  +
    }
          24  +
    /// <p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p>
          25  +
    pub fn reason(&self) -> ::std::option::Option<&str> {
          26  +
        self.reason.as_deref()
          27  +
    }
          28  +
    /// <p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          29  +
    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
          30  +
        self.parameters.as_ref()
          31  +
    }
          32  +
}
          33  +
static STARTSESSIONINPUT_MEMBER_TARGET: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#StartSessionInput$Target",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "StartSessionInput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "Target",
          41  +
    0,
          42  +
);
          43  +
static STARTSESSIONINPUT_MEMBER_DOCUMENT_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts(
          45  +
        "com.amazonaws.ssm.synthetic#StartSessionInput$DocumentName",
          46  +
        "com.amazonaws.ssm.synthetic",
          47  +
        "StartSessionInput",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::String,
          50  +
    "DocumentName",
          51  +
    1,
          52  +
);
          53  +
static STARTSESSIONINPUT_MEMBER_REASON: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts(
          55  +
        "com.amazonaws.ssm.synthetic#StartSessionInput$Reason",
          56  +
        "com.amazonaws.ssm.synthetic",
          57  +
        "StartSessionInput",
          58  +
    ),
          59  +
    ::aws_smithy_schema::ShapeType::String,
          60  +
    "Reason",
          61  +
    2,
          62  +
);
          63  +
static STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm#SessionManagerParameterValueList$member",
          66  +
        "com.amazonaws.ssm",
          67  +
        "SessionManagerParameterValueList",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::String,
          70  +
    "member",
          71  +
    0,
          72  +
);
          73  +
static STARTSESSIONINPUT_MEMBER_PARAMETERS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          74  +
    ::aws_smithy_schema::ShapeId::from_parts(
          75  +
        "com.amazonaws.ssm#SessionManagerParameters$key",
          76  +
        "com.amazonaws.ssm",
          77  +
        "SessionManagerParameters",
          78  +
    ),
          79  +
    ::aws_smithy_schema::ShapeType::String,
          80  +
    "key",
          81  +
    0,
          82  +
);
          83  +
static STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          84  +
    ::aws_smithy_schema::ShapeId::from_parts(
          85  +
        "com.amazonaws.ssm#SessionManagerParameters$value",
          86  +
        "com.amazonaws.ssm",
          87  +
        "SessionManagerParameters",
          88  +
    ),
          89  +
    ::aws_smithy_schema::ShapeType::List,
          90  +
    "value",
          91  +
    1,
          92  +
)
          93  +
.with_list_member(&STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE_MEMBER);
          94  +
static STARTSESSIONINPUT_MEMBER_PARAMETERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          95  +
    ::aws_smithy_schema::ShapeId::from_parts(
          96  +
        "com.amazonaws.ssm.synthetic#StartSessionInput$Parameters",
          97  +
        "com.amazonaws.ssm.synthetic",
          98  +
        "StartSessionInput",
          99  +
    ),
         100  +
    ::aws_smithy_schema::ShapeType::Map,
         101  +
    "Parameters",
         102  +
    3,
         103  +
)
         104  +
.with_map_members(&STARTSESSIONINPUT_MEMBER_PARAMETERS_KEY, &STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE);
         105  +
static STARTSESSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         106  +
    ::aws_smithy_schema::ShapeId::from_parts(
         107  +
        "com.amazonaws.ssm.synthetic#StartSessionInput",
         108  +
        "com.amazonaws.ssm.synthetic",
         109  +
        "StartSessionInput",
         110  +
    ),
         111  +
    ::aws_smithy_schema::ShapeType::Structure,
         112  +
    &[
         113  +
        &STARTSESSIONINPUT_MEMBER_TARGET,
         114  +
        &STARTSESSIONINPUT_MEMBER_DOCUMENT_NAME,
         115  +
        &STARTSESSIONINPUT_MEMBER_REASON,
         116  +
        &STARTSESSIONINPUT_MEMBER_PARAMETERS,
         117  +
    ],
         118  +
)
         119  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         120  +
.with_original_name("StartSessionRequest");
         121  +
impl StartSessionInput {
         122  +
    /// The schema for this shape.
         123  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTSESSIONINPUT_SCHEMA;
         124  +
}
         125  +
impl ::aws_smithy_schema::serde::SerializableStruct for StartSessionInput {
         126  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         127  +
    fn serialize_members(
         128  +
        &self,
         129  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         130  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         131  +
        if let Some(ref val) = self.target {
         132  +
            ser.write_string(&STARTSESSIONINPUT_MEMBER_TARGET, val)?;
         133  +
        }
         134  +
        if let Some(ref val) = self.document_name {
         135  +
            ser.write_string(&STARTSESSIONINPUT_MEMBER_DOCUMENT_NAME, val)?;
         136  +
        }
         137  +
        if let Some(ref val) = self.reason {
         138  +
            ser.write_string(&STARTSESSIONINPUT_MEMBER_REASON, val)?;
         139  +
        }
         140  +
        if let Some(ref val) = self.parameters {
         141  +
            ser.write_map(
         142  +
                &STARTSESSIONINPUT_MEMBER_PARAMETERS,
         143  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         144  +
                    for (key, value) in val {
         145  +
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         146  +
         147  +
                        ser.write_list(
         148  +
                            &STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE,
         149  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         150  +
                                for item in value {
         151  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         152  +
                                }
         153  +
                                Ok(())
         154  +
                            },
         155  +
                        )?;
         156  +
                    }
         157  +
                    Ok(())
         158  +
                },
         159  +
            )?;
         160  +
        }
         161  +
        Ok(())
         162  +
    }
         163  +
}
         164  +
impl StartSessionInput {
         165  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         166  +
    pub fn deserialize(
         167  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         168  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         169  +
        #[allow(unused_variables, unused_mut)]
         170  +
        let mut builder = Self::builder();
         171  +
        #[allow(
         172  +
            unused_variables,
         173  +
            unreachable_code,
         174  +
            clippy::single_match,
         175  +
            clippy::match_single_binding,
         176  +
            clippy::diverging_sub_expression
         177  +
        )]
         178  +
        deserializer.read_struct(&STARTSESSIONINPUT_SCHEMA, &mut |member, deser| {
         179  +
            match member.member_index() {
         180  +
                Some(0) => {
         181  +
                    if deser.is_null() {
         182  +
                        deser.read_null()?;
         183  +
                    } else {
         184  +
                        builder.target = Some(deser.read_string(member)?);
         185  +
                    }
         186  +
                }
         187  +
                Some(1) => {
         188  +
                    if deser.is_null() {
         189  +
                        deser.read_null()?;
         190  +
                    } else {
         191  +
                        builder.document_name = Some(deser.read_string(member)?);
         192  +
                    }
         193  +
                }
         194  +
                Some(2) => {
         195  +
                    if deser.is_null() {
         196  +
                        deser.read_null()?;
         197  +
                    } else {
         198  +
                        builder.reason = Some(deser.read_string(member)?);
         199  +
                    }
         200  +
                }
         201  +
                Some(3) => {
         202  +
                    if deser.is_null() {
         203  +
                        deser.read_null()?;
         204  +
                    } else {
         205  +
                        builder.parameters = Some({
         206  +
                            let mut container = std::collections::HashMap::new();
         207  +
                            deser.read_map(member, &mut |key, deser| {
         208  +
                                container.insert(key, {
         209  +
                                    let mut list = Vec::new();
         210  +
                                    deser.read_list(&STARTSESSIONINPUT_MEMBER_PARAMETERS_VALUE, &mut |deser| {
         211  +
                                        list.push(deser.read_string(&::aws_smithy_schema::prelude::STRING)?);
         212  +
                                        Ok(())
         213  +
                                    })?;
         214  +
                                    list
         215  +
                                });
         216  +
                                Ok(())
         217  +
                            })?;
         218  +
                            container
         219  +
                        });
         220  +
                    }
         221  +
                }
         222  +
                _ => {}
         223  +
            }
         224  +
            Ok(())
         225  +
        })?;
         226  +
        builder.target = builder.target.or(Some(String::new()));
         227  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         228  +
    }
         229  +
}
         230  +
impl StartSessionInput {
         231  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         232  +
    pub fn deserialize_with_response(
         233  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         234  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         235  +
        _status: u16,
         236  +
        _body: &[u8],
         237  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         238  +
        Self::deserialize(deserializer)
         239  +
    }
         240  +
}
         241  +
impl StartSessionInput {
         242  +
    /// Creates a new builder-style object to manufacture [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
         243  +
    pub fn builder() -> crate::operation::start_session::builders::StartSessionInputBuilder {
         244  +
        crate::operation::start_session::builders::StartSessionInputBuilder::default()
         245  +
    }
         246  +
}
         247  +
         248  +
/// A builder for [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
         249  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         250  +
#[non_exhaustive]
         251  +
pub struct StartSessionInputBuilder {
         252  +
    pub(crate) target: ::std::option::Option<::std::string::String>,
         253  +
    pub(crate) document_name: ::std::option::Option<::std::string::String>,
         254  +
    pub(crate) reason: ::std::option::Option<::std::string::String>,
         255  +
    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
         256  +
}
         257  +
impl StartSessionInputBuilder {
         258  +
    /// <p>The managed node to connect to for the session.</p>
         259  +
    /// This field is required.
         260  +
    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         261  +
        self.target = ::std::option::Option::Some(input.into());
         262  +
        self
         263  +
    }
         264  +
    /// <p>The managed node to connect to for the session.</p>
         265  +
    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         266  +
        self.target = input;
         267  +
        self
         268  +
    }
         269  +
    /// <p>The managed node to connect to for the session.</p>
         270  +
    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
         271  +
        &self.target
         272  +
    }
         273  +
    /// <p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         274  +
    pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         275  +
        self.document_name = ::std::option::Option::Some(input.into());
         276  +
        self
         277  +
    }
         278  +
    /// <p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         279  +
    pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         280  +
        self.document_name = input;
         281  +
        self
         282  +
    }
         283  +
    /// <p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         284  +
    pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
         285  +
        &self.document_name
         286  +
    }
         287  +
    /// <p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p>
         288  +
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         289  +
        self.reason = ::std::option::Option::Some(input.into());
         290  +
        self
         291  +
    }
         292  +
    /// <p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p>
         293  +
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         294  +
        self.reason = input;
         295  +
        self
         296  +
    }
         297  +
    /// <p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p>
         298  +
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
         299  +
        &self.reason
         300  +
    }
         301  +
    /// Adds a key-value pair to `parameters`.
         302  +
    ///
         303  +
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
         304  +
    ///
         305  +
    /// <p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         306  +
    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
         307  +
        let mut hash_map = self.parameters.unwrap_or_default();
         308  +
        hash_map.insert(k.into(), v);
         309  +
        self.parameters = ::std::option::Option::Some(hash_map);
         310  +
        self
         311  +
    }
         312  +
    /// <p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         313  +
    pub fn set_parameters(
         314  +
        mut self,
         315  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
         316  +
    ) -> Self {
         317  +
        self.parameters = input;
         318  +
        self
         319  +
    }
         320  +
    /// <p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         321  +
    pub fn get_parameters(
         322  +
        &self,
         323  +
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
         324  +
        &self.parameters
         325  +
    }
         326  +
    /// Consumes the builder and constructs a [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
         327  +
    pub fn build(
         328  +
        self,
         329  +
    ) -> ::std::result::Result<crate::operation::start_session::StartSessionInput, ::aws_smithy_types::error::operation::BuildError> {
         330  +
        ::std::result::Result::Ok(crate::operation::start_session::StartSessionInput {
         331  +
            target: self.target,
         332  +
            document_name: self.document_name,
         333  +
            reason: self.reason,
         334  +
            parameters: self.parameters,
         335  +
        })
         336  +
    }
         337  +
}

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

@@ -0,1 +0,288 @@
           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 StartSessionOutput {
           6  +
    /// <p>The ID of the session.</p>
           7  +
    pub session_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
           9  +
    pub token_value: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p>
          11  +
    /// <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p>
          12  +
    /// <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
          13  +
    pub stream_url: ::std::option::Option<::std::string::String>,
          14  +
    _request_id: Option<String>,
          15  +
}
          16  +
impl StartSessionOutput {
          17  +
    /// <p>The ID of the session.</p>
          18  +
    pub fn session_id(&self) -> ::std::option::Option<&str> {
          19  +
        self.session_id.as_deref()
          20  +
    }
          21  +
    /// <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
          22  +
    pub fn token_value(&self) -> ::std::option::Option<&str> {
          23  +
        self.token_value.as_deref()
          24  +
    }
          25  +
    /// <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p>
          26  +
    /// <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p>
          27  +
    /// <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
          28  +
    pub fn stream_url(&self) -> ::std::option::Option<&str> {
          29  +
        self.stream_url.as_deref()
          30  +
    }
          31  +
}
          32  +
static STARTSESSIONOUTPUT_MEMBER_SESSION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_parts(
          34  +
        "com.amazonaws.ssm.synthetic#StartSessionOutput$SessionId",
          35  +
        "com.amazonaws.ssm.synthetic",
          36  +
        "StartSessionOutput",
          37  +
    ),
          38  +
    ::aws_smithy_schema::ShapeType::String,
          39  +
    "SessionId",
          40  +
    0,
          41  +
);
          42  +
static STARTSESSIONOUTPUT_MEMBER_TOKEN_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts(
          44  +
        "com.amazonaws.ssm.synthetic#StartSessionOutput$TokenValue",
          45  +
        "com.amazonaws.ssm.synthetic",
          46  +
        "StartSessionOutput",
          47  +
    ),
          48  +
    ::aws_smithy_schema::ShapeType::String,
          49  +
    "TokenValue",
          50  +
    1,
          51  +
);
          52  +
static STARTSESSIONOUTPUT_MEMBER_STREAM_URL: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          53  +
    ::aws_smithy_schema::ShapeId::from_parts(
          54  +
        "com.amazonaws.ssm.synthetic#StartSessionOutput$StreamUrl",
          55  +
        "com.amazonaws.ssm.synthetic",
          56  +
        "StartSessionOutput",
          57  +
    ),
          58  +
    ::aws_smithy_schema::ShapeType::String,
          59  +
    "StreamUrl",
          60  +
    2,
          61  +
);
          62  +
static STARTSESSIONOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          64  +
    ::aws_smithy_schema::ShapeType::String,
          65  +
    "request_id",
          66  +
    3,
          67  +
)
          68  +
.with_http_header("x-amzn-requestid");
          69  +
static STARTSESSIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          70  +
    ::aws_smithy_schema::ShapeId::from_parts(
          71  +
        "com.amazonaws.ssm.synthetic#StartSessionOutput",
          72  +
        "com.amazonaws.ssm.synthetic",
          73  +
        "StartSessionOutput",
          74  +
    ),
          75  +
    ::aws_smithy_schema::ShapeType::Structure,
          76  +
    &[
          77  +
        &STARTSESSIONOUTPUT_MEMBER_SESSION_ID,
          78  +
        &STARTSESSIONOUTPUT_MEMBER_TOKEN_VALUE,
          79  +
        &STARTSESSIONOUTPUT_MEMBER_STREAM_URL,
          80  +
        &STARTSESSIONOUTPUT_MEMBER__REQUEST_ID,
          81  +
    ],
          82  +
)
          83  +
.with_original_name("StartSessionResponse");
          84  +
impl StartSessionOutput {
          85  +
    /// The schema for this shape.
          86  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTSESSIONOUTPUT_SCHEMA;
          87  +
}
          88  +
impl ::aws_smithy_schema::serde::SerializableStruct for StartSessionOutput {
          89  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          90  +
    fn serialize_members(
          91  +
        &self,
          92  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          93  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          94  +
        if let Some(ref val) = self.session_id {
          95  +
            ser.write_string(&STARTSESSIONOUTPUT_MEMBER_SESSION_ID, val)?;
          96  +
        }
          97  +
        if let Some(ref val) = self.token_value {
          98  +
            ser.write_string(&STARTSESSIONOUTPUT_MEMBER_TOKEN_VALUE, val)?;
          99  +
        }
         100  +
        if let Some(ref val) = self.stream_url {
         101  +
            ser.write_string(&STARTSESSIONOUTPUT_MEMBER_STREAM_URL, val)?;
         102  +
        }
         103  +
        Ok(())
         104  +
    }
         105  +
}
         106  +
impl StartSessionOutput {
         107  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         108  +
    pub fn deserialize(
         109  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         110  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         111  +
        #[allow(unused_variables, unused_mut)]
         112  +
        let mut builder = Self::builder();
         113  +
        #[allow(
         114  +
            unused_variables,
         115  +
            unreachable_code,
         116  +
            clippy::single_match,
         117  +
            clippy::match_single_binding,
         118  +
            clippy::diverging_sub_expression
         119  +
        )]
         120  +
        deserializer.read_struct(&STARTSESSIONOUTPUT_SCHEMA, &mut |member, deser| {
         121  +
            match member.member_index() {
         122  +
                Some(0) => {
         123  +
                    if deser.is_null() {
         124  +
                        deser.read_null()?;
         125  +
                    } else {
         126  +
                        builder.session_id = Some(deser.read_string(member)?);
         127  +
                    }
         128  +
                }
         129  +
                Some(1) => {
         130  +
                    if deser.is_null() {
         131  +
                        deser.read_null()?;
         132  +
                    } else {
         133  +
                        builder.token_value = Some(deser.read_string(member)?);
         134  +
                    }
         135  +
                }
         136  +
                Some(2) => {
         137  +
                    if deser.is_null() {
         138  +
                        deser.read_null()?;
         139  +
                    } else {
         140  +
                        builder.stream_url = Some(deser.read_string(member)?);
         141  +
                    }
         142  +
                }
         143  +
                Some(3) => {
         144  +
                    builder._request_id = Some(deser.read_string(member)?);
         145  +
                }
         146  +
                _ => {}
         147  +
            }
         148  +
            Ok(())
         149  +
        })?;
         150  +
        Ok(builder.build())
         151  +
    }
         152  +
}
         153  +
impl StartSessionOutput {
         154  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         155  +
    /// Header-bound members are read directly from headers, avoiding runtime
         156  +
    /// member iteration overhead. Body members are read via the deserializer.
         157  +
    pub fn deserialize_with_response(
         158  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         159  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         160  +
        _status: u16,
         161  +
        _body: &[u8],
         162  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         163  +
        #[allow(unused_variables, unused_mut)]
         164  +
        let mut builder = Self::builder();
         165  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         166  +
            builder._request_id = Some(val.to_string());
         167  +
        }
         168  +
         169  +
        #[allow(
         170  +
            unused_variables,
         171  +
            unreachable_code,
         172  +
            clippy::single_match,
         173  +
            clippy::match_single_binding,
         174  +
            clippy::diverging_sub_expression
         175  +
        )]
         176  +
        deserializer.read_struct(&STARTSESSIONOUTPUT_SCHEMA, &mut |member, deser| {
         177  +
            match member.member_index() {
         178  +
                Some(0) => {
         179  +
                    builder.session_id = Some(deser.read_string(member)?);
         180  +
                }
         181  +
                Some(1) => {
         182  +
                    builder.token_value = Some(deser.read_string(member)?);
         183  +
                }
         184  +
                Some(2) => {
         185  +
                    builder.stream_url = Some(deser.read_string(member)?);
         186  +
                }
         187  +
                _ => {}
         188  +
            }
         189  +
            Ok(())
         190  +
        })?;
         191  +
        Ok(builder.build())
         192  +
    }
         193  +
}
         194  +
impl ::aws_types::request_id::RequestId for StartSessionOutput {
         195  +
    fn request_id(&self) -> Option<&str> {
         196  +
        self._request_id.as_deref()
         197  +
    }
         198  +
}
         199  +
impl StartSessionOutput {
         200  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         201  +
        self._request_id = request_id;
         202  +
        self
         203  +
    }
         204  +
}
         205  +
impl StartSessionOutput {
         206  +
    /// Creates a new builder-style object to manufacture [`StartSessionOutput`](crate::operation::start_session::StartSessionOutput).
         207  +
    pub fn builder() -> crate::operation::start_session::builders::StartSessionOutputBuilder {
         208  +
        crate::operation::start_session::builders::StartSessionOutputBuilder::default()
         209  +
    }
         210  +
}
         211  +
         212  +
/// A builder for [`StartSessionOutput`](crate::operation::start_session::StartSessionOutput).
         213  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         214  +
#[non_exhaustive]
         215  +
pub struct StartSessionOutputBuilder {
         216  +
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
         217  +
    pub(crate) token_value: ::std::option::Option<::std::string::String>,
         218  +
    pub(crate) stream_url: ::std::option::Option<::std::string::String>,
         219  +
    _request_id: Option<String>,
         220  +
}
         221  +
impl StartSessionOutputBuilder {
         222  +
    /// <p>The ID of the session.</p>
         223  +
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         224  +
        self.session_id = ::std::option::Option::Some(input.into());
         225  +
        self
         226  +
    }
         227  +
    /// <p>The ID of the session.</p>
         228  +
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         229  +
        self.session_id = input;
         230  +
        self
         231  +
    }
         232  +
    /// <p>The ID of the session.</p>
         233  +
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
         234  +
        &self.session_id
         235  +
    }
         236  +
    /// <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
         237  +
    pub fn token_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         238  +
        self.token_value = ::std::option::Option::Some(input.into());
         239  +
        self
         240  +
    }
         241  +
    /// <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
         242  +
    pub fn set_token_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         243  +
        self.token_value = input;
         244  +
        self
         245  +
    }
         246  +
    /// <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
         247  +
    pub fn get_token_value(&self) -> &::std::option::Option<::std::string::String> {
         248  +
        &self.token_value
         249  +
    }
         250  +
    /// <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p>
         251  +
    /// <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p>
         252  +
    /// <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
         253  +
    pub fn stream_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         254  +
        self.stream_url = ::std::option::Option::Some(input.into());
         255  +
        self
         256  +
    }
         257  +
    /// <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p>
         258  +
    /// <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p>
         259  +
    /// <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
         260  +
    pub fn set_stream_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         261  +
        self.stream_url = input;
         262  +
        self
         263  +
    }
         264  +
    /// <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p>
         265  +
    /// <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p>
         266  +
    /// <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
         267  +
    pub fn get_stream_url(&self) -> &::std::option::Option<::std::string::String> {
         268  +
        &self.stream_url
         269  +
    }
         270  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         271  +
        self._request_id = Some(request_id.into());
         272  +
        self
         273  +
    }
         274  +
         275  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         276  +
        self._request_id = request_id;
         277  +
        self
         278  +
    }
         279  +
    /// Consumes the builder and constructs a [`StartSessionOutput`](crate::operation::start_session::StartSessionOutput).
         280  +
    pub fn build(self) -> crate::operation::start_session::StartSessionOutput {
         281  +
        crate::operation::start_session::StartSessionOutput {
         282  +
            session_id: self.session_id,
         283  +
            token_value: self.token_value,
         284  +
            stream_url: self.stream_url,
         285  +
            _request_id: self._request_id,
         286  +
        }
         287  +
    }
         288  +
}