AWS SDK

AWS SDK

rev. eb19c4c7998eaae1210cb747286b497c3425236c

Files changed:

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/lib.rs

@@ -0,1 +0,201 @@
           1  +
#![allow(deprecated)]
           2  +
#![allow(unknown_lints)]
           3  +
#![allow(clippy::module_inception)]
           4  +
#![allow(clippy::upper_case_acronyms)]
           5  +
#![allow(clippy::large_enum_variant)]
           6  +
#![allow(clippy::wrong_self_convention)]
           7  +
#![allow(clippy::should_implement_trait)]
           8  +
#![allow(clippy::disallowed_names)]
           9  +
#![allow(clippy::vec_init_then_push)]
          10  +
#![allow(clippy::type_complexity)]
          11  +
#![allow(clippy::needless_return)]
          12  +
#![allow(clippy::derive_partial_eq_without_eq)]
          13  +
#![allow(clippy::result_large_err)]
          14  +
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::deprecated_semver)]
          16  +
#![allow(rustdoc::bare_urls)]
          17  +
#![allow(rustdoc::redundant_explicit_links)]
          18  +
#![allow(rustdoc::invalid_html_tags)]
          19  +
#![forbid(unsafe_code)]
          20  +
#![warn(missing_docs)]
          21  +
#![cfg_attr(docsrs, feature(doc_cfg))]
          22  +
//! The transactional data APIs for Amazon QLDB
          23  +
//!
          24  +
//! ## Getting Started
          25  +
//!
          26  +
//! > Examples are available for many services and operations, check out the
          27  +
//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
          28  +
//!
          29  +
//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
          30  +
//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-qldbsession` to
          31  +
//! your project, add the following to your **Cargo.toml** file:
          32  +
//!
          33  +
//! ```toml
          34  +
//! [dependencies]
          35  +
//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
          36  +
//! aws-sdk-qldbsession = "0.0.0-local"
          37  +
//! tokio = { version = "1", features = ["full"] }
          38  +
//! ```
          39  +
//!
          40  +
//! Then in code, a client can be created with the following:
          41  +
//!
          42  +
//! ```rust,no_run
          43  +
//! use aws_sdk_qldbsession as qldbsession;
          44  +
//!
          45  +
//! #[::tokio::main]
          46  +
//! async fn main() -> Result<(), qldbsession::Error> {
          47  +
//!     let config = aws_config::load_from_env().await;
          48  +
//!     let client = aws_sdk_qldbsession::Client::new(&config);
          49  +
//!
          50  +
//!     // ... make some calls with the client
          51  +
//!
          52  +
//!     Ok(())
          53  +
//! }
          54  +
//! ```
          55  +
//!
          56  +
//! See the [client documentation](https://docs.rs/aws-sdk-qldbsession/latest/aws_sdk_qldbsession/client/struct.Client.html)
          57  +
//! for information on what calls can be made, and the inputs and outputs for each of those calls.
          58  +
//!
          59  +
//! ## Using the SDK
          60  +
//!
          61  +
//! Until the SDK is released, we will be adding information about using the SDK to the
          62  +
//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
          63  +
//! additional sections for the guide by opening an issue and describing what you are trying to do.
          64  +
//!
          65  +
//! ## Getting Help
          66  +
//!
          67  +
//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
          68  +
//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
          69  +
//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
          70  +
//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
          71  +
//!
          72  +
//!
          73  +
//! # Crate Organization
          74  +
//!
          75  +
//! The entry point for most customers will be [`Client`], which exposes one method for each API
          76  +
//! offered by Amazon QLDB Session. The return value of each of these methods is a "fluent builder",
          77  +
//! where the different inputs for that API are added by builder-style function call chaining,
          78  +
//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
          79  +
//! either a successful output or a [`SdkError`](crate::error::SdkError).
          80  +
//!
          81  +
//! Some of these API inputs may be structs or enums to provide more complex structured information.
          82  +
//! These structs and enums live in [`types`](crate::types). There are some simpler types for
          83  +
//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
          84  +
//!
          85  +
//! All types required to configure a client via the [`Config`](crate::Config) struct live
          86  +
//! in [`config`](crate::config).
          87  +
//!
          88  +
//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
          89  +
//! is the input, output, and error type for that API, as well as builders to construct each of those.
          90  +
//!
          91  +
//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
          92  +
//! client can return. Any other error type can be converted to this `Error` type via the
          93  +
//! [`From`](std::convert::From) trait.
          94  +
//!
          95  +
//! The other modules within this crate are not required for normal usage.
          96  +
          97  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          98  +
pub use error_meta::Error;
          99  +
         100  +
#[doc(inline)]
         101  +
pub use config::Config;
         102  +
         103  +
/// Client for calling Amazon QLDB Session.
         104  +
/// ## Constructing a `Client`
         105  +
///
         106  +
/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
         107  +
/// crate should be used to automatically resolve this config using
         108  +
/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
         109  +
/// across multiple different AWS SDK clients. This config resolution process can be customized
         110  +
/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
         111  +
/// the [builder pattern] to customize the default config.
         112  +
///
         113  +
/// In the simplest case, creating a client looks as follows:
         114  +
/// ```rust,no_run
         115  +
/// # async fn wrapper() {
         116  +
/// let config = aws_config::load_from_env().await;
         117  +
/// let client = aws_sdk_qldbsession::Client::new(&config);
         118  +
/// # }
         119  +
/// ```
         120  +
///
         121  +
/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
         122  +
/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
         123  +
/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
         124  +
/// done as follows:
         125  +
///
         126  +
/// ```rust,no_run
         127  +
/// # async fn wrapper() {
         128  +
/// let sdk_config = ::aws_config::load_from_env().await;
         129  +
/// let config = aws_sdk_qldbsession::config::Builder::from(&sdk_config)
         130  +
/// # /*
         131  +
///     .some_service_specific_setting("value")
         132  +
/// # */
         133  +
///     .build();
         134  +
/// # }
         135  +
/// ```
         136  +
///
         137  +
/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
         138  +
///
         139  +
/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
         140  +
/// be done once at application start-up.
         141  +
///
         142  +
/// [`Config`]: crate::Config
         143  +
/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
         144  +
/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
         145  +
/// [`aws-config` docs]: https://docs.rs/aws-config/*
         146  +
/// [`aws-config`]: https://crates.io/crates/aws-config
         147  +
/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
         148  +
/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
         149  +
/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
         150  +
/// # Using the `Client`
         151  +
///
         152  +
/// A client has a function for every operation that can be performed by the service.
         153  +
/// For example, the [`SendCommand`](crate::operation::send_command) operation has
         154  +
/// a [`Client::send_command`], function which returns a builder for that operation.
         155  +
/// The fluent builder ultimately has a `send()` function that returns an async future that
         156  +
/// returns a result, as illustrated below:
         157  +
///
         158  +
/// ```rust,ignore
         159  +
/// let result = client.send_command()
         160  +
///     .session_token("example")
         161  +
///     .send()
         162  +
///     .await;
         163  +
/// ```
         164  +
///
         165  +
/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
         166  +
/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
         167  +
/// information.
         168  +
pub mod client;
         169  +
         170  +
/// Configuration for Amazon QLDB Session.
         171  +
pub mod config;
         172  +
         173  +
/// Common errors and error handling utilities.
         174  +
pub mod error;
         175  +
         176  +
mod error_meta;
         177  +
         178  +
/// Information about this crate.
         179  +
pub mod meta;
         180  +
         181  +
/// All operations that this crate can perform.
         182  +
pub mod operation;
         183  +
         184  +
/// Primitives such as `Blob` or `DateTime` used by other types.
         185  +
pub mod primitives;
         186  +
         187  +
/// Data structures used by operation inputs/outputs.
         188  +
pub mod types;
         189  +
         190  +
pub(crate) mod protocol_serde;
         191  +
         192  +
mod sdk_feature_tracker;
         193  +
         194  +
mod serialization_settings;
         195  +
         196  +
mod endpoint_lib;
         197  +
         198  +
mod json_errors;
         199  +
         200  +
#[doc(inline)]
         201  +
pub use client::Client;

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/meta.rs

@@ -0,1 +0,6 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) static API_METADATA: ::aws_runtime::user_agent::ApiMetadata =
           3  +
    ::aws_runtime::user_agent::ApiMetadata::new("qldbsession", crate::meta::PKG_VERSION);
           4  +
           5  +
/// Crate version number.
           6  +
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/operation.rs

@@ -0,1 +0,5 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_types::request_id::RequestId;
           3  +
           4  +
/// Types for the `SendCommand` operation.
           5  +
pub mod send_command;

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/operation/send_command.rs

@@ -0,1 +0,421 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `SendCommand`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct SendCommand;
           6  +
impl SendCommand {
           7  +
    /// Creates a new `SendCommand`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    pub(crate) async fn orchestrate(
          12  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          13  +
        input: crate::operation::send_command::SendCommandInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::send_command::SendCommandOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::send_command::SendCommandError,
          18  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          19  +
        >,
          20  +
    > {
          21  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          22  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          23  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          24  +
        >| {
          25  +
            err.map_service_error(|err| {
          26  +
                err.downcast::<crate::operation::send_command::SendCommandError>()
          27  +
                    .expect("correct error type")
          28  +
            })
          29  +
        };
          30  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          31  +
            .await
          32  +
            .map_err(map_err)?;
          33  +
        let output = context.finalize().map_err(map_err)?;
          34  +
        ::std::result::Result::Ok(
          35  +
            output
          36  +
                .downcast::<crate::operation::send_command::SendCommandOutput>()
          37  +
                .expect("correct output type"),
          38  +
        )
          39  +
    }
          40  +
          41  +
    pub(crate) async fn orchestrate_with_stop_point(
          42  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          43  +
        input: crate::operation::send_command::SendCommandInput,
          44  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          45  +
    ) -> ::std::result::Result<
          46  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          47  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          48  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          49  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          50  +
        >,
          51  +
    > {
          52  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          53  +
        use ::tracing::Instrument;
          54  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("QLDB Session", "SendCommand", input, runtime_plugins, stop_point)
          55  +
            // Create a parent span for the entire operation. Includes a random, internal-only,
          56  +
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          57  +
            .instrument(::tracing::debug_span!(
          58  +
                "QLDB Session.SendCommand",
          59  +
                "rpc.service" = "QLDB Session",
          60  +
                "rpc.method" = "SendCommand",
          61  +
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          62  +
                "rpc.system" = "aws-api",
          63  +
            ))
          64  +
            .await
          65  +
    }
          66  +
          67  +
    pub(crate) fn operation_runtime_plugins(
          68  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          69  +
        client_config: &crate::config::Config,
          70  +
        config_override: ::std::option::Option<crate::config::Builder>,
          71  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          72  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          73  +
          74  +
        if let ::std::option::Option::Some(config_override) = config_override {
          75  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          76  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          77  +
            }
          78  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          79  +
                config_override,
          80  +
                client_config.config.clone(),
          81  +
                &client_config.runtime_components,
          82  +
            ));
          83  +
        }
          84  +
        runtime_plugins
          85  +
    }
          86  +
}
          87  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SendCommand {
          88  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          89  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SendCommand");
          90  +
          91  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          92  +
            SendCommandRequestSerializer,
          93  +
        ));
          94  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
          95  +
            SendCommandResponseDeserializer,
          96  +
        ));
          97  +
          98  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
          99  +
            crate::config::auth::Params::builder()
         100  +
                .operation_name("SendCommand")
         101  +
                .build()
         102  +
                .expect("required fields set"),
         103  +
        ));
         104  +
         105  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         106  +
            "SendCommand",
         107  +
            "QLDB Session",
         108  +
        ));
         109  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         110  +
        signing_options.double_uri_encode = true;
         111  +
        signing_options.content_sha256_header = false;
         112  +
        signing_options.normalize_uri_path = true;
         113  +
        signing_options.payload_override = None;
         114  +
         115  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         116  +
            signing_options,
         117  +
            ..::std::default::Default::default()
         118  +
        });
         119  +
         120  +
        ::std::option::Option::Some(cfg.freeze())
         121  +
    }
         122  +
         123  +
    fn runtime_components(
         124  +
        &self,
         125  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         126  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         127  +
        #[allow(unused_mut)]
         128  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SendCommand")
         129  +
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
         130  +
            .with_interceptor(SendCommandEndpointParamsInterceptor)
         131  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         132  +
                crate::operation::send_command::SendCommandError,
         133  +
            >::new())
         134  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         135  +
                crate::operation::send_command::SendCommandError,
         136  +
            >::new())
         137  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         138  +
                crate::operation::send_command::SendCommandError,
         139  +
            >::new());
         140  +
         141  +
        ::std::borrow::Cow::Owned(rcb)
         142  +
    }
         143  +
}
         144  +
         145  +
#[derive(Debug)]
         146  +
struct SendCommandResponseDeserializer;
         147  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SendCommandResponseDeserializer {
         148  +
    fn deserialize_nonstreaming(
         149  +
        &self,
         150  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         151  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         152  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         153  +
        let headers = response.headers();
         154  +
        let body = response.body().bytes().expect("body loaded");
         155  +
        #[allow(unused_mut)]
         156  +
        let mut force_error = false;
         157  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         158  +
        let parse_result = if !success && status != 200 || force_error {
         159  +
            crate::protocol_serde::shape_send_command::de_send_command_http_error(status, headers, body)
         160  +
        } else {
         161  +
            crate::protocol_serde::shape_send_command::de_send_command_http_response(status, headers, body)
         162  +
        };
         163  +
        crate::protocol_serde::type_erase_result(parse_result)
         164  +
    }
         165  +
}
         166  +
#[derive(Debug)]
         167  +
struct SendCommandRequestSerializer;
         168  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SendCommandRequestSerializer {
         169  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         170  +
    fn serialize_input(
         171  +
        &self,
         172  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         173  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         174  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         175  +
        let input = input
         176  +
            .downcast::<crate::operation::send_command::SendCommandInput>()
         177  +
            .expect("correct type");
         178  +
        let _header_serialization_settings = _cfg
         179  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         180  +
            .cloned()
         181  +
            .unwrap_or_default();
         182  +
        let mut request_builder = {
         183  +
            #[allow(clippy::uninlined_format_args)]
         184  +
            fn uri_base(
         185  +
                _input: &crate::operation::send_command::SendCommandInput,
         186  +
                output: &mut ::std::string::String,
         187  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         188  +
                use ::std::fmt::Write as _;
         189  +
                ::std::write!(output, "/").expect("formatting should succeed");
         190  +
                ::std::result::Result::Ok(())
         191  +
            }
         192  +
            #[allow(clippy::unnecessary_wraps)]
         193  +
            fn update_http_builder(
         194  +
                input: &crate::operation::send_command::SendCommandInput,
         195  +
                builder: ::http::request::Builder,
         196  +
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         197  +
                let mut uri = ::std::string::String::new();
         198  +
                uri_base(input, &mut uri)?;
         199  +
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         200  +
            }
         201  +
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         202  +
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
         203  +
            builder = _header_serialization_settings.set_default_header(
         204  +
                builder,
         205  +
                ::http::header::HeaderName::from_static("x-amz-target"),
         206  +
                "QLDBSession.SendCommand",
         207  +
            );
         208  +
            builder
         209  +
        };
         210  +
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_send_command::ser_send_command_input(&input)?);
         211  +
        if let Some(content_length) = body.content_length() {
         212  +
            let content_length = content_length.to_string();
         213  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         214  +
        }
         215  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         216  +
    }
         217  +
}
         218  +
#[derive(Debug)]
         219  +
struct SendCommandEndpointParamsInterceptor;
         220  +
         221  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SendCommandEndpointParamsInterceptor {
         222  +
    fn name(&self) -> &'static str {
         223  +
        "SendCommandEndpointParamsInterceptor"
         224  +
    }
         225  +
         226  +
    fn read_before_execution(
         227  +
        &self,
         228  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         229  +
            '_,
         230  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         231  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         232  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         233  +
        >,
         234  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         235  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         236  +
        let _input = context
         237  +
            .input()
         238  +
            .downcast_ref::<SendCommandInput>()
         239  +
            .ok_or("failed to downcast to SendCommandInput")?;
         240  +
         241  +
        let params = crate::config::endpoint::Params::builder()
         242  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         243  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         244  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         245  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         246  +
            .build()
         247  +
            .map_err(|err| {
         248  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         249  +
            })?;
         250  +
        cfg.interceptor_state()
         251  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         252  +
        ::std::result::Result::Ok(())
         253  +
    }
         254  +
}
         255  +
         256  +
// The get_* functions below are generated from JMESPath expressions in the
         257  +
// operationContextParams trait. They target the operation's input shape.
         258  +
         259  +
/// Error type for the `SendCommandError` operation.
         260  +
#[non_exhaustive]
         261  +
#[derive(::std::fmt::Debug)]
         262  +
pub enum SendCommandError {
         263  +
    /// <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
         264  +
    BadRequestException(crate::types::error::BadRequestException),
         265  +
    /// <p>Returned when the request exceeds the processing capacity of the ledger.</p>
         266  +
    CapacityExceededException(crate::types::error::CapacityExceededException),
         267  +
    /// <p>Returned if the session doesn't exist anymore because it timed out or expired.</p>
         268  +
    InvalidSessionException(crate::types::error::InvalidSessionException),
         269  +
    /// <p>Returned if a resource limit such as number of active sessions is exceeded.</p>
         270  +
    LimitExceededException(crate::types::error::LimitExceededException),
         271  +
    /// <p>Returned when a transaction cannot be written to the journal due to a failure in the verification phase of <i>optimistic concurrency control</i> (OCC).</p>
         272  +
    OccConflictException(crate::types::error::OccConflictException),
         273  +
    /// <p>Returned when the rate of requests exceeds the allowed throughput.</p>
         274  +
    RateExceededException(crate::types::error::RateExceededException),
         275  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         276  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         277  +
    variable wildcard pattern and check `.code()`:
         278  +
     \
         279  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         280  +
     \
         281  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SendCommandError) for what information is available for the error.")]
         282  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         283  +
}
         284  +
impl SendCommandError {
         285  +
    /// Creates the `SendCommandError::Unhandled` variant from any error type.
         286  +
    pub fn unhandled(
         287  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         288  +
    ) -> Self {
         289  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         290  +
            source: err.into(),
         291  +
            meta: ::std::default::Default::default(),
         292  +
        })
         293  +
    }
         294  +
         295  +
    /// Creates the `SendCommandError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         296  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         297  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         298  +
            source: err.clone().into(),
         299  +
            meta: err,
         300  +
        })
         301  +
    }
         302  +
    ///
         303  +
    /// Returns error metadata, which includes the error code, message,
         304  +
    /// request ID, and potentially additional information.
         305  +
    ///
         306  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         307  +
        match self {
         308  +
            Self::BadRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         309  +
            Self::CapacityExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         310  +
            Self::InvalidSessionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         311  +
            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         312  +
            Self::OccConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         313  +
            Self::RateExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         314  +
            Self::Unhandled(e) => &e.meta,
         315  +
        }
         316  +
    }
         317  +
    /// Returns `true` if the error kind is `SendCommandError::BadRequestException`.
         318  +
    pub fn is_bad_request_exception(&self) -> bool {
         319  +
        matches!(self, Self::BadRequestException(_))
         320  +
    }
         321  +
    /// Returns `true` if the error kind is `SendCommandError::CapacityExceededException`.
         322  +
    pub fn is_capacity_exceeded_exception(&self) -> bool {
         323  +
        matches!(self, Self::CapacityExceededException(_))
         324  +
    }
         325  +
    /// Returns `true` if the error kind is `SendCommandError::InvalidSessionException`.
         326  +
    pub fn is_invalid_session_exception(&self) -> bool {
         327  +
        matches!(self, Self::InvalidSessionException(_))
         328  +
    }
         329  +
    /// Returns `true` if the error kind is `SendCommandError::LimitExceededException`.
         330  +
    pub fn is_limit_exceeded_exception(&self) -> bool {
         331  +
        matches!(self, Self::LimitExceededException(_))
         332  +
    }
         333  +
    /// Returns `true` if the error kind is `SendCommandError::OccConflictException`.
         334  +
    pub fn is_occ_conflict_exception(&self) -> bool {
         335  +
        matches!(self, Self::OccConflictException(_))
         336  +
    }
         337  +
    /// Returns `true` if the error kind is `SendCommandError::RateExceededException`.
         338  +
    pub fn is_rate_exceeded_exception(&self) -> bool {
         339  +
        matches!(self, Self::RateExceededException(_))
         340  +
    }
         341  +
}
         342  +
impl ::std::error::Error for SendCommandError {
         343  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         344  +
        match self {
         345  +
            Self::BadRequestException(_inner) => ::std::option::Option::Some(_inner),
         346  +
            Self::CapacityExceededException(_inner) => ::std::option::Option::Some(_inner),
         347  +
            Self::InvalidSessionException(_inner) => ::std::option::Option::Some(_inner),
         348  +
            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
         349  +
            Self::OccConflictException(_inner) => ::std::option::Option::Some(_inner),
         350  +
            Self::RateExceededException(_inner) => ::std::option::Option::Some(_inner),
         351  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         352  +
        }
         353  +
    }
         354  +
}
         355  +
impl ::std::fmt::Display for SendCommandError {
         356  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         357  +
        match self {
         358  +
            Self::BadRequestException(_inner) => _inner.fmt(f),
         359  +
            Self::CapacityExceededException(_inner) => _inner.fmt(f),
         360  +
            Self::InvalidSessionException(_inner) => _inner.fmt(f),
         361  +
            Self::LimitExceededException(_inner) => _inner.fmt(f),
         362  +
            Self::OccConflictException(_inner) => _inner.fmt(f),
         363  +
            Self::RateExceededException(_inner) => _inner.fmt(f),
         364  +
            Self::Unhandled(_inner) => {
         365  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         366  +
                    write!(f, "unhandled error ({code})")
         367  +
                } else {
         368  +
                    f.write_str("unhandled error")
         369  +
                }
         370  +
            }
         371  +
        }
         372  +
    }
         373  +
}
         374  +
impl ::aws_smithy_types::retry::ProvideErrorKind for SendCommandError {
         375  +
    fn code(&self) -> ::std::option::Option<&str> {
         376  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         377  +
    }
         378  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         379  +
        ::std::option::Option::None
         380  +
    }
         381  +
}
         382  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SendCommandError {
         383  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         384  +
        match self {
         385  +
            Self::BadRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         386  +
            Self::CapacityExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         387  +
            Self::InvalidSessionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         388  +
            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         389  +
            Self::OccConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         390  +
            Self::RateExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         391  +
            Self::Unhandled(_inner) => &_inner.meta,
         392  +
        }
         393  +
    }
         394  +
}
         395  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SendCommandError {
         396  +
    fn create_unhandled_error(
         397  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         398  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         399  +
    ) -> Self {
         400  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         401  +
            source,
         402  +
            meta: meta.unwrap_or_default(),
         403  +
        })
         404  +
    }
         405  +
}
         406  +
impl ::aws_types::request_id::RequestId for crate::operation::send_command::SendCommandError {
         407  +
    fn request_id(&self) -> Option<&str> {
         408  +
        self.meta().request_id()
         409  +
    }
         410  +
}
         411  +
         412  +
pub use crate::operation::send_command::_send_command_output::SendCommandOutput;
         413  +
         414  +
pub use crate::operation::send_command::_send_command_input::SendCommandInput;
         415  +
         416  +
mod _send_command_input;
         417  +
         418  +
mod _send_command_output;
         419  +
         420  +
/// Builders
         421  +
pub mod builders;

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/operation/send_command/_send_command_input.rs

@@ -0,1 +0,208 @@
           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 SendCommandInput {
           6  +
    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
           7  +
    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
           8  +
    pub session_token: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
          10  +
    pub start_session: ::std::option::Option<crate::types::StartSessionRequest>,
          11  +
    /// <p>Command to start a new transaction.</p>
          12  +
    pub start_transaction: ::std::option::Option<crate::types::StartTransactionRequest>,
          13  +
    /// <p>Command to end the current session.</p>
          14  +
    pub end_session: ::std::option::Option<crate::types::EndSessionRequest>,
          15  +
    /// <p>Command to commit the specified transaction.</p>
          16  +
    pub commit_transaction: ::std::option::Option<crate::types::CommitTransactionRequest>,
          17  +
    /// <p>Command to abort the current transaction.</p>
          18  +
    pub abort_transaction: ::std::option::Option<crate::types::AbortTransactionRequest>,
          19  +
    /// <p>Command to execute a statement in the specified transaction.</p>
          20  +
    pub execute_statement: ::std::option::Option<crate::types::ExecuteStatementRequest>,
          21  +
    /// <p>Command to fetch a page.</p>
          22  +
    pub fetch_page: ::std::option::Option<crate::types::FetchPageRequest>,
          23  +
}
          24  +
impl SendCommandInput {
          25  +
    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
          26  +
    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          27  +
    pub fn session_token(&self) -> ::std::option::Option<&str> {
          28  +
        self.session_token.as_deref()
          29  +
    }
          30  +
    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
          31  +
    pub fn start_session(&self) -> ::std::option::Option<&crate::types::StartSessionRequest> {
          32  +
        self.start_session.as_ref()
          33  +
    }
          34  +
    /// <p>Command to start a new transaction.</p>
          35  +
    pub fn start_transaction(&self) -> ::std::option::Option<&crate::types::StartTransactionRequest> {
          36  +
        self.start_transaction.as_ref()
          37  +
    }
          38  +
    /// <p>Command to end the current session.</p>
          39  +
    pub fn end_session(&self) -> ::std::option::Option<&crate::types::EndSessionRequest> {
          40  +
        self.end_session.as_ref()
          41  +
    }
          42  +
    /// <p>Command to commit the specified transaction.</p>
          43  +
    pub fn commit_transaction(&self) -> ::std::option::Option<&crate::types::CommitTransactionRequest> {
          44  +
        self.commit_transaction.as_ref()
          45  +
    }
          46  +
    /// <p>Command to abort the current transaction.</p>
          47  +
    pub fn abort_transaction(&self) -> ::std::option::Option<&crate::types::AbortTransactionRequest> {
          48  +
        self.abort_transaction.as_ref()
          49  +
    }
          50  +
    /// <p>Command to execute a statement in the specified transaction.</p>
          51  +
    pub fn execute_statement(&self) -> ::std::option::Option<&crate::types::ExecuteStatementRequest> {
          52  +
        self.execute_statement.as_ref()
          53  +
    }
          54  +
    /// <p>Command to fetch a page.</p>
          55  +
    pub fn fetch_page(&self) -> ::std::option::Option<&crate::types::FetchPageRequest> {
          56  +
        self.fetch_page.as_ref()
          57  +
    }
          58  +
}
          59  +
impl SendCommandInput {
          60  +
    /// Creates a new builder-style object to manufacture [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
          61  +
    pub fn builder() -> crate::operation::send_command::builders::SendCommandInputBuilder {
          62  +
        crate::operation::send_command::builders::SendCommandInputBuilder::default()
          63  +
    }
          64  +
}
          65  +
          66  +
/// A builder for [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
          67  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          68  +
#[non_exhaustive]
          69  +
pub struct SendCommandInputBuilder {
          70  +
    pub(crate) session_token: ::std::option::Option<::std::string::String>,
          71  +
    pub(crate) start_session: ::std::option::Option<crate::types::StartSessionRequest>,
          72  +
    pub(crate) start_transaction: ::std::option::Option<crate::types::StartTransactionRequest>,
          73  +
    pub(crate) end_session: ::std::option::Option<crate::types::EndSessionRequest>,
          74  +
    pub(crate) commit_transaction: ::std::option::Option<crate::types::CommitTransactionRequest>,
          75  +
    pub(crate) abort_transaction: ::std::option::Option<crate::types::AbortTransactionRequest>,
          76  +
    pub(crate) execute_statement: ::std::option::Option<crate::types::ExecuteStatementRequest>,
          77  +
    pub(crate) fetch_page: ::std::option::Option<crate::types::FetchPageRequest>,
          78  +
}
          79  +
impl SendCommandInputBuilder {
          80  +
    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
          81  +
    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          82  +
    pub fn session_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          83  +
        self.session_token = ::std::option::Option::Some(input.into());
          84  +
        self
          85  +
    }
          86  +
    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
          87  +
    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          88  +
    pub fn set_session_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          89  +
        self.session_token = input;
          90  +
        self
          91  +
    }
          92  +
    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
          93  +
    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          94  +
    pub fn get_session_token(&self) -> &::std::option::Option<::std::string::String> {
          95  +
        &self.session_token
          96  +
    }
          97  +
    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
          98  +
    pub fn start_session(mut self, input: crate::types::StartSessionRequest) -> Self {
          99  +
        self.start_session = ::std::option::Option::Some(input);
         100  +
        self
         101  +
    }
         102  +
    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
         103  +
    pub fn set_start_session(mut self, input: ::std::option::Option<crate::types::StartSessionRequest>) -> Self {
         104  +
        self.start_session = input;
         105  +
        self
         106  +
    }
         107  +
    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
         108  +
    pub fn get_start_session(&self) -> &::std::option::Option<crate::types::StartSessionRequest> {
         109  +
        &self.start_session
         110  +
    }
         111  +
    /// <p>Command to start a new transaction.</p>
         112  +
    pub fn start_transaction(mut self, input: crate::types::StartTransactionRequest) -> Self {
         113  +
        self.start_transaction = ::std::option::Option::Some(input);
         114  +
        self
         115  +
    }
         116  +
    /// <p>Command to start a new transaction.</p>
         117  +
    pub fn set_start_transaction(mut self, input: ::std::option::Option<crate::types::StartTransactionRequest>) -> Self {
         118  +
        self.start_transaction = input;
         119  +
        self
         120  +
    }
         121  +
    /// <p>Command to start a new transaction.</p>
         122  +
    pub fn get_start_transaction(&self) -> &::std::option::Option<crate::types::StartTransactionRequest> {
         123  +
        &self.start_transaction
         124  +
    }
         125  +
    /// <p>Command to end the current session.</p>
         126  +
    pub fn end_session(mut self, input: crate::types::EndSessionRequest) -> Self {
         127  +
        self.end_session = ::std::option::Option::Some(input);
         128  +
        self
         129  +
    }
         130  +
    /// <p>Command to end the current session.</p>
         131  +
    pub fn set_end_session(mut self, input: ::std::option::Option<crate::types::EndSessionRequest>) -> Self {
         132  +
        self.end_session = input;
         133  +
        self
         134  +
    }
         135  +
    /// <p>Command to end the current session.</p>
         136  +
    pub fn get_end_session(&self) -> &::std::option::Option<crate::types::EndSessionRequest> {
         137  +
        &self.end_session
         138  +
    }
         139  +
    /// <p>Command to commit the specified transaction.</p>
         140  +
    pub fn commit_transaction(mut self, input: crate::types::CommitTransactionRequest) -> Self {
         141  +
        self.commit_transaction = ::std::option::Option::Some(input);
         142  +
        self
         143  +
    }
         144  +
    /// <p>Command to commit the specified transaction.</p>
         145  +
    pub fn set_commit_transaction(mut self, input: ::std::option::Option<crate::types::CommitTransactionRequest>) -> Self {
         146  +
        self.commit_transaction = input;
         147  +
        self
         148  +
    }
         149  +
    /// <p>Command to commit the specified transaction.</p>
         150  +
    pub fn get_commit_transaction(&self) -> &::std::option::Option<crate::types::CommitTransactionRequest> {
         151  +
        &self.commit_transaction
         152  +
    }
         153  +
    /// <p>Command to abort the current transaction.</p>
         154  +
    pub fn abort_transaction(mut self, input: crate::types::AbortTransactionRequest) -> Self {
         155  +
        self.abort_transaction = ::std::option::Option::Some(input);
         156  +
        self
         157  +
    }
         158  +
    /// <p>Command to abort the current transaction.</p>
         159  +
    pub fn set_abort_transaction(mut self, input: ::std::option::Option<crate::types::AbortTransactionRequest>) -> Self {
         160  +
        self.abort_transaction = input;
         161  +
        self
         162  +
    }
         163  +
    /// <p>Command to abort the current transaction.</p>
         164  +
    pub fn get_abort_transaction(&self) -> &::std::option::Option<crate::types::AbortTransactionRequest> {
         165  +
        &self.abort_transaction
         166  +
    }
         167  +
    /// <p>Command to execute a statement in the specified transaction.</p>
         168  +
    pub fn execute_statement(mut self, input: crate::types::ExecuteStatementRequest) -> Self {
         169  +
        self.execute_statement = ::std::option::Option::Some(input);
         170  +
        self
         171  +
    }
         172  +
    /// <p>Command to execute a statement in the specified transaction.</p>
         173  +
    pub fn set_execute_statement(mut self, input: ::std::option::Option<crate::types::ExecuteStatementRequest>) -> Self {
         174  +
        self.execute_statement = input;
         175  +
        self
         176  +
    }
         177  +
    /// <p>Command to execute a statement in the specified transaction.</p>
         178  +
    pub fn get_execute_statement(&self) -> &::std::option::Option<crate::types::ExecuteStatementRequest> {
         179  +
        &self.execute_statement
         180  +
    }
         181  +
    /// <p>Command to fetch a page.</p>
         182  +
    pub fn fetch_page(mut self, input: crate::types::FetchPageRequest) -> Self {
         183  +
        self.fetch_page = ::std::option::Option::Some(input);
         184  +
        self
         185  +
    }
         186  +
    /// <p>Command to fetch a page.</p>
         187  +
    pub fn set_fetch_page(mut self, input: ::std::option::Option<crate::types::FetchPageRequest>) -> Self {
         188  +
        self.fetch_page = input;
         189  +
        self
         190  +
    }
         191  +
    /// <p>Command to fetch a page.</p>
         192  +
    pub fn get_fetch_page(&self) -> &::std::option::Option<crate::types::FetchPageRequest> {
         193  +
        &self.fetch_page
         194  +
    }
         195  +
    /// Consumes the builder and constructs a [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
         196  +
    pub fn build(self) -> ::std::result::Result<crate::operation::send_command::SendCommandInput, ::aws_smithy_types::error::operation::BuildError> {
         197  +
        ::std::result::Result::Ok(crate::operation::send_command::SendCommandInput {
         198  +
            session_token: self.session_token,
         199  +
            start_session: self.start_session,
         200  +
            start_transaction: self.start_transaction,
         201  +
            end_session: self.end_session,
         202  +
            commit_transaction: self.commit_transaction,
         203  +
            abort_transaction: self.abort_transaction,
         204  +
            execute_statement: self.execute_statement,
         205  +
            fetch_page: self.fetch_page,
         206  +
        })
         207  +
    }
         208  +
}

tmp-codegen-diff/aws-sdk/sdk/qldbsession/src/operation/send_command/_send_command_output.rs

@@ -0,1 +0,198 @@
           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 SendCommandOutput {
           6  +
    /// <p>Contains the details of the started session that includes a session token. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
           7  +
    pub start_session: ::std::option::Option<crate::types::StartSessionResult>,
           8  +
    /// <p>Contains the details of the started transaction.</p>
           9  +
    pub start_transaction: ::std::option::Option<crate::types::StartTransactionResult>,
          10  +
    /// <p>Contains the details of the ended session.</p>
          11  +
    pub end_session: ::std::option::Option<crate::types::EndSessionResult>,
          12  +
    /// <p>Contains the details of the committed transaction.</p>
          13  +
    pub commit_transaction: ::std::option::Option<crate::types::CommitTransactionResult>,
          14  +
    /// <p>Contains the details of the aborted transaction.</p>
          15  +
    pub abort_transaction: ::std::option::Option<crate::types::AbortTransactionResult>,
          16  +
    /// <p>Contains the details of the executed statement.</p>
          17  +
    pub execute_statement: ::std::option::Option<crate::types::ExecuteStatementResult>,
          18  +
    /// <p>Contains the details of the fetched page.</p>
          19  +
    pub fetch_page: ::std::option::Option<crate::types::FetchPageResult>,
          20  +
    _request_id: Option<String>,
          21  +
}
          22  +
impl SendCommandOutput {
          23  +
    /// <p>Contains the details of the started session that includes a session token. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          24  +
    pub fn start_session(&self) -> ::std::option::Option<&crate::types::StartSessionResult> {
          25  +
        self.start_session.as_ref()
          26  +
    }
          27  +
    /// <p>Contains the details of the started transaction.</p>
          28  +
    pub fn start_transaction(&self) -> ::std::option::Option<&crate::types::StartTransactionResult> {
          29  +
        self.start_transaction.as_ref()
          30  +
    }
          31  +
    /// <p>Contains the details of the ended session.</p>
          32  +
    pub fn end_session(&self) -> ::std::option::Option<&crate::types::EndSessionResult> {
          33  +
        self.end_session.as_ref()
          34  +
    }
          35  +
    /// <p>Contains the details of the committed transaction.</p>
          36  +
    pub fn commit_transaction(&self) -> ::std::option::Option<&crate::types::CommitTransactionResult> {
          37  +
        self.commit_transaction.as_ref()
          38  +
    }
          39  +
    /// <p>Contains the details of the aborted transaction.</p>
          40  +
    pub fn abort_transaction(&self) -> ::std::option::Option<&crate::types::AbortTransactionResult> {
          41  +
        self.abort_transaction.as_ref()
          42  +
    }
          43  +
    /// <p>Contains the details of the executed statement.</p>
          44  +
    pub fn execute_statement(&self) -> ::std::option::Option<&crate::types::ExecuteStatementResult> {
          45  +
        self.execute_statement.as_ref()
          46  +
    }
          47  +
    /// <p>Contains the details of the fetched page.</p>
          48  +
    pub fn fetch_page(&self) -> ::std::option::Option<&crate::types::FetchPageResult> {
          49  +
        self.fetch_page.as_ref()
          50  +
    }
          51  +
}
          52  +
impl ::aws_types::request_id::RequestId for SendCommandOutput {
          53  +
    fn request_id(&self) -> Option<&str> {
          54  +
        self._request_id.as_deref()
          55  +
    }
          56  +
}
          57  +
impl SendCommandOutput {
          58  +
    /// Creates a new builder-style object to manufacture [`SendCommandOutput`](crate::operation::send_command::SendCommandOutput).
          59  +
    pub fn builder() -> crate::operation::send_command::builders::SendCommandOutputBuilder {
          60  +
        crate::operation::send_command::builders::SendCommandOutputBuilder::default()
          61  +
    }
          62  +
}
          63  +
          64  +
/// A builder for [`SendCommandOutput`](crate::operation::send_command::SendCommandOutput).
          65  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          66  +
#[non_exhaustive]
          67  +
pub struct SendCommandOutputBuilder {
          68  +
    pub(crate) start_session: ::std::option::Option<crate::types::StartSessionResult>,
          69  +
    pub(crate) start_transaction: ::std::option::Option<crate::types::StartTransactionResult>,
          70  +
    pub(crate) end_session: ::std::option::Option<crate::types::EndSessionResult>,
          71  +
    pub(crate) commit_transaction: ::std::option::Option<crate::types::CommitTransactionResult>,
          72  +
    pub(crate) abort_transaction: ::std::option::Option<crate::types::AbortTransactionResult>,
          73  +
    pub(crate) execute_statement: ::std::option::Option<crate::types::ExecuteStatementResult>,
          74  +
    pub(crate) fetch_page: ::std::option::Option<crate::types::FetchPageResult>,
          75  +
    _request_id: Option<String>,
          76  +
}
          77  +
impl SendCommandOutputBuilder {
          78  +
    /// <p>Contains the details of the started session that includes a session token. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          79  +
    pub fn start_session(mut self, input: crate::types::StartSessionResult) -> Self {
          80  +
        self.start_session = ::std::option::Option::Some(input);
          81  +
        self
          82  +
    }
          83  +
    /// <p>Contains the details of the started session that includes a session token. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          84  +
    pub fn set_start_session(mut self, input: ::std::option::Option<crate::types::StartSessionResult>) -> Self {
          85  +
        self.start_session = input;
          86  +
        self
          87  +
    }
          88  +
    /// <p>Contains the details of the started session that includes a session token. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
          89  +
    pub fn get_start_session(&self) -> &::std::option::Option<crate::types::StartSessionResult> {
          90  +
        &self.start_session
          91  +
    }
          92  +
    /// <p>Contains the details of the started transaction.</p>
          93  +
    pub fn start_transaction(mut self, input: crate::types::StartTransactionResult) -> Self {
          94  +
        self.start_transaction = ::std::option::Option::Some(input);
          95  +
        self
          96  +
    }
          97  +
    /// <p>Contains the details of the started transaction.</p>
          98  +
    pub fn set_start_transaction(mut self, input: ::std::option::Option<crate::types::StartTransactionResult>) -> Self {
          99  +
        self.start_transaction = input;
         100  +
        self
         101  +
    }
         102  +
    /// <p>Contains the details of the started transaction.</p>
         103  +
    pub fn get_start_transaction(&self) -> &::std::option::Option<crate::types::StartTransactionResult> {
         104  +
        &self.start_transaction
         105  +
    }
         106  +
    /// <p>Contains the details of the ended session.</p>
         107  +
    pub fn end_session(mut self, input: crate::types::EndSessionResult) -> Self {
         108  +
        self.end_session = ::std::option::Option::Some(input);
         109  +
        self
         110  +
    }
         111  +
    /// <p>Contains the details of the ended session.</p>
         112  +
    pub fn set_end_session(mut self, input: ::std::option::Option<crate::types::EndSessionResult>) -> Self {
         113  +
        self.end_session = input;
         114  +
        self
         115  +
    }
         116  +
    /// <p>Contains the details of the ended session.</p>
         117  +
    pub fn get_end_session(&self) -> &::std::option::Option<crate::types::EndSessionResult> {
         118  +
        &self.end_session
         119  +
    }
         120  +
    /// <p>Contains the details of the committed transaction.</p>
         121  +
    pub fn commit_transaction(mut self, input: crate::types::CommitTransactionResult) -> Self {
         122  +
        self.commit_transaction = ::std::option::Option::Some(input);
         123  +
        self
         124  +
    }
         125  +
    /// <p>Contains the details of the committed transaction.</p>
         126  +
    pub fn set_commit_transaction(mut self, input: ::std::option::Option<crate::types::CommitTransactionResult>) -> Self {
         127  +
        self.commit_transaction = input;
         128  +
        self
         129  +
    }
         130  +
    /// <p>Contains the details of the committed transaction.</p>
         131  +
    pub fn get_commit_transaction(&self) -> &::std::option::Option<crate::types::CommitTransactionResult> {
         132  +
        &self.commit_transaction
         133  +
    }
         134  +
    /// <p>Contains the details of the aborted transaction.</p>
         135  +
    pub fn abort_transaction(mut self, input: crate::types::AbortTransactionResult) -> Self {
         136  +
        self.abort_transaction = ::std::option::Option::Some(input);
         137  +
        self
         138  +
    }
         139  +
    /// <p>Contains the details of the aborted transaction.</p>
         140  +
    pub fn set_abort_transaction(mut self, input: ::std::option::Option<crate::types::AbortTransactionResult>) -> Self {
         141  +
        self.abort_transaction = input;
         142  +
        self
         143  +
    }
         144  +
    /// <p>Contains the details of the aborted transaction.</p>
         145  +
    pub fn get_abort_transaction(&self) -> &::std::option::Option<crate::types::AbortTransactionResult> {
         146  +
        &self.abort_transaction
         147  +
    }
         148  +
    /// <p>Contains the details of the executed statement.</p>
         149  +
    pub fn execute_statement(mut self, input: crate::types::ExecuteStatementResult) -> Self {
         150  +
        self.execute_statement = ::std::option::Option::Some(input);
         151  +
        self
         152  +
    }
         153  +
    /// <p>Contains the details of the executed statement.</p>
         154  +
    pub fn set_execute_statement(mut self, input: ::std::option::Option<crate::types::ExecuteStatementResult>) -> Self {
         155  +
        self.execute_statement = input;
         156  +
        self
         157  +
    }
         158  +
    /// <p>Contains the details of the executed statement.</p>
         159  +
    pub fn get_execute_statement(&self) -> &::std::option::Option<crate::types::ExecuteStatementResult> {
         160  +
        &self.execute_statement
         161  +
    }
         162  +
    /// <p>Contains the details of the fetched page.</p>
         163  +
    pub fn fetch_page(mut self, input: crate::types::FetchPageResult) -> Self {
         164  +
        self.fetch_page = ::std::option::Option::Some(input);
         165  +
        self
         166  +
    }
         167  +
    /// <p>Contains the details of the fetched page.</p>
         168  +
    pub fn set_fetch_page(mut self, input: ::std::option::Option<crate::types::FetchPageResult>) -> Self {
         169  +
        self.fetch_page = input;
         170  +
        self
         171  +
    }
         172  +
    /// <p>Contains the details of the fetched page.</p>
         173  +
    pub fn get_fetch_page(&self) -> &::std::option::Option<crate::types::FetchPageResult> {
         174  +
        &self.fetch_page
         175  +
    }
         176  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         177  +
        self._request_id = Some(request_id.into());
         178  +
        self
         179  +
    }
         180  +
         181  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         182  +
        self._request_id = request_id;
         183  +
        self
         184  +
    }
         185  +
    /// Consumes the builder and constructs a [`SendCommandOutput`](crate::operation::send_command::SendCommandOutput).
         186  +
    pub fn build(self) -> crate::operation::send_command::SendCommandOutput {
         187  +
        crate::operation::send_command::SendCommandOutput {
         188  +
            start_session: self.start_session,
         189  +
            start_transaction: self.start_transaction,
         190  +
            end_session: self.end_session,
         191  +
            commit_transaction: self.commit_transaction,
         192  +
            abort_transaction: self.abort_transaction,
         193  +
            execute_statement: self.execute_statement,
         194  +
            fetch_page: self.fetch_page,
         195  +
            _request_id: self._request_id,
         196  +
        }
         197  +
    }
         198  +
}