AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,197 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p></p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct CancelCommandInput {
           7  +
    /// <p>The ID of the command you want to cancel.</p>
           8  +
    pub command_id: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
          10  +
    pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          11  +
}
          12  +
impl CancelCommandInput {
          13  +
    /// <p>The ID of the command you want to cancel.</p>
          14  +
    pub fn command_id(&self) -> ::std::option::Option<&str> {
          15  +
        self.command_id.as_deref()
          16  +
    }
          17  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</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 `.instance_ids.is_none()`.
          20  +
    pub fn instance_ids(&self) -> &[::std::string::String] {
          21  +
        self.instance_ids.as_deref().unwrap_or_default()
          22  +
    }
          23  +
}
          24  +
static CANCELCOMMANDINPUT_MEMBER_COMMAND_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          25  +
    ::aws_smithy_schema::ShapeId::from_parts(
          26  +
        "com.amazonaws.ssm.synthetic#CancelCommandInput$CommandId",
          27  +
        "com.amazonaws.ssm.synthetic",
          28  +
        "CancelCommandInput",
          29  +
    ),
          30  +
    ::aws_smithy_schema::ShapeType::String,
          31  +
    "CommandId",
          32  +
    0,
          33  +
);
          34  +
static CANCELCOMMANDINPUT_MEMBER_INSTANCE_IDS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InstanceIdList$member", "com.amazonaws.ssm", "InstanceIdList"),
          36  +
    ::aws_smithy_schema::ShapeType::String,
          37  +
    "member",
          38  +
    0,
          39  +
);
          40  +
static CANCELCOMMANDINPUT_MEMBER_INSTANCE_IDS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_parts(
          42  +
        "com.amazonaws.ssm.synthetic#CancelCommandInput$InstanceIds",
          43  +
        "com.amazonaws.ssm.synthetic",
          44  +
        "CancelCommandInput",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::List,
          47  +
    "InstanceIds",
          48  +
    1,
          49  +
)
          50  +
.with_list_member(&CANCELCOMMANDINPUT_MEMBER_INSTANCE_IDS_MEMBER);
          51  +
static CANCELCOMMANDINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          52  +
    ::aws_smithy_schema::ShapeId::from_parts(
          53  +
        "com.amazonaws.ssm.synthetic#CancelCommandInput",
          54  +
        "com.amazonaws.ssm.synthetic",
          55  +
        "CancelCommandInput",
          56  +
    ),
          57  +
    ::aws_smithy_schema::ShapeType::Structure,
          58  +
    &[&CANCELCOMMANDINPUT_MEMBER_COMMAND_ID, &CANCELCOMMANDINPUT_MEMBER_INSTANCE_IDS],
          59  +
)
          60  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          61  +
.with_original_name("CancelCommandRequest");
          62  +
impl CancelCommandInput {
          63  +
    /// The schema for this shape.
          64  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CANCELCOMMANDINPUT_SCHEMA;
          65  +
}
          66  +
impl ::aws_smithy_schema::serde::SerializableStruct for CancelCommandInput {
          67  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          68  +
    fn serialize_members(
          69  +
        &self,
          70  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          71  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          72  +
        if let Some(ref val) = self.command_id {
          73  +
            ser.write_string(&CANCELCOMMANDINPUT_MEMBER_COMMAND_ID, val)?;
          74  +
        }
          75  +
        if let Some(ref val) = self.instance_ids {
          76  +
            ser.write_list(
          77  +
                &CANCELCOMMANDINPUT_MEMBER_INSTANCE_IDS,
          78  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          79  +
                    for item in val {
          80  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          81  +
                    }
          82  +
                    Ok(())
          83  +
                },
          84  +
            )?;
          85  +
        }
          86  +
        Ok(())
          87  +
    }
          88  +
}
          89  +
impl CancelCommandInput {
          90  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          91  +
    pub fn deserialize(
          92  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          93  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          94  +
        #[allow(unused_variables, unused_mut)]
          95  +
        let mut builder = Self::builder();
          96  +
        #[allow(
          97  +
            unused_variables,
          98  +
            unreachable_code,
          99  +
            clippy::single_match,
         100  +
            clippy::match_single_binding,
         101  +
            clippy::diverging_sub_expression
         102  +
        )]
         103  +
        deserializer.read_struct(&CANCELCOMMANDINPUT_SCHEMA, &mut |member, deser| {
         104  +
            match member.member_index() {
         105  +
                Some(0) => {
         106  +
                    if deser.is_null() {
         107  +
                        deser.read_null()?;
         108  +
                    } else {
         109  +
                        builder.command_id = Some(deser.read_string(member)?);
         110  +
                    }
         111  +
                }
         112  +
                Some(1) => {
         113  +
                    if deser.is_null() {
         114  +
                        deser.read_null()?;
         115  +
                    } else {
         116  +
                        builder.instance_ids = Some(deser.read_string_list(member)?);
         117  +
                    }
         118  +
                }
         119  +
                _ => {}
         120  +
            }
         121  +
            Ok(())
         122  +
        })?;
         123  +
        builder.command_id = builder.command_id.or(Some(String::new()));
         124  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         125  +
    }
         126  +
}
         127  +
impl CancelCommandInput {
         128  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         129  +
    pub fn deserialize_with_response(
         130  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         131  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         132  +
        _status: u16,
         133  +
        _body: &[u8],
         134  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         135  +
        Self::deserialize(deserializer)
         136  +
    }
         137  +
}
         138  +
impl CancelCommandInput {
         139  +
    /// Creates a new builder-style object to manufacture [`CancelCommandInput`](crate::operation::cancel_command::CancelCommandInput).
         140  +
    pub fn builder() -> crate::operation::cancel_command::builders::CancelCommandInputBuilder {
         141  +
        crate::operation::cancel_command::builders::CancelCommandInputBuilder::default()
         142  +
    }
         143  +
}
         144  +
         145  +
/// A builder for [`CancelCommandInput`](crate::operation::cancel_command::CancelCommandInput).
         146  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         147  +
#[non_exhaustive]
         148  +
pub struct CancelCommandInputBuilder {
         149  +
    pub(crate) command_id: ::std::option::Option<::std::string::String>,
         150  +
    pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         151  +
}
         152  +
impl CancelCommandInputBuilder {
         153  +
    /// <p>The ID of the command you want to cancel.</p>
         154  +
    /// This field is required.
         155  +
    pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         156  +
        self.command_id = ::std::option::Option::Some(input.into());
         157  +
        self
         158  +
    }
         159  +
    /// <p>The ID of the command you want to cancel.</p>
         160  +
    pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         161  +
        self.command_id = input;
         162  +
        self
         163  +
    }
         164  +
    /// <p>The ID of the command you want to cancel.</p>
         165  +
    pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
         166  +
        &self.command_id
         167  +
    }
         168  +
    /// Appends an item to `instance_ids`.
         169  +
    ///
         170  +
    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
         171  +
    ///
         172  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         173  +
    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         174  +
        let mut v = self.instance_ids.unwrap_or_default();
         175  +
        v.push(input.into());
         176  +
        self.instance_ids = ::std::option::Option::Some(v);
         177  +
        self
         178  +
    }
         179  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         180  +
    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         181  +
        self.instance_ids = input;
         182  +
        self
         183  +
    }
         184  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         185  +
    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         186  +
        &self.instance_ids
         187  +
    }
         188  +
    /// Consumes the builder and constructs a [`CancelCommandInput`](crate::operation::cancel_command::CancelCommandInput).
         189  +
    pub fn build(
         190  +
        self,
         191  +
    ) -> ::std::result::Result<crate::operation::cancel_command::CancelCommandInput, ::aws_smithy_types::error::operation::BuildError> {
         192  +
        ::std::result::Result::Ok(crate::operation::cancel_command::CancelCommandInput {
         193  +
            command_id: self.command_id,
         194  +
            instance_ids: self.instance_ids,
         195  +
        })
         196  +
    }
         197  +
}

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

@@ -0,1 +0,123 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Whether or not the command was successfully canceled. There is no guarantee that a request can be canceled.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct CancelCommandOutput {
           7  +
    _request_id: Option<String>,
           8  +
}
           9  +
static CANCELCOMMANDOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          10  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          11  +
    ::aws_smithy_schema::ShapeType::String,
          12  +
    "request_id",
          13  +
    0,
          14  +
)
          15  +
.with_http_header("x-amzn-requestid");
          16  +
static CANCELCOMMANDOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          17  +
    ::aws_smithy_schema::ShapeId::from_parts(
          18  +
        "com.amazonaws.ssm.synthetic#CancelCommandOutput",
          19  +
        "com.amazonaws.ssm.synthetic",
          20  +
        "CancelCommandOutput",
          21  +
    ),
          22  +
    ::aws_smithy_schema::ShapeType::Structure,
          23  +
    &[&CANCELCOMMANDOUTPUT_MEMBER__REQUEST_ID],
          24  +
)
          25  +
.with_original_name("CancelCommandResult");
          26  +
impl CancelCommandOutput {
          27  +
    /// The schema for this shape.
          28  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CANCELCOMMANDOUTPUT_SCHEMA;
          29  +
}
          30  +
impl ::aws_smithy_schema::serde::SerializableStruct for CancelCommandOutput {
          31  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          32  +
    fn serialize_members(
          33  +
        &self,
          34  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          35  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          36  +
        Ok(())
          37  +
    }
          38  +
}
          39  +
impl CancelCommandOutput {
          40  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          41  +
    pub fn deserialize(
          42  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          43  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          44  +
        #[allow(unused_variables, unused_mut)]
          45  +
        let mut builder = Self::builder();
          46  +
        #[allow(
          47  +
            unused_variables,
          48  +
            unreachable_code,
          49  +
            clippy::single_match,
          50  +
            clippy::match_single_binding,
          51  +
            clippy::diverging_sub_expression
          52  +
        )]
          53  +
        deserializer.read_struct(&CANCELCOMMANDOUTPUT_SCHEMA, &mut |member, deser| {
          54  +
            match member.member_index() {
          55  +
                Some(0) => {
          56  +
                    builder._request_id = Some(deser.read_string(member)?);
          57  +
                }
          58  +
                _ => {}
          59  +
            }
          60  +
            Ok(())
          61  +
        })?;
          62  +
        Ok(builder.build())
          63  +
    }
          64  +
}
          65  +
impl CancelCommandOutput {
          66  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          67  +
    /// Header-bound members are read directly from headers, avoiding runtime
          68  +
    /// member iteration overhead. Body members are read via the deserializer.
          69  +
    pub fn deserialize_with_response(
          70  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          71  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          72  +
        _status: u16,
          73  +
        _body: &[u8],
          74  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          75  +
        #[allow(unused_variables, unused_mut)]
          76  +
        let mut builder = Self::builder();
          77  +
        if let Some(val) = headers.get("x-amzn-requestid") {
          78  +
            builder._request_id = Some(val.to_string());
          79  +
        }
          80  +
        Ok(builder.build())
          81  +
    }
          82  +
}
          83  +
impl ::aws_types::request_id::RequestId for CancelCommandOutput {
          84  +
    fn request_id(&self) -> Option<&str> {
          85  +
        self._request_id.as_deref()
          86  +
    }
          87  +
}
          88  +
impl CancelCommandOutput {
          89  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
          90  +
        self._request_id = request_id;
          91  +
        self
          92  +
    }
          93  +
}
          94  +
impl CancelCommandOutput {
          95  +
    /// Creates a new builder-style object to manufacture [`CancelCommandOutput`](crate::operation::cancel_command::CancelCommandOutput).
          96  +
    pub fn builder() -> crate::operation::cancel_command::builders::CancelCommandOutputBuilder {
          97  +
        crate::operation::cancel_command::builders::CancelCommandOutputBuilder::default()
          98  +
    }
          99  +
}
         100  +
         101  +
/// A builder for [`CancelCommandOutput`](crate::operation::cancel_command::CancelCommandOutput).
         102  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         103  +
#[non_exhaustive]
         104  +
pub struct CancelCommandOutputBuilder {
         105  +
    _request_id: Option<String>,
         106  +
}
         107  +
impl CancelCommandOutputBuilder {
         108  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         109  +
        self._request_id = Some(request_id.into());
         110  +
        self
         111  +
    }
         112  +
         113  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         114  +
        self._request_id = request_id;
         115  +
        self
         116  +
    }
         117  +
    /// Consumes the builder and constructs a [`CancelCommandOutput`](crate::operation::cancel_command::CancelCommandOutput).
         118  +
    pub fn build(self) -> crate::operation::cancel_command::CancelCommandOutput {
         119  +
        crate::operation::cancel_command::CancelCommandOutput {
         120  +
            _request_id: self._request_id,
         121  +
        }
         122  +
    }
         123  +
}

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

@@ -0,1 +0,144 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::cancel_command::_cancel_command_input::CancelCommandInputBuilder;
           3  +
           4  +
pub use crate::operation::cancel_command::_cancel_command_output::CancelCommandOutputBuilder;
           5  +
           6  +
impl crate::operation::cancel_command::builders::CancelCommandInputBuilder {
           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::cancel_command::CancelCommandOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::cancel_command::CancelCommandError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.cancel_command();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `CancelCommand`.
          24  +
///
          25  +
/// <p>Attempts to cancel the command specified by the Command ID. There is no guarantee that the command will be terminated and the underlying process stopped.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct CancelCommandFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::cancel_command::builders::CancelCommandInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::cancel_command::CancelCommandOutput,
          35  +
        crate::operation::cancel_command::CancelCommandError,
          36  +
    > for CancelCommandFluentBuilder
          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::cancel_command::CancelCommandOutput,
          44  +
            crate::operation::cancel_command::CancelCommandError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl CancelCommandFluentBuilder {
          51  +
    /// Creates a new `CancelCommandFluentBuilder`.
          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 CancelCommand as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::cancel_command::builders::CancelCommandInputBuilder {
          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::cancel_command::CancelCommandOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::cancel_command::CancelCommandError,
          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::cancel_command::CancelCommand::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::cancel_command::CancelCommand::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::cancel_command::CancelCommandOutput,
          97  +
        crate::operation::cancel_command::CancelCommandError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// <p>The ID of the command you want to cancel.</p>
         112  +
    pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.inner = self.inner.command_id(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>The ID of the command you want to cancel.</p>
         117  +
    pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.inner = self.inner.set_command_id(input);
         119  +
        self
         120  +
    }
         121  +
    /// <p>The ID of the command you want to cancel.</p>
         122  +
    pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        self.inner.get_command_id()
         124  +
    }
         125  +
    ///
         126  +
    /// Appends an item to `InstanceIds`.
         127  +
    ///
         128  +
    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
         129  +
    ///
         130  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         131  +
    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         132  +
        self.inner = self.inner.instance_ids(input.into());
         133  +
        self
         134  +
    }
         135  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         136  +
    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         137  +
        self.inner = self.inner.set_instance_ids(input);
         138  +
        self
         139  +
    }
         140  +
    /// <p>(Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.</p>
         141  +
    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         142  +
        self.inner.get_instance_ids()
         143  +
    }
         144  +
}

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

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