AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3 (ignoring whitespace)

Files changed:

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

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

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

@@ -0,1 +0,247 @@
           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 ListOpsItemEventsInput {
           6  +
    /// <p>One or more OpsItem filters. Use a filter to return a more specific list of results.</p>
           7  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::OpsItemEventFilter>>,
           8  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
           9  +
    pub max_results: ::std::option::Option<i32>,
          10  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
          11  +
    pub next_token: ::std::option::Option<::std::string::String>,
          12  +
}
          13  +
impl ListOpsItemEventsInput {
          14  +
    /// <p>One or more OpsItem filters. Use a filter to return a more specific list of results.</p>
          15  +
    ///
          16  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
          17  +
    pub fn filters(&self) -> &[crate::types::OpsItemEventFilter] {
          18  +
        self.filters.as_deref().unwrap_or_default()
          19  +
    }
          20  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          21  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          22  +
        self.max_results
          23  +
    }
          24  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
          25  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          26  +
        self.next_token.as_deref()
          27  +
    }
          28  +
}
          29  +
static LISTOPSITEMEVENTSINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          30  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#OpsItemEventFilters$member", "com.amazonaws.ssm", "OpsItemEventFilters"),
          31  +
    ::aws_smithy_schema::ShapeType::Structure,
          32  +
    "member",
          33  +
    0,
          34  +
);
          35  +
static LISTOPSITEMEVENTSINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          36  +
    ::aws_smithy_schema::ShapeId::from_parts(
          37  +
        "com.amazonaws.ssm.synthetic#ListOpsItemEventsInput$Filters",
          38  +
        "com.amazonaws.ssm.synthetic",
          39  +
        "ListOpsItemEventsInput",
          40  +
    ),
          41  +
    ::aws_smithy_schema::ShapeType::List,
          42  +
    "Filters",
          43  +
    0,
          44  +
)
          45  +
.with_list_member(&LISTOPSITEMEVENTSINPUT_MEMBER_FILTERS_MEMBER);
          46  +
static LISTOPSITEMEVENTSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          47  +
    ::aws_smithy_schema::ShapeId::from_parts(
          48  +
        "com.amazonaws.ssm.synthetic#ListOpsItemEventsInput$MaxResults",
          49  +
        "com.amazonaws.ssm.synthetic",
          50  +
        "ListOpsItemEventsInput",
          51  +
    ),
          52  +
    ::aws_smithy_schema::ShapeType::Integer,
          53  +
    "MaxResults",
          54  +
    1,
          55  +
);
          56  +
static LISTOPSITEMEVENTSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          57  +
    ::aws_smithy_schema::ShapeId::from_parts(
          58  +
        "com.amazonaws.ssm.synthetic#ListOpsItemEventsInput$NextToken",
          59  +
        "com.amazonaws.ssm.synthetic",
          60  +
        "ListOpsItemEventsInput",
          61  +
    ),
          62  +
    ::aws_smithy_schema::ShapeType::String,
          63  +
    "NextToken",
          64  +
    2,
          65  +
);
          66  +
static LISTOPSITEMEVENTSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          67  +
    ::aws_smithy_schema::ShapeId::from_parts(
          68  +
        "com.amazonaws.ssm.synthetic#ListOpsItemEventsInput",
          69  +
        "com.amazonaws.ssm.synthetic",
          70  +
        "ListOpsItemEventsInput",
          71  +
    ),
          72  +
    ::aws_smithy_schema::ShapeType::Structure,
          73  +
    &[
          74  +
        &LISTOPSITEMEVENTSINPUT_MEMBER_FILTERS,
          75  +
        &LISTOPSITEMEVENTSINPUT_MEMBER_MAX_RESULTS,
          76  +
        &LISTOPSITEMEVENTSINPUT_MEMBER_NEXT_TOKEN,
          77  +
    ],
          78  +
)
          79  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          80  +
.with_original_name("ListOpsItemEventsRequest");
          81  +
impl ListOpsItemEventsInput {
          82  +
    /// The schema for this shape.
          83  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &LISTOPSITEMEVENTSINPUT_SCHEMA;
          84  +
}
          85  +
impl ::aws_smithy_schema::serde::SerializableStruct for ListOpsItemEventsInput {
          86  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          87  +
    fn serialize_members(
          88  +
        &self,
          89  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          90  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          91  +
        if let Some(ref val) = self.filters {
          92  +
            ser.write_list(
          93  +
                &LISTOPSITEMEVENTSINPUT_MEMBER_FILTERS,
          94  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          95  +
                    for item in val {
          96  +
                        ser.write_struct(crate::types::OpsItemEventFilter::SCHEMA, item)?;
          97  +
                    }
          98  +
                    Ok(())
          99  +
                },
         100  +
            )?;
         101  +
        }
         102  +
        if let Some(ref val) = self.max_results {
         103  +
            ser.write_integer(&LISTOPSITEMEVENTSINPUT_MEMBER_MAX_RESULTS, *val)?;
         104  +
        }
         105  +
        if let Some(ref val) = self.next_token {
         106  +
            ser.write_string(&LISTOPSITEMEVENTSINPUT_MEMBER_NEXT_TOKEN, val)?;
         107  +
        }
         108  +
        Ok(())
         109  +
    }
         110  +
}
         111  +
impl ListOpsItemEventsInput {
         112  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         113  +
    pub fn deserialize(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         116  +
        #[allow(unused_variables, unused_mut)]
         117  +
        let mut builder = Self::builder();
         118  +
        #[allow(
         119  +
            unused_variables,
         120  +
            unreachable_code,
         121  +
            clippy::single_match,
         122  +
            clippy::match_single_binding,
         123  +
            clippy::diverging_sub_expression
         124  +
        )]
         125  +
        deserializer.read_struct(&LISTOPSITEMEVENTSINPUT_SCHEMA, &mut |member, deser| {
         126  +
            match member.member_index() {
         127  +
                Some(0) => {
         128  +
                    if deser.is_null() {
         129  +
                        deser.read_null()?;
         130  +
                    } else {
         131  +
                        builder.filters = Some({
         132  +
                            let mut container = Vec::new();
         133  +
                            deser.read_list(member, &mut |deser| {
         134  +
                                container.push(crate::types::OpsItemEventFilter::deserialize(deser)?);
         135  +
                                Ok(())
         136  +
                            })?;
         137  +
                            container
         138  +
                        });
         139  +
                    }
         140  +
                }
         141  +
                Some(1) => {
         142  +
                    if deser.is_null() {
         143  +
                        deser.read_null()?;
         144  +
                    } else {
         145  +
                        builder.max_results = Some(deser.read_integer(member)?);
         146  +
                    }
         147  +
                }
         148  +
                Some(2) => {
         149  +
                    if deser.is_null() {
         150  +
                        deser.read_null()?;
         151  +
                    } else {
         152  +
                        builder.next_token = Some(deser.read_string(member)?);
         153  +
                    }
         154  +
                }
         155  +
                _ => {}
         156  +
            }
         157  +
            Ok(())
         158  +
        })?;
         159  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         160  +
    }
         161  +
}
         162  +
impl ListOpsItemEventsInput {
         163  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         164  +
    pub fn deserialize_with_response(
         165  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         166  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         167  +
        _status: u16,
         168  +
        _body: &[u8],
         169  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         170  +
        Self::deserialize(deserializer)
         171  +
    }
         172  +
}
         173  +
impl ListOpsItemEventsInput {
         174  +
    /// Creates a new builder-style object to manufacture [`ListOpsItemEventsInput`](crate::operation::list_ops_item_events::ListOpsItemEventsInput).
         175  +
    pub fn builder() -> crate::operation::list_ops_item_events::builders::ListOpsItemEventsInputBuilder {
         176  +
        crate::operation::list_ops_item_events::builders::ListOpsItemEventsInputBuilder::default()
         177  +
    }
         178  +
}
         179  +
         180  +
/// A builder for [`ListOpsItemEventsInput`](crate::operation::list_ops_item_events::ListOpsItemEventsInput).
         181  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         182  +
#[non_exhaustive]
         183  +
pub struct ListOpsItemEventsInputBuilder {
         184  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::OpsItemEventFilter>>,
         185  +
    pub(crate) max_results: ::std::option::Option<i32>,
         186  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         187  +
}
         188  +
impl ListOpsItemEventsInputBuilder {
         189  +
    /// Appends an item to `filters`.
         190  +
    ///
         191  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         192  +
    ///
         193  +
    /// <p>One or more OpsItem filters. Use a filter to return a more specific list of results.</p>
         194  +
    pub fn filters(mut self, input: crate::types::OpsItemEventFilter) -> Self {
         195  +
        let mut v = self.filters.unwrap_or_default();
         196  +
        v.push(input);
         197  +
        self.filters = ::std::option::Option::Some(v);
         198  +
        self
         199  +
    }
         200  +
    /// <p>One or more OpsItem filters. Use a filter to return a more specific list of results.</p>
         201  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OpsItemEventFilter>>) -> Self {
         202  +
        self.filters = input;
         203  +
        self
         204  +
    }
         205  +
    /// <p>One or more OpsItem filters. Use a filter to return a more specific list of results.</p>
         206  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OpsItemEventFilter>> {
         207  +
        &self.filters
         208  +
    }
         209  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         210  +
    pub fn max_results(mut self, input: i32) -> Self {
         211  +
        self.max_results = ::std::option::Option::Some(input);
         212  +
        self
         213  +
    }
         214  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         215  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         216  +
        self.max_results = input;
         217  +
        self
         218  +
    }
         219  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         220  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         221  +
        &self.max_results
         222  +
    }
         223  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         224  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         225  +
        self.next_token = ::std::option::Option::Some(input.into());
         226  +
        self
         227  +
    }
         228  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         229  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         230  +
        self.next_token = input;
         231  +
        self
         232  +
    }
         233  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         234  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         235  +
        &self.next_token
         236  +
    }
         237  +
    /// Consumes the builder and constructs a [`ListOpsItemEventsInput`](crate::operation::list_ops_item_events::ListOpsItemEventsInput).
         238  +
    pub fn build(
         239  +
        self,
         240  +
    ) -> ::std::result::Result<crate::operation::list_ops_item_events::ListOpsItemEventsInput, ::aws_smithy_types::error::operation::BuildError> {
         241  +
        ::std::result::Result::Ok(crate::operation::list_ops_item_events::ListOpsItemEventsInput {
         242  +
            filters: self.filters,
         243  +
            max_results: self.max_results,
         244  +
            next_token: self.next_token,
         245  +
        })
         246  +
    }
         247  +
}

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

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