AWS SDK

AWS SDK

rev. aa190e630077955f0bc8f58dee6a16530c1e0578 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,264 @@
           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 PutResourcePolicyInput {
           6  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
           7  +
    pub resource_arn: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>A policy you want to associate with a resource.</p>
           9  +
    pub policy: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The policy ID.</p>
          11  +
    pub policy_id: ::std::option::Option<::std::string::String>,
          12  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
          13  +
    pub policy_hash: ::std::option::Option<::std::string::String>,
          14  +
}
          15  +
impl PutResourcePolicyInput {
          16  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
          17  +
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
          18  +
        self.resource_arn.as_deref()
          19  +
    }
          20  +
    /// <p>A policy you want to associate with a resource.</p>
          21  +
    pub fn policy(&self) -> ::std::option::Option<&str> {
          22  +
        self.policy.as_deref()
          23  +
    }
          24  +
    /// <p>The policy ID.</p>
          25  +
    pub fn policy_id(&self) -> ::std::option::Option<&str> {
          26  +
        self.policy_id.as_deref()
          27  +
    }
          28  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
          29  +
    pub fn policy_hash(&self) -> ::std::option::Option<&str> {
          30  +
        self.policy_hash.as_deref()
          31  +
    }
          32  +
}
          33  +
static PUTRESOURCEPOLICYINPUT_MEMBER_RESOURCE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyInput$ResourceArn",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "PutResourcePolicyInput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::String,
          40  +
    "ResourceArn",
          41  +
    0,
          42  +
);
          43  +
static PUTRESOURCEPOLICYINPUT_MEMBER_POLICY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          44  +
    ::aws_smithy_schema::ShapeId::from_parts(
          45  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyInput$Policy",
          46  +
        "com.amazonaws.ssm.synthetic",
          47  +
        "PutResourcePolicyInput",
          48  +
    ),
          49  +
    ::aws_smithy_schema::ShapeType::String,
          50  +
    "Policy",
          51  +
    1,
          52  +
);
          53  +
static PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts(
          55  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyInput$PolicyId",
          56  +
        "com.amazonaws.ssm.synthetic",
          57  +
        "PutResourcePolicyInput",
          58  +
    ),
          59  +
    ::aws_smithy_schema::ShapeType::String,
          60  +
    "PolicyId",
          61  +
    2,
          62  +
);
          63  +
static PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_HASH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyInput$PolicyHash",
          66  +
        "com.amazonaws.ssm.synthetic",
          67  +
        "PutResourcePolicyInput",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::String,
          70  +
    "PolicyHash",
          71  +
    3,
          72  +
);
          73  +
static PUTRESOURCEPOLICYINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          74  +
    ::aws_smithy_schema::ShapeId::from_parts(
          75  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyInput",
          76  +
        "com.amazonaws.ssm.synthetic",
          77  +
        "PutResourcePolicyInput",
          78  +
    ),
          79  +
    ::aws_smithy_schema::ShapeType::Structure,
          80  +
    &[
          81  +
        &PUTRESOURCEPOLICYINPUT_MEMBER_RESOURCE_ARN,
          82  +
        &PUTRESOURCEPOLICYINPUT_MEMBER_POLICY,
          83  +
        &PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_ID,
          84  +
        &PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_HASH,
          85  +
    ],
          86  +
)
          87  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          88  +
.with_original_name("PutResourcePolicyRequest");
          89  +
impl PutResourcePolicyInput {
          90  +
    /// The schema for this shape.
          91  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTRESOURCEPOLICYINPUT_SCHEMA;
          92  +
}
          93  +
impl ::aws_smithy_schema::serde::SerializableStruct for PutResourcePolicyInput {
          94  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          95  +
    fn serialize_members(
          96  +
        &self,
          97  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          98  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          99  +
        if let Some(ref val) = self.resource_arn {
         100  +
            ser.write_string(&PUTRESOURCEPOLICYINPUT_MEMBER_RESOURCE_ARN, val)?;
         101  +
        }
         102  +
        if let Some(ref val) = self.policy {
         103  +
            ser.write_string(&PUTRESOURCEPOLICYINPUT_MEMBER_POLICY, val)?;
         104  +
        }
         105  +
        if let Some(ref val) = self.policy_id {
         106  +
            ser.write_string(&PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_ID, val)?;
         107  +
        }
         108  +
        if let Some(ref val) = self.policy_hash {
         109  +
            ser.write_string(&PUTRESOURCEPOLICYINPUT_MEMBER_POLICY_HASH, val)?;
         110  +
        }
         111  +
        Ok(())
         112  +
    }
         113  +
}
         114  +
impl PutResourcePolicyInput {
         115  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         116  +
    pub fn deserialize(
         117  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         118  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         119  +
        #[allow(unused_variables, unused_mut)]
         120  +
        let mut builder = Self::builder();
         121  +
        #[allow(
         122  +
            unused_variables,
         123  +
            unreachable_code,
         124  +
            clippy::single_match,
         125  +
            clippy::match_single_binding,
         126  +
            clippy::diverging_sub_expression
         127  +
        )]
         128  +
        deserializer.read_struct(&PUTRESOURCEPOLICYINPUT_SCHEMA, &mut |member, deser| {
         129  +
            match member.member_index() {
         130  +
                Some(0) => {
         131  +
                    if deser.is_null() {
         132  +
                        deser.read_null()?;
         133  +
                    } else {
         134  +
                        builder.resource_arn = Some(deser.read_string(member)?);
         135  +
                    }
         136  +
                }
         137  +
                Some(1) => {
         138  +
                    if deser.is_null() {
         139  +
                        deser.read_null()?;
         140  +
                    } else {
         141  +
                        builder.policy = Some(deser.read_string(member)?);
         142  +
                    }
         143  +
                }
         144  +
                Some(2) => {
         145  +
                    if deser.is_null() {
         146  +
                        deser.read_null()?;
         147  +
                    } else {
         148  +
                        builder.policy_id = Some(deser.read_string(member)?);
         149  +
                    }
         150  +
                }
         151  +
                Some(3) => {
         152  +
                    if deser.is_null() {
         153  +
                        deser.read_null()?;
         154  +
                    } else {
         155  +
                        builder.policy_hash = Some(deser.read_string(member)?);
         156  +
                    }
         157  +
                }
         158  +
                _ => {}
         159  +
            }
         160  +
            Ok(())
         161  +
        })?;
         162  +
        builder.resource_arn = builder.resource_arn.or(Some(String::new()));
         163  +
        builder.policy = builder.policy.or(Some(String::new()));
         164  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         165  +
    }
         166  +
}
         167  +
impl PutResourcePolicyInput {
         168  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         169  +
    pub fn deserialize_with_response(
         170  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         171  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         172  +
        _status: u16,
         173  +
        _body: &[u8],
         174  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         175  +
        Self::deserialize(deserializer)
         176  +
    }
         177  +
}
         178  +
impl PutResourcePolicyInput {
         179  +
    /// Creates a new builder-style object to manufacture [`PutResourcePolicyInput`](crate::operation::put_resource_policy::PutResourcePolicyInput).
         180  +
    pub fn builder() -> crate::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder {
         181  +
        crate::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder::default()
         182  +
    }
         183  +
}
         184  +
         185  +
/// A builder for [`PutResourcePolicyInput`](crate::operation::put_resource_policy::PutResourcePolicyInput).
         186  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         187  +
#[non_exhaustive]
         188  +
pub struct PutResourcePolicyInputBuilder {
         189  +
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
         190  +
    pub(crate) policy: ::std::option::Option<::std::string::String>,
         191  +
    pub(crate) policy_id: ::std::option::Option<::std::string::String>,
         192  +
    pub(crate) policy_hash: ::std::option::Option<::std::string::String>,
         193  +
}
         194  +
impl PutResourcePolicyInputBuilder {
         195  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         196  +
    /// This field is required.
         197  +
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         198  +
        self.resource_arn = ::std::option::Option::Some(input.into());
         199  +
        self
         200  +
    }
         201  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         202  +
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         203  +
        self.resource_arn = input;
         204  +
        self
         205  +
    }
         206  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         207  +
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
         208  +
        &self.resource_arn
         209  +
    }
         210  +
    /// <p>A policy you want to associate with a resource.</p>
         211  +
    /// This field is required.
         212  +
    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         213  +
        self.policy = ::std::option::Option::Some(input.into());
         214  +
        self
         215  +
    }
         216  +
    /// <p>A policy you want to associate with a resource.</p>
         217  +
    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         218  +
        self.policy = input;
         219  +
        self
         220  +
    }
         221  +
    /// <p>A policy you want to associate with a resource.</p>
         222  +
    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
         223  +
        &self.policy
         224  +
    }
         225  +
    /// <p>The policy ID.</p>
         226  +
    pub fn policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         227  +
        self.policy_id = ::std::option::Option::Some(input.into());
         228  +
        self
         229  +
    }
         230  +
    /// <p>The policy ID.</p>
         231  +
    pub fn set_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         232  +
        self.policy_id = input;
         233  +
        self
         234  +
    }
         235  +
    /// <p>The policy ID.</p>
         236  +
    pub fn get_policy_id(&self) -> &::std::option::Option<::std::string::String> {
         237  +
        &self.policy_id
         238  +
    }
         239  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         240  +
    pub fn policy_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         241  +
        self.policy_hash = ::std::option::Option::Some(input.into());
         242  +
        self
         243  +
    }
         244  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         245  +
    pub fn set_policy_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         246  +
        self.policy_hash = input;
         247  +
        self
         248  +
    }
         249  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         250  +
    pub fn get_policy_hash(&self) -> &::std::option::Option<::std::string::String> {
         251  +
        &self.policy_hash
         252  +
    }
         253  +
    /// Consumes the builder and constructs a [`PutResourcePolicyInput`](crate::operation::put_resource_policy::PutResourcePolicyInput).
         254  +
    pub fn build(
         255  +
        self,
         256  +
    ) -> ::std::result::Result<crate::operation::put_resource_policy::PutResourcePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
         257  +
        ::std::result::Result::Ok(crate::operation::put_resource_policy::PutResourcePolicyInput {
         258  +
            resource_arn: self.resource_arn,
         259  +
            policy: self.policy,
         260  +
            policy_id: self.policy_id,
         261  +
            policy_hash: self.policy_hash,
         262  +
        })
         263  +
    }
         264  +
}

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

@@ -0,1 +0,232 @@
           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 PutResourcePolicyOutput {
           6  +
    /// <p>The policy ID. To update a policy, you must specify <code>PolicyId</code> and <code>PolicyHash</code>.</p>
           7  +
    pub policy_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>ID of the current policy version.</p>
           9  +
    pub policy_hash: ::std::option::Option<::std::string::String>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl PutResourcePolicyOutput {
          13  +
    /// <p>The policy ID. To update a policy, you must specify <code>PolicyId</code> and <code>PolicyHash</code>.</p>
          14  +
    pub fn policy_id(&self) -> ::std::option::Option<&str> {
          15  +
        self.policy_id.as_deref()
          16  +
    }
          17  +
    /// <p>ID of the current policy version.</p>
          18  +
    pub fn policy_hash(&self) -> ::std::option::Option<&str> {
          19  +
        self.policy_hash.as_deref()
          20  +
    }
          21  +
}
          22  +
static PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          23  +
    ::aws_smithy_schema::ShapeId::from_parts(
          24  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyOutput$PolicyId",
          25  +
        "com.amazonaws.ssm.synthetic",
          26  +
        "PutResourcePolicyOutput",
          27  +
    ),
          28  +
    ::aws_smithy_schema::ShapeType::String,
          29  +
    "PolicyId",
          30  +
    0,
          31  +
);
          32  +
static PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_HASH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_parts(
          34  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyOutput$PolicyHash",
          35  +
        "com.amazonaws.ssm.synthetic",
          36  +
        "PutResourcePolicyOutput",
          37  +
    ),
          38  +
    ::aws_smithy_schema::ShapeType::String,
          39  +
    "PolicyHash",
          40  +
    1,
          41  +
);
          42  +
static PUTRESOURCEPOLICYOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          44  +
    ::aws_smithy_schema::ShapeType::String,
          45  +
    "request_id",
          46  +
    2,
          47  +
)
          48  +
.with_http_header("x-amzn-requestid");
          49  +
static PUTRESOURCEPOLICYOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          50  +
    ::aws_smithy_schema::ShapeId::from_parts(
          51  +
        "com.amazonaws.ssm.synthetic#PutResourcePolicyOutput",
          52  +
        "com.amazonaws.ssm.synthetic",
          53  +
        "PutResourcePolicyOutput",
          54  +
    ),
          55  +
    ::aws_smithy_schema::ShapeType::Structure,
          56  +
    &[
          57  +
        &PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_ID,
          58  +
        &PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_HASH,
          59  +
        &PUTRESOURCEPOLICYOUTPUT_MEMBER__REQUEST_ID,
          60  +
    ],
          61  +
)
          62  +
.with_original_name("PutResourcePolicyResponse");
          63  +
impl PutResourcePolicyOutput {
          64  +
    /// The schema for this shape.
          65  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTRESOURCEPOLICYOUTPUT_SCHEMA;
          66  +
}
          67  +
impl ::aws_smithy_schema::serde::SerializableStruct for PutResourcePolicyOutput {
          68  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          69  +
    fn serialize_members(
          70  +
        &self,
          71  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          72  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          73  +
        if let Some(ref val) = self.policy_id {
          74  +
            ser.write_string(&PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_ID, val)?;
          75  +
        }
          76  +
        if let Some(ref val) = self.policy_hash {
          77  +
            ser.write_string(&PUTRESOURCEPOLICYOUTPUT_MEMBER_POLICY_HASH, val)?;
          78  +
        }
          79  +
        Ok(())
          80  +
    }
          81  +
}
          82  +
impl PutResourcePolicyOutput {
          83  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          84  +
    pub fn deserialize(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          87  +
        #[allow(unused_variables, unused_mut)]
          88  +
        let mut builder = Self::builder();
          89  +
        #[allow(
          90  +
            unused_variables,
          91  +
            unreachable_code,
          92  +
            clippy::single_match,
          93  +
            clippy::match_single_binding,
          94  +
            clippy::diverging_sub_expression
          95  +
        )]
          96  +
        deserializer.read_struct(&PUTRESOURCEPOLICYOUTPUT_SCHEMA, &mut |member, deser| {
          97  +
            match member.member_index() {
          98  +
                Some(0) => {
          99  +
                    if deser.is_null() {
         100  +
                        deser.read_null()?;
         101  +
                    } else {
         102  +
                        builder.policy_id = Some(deser.read_string(member)?);
         103  +
                    }
         104  +
                }
         105  +
                Some(1) => {
         106  +
                    if deser.is_null() {
         107  +
                        deser.read_null()?;
         108  +
                    } else {
         109  +
                        builder.policy_hash = Some(deser.read_string(member)?);
         110  +
                    }
         111  +
                }
         112  +
                Some(2) => {
         113  +
                    builder._request_id = Some(deser.read_string(member)?);
         114  +
                }
         115  +
                _ => {}
         116  +
            }
         117  +
            Ok(())
         118  +
        })?;
         119  +
        Ok(builder.build())
         120  +
    }
         121  +
}
         122  +
impl PutResourcePolicyOutput {
         123  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         124  +
    /// Header-bound members are read directly from headers, avoiding runtime
         125  +
    /// member iteration overhead. Body members are read via the deserializer.
         126  +
    pub fn deserialize_with_response(
         127  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         128  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         129  +
        _status: u16,
         130  +
        _body: &[u8],
         131  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         132  +
        #[allow(unused_variables, unused_mut)]
         133  +
        let mut builder = Self::builder();
         134  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         135  +
            builder._request_id = Some(val.to_string());
         136  +
        }
         137  +
         138  +
        #[allow(
         139  +
            unused_variables,
         140  +
            unreachable_code,
         141  +
            clippy::single_match,
         142  +
            clippy::match_single_binding,
         143  +
            clippy::diverging_sub_expression
         144  +
        )]
         145  +
        deserializer.read_struct(&PUTRESOURCEPOLICYOUTPUT_SCHEMA, &mut |member, deser| {
         146  +
            match member.member_index() {
         147  +
                Some(0) => {
         148  +
                    builder.policy_id = Some(deser.read_string(member)?);
         149  +
                }
         150  +
                Some(1) => {
         151  +
                    builder.policy_hash = Some(deser.read_string(member)?);
         152  +
                }
         153  +
                _ => {}
         154  +
            }
         155  +
            Ok(())
         156  +
        })?;
         157  +
        Ok(builder.build())
         158  +
    }
         159  +
}
         160  +
impl ::aws_types::request_id::RequestId for PutResourcePolicyOutput {
         161  +
    fn request_id(&self) -> Option<&str> {
         162  +
        self._request_id.as_deref()
         163  +
    }
         164  +
}
         165  +
impl PutResourcePolicyOutput {
         166  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         167  +
        self._request_id = request_id;
         168  +
        self
         169  +
    }
         170  +
}
         171  +
impl PutResourcePolicyOutput {
         172  +
    /// Creates a new builder-style object to manufacture [`PutResourcePolicyOutput`](crate::operation::put_resource_policy::PutResourcePolicyOutput).
         173  +
    pub fn builder() -> crate::operation::put_resource_policy::builders::PutResourcePolicyOutputBuilder {
         174  +
        crate::operation::put_resource_policy::builders::PutResourcePolicyOutputBuilder::default()
         175  +
    }
         176  +
}
         177  +
         178  +
/// A builder for [`PutResourcePolicyOutput`](crate::operation::put_resource_policy::PutResourcePolicyOutput).
         179  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         180  +
#[non_exhaustive]
         181  +
pub struct PutResourcePolicyOutputBuilder {
         182  +
    pub(crate) policy_id: ::std::option::Option<::std::string::String>,
         183  +
    pub(crate) policy_hash: ::std::option::Option<::std::string::String>,
         184  +
    _request_id: Option<String>,
         185  +
}
         186  +
impl PutResourcePolicyOutputBuilder {
         187  +
    /// <p>The policy ID. To update a policy, you must specify <code>PolicyId</code> and <code>PolicyHash</code>.</p>
         188  +
    pub fn policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         189  +
        self.policy_id = ::std::option::Option::Some(input.into());
         190  +
        self
         191  +
    }
         192  +
    /// <p>The policy ID. To update a policy, you must specify <code>PolicyId</code> and <code>PolicyHash</code>.</p>
         193  +
    pub fn set_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         194  +
        self.policy_id = input;
         195  +
        self
         196  +
    }
         197  +
    /// <p>The policy ID. To update a policy, you must specify <code>PolicyId</code> and <code>PolicyHash</code>.</p>
         198  +
    pub fn get_policy_id(&self) -> &::std::option::Option<::std::string::String> {
         199  +
        &self.policy_id
         200  +
    }
         201  +
    /// <p>ID of the current policy version.</p>
         202  +
    pub fn policy_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         203  +
        self.policy_hash = ::std::option::Option::Some(input.into());
         204  +
        self
         205  +
    }
         206  +
    /// <p>ID of the current policy version.</p>
         207  +
    pub fn set_policy_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         208  +
        self.policy_hash = input;
         209  +
        self
         210  +
    }
         211  +
    /// <p>ID of the current policy version.</p>
         212  +
    pub fn get_policy_hash(&self) -> &::std::option::Option<::std::string::String> {
         213  +
        &self.policy_hash
         214  +
    }
         215  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         216  +
        self._request_id = Some(request_id.into());
         217  +
        self
         218  +
    }
         219  +
         220  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         221  +
        self._request_id = request_id;
         222  +
        self
         223  +
    }
         224  +
    /// Consumes the builder and constructs a [`PutResourcePolicyOutput`](crate::operation::put_resource_policy::PutResourcePolicyOutput).
         225  +
    pub fn build(self) -> crate::operation::put_resource_policy::PutResourcePolicyOutput {
         226  +
        crate::operation::put_resource_policy::PutResourcePolicyOutput {
         227  +
            policy_id: self.policy_id,
         228  +
            policy_hash: self.policy_hash,
         229  +
            _request_id: self._request_id,
         230  +
        }
         231  +
    }
         232  +
}

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

@@ -0,1 +0,178 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::put_resource_policy::_put_resource_policy_input::PutResourcePolicyInputBuilder;
           3  +
           4  +
pub use crate::operation::put_resource_policy::_put_resource_policy_output::PutResourcePolicyOutputBuilder;
           5  +
           6  +
impl crate::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder {
           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::put_resource_policy::PutResourcePolicyOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::put_resource_policy::PutResourcePolicyError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.put_resource_policy();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `PutResourcePolicy`.
          24  +
///
          25  +
/// <p>Creates or updates a Systems Manager resource policy. A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. The following resources support Systems Manager resource policies.</p>
          26  +
/// <ul>
          27  +
/// <li>
          28  +
/// <p><code>OpsItemGroup</code> - The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p></li>
          29  +
/// <li>
          30  +
/// <p><code>Parameter</code> - The resource policy is used to share a parameter with other accounts using Resource Access Manager (RAM).</p>
          31  +
/// <p>To share a parameter, it must be in the advanced parameter tier. For information about parameter tiers, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html">Managing parameter tiers</a>. For information about changing an existing standard parameter to an advanced parameter, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html#parameter-store-advanced-parameters-enabling">Changing a standard parameter to an advanced parameter</a>.</p>
          32  +
/// <p>To share a <code>SecureString</code> parameter, it must be encrypted with a customer managed key, and you must share the key separately through Key Management Service. Amazon Web Services managed keys cannot be shared. Parameters encrypted with the default Amazon Web Services managed key can be updated to use a customer managed key instead. For KMS key definitions, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html">KMS concepts</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
          33  +
/// <p>While you can share a parameter using the Systems Manager <code>PutResourcePolicy</code> operation, we recommend using Resource Access Manager (RAM) instead. This is because using <code>PutResourcePolicy</code> requires the extra step of promoting the parameter to a standard RAM Resource Share using the RAM <a href="https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. Otherwise, the parameter won't be returned by the Systems Manager <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribeParameters.html">DescribeParameters</a> API operation using the <code>--shared</code> option.</p>
          34  +
/// <p>For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html#share">Sharing a parameter</a> in the <i>Amazon Web Services Systems Manager User Guide</i></p>
          35  +
/// </important></li>
          36  +
/// </ul>
          37  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          38  +
pub struct PutResourcePolicyFluentBuilder {
          39  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          40  +
    inner: crate::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder,
          41  +
    config_override: ::std::option::Option<crate::config::Builder>,
          42  +
}
          43  +
impl
          44  +
    crate::client::customize::internal::CustomizableSend<
          45  +
        crate::operation::put_resource_policy::PutResourcePolicyOutput,
          46  +
        crate::operation::put_resource_policy::PutResourcePolicyError,
          47  +
    > for PutResourcePolicyFluentBuilder
          48  +
{
          49  +
    fn send(
          50  +
        self,
          51  +
        config_override: crate::config::Builder,
          52  +
    ) -> crate::client::customize::internal::BoxFuture<
          53  +
        crate::client::customize::internal::SendResult<
          54  +
            crate::operation::put_resource_policy::PutResourcePolicyOutput,
          55  +
            crate::operation::put_resource_policy::PutResourcePolicyError,
          56  +
        >,
          57  +
    > {
          58  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          59  +
    }
          60  +
}
          61  +
impl PutResourcePolicyFluentBuilder {
          62  +
    /// Creates a new `PutResourcePolicyFluentBuilder`.
          63  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          64  +
        Self {
          65  +
            handle,
          66  +
            inner: ::std::default::Default::default(),
          67  +
            config_override: ::std::option::Option::None,
          68  +
        }
          69  +
    }
          70  +
    /// Access the PutResourcePolicy as a reference.
          71  +
    pub fn as_input(&self) -> &crate::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder {
          72  +
        &self.inner
          73  +
    }
          74  +
    /// Sends the request and returns the response.
          75  +
    ///
          76  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          77  +
    /// can be matched against.
          78  +
    ///
          79  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          80  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          81  +
    /// set when configuring the client.
          82  +
    pub async fn send(
          83  +
        self,
          84  +
    ) -> ::std::result::Result<
          85  +
        crate::operation::put_resource_policy::PutResourcePolicyOutput,
          86  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          87  +
            crate::operation::put_resource_policy::PutResourcePolicyError,
          88  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          89  +
        >,
          90  +
    > {
          91  +
        let input = self
          92  +
            .inner
          93  +
            .build()
          94  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          95  +
        let runtime_plugins = crate::operation::put_resource_policy::PutResourcePolicy::operation_runtime_plugins(
          96  +
            self.handle.runtime_plugins.clone(),
          97  +
            &self.handle.conf,
          98  +
            self.config_override,
          99  +
        );
         100  +
        crate::operation::put_resource_policy::PutResourcePolicy::orchestrate(&runtime_plugins, input).await
         101  +
    }
         102  +
         103  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
         104  +
    pub fn customize(
         105  +
        self,
         106  +
    ) -> crate::client::customize::CustomizableOperation<
         107  +
        crate::operation::put_resource_policy::PutResourcePolicyOutput,
         108  +
        crate::operation::put_resource_policy::PutResourcePolicyError,
         109  +
        Self,
         110  +
    > {
         111  +
        crate::client::customize::CustomizableOperation::new(self)
         112  +
    }
         113  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         114  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         115  +
        self
         116  +
    }
         117  +
         118  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         119  +
        self.config_override = config_override;
         120  +
        self
         121  +
    }
         122  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         123  +
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.resource_arn(input.into());
         125  +
        self
         126  +
    }
         127  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         128  +
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         129  +
        self.inner = self.inner.set_resource_arn(input);
         130  +
        self
         131  +
    }
         132  +
    /// <p>Amazon Resource Name (ARN) of the resource to which you want to attach a policy.</p>
         133  +
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
         134  +
        self.inner.get_resource_arn()
         135  +
    }
         136  +
    /// <p>A policy you want to associate with a resource.</p>
         137  +
    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         138  +
        self.inner = self.inner.policy(input.into());
         139  +
        self
         140  +
    }
         141  +
    /// <p>A policy you want to associate with a resource.</p>
         142  +
    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         143  +
        self.inner = self.inner.set_policy(input);
         144  +
        self
         145  +
    }
         146  +
    /// <p>A policy you want to associate with a resource.</p>
         147  +
    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
         148  +
        self.inner.get_policy()
         149  +
    }
         150  +
    /// <p>The policy ID.</p>
         151  +
    pub fn policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         152  +
        self.inner = self.inner.policy_id(input.into());
         153  +
        self
         154  +
    }
         155  +
    /// <p>The policy ID.</p>
         156  +
    pub fn set_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         157  +
        self.inner = self.inner.set_policy_id(input);
         158  +
        self
         159  +
    }
         160  +
    /// <p>The policy ID.</p>
         161  +
    pub fn get_policy_id(&self) -> &::std::option::Option<::std::string::String> {
         162  +
        self.inner.get_policy_id()
         163  +
    }
         164  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         165  +
    pub fn policy_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         166  +
        self.inner = self.inner.policy_hash(input.into());
         167  +
        self
         168  +
    }
         169  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         170  +
    pub fn set_policy_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         171  +
        self.inner = self.inner.set_policy_hash(input);
         172  +
        self
         173  +
    }
         174  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         175  +
    pub fn get_policy_hash(&self) -> &::std::option::Option<::std::string::String> {
         176  +
        self.inner.get_policy_hash()
         177  +
    }
         178  +
}

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

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