AWS SDK

AWS SDK

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_key_unavailable_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_key_unavailable_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::KeyUnavailableExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::KeyUnavailableExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_kms_internal_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kms_internal_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::KmsInternalExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::KmsInternalExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_kms_invalid_mac_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kms_invalid_mac_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::KmsInvalidMacExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::KmsInvalidMacExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_kms_invalid_signature_exception.rs

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kms_invalid_signature_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::KmsInvalidSignatureExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::KmsInvalidSignatureExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
{
    7         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    8         -
    let tokens = &mut tokens_owned;
    9         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   10         -
    loop {
   11         -
        match tokens.next().transpose()? {
   12         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   13         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   14         -
                "message" => {
   15         -
                    builder = builder.set_message(
   16         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   17         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   18         -
                            .transpose()?,
   19         -
                    );
   20         -
                }
   21         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   22         -
            },
   23         -
            other => {
   24         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   25         -
                    "expected object key or end object, found: {other:?}"
   26         -
                )))
   27         -
            }
   28         -
        }
   29         -
    }
   30         -
    if tokens.next().is_some() {
   31         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "found more JSON tokens after completing parsing",
   33         -
        ));
   34         -
    }
   35         -
    Ok(builder)
   36         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_kms_invalid_state_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kms_invalid_state_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::KmsInvalidStateExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::KmsInvalidStateExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_limit_exceeded_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_limit_exceeded_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::LimitExceededExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::LimitExceededExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_aliases.rs

@@ -1,0 +165,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_aliases_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_aliases::ListAliasesOutput, crate::operation::list_aliases::ListAliasesError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_aliases::ListAliasesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::list_aliases::ListAliasesError::DependencyTimeoutException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InvalidArnException" => crate::operation::list_aliases::ListAliasesError::InvalidArnException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "InvalidMarkerException" => crate::operation::list_aliases::ListAliasesError::InvalidMarkerException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::InvalidMarkerExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_invalid_marker_exception::de_invalid_marker_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "KMSInternalException" => crate::operation::list_aliases::ListAliasesError::KmsInternalException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "NotFoundException" => crate::operation::list_aliases::ListAliasesError::NotFoundException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        _ => crate::operation::list_aliases::ListAliasesError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_list_aliases_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<crate::operation::list_aliases::ListAliasesOutput, crate::operation::list_aliases::ListAliasesError> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::list_aliases::builders::ListAliasesOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_list_aliases::de_list_aliases(_response_body, output)
  109         -
            .map_err(crate::operation::list_aliases::ListAliasesError::unhandled)?;
  110         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  111         -
        output.build()
  112         -
    })
  113         -
}
  114         -
  115         -
pub fn ser_list_aliases_input(
  116         -
    input: &crate::operation::list_aliases::ListAliasesInput,
  117         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  118         -
    let mut out = String::new();
  119         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  120         -
    crate::protocol_serde::shape_list_aliases_input::ser_list_aliases_input_input(&mut object, input)?;
  121         -
    object.finish();
  122         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  123         -
}
  124         -
  125         -
pub(crate) fn de_list_aliases(
  126         -
    _value: &[u8],
  127         -
    mut builder: crate::operation::list_aliases::builders::ListAliasesOutputBuilder,
  128         -
) -> ::std::result::Result<crate::operation::list_aliases::builders::ListAliasesOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  129         -
{
  130         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  131         -
    let tokens = &mut tokens_owned;
  132         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  133         -
    loop {
  134         -
        match tokens.next().transpose()? {
  135         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  136         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  137         -
                "Aliases" => {
  138         -
                    builder = builder.set_aliases(crate::protocol_serde::shape_alias_list::de_alias_list(tokens, _value)?);
  139         -
                }
  140         -
                "NextMarker" => {
  141         -
                    builder = builder.set_next_marker(
  142         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  143         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  144         -
                            .transpose()?,
  145         -
                    );
  146         -
                }
  147         -
                "Truncated" => {
  148         -
                    builder = builder.set_truncated(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  149         -
                }
  150         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  151         -
            },
  152         -
            other => {
  153         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  154         -
                    "expected object key or end object, found: {other:?}"
  155         -
                )))
  156         -
            }
  157         -
        }
  158         -
    }
  159         -
    if tokens.next().is_some() {
  160         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  161         -
            "found more JSON tokens after completing parsing",
  162         -
        ));
  163         -
    }
  164         -
    Ok(builder)
  165         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_aliases_input.rs

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_aliases_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_aliases::ListAliasesInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.key_id {
    7         -
        object.key("KeyId").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.limit {
   10         -
        object.key("Limit").number(
   11         -
            #[allow(clippy::useless_conversion)]
   12         -
            ::aws_smithy_types::Number::NegInt((*var_2).into()),
   13         -
        );
   14         -
    }
   15         -
    if let Some(var_3) = &input.marker {
   16         -
        object.key("Marker").string(var_3.as_str());
   17         -
    }
   18         -
    Ok(())
   19         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_grants.rs

@@ -1,0 +195,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_grants_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_grants::ListGrantsOutput, crate::operation::list_grants::ListGrantsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_grants::ListGrantsError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::list_grants::ListGrantsError::DependencyTimeoutException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InvalidArnException" => crate::operation::list_grants::ListGrantsError::InvalidArnException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "InvalidGrantIdException" => crate::operation::list_grants::ListGrantsError::InvalidGrantIdException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::InvalidGrantIdExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_invalid_grant_id_exception::de_invalid_grant_id_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "InvalidMarkerException" => crate::operation::list_grants::ListGrantsError::InvalidMarkerException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::InvalidMarkerExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_invalid_marker_exception::de_invalid_marker_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "KMSInternalException" => crate::operation::list_grants::ListGrantsError::KmsInternalException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        "KMSInvalidStateException" => crate::operation::list_grants::ListGrantsError::KmsInvalidStateException({
   96         -
            #[allow(unused_mut)]
   97         -
            let mut tmp = {
   98         -
                #[allow(unused_mut)]
   99         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
  100         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
  101         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
  102         -
                let output = output.meta(generic);
  103         -
                output.build()
  104         -
            };
  105         -
            if tmp.message.is_none() {
  106         -
                tmp.message = _error_message;
  107         -
            }
  108         -
            tmp
  109         -
        }),
  110         -
        "NotFoundException" => crate::operation::list_grants::ListGrantsError::NotFoundException({
  111         -
            #[allow(unused_mut)]
  112         -
            let mut tmp = {
  113         -
                #[allow(unused_mut)]
  114         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
  115         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
  116         -
                    .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
  117         -
                let output = output.meta(generic);
  118         -
                output.build()
  119         -
            };
  120         -
            if tmp.message.is_none() {
  121         -
                tmp.message = _error_message;
  122         -
            }
  123         -
            tmp
  124         -
        }),
  125         -
        _ => crate::operation::list_grants::ListGrantsError::generic(generic),
  126         -
    })
  127         -
}
  128         -
  129         -
#[allow(clippy::unnecessary_wraps)]
  130         -
pub fn de_list_grants_http_response(
  131         -
    _response_status: u16,
  132         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  133         -
    _response_body: &[u8],
  134         -
) -> std::result::Result<crate::operation::list_grants::ListGrantsOutput, crate::operation::list_grants::ListGrantsError> {
  135         -
    Ok({
  136         -
        #[allow(unused_mut)]
  137         -
        let mut output = crate::operation::list_grants::builders::ListGrantsOutputBuilder::default();
  138         -
        output = crate::protocol_serde::shape_list_grants::de_list_grants(_response_body, output)
  139         -
            .map_err(crate::operation::list_grants::ListGrantsError::unhandled)?;
  140         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  141         -
        output.build()
  142         -
    })
  143         -
}
  144         -
  145         -
pub fn ser_list_grants_input(
  146         -
    input: &crate::operation::list_grants::ListGrantsInput,
  147         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  148         -
    let mut out = String::new();
  149         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  150         -
    crate::protocol_serde::shape_list_grants_input::ser_list_grants_input_input(&mut object, input)?;
  151         -
    object.finish();
  152         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  153         -
}
  154         -
  155         -
pub(crate) fn de_list_grants(
  156         -
    _value: &[u8],
  157         -
    mut builder: crate::operation::list_grants::builders::ListGrantsOutputBuilder,
  158         -
) -> ::std::result::Result<crate::operation::list_grants::builders::ListGrantsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  159         -
{
  160         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  161         -
    let tokens = &mut tokens_owned;
  162         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  163         -
    loop {
  164         -
        match tokens.next().transpose()? {
  165         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  166         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  167         -
                "Grants" => {
  168         -
                    builder = builder.set_grants(crate::protocol_serde::shape_grant_list::de_grant_list(tokens, _value)?);
  169         -
                }
  170         -
                "NextMarker" => {
  171         -
                    builder = builder.set_next_marker(
  172         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  173         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  174         -
                            .transpose()?,
  175         -
                    );
  176         -
                }
  177         -
                "Truncated" => {
  178         -
                    builder = builder.set_truncated(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  179         -
                }
  180         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  181         -
            },
  182         -
            other => {
  183         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  184         -
                    "expected object key or end object, found: {other:?}"
  185         -
                )))
  186         -
            }
  187         -
        }
  188         -
    }
  189         -
    if tokens.next().is_some() {
  190         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  191         -
            "found more JSON tokens after completing parsing",
  192         -
        ));
  193         -
    }
  194         -
    Ok(builder)
  195         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_grants_input.rs

@@ -1,0 +25,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_grants_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_grants::ListGrantsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.limit {
    7         -
        object.key("Limit").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.marker {
   13         -
        object.key("Marker").string(var_2.as_str());
   14         -
    }
   15         -
    if let Some(var_3) = &input.key_id {
   16         -
        object.key("KeyId").string(var_3.as_str());
   17         -
    }
   18         -
    if let Some(var_4) = &input.grant_id {
   19         -
        object.key("GrantId").string(var_4.as_str());
   20         -
    }
   21         -
    if let Some(var_5) = &input.grantee_principal {
   22         -
        object.key("GranteePrincipal").string(var_5.as_str());
   23         -
    }
   24         -
    Ok(())
   25         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_key_policies.rs

@@ -1,0 +167,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_key_policies_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_key_policies::ListKeyPoliciesOutput, crate::operation::list_key_policies::ListKeyPoliciesError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::list_key_policies::ListKeyPoliciesError::DependencyTimeoutException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InvalidArnException" => crate::operation::list_key_policies::ListKeyPoliciesError::InvalidArnException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "KMSInternalException" => crate::operation::list_key_policies::ListKeyPoliciesError::KmsInternalException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "KMSInvalidStateException" => crate::operation::list_key_policies::ListKeyPoliciesError::KmsInvalidStateException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "NotFoundException" => crate::operation::list_key_policies::ListKeyPoliciesError::NotFoundException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        _ => crate::operation::list_key_policies::ListKeyPoliciesError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_list_key_policies_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<crate::operation::list_key_policies::ListKeyPoliciesOutput, crate::operation::list_key_policies::ListKeyPoliciesError> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::list_key_policies::builders::ListKeyPoliciesOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_list_key_policies::de_list_key_policies(_response_body, output)
  109         -
            .map_err(crate::operation::list_key_policies::ListKeyPoliciesError::unhandled)?;
  110         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  111         -
        output.build()
  112         -
    })
  113         -
}
  114         -
  115         -
pub fn ser_list_key_policies_input(
  116         -
    input: &crate::operation::list_key_policies::ListKeyPoliciesInput,
  117         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  118         -
    let mut out = String::new();
  119         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  120         -
    crate::protocol_serde::shape_list_key_policies_input::ser_list_key_policies_input_input(&mut object, input)?;
  121         -
    object.finish();
  122         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  123         -
}
  124         -
  125         -
pub(crate) fn de_list_key_policies(
  126         -
    _value: &[u8],
  127         -
    mut builder: crate::operation::list_key_policies::builders::ListKeyPoliciesOutputBuilder,
  128         -
) -> ::std::result::Result<
  129         -
    crate::operation::list_key_policies::builders::ListKeyPoliciesOutputBuilder,
  130         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  131         -
> {
  132         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  133         -
    let tokens = &mut tokens_owned;
  134         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  135         -
    loop {
  136         -
        match tokens.next().transpose()? {
  137         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  138         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  139         -
                "PolicyNames" => {
  140         -
                    builder = builder.set_policy_names(crate::protocol_serde::shape_policy_name_list::de_policy_name_list(tokens, _value)?);
  141         -
                }
  142         -
                "NextMarker" => {
  143         -
                    builder = builder.set_next_marker(
  144         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  145         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  146         -
                            .transpose()?,
  147         -
                    );
  148         -
                }
  149         -
                "Truncated" => {
  150         -
                    builder = builder.set_truncated(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  151         -
                }
  152         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  153         -
            },
  154         -
            other => {
  155         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  156         -
                    "expected object key or end object, found: {other:?}"
  157         -
                )))
  158         -
            }
  159         -
        }
  160         -
    }
  161         -
    if tokens.next().is_some() {
  162         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  163         -
            "found more JSON tokens after completing parsing",
  164         -
        ));
  165         -
    }
  166         -
    Ok(builder)
  167         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_key_policies_input.rs

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_key_policies_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_key_policies::ListKeyPoliciesInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.key_id {
    7         -
        object.key("KeyId").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.limit {
   10         -
        object.key("Limit").number(
   11         -
            #[allow(clippy::useless_conversion)]
   12         -
            ::aws_smithy_types::Number::NegInt((*var_2).into()),
   13         -
        );
   14         -
    }
   15         -
    if let Some(var_3) = &input.marker {
   16         -
        object.key("Marker").string(var_3.as_str());
   17         -
    }
   18         -
    Ok(())
   19         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_key_rotations.rs

@@ -1,0 +183,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_key_rotations_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_key_rotations::ListKeyRotationsOutput, crate::operation::list_key_rotations::ListKeyRotationsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidArnException" => crate::operation::list_key_rotations::ListKeyRotationsError::InvalidArnException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InvalidMarkerException" => crate::operation::list_key_rotations::ListKeyRotationsError::InvalidMarkerException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InvalidMarkerExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_invalid_marker_exception::de_invalid_marker_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "KMSInternalException" => crate::operation::list_key_rotations::ListKeyRotationsError::KmsInternalException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "KMSInvalidStateException" => crate::operation::list_key_rotations::ListKeyRotationsError::KmsInvalidStateException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "NotFoundException" => crate::operation::list_key_rotations::ListKeyRotationsError::NotFoundException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        "UnsupportedOperationException" => crate::operation::list_key_rotations::ListKeyRotationsError::UnsupportedOperationException({
   96         -
            #[allow(unused_mut)]
   97         -
            let mut tmp = {
   98         -
                #[allow(unused_mut)]
   99         -
                let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default();
  100         -
                output =
  101         -
                    crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err(_response_body, output)
  102         -
                        .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
  103         -
                let output = output.meta(generic);
  104         -
                output.build()
  105         -
            };
  106         -
            if tmp.message.is_none() {
  107         -
                tmp.message = _error_message;
  108         -
            }
  109         -
            tmp
  110         -
        }),
  111         -
        _ => crate::operation::list_key_rotations::ListKeyRotationsError::generic(generic),
  112         -
    })
  113         -
}
  114         -
  115         -
#[allow(clippy::unnecessary_wraps)]
  116         -
pub fn de_list_key_rotations_http_response(
  117         -
    _response_status: u16,
  118         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  119         -
    _response_body: &[u8],
  120         -
) -> std::result::Result<crate::operation::list_key_rotations::ListKeyRotationsOutput, crate::operation::list_key_rotations::ListKeyRotationsError> {
  121         -
    Ok({
  122         -
        #[allow(unused_mut)]
  123         -
        let mut output = crate::operation::list_key_rotations::builders::ListKeyRotationsOutputBuilder::default();
  124         -
        output = crate::protocol_serde::shape_list_key_rotations::de_list_key_rotations(_response_body, output)
  125         -
            .map_err(crate::operation::list_key_rotations::ListKeyRotationsError::unhandled)?;
  126         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  127         -
        output.build()
  128         -
    })
  129         -
}
  130         -
  131         -
pub fn ser_list_key_rotations_input(
  132         -
    input: &crate::operation::list_key_rotations::ListKeyRotationsInput,
  133         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  134         -
    let mut out = String::new();
  135         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  136         -
    crate::protocol_serde::shape_list_key_rotations_input::ser_list_key_rotations_input_input(&mut object, input)?;
  137         -
    object.finish();
  138         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  139         -
}
  140         -
  141         -
pub(crate) fn de_list_key_rotations(
  142         -
    _value: &[u8],
  143         -
    mut builder: crate::operation::list_key_rotations::builders::ListKeyRotationsOutputBuilder,
  144         -
) -> ::std::result::Result<
  145         -
    crate::operation::list_key_rotations::builders::ListKeyRotationsOutputBuilder,
  146         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  147         -
> {
  148         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  149         -
    let tokens = &mut tokens_owned;
  150         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  151         -
    loop {
  152         -
        match tokens.next().transpose()? {
  153         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  154         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  155         -
                "Rotations" => {
  156         -
                    builder = builder.set_rotations(crate::protocol_serde::shape_rotations_list::de_rotations_list(tokens, _value)?);
  157         -
                }
  158         -
                "NextMarker" => {
  159         -
                    builder = builder.set_next_marker(
  160         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  161         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  162         -
                            .transpose()?,
  163         -
                    );
  164         -
                }
  165         -
                "Truncated" => {
  166         -
                    builder = builder.set_truncated(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  167         -
                }
  168         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  169         -
            },
  170         -
            other => {
  171         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  172         -
                    "expected object key or end object, found: {other:?}"
  173         -
                )))
  174         -
            }
  175         -
        }
  176         -
    }
  177         -
    if tokens.next().is_some() {
  178         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  179         -
            "found more JSON tokens after completing parsing",
  180         -
        ));
  181         -
    }
  182         -
    Ok(builder)
  183         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_list_key_rotations_input.rs

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_key_rotations_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_key_rotations::ListKeyRotationsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.key_id {
    7         -
        object.key("KeyId").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.include_key_material {
   10         -
        object.key("IncludeKeyMaterial").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.limit {
   13         -
        object.key("Limit").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((*var_3).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_4) = &input.marker {
   19         -
        object.key("Marker").string(var_4.as_str());
   20         -
    }
   21         -
    Ok(())
   22         -
}