AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,187 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::get_inventory_schema::_get_inventory_schema_input::GetInventorySchemaInputBuilder;
           3  +
           4  +
pub use crate::operation::get_inventory_schema::_get_inventory_schema_output::GetInventorySchemaOutputBuilder;
           5  +
           6  +
impl crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_inventory_schema::GetInventorySchemaError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_inventory_schema();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetInventorySchema`.
          24  +
///
          25  +
/// <p>Return a list of inventory type names for the account, or return a list of attribute names for a specific Inventory item type.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct GetInventorySchemaFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          35  +
        crate::operation::get_inventory_schema::GetInventorySchemaError,
          36  +
    > for GetInventorySchemaFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          44  +
            crate::operation::get_inventory_schema::GetInventorySchemaError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl GetInventorySchemaFluentBuilder {
          51  +
    /// Creates a new `GetInventorySchemaFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the GetInventorySchema as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::get_inventory_schema::GetInventorySchemaError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::get_inventory_schema::GetInventorySchema::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::get_inventory_schema::GetInventorySchema::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          97  +
        crate::operation::get_inventory_schema::GetInventorySchemaError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// Create a paginator for this request
         112  +
    ///
         113  +
    /// Paginators are used by calling [`send().await`](crate::operation::get_inventory_schema::paginator::GetInventorySchemaPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
         114  +
    pub fn into_paginator(self) -> crate::operation::get_inventory_schema::paginator::GetInventorySchemaPaginator {
         115  +
        crate::operation::get_inventory_schema::paginator::GetInventorySchemaPaginator::new(self.handle, self.inner)
         116  +
    }
         117  +
    /// <p>The type of inventory item to return.</p>
         118  +
    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.type_name(input.into());
         120  +
        self
         121  +
    }
         122  +
    /// <p>The type of inventory item to return.</p>
         123  +
    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.set_type_name(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>The type of inventory item to return.</p>
         128  +
    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_type_name()
         130  +
    }
         131  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         132  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         133  +
        self.inner = self.inner.next_token(input.into());
         134  +
        self
         135  +
    }
         136  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         137  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         138  +
        self.inner = self.inner.set_next_token(input);
         139  +
        self
         140  +
    }
         141  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         142  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         143  +
        self.inner.get_next_token()
         144  +
    }
         145  +
    /// <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>
         146  +
    pub fn max_results(mut self, input: i32) -> Self {
         147  +
        self.inner = self.inner.max_results(input);
         148  +
        self
         149  +
    }
         150  +
    /// <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>
         151  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         152  +
        self.inner = self.inner.set_max_results(input);
         153  +
        self
         154  +
    }
         155  +
    /// <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>
         156  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         157  +
        self.inner.get_max_results()
         158  +
    }
         159  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         160  +
    pub fn aggregator(mut self, input: bool) -> Self {
         161  +
        self.inner = self.inner.aggregator(input);
         162  +
        self
         163  +
    }
         164  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         165  +
    pub fn set_aggregator(mut self, input: ::std::option::Option<bool>) -> Self {
         166  +
        self.inner = self.inner.set_aggregator(input);
         167  +
        self
         168  +
    }
         169  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         170  +
    pub fn get_aggregator(&self) -> &::std::option::Option<bool> {
         171  +
        self.inner.get_aggregator()
         172  +
    }
         173  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         174  +
    pub fn sub_type(mut self, input: bool) -> Self {
         175  +
        self.inner = self.inner.sub_type(input);
         176  +
        self
         177  +
    }
         178  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         179  +
    pub fn set_sub_type(mut self, input: ::std::option::Option<bool>) -> Self {
         180  +
        self.inner = self.inner.set_sub_type(input);
         181  +
        self
         182  +
    }
         183  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         184  +
    pub fn get_sub_type(&self) -> &::std::option::Option<bool> {
         185  +
        self.inner.get_sub_type()
         186  +
    }
         187  +
}

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

@@ -0,1 +0,148 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Paginator for [`GetInventorySchema`](crate::operation::get_inventory_schema::GetInventorySchema)
           3  +
pub struct GetInventorySchemaPaginator {
           4  +
    handle: std::sync::Arc<crate::client::Handle>,
           5  +
    builder: crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder,
           6  +
    stop_on_duplicate_token: bool,
           7  +
}
           8  +
           9  +
impl GetInventorySchemaPaginator {
          10  +
    /// Create a new paginator-wrapper
          11  +
    pub(crate) fn new(
          12  +
        handle: std::sync::Arc<crate::client::Handle>,
          13  +
        builder: crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder,
          14  +
    ) -> Self {
          15  +
        Self {
          16  +
            handle,
          17  +
            builder,
          18  +
            stop_on_duplicate_token: true,
          19  +
        }
          20  +
    }
          21  +
          22  +
    /// Set the page size
          23  +
    ///
          24  +
    /// _Note: this method will override any previously set value for `max_results`_
          25  +
    pub fn page_size(mut self, limit: i32) -> Self {
          26  +
        self.builder.max_results = ::std::option::Option::Some(limit);
          27  +
        self
          28  +
    }
          29  +
          30  +
    /// Create a flattened paginator
          31  +
    ///
          32  +
    /// This paginator automatically flattens results using `schemas`. Queries to the underlying service
          33  +
    /// are dispatched lazily.
          34  +
    pub fn items(self) -> crate::operation::get_inventory_schema::paginator::GetInventorySchemaPaginatorItems {
          35  +
        crate::operation::get_inventory_schema::paginator::GetInventorySchemaPaginatorItems(self)
          36  +
    }
          37  +
          38  +
    /// Stop paginating when the service returns the same pagination token twice in a row.
          39  +
    ///
          40  +
    /// Defaults to true.
          41  +
    ///
          42  +
    /// For certain operations, it may be useful to continue on duplicate token. For example,
          43  +
    /// if an operation is for tailing a log file in real-time, then continuing may be desired.
          44  +
    /// This option can be set to `false` to accommodate these use cases.
          45  +
    pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
          46  +
        self.stop_on_duplicate_token = stop_on_duplicate_token;
          47  +
        self
          48  +
    }
          49  +
          50  +
    /// Create the pagination stream
          51  +
    ///
          52  +
    /// _Note:_ No requests will be dispatched until the stream is used
          53  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
          54  +
    pub fn send(
          55  +
        self,
          56  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
          57  +
        ::std::result::Result<
          58  +
            crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          59  +
            ::aws_smithy_runtime_api::client::result::SdkError<
          60  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
          61  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          62  +
            >,
          63  +
        >,
          64  +
    > {
          65  +
        // Move individual fields out of self for the borrow checker
          66  +
        let builder = self.builder;
          67  +
        let handle = self.handle;
          68  +
        let runtime_plugins = crate::operation::get_inventory_schema::GetInventorySchema::operation_runtime_plugins(
          69  +
            handle.runtime_plugins.clone(),
          70  +
            &handle.conf,
          71  +
            ::std::option::Option::None,
          72  +
        )
          73  +
        .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new());
          74  +
        ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new(
          75  +
            move |tx| {
          76  +
                ::std::boxed::Box::pin(async move {
          77  +
                    // Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
          78  +
                    let mut input = match builder
          79  +
                        .build()
          80  +
                        .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
          81  +
                    {
          82  +
                        ::std::result::Result::Ok(input) => input,
          83  +
                        ::std::result::Result::Err(e) => {
          84  +
                            let _ = tx.send(::std::result::Result::Err(e)).await;
          85  +
                            return;
          86  +
                        }
          87  +
                    };
          88  +
                    loop {
          89  +
                        let resp = crate::operation::get_inventory_schema::GetInventorySchema::orchestrate(&runtime_plugins, input.clone()).await;
          90  +
                        // If the input member is None or it was an error
          91  +
                        let done = match resp {
          92  +
                            ::std::result::Result::Ok(ref resp) => {
          93  +
                                let new_token = crate::lens::reflens_get_inventory_schema_output_output_next_token(resp);
          94  +
                                // Pagination is exhausted when the next token is an empty string
          95  +
                                let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
          96  +
                                if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token {
          97  +
                                    true
          98  +
                                } else {
          99  +
                                    input.next_token = new_token.cloned();
         100  +
                                    is_empty
         101  +
                                }
         102  +
                            }
         103  +
                            ::std::result::Result::Err(_) => true,
         104  +
                        };
         105  +
                        if tx.send(resp).await.is_err() {
         106  +
                            // receiving end was dropped
         107  +
                            return;
         108  +
                        }
         109  +
                        if done {
         110  +
                            return;
         111  +
                        }
         112  +
                    }
         113  +
                })
         114  +
            },
         115  +
        ))
         116  +
    }
         117  +
}
         118  +
         119  +
/// Flattened paginator for `GetInventorySchemaPaginator`
         120  +
///
         121  +
/// This is created with [`.items()`](GetInventorySchemaPaginator::items)
         122  +
pub struct GetInventorySchemaPaginatorItems(GetInventorySchemaPaginator);
         123  +
         124  +
impl GetInventorySchemaPaginatorItems {
         125  +
    /// Create the pagination stream
         126  +
    ///
         127  +
    /// _Note_: No requests will be dispatched until the stream is used
         128  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
         129  +
    ///
         130  +
    /// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect).
         131  +
    pub fn send(
         132  +
        self,
         133  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
         134  +
        ::std::result::Result<
         135  +
            crate::types::InventoryItemSchema,
         136  +
            ::aws_smithy_runtime_api::client::result::SdkError<
         137  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
         138  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         139  +
            >,
         140  +
        >,
         141  +
    > {
         142  +
        ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
         143  +
            crate::lens::lens_get_inventory_schema_output_output_schemas(page)
         144  +
                .unwrap_or_default()
         145  +
                .into_iter()
         146  +
        })
         147  +
    }
         148  +
}

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

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

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

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