AWS SDK

AWS SDK

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_create_custom_key_store_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::create_custom_key_store::CreateCustomKeyStoreInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.custom_key_store_name {
    7         -
        object.key("CustomKeyStoreName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.cloud_hsm_cluster_id {
   10         -
        object.key("CloudHsmClusterId").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.trust_anchor_certificate {
   13         -
        object.key("TrustAnchorCertificate").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.key_store_password {
   16         -
        object.key("KeyStorePassword").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.custom_key_store_type {
   19         -
        object.key("CustomKeyStoreType").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.xks_proxy_uri_endpoint {
   22         -
        object.key("XksProxyUriEndpoint").string(var_6.as_str());
   23         -
    }
   24         -
    if let Some(var_7) = &input.xks_proxy_uri_path {
   25         -
        object.key("XksProxyUriPath").string(var_7.as_str());
   26         -
    }
   27         -
    if let Some(var_8) = &input.xks_proxy_vpc_endpoint_service_name {
   28         -
        object.key("XksProxyVpcEndpointServiceName").string(var_8.as_str());
   29         -
    }
   30         -
    if let Some(var_9) = &input.xks_proxy_authentication_credential {
   31         -
        #[allow(unused_mut)]
   32         -
        let mut object_10 = object.key("XksProxyAuthenticationCredential").start_object();
   33         -
        crate::protocol_serde::shape_xks_proxy_authentication_credential_type::ser_xks_proxy_authentication_credential_type(&mut object_10, var_9)?;
   34         -
        object_10.finish();
   35         -
    }
   36         -
    if let Some(var_11) = &input.xks_proxy_connectivity {
   37         -
        object.key("XksProxyConnectivity").string(var_11.as_str());
   38         -
    }
   39         -
    Ok(())
   40         -
}

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

@@ -1,0 +227,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_create_grant_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::create_grant::CreateGrantOutput, crate::operation::create_grant::CreateGrantError> {
    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::create_grant::CreateGrantError::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::create_grant::CreateGrantError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::create_grant::CreateGrantError::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::create_grant::CreateGrantError::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         -
        "DisabledException" => crate::operation::create_grant::CreateGrantError::DisabledException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::DisabledExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_disabled_exception::de_disabled_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::create_grant::CreateGrantError::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         -
        "DryRunOperationException" => crate::operation::create_grant::CreateGrantError::DryRunOperationException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::DryRunOperationExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_dry_run_operation_exception::de_dry_run_operation_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::create_grant::CreateGrantError::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         -
        "InvalidArnException" => crate::operation::create_grant::CreateGrantError::InvalidArnException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::create_grant::CreateGrantError::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         -
        "InvalidGrantTokenException" => crate::operation::create_grant::CreateGrantError::InvalidGrantTokenException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::InvalidGrantTokenExceptionBuilder::default();
   85         -
                output =
   86         -
                    crate::protocol_serde::shape_invalid_grant_token_exception::de_invalid_grant_token_exception_json_err(_response_body, output)
   87         -
                        .map_err(crate::operation::create_grant::CreateGrantError::unhandled)?;
   88         -
                let output = output.meta(generic);
   89         -
                output.build()
   90         -
            };
   91         -
            if tmp.message.is_none() {
   92         -
                tmp.message = _error_message;
   93         -
            }
   94         -
            tmp
   95         -
        }),
   96         -
        "KMSInternalException" => crate::operation::create_grant::CreateGrantError::KmsInternalException({
   97         -
            #[allow(unused_mut)]
   98         -
            let mut tmp = {
   99         -
                #[allow(unused_mut)]
  100         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
  101         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
  102         -
                    .map_err(crate::operation::create_grant::CreateGrantError::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         -
        "KMSInvalidStateException" => crate::operation::create_grant::CreateGrantError::KmsInvalidStateException({
  112         -
            #[allow(unused_mut)]
  113         -
            let mut tmp = {
  114         -
                #[allow(unused_mut)]
  115         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
  116         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
  117         -
                    .map_err(crate::operation::create_grant::CreateGrantError::unhandled)?;
  118         -
                let output = output.meta(generic);
  119         -
                output.build()
  120         -
            };
  121         -
            if tmp.message.is_none() {
  122         -
                tmp.message = _error_message;
  123         -
            }
  124         -
            tmp
  125         -
        }),
  126         -
        "LimitExceededException" => crate::operation::create_grant::CreateGrantError::LimitExceededException({
  127         -
            #[allow(unused_mut)]
  128         -
            let mut tmp = {
  129         -
                #[allow(unused_mut)]
  130         -
                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
  131         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
  132         -
                    .map_err(crate::operation::create_grant::CreateGrantError::unhandled)?;
  133         -
                let output = output.meta(generic);
  134         -
                output.build()
  135         -
            };
  136         -
            if tmp.message.is_none() {
  137         -
                tmp.message = _error_message;
  138         -
            }
  139         -
            tmp
  140         -
        }),
  141         -
        "NotFoundException" => crate::operation::create_grant::CreateGrantError::NotFoundException({
  142         -
            #[allow(unused_mut)]
  143         -
            let mut tmp = {
  144         -
                #[allow(unused_mut)]
  145         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
  146         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
  147         -
                    .map_err(crate::operation::create_grant::CreateGrantError::unhandled)?;
  148         -
                let output = output.meta(generic);
  149         -
                output.build()
  150         -
            };
  151         -
            if tmp.message.is_none() {
  152         -
                tmp.message = _error_message;
  153         -
            }
  154         -
            tmp
  155         -
        }),
  156         -
        _ => crate::operation::create_grant::CreateGrantError::generic(generic),
  157         -
    })
  158         -
}
  159         -
  160         -
#[allow(clippy::unnecessary_wraps)]
  161         -
pub fn de_create_grant_http_response(
  162         -
    _response_status: u16,
  163         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  164         -
    _response_body: &[u8],
  165         -
) -> std::result::Result<crate::operation::create_grant::CreateGrantOutput, crate::operation::create_grant::CreateGrantError> {
  166         -
    Ok({
  167         -
        #[allow(unused_mut)]
  168         -
        let mut output = crate::operation::create_grant::builders::CreateGrantOutputBuilder::default();
  169         -
        output = crate::protocol_serde::shape_create_grant::de_create_grant(_response_body, output)
  170         -
            .map_err(crate::operation::create_grant::CreateGrantError::unhandled)?;
  171         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  172         -
        output.build()
  173         -
    })
  174         -
}
  175         -
  176         -
pub fn ser_create_grant_input(
  177         -
    input: &crate::operation::create_grant::CreateGrantInput,
  178         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  179         -
    let mut out = String::new();
  180         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  181         -
    crate::protocol_serde::shape_create_grant_input::ser_create_grant_input_input(&mut object, input)?;
  182         -
    object.finish();
  183         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  184         -
}
  185         -
  186         -
pub(crate) fn de_create_grant(
  187         -
    _value: &[u8],
  188         -
    mut builder: crate::operation::create_grant::builders::CreateGrantOutputBuilder,
  189         -
) -> ::std::result::Result<crate::operation::create_grant::builders::CreateGrantOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  190         -
{
  191         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  192         -
    let tokens = &mut tokens_owned;
  193         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  194         -
    loop {
  195         -
        match tokens.next().transpose()? {
  196         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  197         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  198         -
                "GrantToken" => {
  199         -
                    builder = builder.set_grant_token(
  200         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  201         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  202         -
                            .transpose()?,
  203         -
                    );
  204         -
                }
  205         -
                "GrantId" => {
  206         -
                    builder = builder.set_grant_id(
  207         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  208         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  209         -
                            .transpose()?,
  210         -
                    );
  211         -
                }
  212         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  213         -
            },
  214         -
            other => {
  215         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  216         -
                    "expected object key or end object, found: {other:?}"
  217         -
                )))
  218         -
            }
  219         -
        }
  220         -
    }
  221         -
    if tokens.next().is_some() {
  222         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  223         -
            "found more JSON tokens after completing parsing",
  224         -
        ));
  225         -
    }
  226         -
    Ok(builder)
  227         -
}

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_create_grant_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::create_grant::CreateGrantInput,
    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.grantee_principal {
   10         -
        object.key("GranteePrincipal").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.retiring_principal {
   13         -
        object.key("RetiringPrincipal").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.operations {
   16         -
        let mut array_5 = object.key("Operations").start_array();
   17         -
        for item_6 in var_4 {
   18         -
            {
   19         -
                array_5.value().string(item_6.as_str());
   20         -
            }
   21         -
        }
   22         -
        array_5.finish();
   23         -
    }
   24         -
    if let Some(var_7) = &input.constraints {
   25         -
        #[allow(unused_mut)]
   26         -
        let mut object_8 = object.key("Constraints").start_object();
   27         -
        crate::protocol_serde::shape_grant_constraints::ser_grant_constraints(&mut object_8, var_7)?;
   28         -
        object_8.finish();
   29         -
    }
   30         -
    if let Some(var_9) = &input.grant_tokens {
   31         -
        let mut array_10 = object.key("GrantTokens").start_array();
   32         -
        for item_11 in var_9 {
   33         -
            {
   34         -
                array_10.value().string(item_11.as_str());
   35         -
            }
   36         -
        }
   37         -
        array_10.finish();
   38         -
    }
   39         -
    if let Some(var_12) = &input.name {
   40         -
        object.key("Name").string(var_12.as_str());
   41         -
    }
   42         -
    if let Some(var_13) = &input.dry_run {
   43         -
        object.key("DryRun").boolean(*var_13);
   44         -
    }
   45         -
    Ok(())
   46         -
}

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

@@ -1,0 +291,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_create_key_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::create_key::CreateKeyOutput, crate::operation::create_key::CreateKeyError> {
    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::create_key::CreateKeyError::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::create_key::CreateKeyError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "CloudHsmClusterInvalidConfigurationException" => {
   21         -
            crate::operation::create_key::CreateKeyError::CloudHsmClusterInvalidConfigurationException({
   22         -
                #[allow(unused_mut)]
   23         -
                let mut tmp = {
   24         -
                    #[allow(unused_mut)]
   25         -
                    let mut output = crate::types::error::builders::CloudHsmClusterInvalidConfigurationExceptionBuilder::default();
   26         -
                    output = crate::protocol_serde::shape_cloud_hsm_cluster_invalid_configuration_exception::de_cloud_hsm_cluster_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::create_key::CreateKeyError::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         -
        }
   36         -
        "CustomKeyStoreInvalidStateException" => crate::operation::create_key::CreateKeyError::CustomKeyStoreInvalidStateException({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::CustomKeyStoreInvalidStateExceptionBuilder::default();
   41         -
                output = crate::protocol_serde::shape_custom_key_store_invalid_state_exception::de_custom_key_store_invalid_state_exception_json_err(
   42         -
                    _response_body,
   43         -
                    output,
   44         -
                )
   45         -
                .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
   46         -
                let output = output.meta(generic);
   47         -
                output.build()
   48         -
            };
   49         -
            if tmp.message.is_none() {
   50         -
                tmp.message = _error_message;
   51         -
            }
   52         -
            tmp
   53         -
        }),
   54         -
        "CustomKeyStoreNotFoundException" => crate::operation::create_key::CreateKeyError::CustomKeyStoreNotFoundException({
   55         -
            #[allow(unused_mut)]
   56         -
            let mut tmp = {
   57         -
                #[allow(unused_mut)]
   58         -
                let mut output = crate::types::error::builders::CustomKeyStoreNotFoundExceptionBuilder::default();
   59         -
                output = crate::protocol_serde::shape_custom_key_store_not_found_exception::de_custom_key_store_not_found_exception_json_err(
   60         -
                    _response_body,
   61         -
                    output,
   62         -
                )
   63         -
                .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
   64         -
                let output = output.meta(generic);
   65         -
                output.build()
   66         -
            };
   67         -
            if tmp.message.is_none() {
   68         -
                tmp.message = _error_message;
   69         -
            }
   70         -
            tmp
   71         -
        }),
   72         -
        "DependencyTimeoutException" => crate::operation::create_key::CreateKeyError::DependencyTimeoutException({
   73         -
            #[allow(unused_mut)]
   74         -
            let mut tmp = {
   75         -
                #[allow(unused_mut)]
   76         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   77         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   78         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
   79         -
                let output = output.meta(generic);
   80         -
                output.build()
   81         -
            };
   82         -
            if tmp.message.is_none() {
   83         -
                tmp.message = _error_message;
   84         -
            }
   85         -
            tmp
   86         -
        }),
   87         -
        "InvalidArnException" => crate::operation::create_key::CreateKeyError::InvalidArnException({
   88         -
            #[allow(unused_mut)]
   89         -
            let mut tmp = {
   90         -
                #[allow(unused_mut)]
   91         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   92         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   93         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
   94         -
                let output = output.meta(generic);
   95         -
                output.build()
   96         -
            };
   97         -
            if tmp.message.is_none() {
   98         -
                tmp.message = _error_message;
   99         -
            }
  100         -
            tmp
  101         -
        }),
  102         -
        "KMSInternalException" => crate::operation::create_key::CreateKeyError::KmsInternalException({
  103         -
            #[allow(unused_mut)]
  104         -
            let mut tmp = {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
  107         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
  108         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  109         -
                let output = output.meta(generic);
  110         -
                output.build()
  111         -
            };
  112         -
            if tmp.message.is_none() {
  113         -
                tmp.message = _error_message;
  114         -
            }
  115         -
            tmp
  116         -
        }),
  117         -
        "LimitExceededException" => crate::operation::create_key::CreateKeyError::LimitExceededException({
  118         -
            #[allow(unused_mut)]
  119         -
            let mut tmp = {
  120         -
                #[allow(unused_mut)]
  121         -
                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
  122         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
  123         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  124         -
                let output = output.meta(generic);
  125         -
                output.build()
  126         -
            };
  127         -
            if tmp.message.is_none() {
  128         -
                tmp.message = _error_message;
  129         -
            }
  130         -
            tmp
  131         -
        }),
  132         -
        "MalformedPolicyDocumentException" => crate::operation::create_key::CreateKeyError::MalformedPolicyDocumentException({
  133         -
            #[allow(unused_mut)]
  134         -
            let mut tmp = {
  135         -
                #[allow(unused_mut)]
  136         -
                let mut output = crate::types::error::builders::MalformedPolicyDocumentExceptionBuilder::default();
  137         -
                output = crate::protocol_serde::shape_malformed_policy_document_exception::de_malformed_policy_document_exception_json_err(
  138         -
                    _response_body,
  139         -
                    output,
  140         -
                )
  141         -
                .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  142         -
                let output = output.meta(generic);
  143         -
                output.build()
  144         -
            };
  145         -
            if tmp.message.is_none() {
  146         -
                tmp.message = _error_message;
  147         -
            }
  148         -
            tmp
  149         -
        }),
  150         -
        "TagException" => crate::operation::create_key::CreateKeyError::TagException({
  151         -
            #[allow(unused_mut)]
  152         -
            let mut tmp = {
  153         -
                #[allow(unused_mut)]
  154         -
                let mut output = crate::types::error::builders::TagExceptionBuilder::default();
  155         -
                output = crate::protocol_serde::shape_tag_exception::de_tag_exception_json_err(_response_body, output)
  156         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  157         -
                let output = output.meta(generic);
  158         -
                output.build()
  159         -
            };
  160         -
            if tmp.message.is_none() {
  161         -
                tmp.message = _error_message;
  162         -
            }
  163         -
            tmp
  164         -
        }),
  165         -
        "UnsupportedOperationException" => crate::operation::create_key::CreateKeyError::UnsupportedOperationException({
  166         -
            #[allow(unused_mut)]
  167         -
            let mut tmp = {
  168         -
                #[allow(unused_mut)]
  169         -
                let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default();
  170         -
                output =
  171         -
                    crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err(_response_body, output)
  172         -
                        .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  173         -
                let output = output.meta(generic);
  174         -
                output.build()
  175         -
            };
  176         -
            if tmp.message.is_none() {
  177         -
                tmp.message = _error_message;
  178         -
            }
  179         -
            tmp
  180         -
        }),
  181         -
        "XksKeyAlreadyInUseException" => crate::operation::create_key::CreateKeyError::XksKeyAlreadyInUseException({
  182         -
            #[allow(unused_mut)]
  183         -
            let mut tmp = {
  184         -
                #[allow(unused_mut)]
  185         -
                let mut output = crate::types::error::builders::XksKeyAlreadyInUseExceptionBuilder::default();
  186         -
                output = crate::protocol_serde::shape_xks_key_already_in_use_exception::de_xks_key_already_in_use_exception_json_err(
  187         -
                    _response_body,
  188         -
                    output,
  189         -
                )
  190         -
                .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  191         -
                let output = output.meta(generic);
  192         -
                output.build()
  193         -
            };
  194         -
            if tmp.message.is_none() {
  195         -
                tmp.message = _error_message;
  196         -
            }
  197         -
            tmp
  198         -
        }),
  199         -
        "XksKeyInvalidConfigurationException" => crate::operation::create_key::CreateKeyError::XksKeyInvalidConfigurationException({
  200         -
            #[allow(unused_mut)]
  201         -
            let mut tmp = {
  202         -
                #[allow(unused_mut)]
  203         -
                let mut output = crate::types::error::builders::XksKeyInvalidConfigurationExceptionBuilder::default();
  204         -
                output = crate::protocol_serde::shape_xks_key_invalid_configuration_exception::de_xks_key_invalid_configuration_exception_json_err(
  205         -
                    _response_body,
  206         -
                    output,
  207         -
                )
  208         -
                .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  209         -
                let output = output.meta(generic);
  210         -
                output.build()
  211         -
            };
  212         -
            if tmp.message.is_none() {
  213         -
                tmp.message = _error_message;
  214         -
            }
  215         -
            tmp
  216         -
        }),
  217         -
        "XksKeyNotFoundException" => crate::operation::create_key::CreateKeyError::XksKeyNotFoundException({
  218         -
            #[allow(unused_mut)]
  219         -
            let mut tmp = {
  220         -
                #[allow(unused_mut)]
  221         -
                let mut output = crate::types::error::builders::XksKeyNotFoundExceptionBuilder::default();
  222         -
                output = crate::protocol_serde::shape_xks_key_not_found_exception::de_xks_key_not_found_exception_json_err(_response_body, output)
  223         -
                    .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  224         -
                let output = output.meta(generic);
  225         -
                output.build()
  226         -
            };
  227         -
            if tmp.message.is_none() {
  228         -
                tmp.message = _error_message;
  229         -
            }
  230         -
            tmp
  231         -
        }),
  232         -
        _ => crate::operation::create_key::CreateKeyError::generic(generic),
  233         -
    })
  234         -
}
  235         -
  236         -
#[allow(clippy::unnecessary_wraps)]
  237         -
pub fn de_create_key_http_response(
  238         -
    _response_status: u16,
  239         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  240         -
    _response_body: &[u8],
  241         -
) -> std::result::Result<crate::operation::create_key::CreateKeyOutput, crate::operation::create_key::CreateKeyError> {
  242         -
    Ok({
  243         -
        #[allow(unused_mut)]
  244         -
        let mut output = crate::operation::create_key::builders::CreateKeyOutputBuilder::default();
  245         -
        output = crate::protocol_serde::shape_create_key::de_create_key(_response_body, output)
  246         -
            .map_err(crate::operation::create_key::CreateKeyError::unhandled)?;
  247         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  248         -
        output.build()
  249         -
    })
  250         -
}
  251         -
  252         -
pub fn ser_create_key_input(
  253         -
    input: &crate::operation::create_key::CreateKeyInput,
  254         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  255         -
    let mut out = String::new();
  256         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  257         -
    crate::protocol_serde::shape_create_key_input::ser_create_key_input_input(&mut object, input)?;
  258         -
    object.finish();
  259         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  260         -
}
  261         -
  262         -
pub(crate) fn de_create_key(
  263         -
    _value: &[u8],
  264         -
    mut builder: crate::operation::create_key::builders::CreateKeyOutputBuilder,
  265         -
) -> ::std::result::Result<crate::operation::create_key::builders::CreateKeyOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  266         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  267         -
    let tokens = &mut tokens_owned;
  268         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  269         -
    loop {
  270         -
        match tokens.next().transpose()? {
  271         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  272         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  273         -
                "KeyMetadata" => {
  274         -
                    builder = builder.set_key_metadata(crate::protocol_serde::shape_key_metadata::de_key_metadata(tokens, _value)?);
  275         -
                }
  276         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  277         -
            },
  278         -
            other => {
  279         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  280         -
                    "expected object key or end object, found: {other:?}"
  281         -
                )))
  282         -
            }
  283         -
        }
  284         -
    }
  285         -
    if tokens.next().is_some() {
  286         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  287         -
            "found more JSON tokens after completing parsing",
  288         -
        ));
  289         -
    }
  290         -
    Ok(builder)
  291         -
}

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

@@ -1,0 +49,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_create_key_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::create_key::CreateKeyInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.policy {
    7         -
        object.key("Policy").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.description {
   10         -
        object.key("Description").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.key_usage {
   13         -
        object.key("KeyUsage").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.customer_master_key_spec {
   16         -
        object.key("CustomerMasterKeySpec").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.key_spec {
   19         -
        object.key("KeySpec").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.origin {
   22         -
        object.key("Origin").string(var_6.as_str());
   23         -
    }
   24         -
    if let Some(var_7) = &input.custom_key_store_id {
   25         -
        object.key("CustomKeyStoreId").string(var_7.as_str());
   26         -
    }
   27         -
    if let Some(var_8) = &input.bypass_policy_lockout_safety_check {
   28         -
        object.key("BypassPolicyLockoutSafetyCheck").boolean(*var_8);
   29         -
    }
   30         -
    if let Some(var_9) = &input.tags {
   31         -
        let mut array_10 = object.key("Tags").start_array();
   32         -
        for item_11 in var_9 {
   33         -
            {
   34         -
                #[allow(unused_mut)]
   35         -
                let mut object_12 = array_10.value().start_object();
   36         -
                crate::protocol_serde::shape_tag::ser_tag(&mut object_12, item_11)?;
   37         -
                object_12.finish();
   38         -
            }
   39         -
        }
   40         -
        array_10.finish();
   41         -
    }
   42         -
    if let Some(var_13) = &input.multi_region {
   43         -
        object.key("MultiRegion").boolean(*var_13);
   44         -
    }
   45         -
    if let Some(var_14) = &input.xks_key_id {
   46         -
        object.key("XksKeyId").string(var_14.as_str());
   47         -
    }
   48         -
    Ok(())
   49         -
}

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

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

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

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

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

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

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

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

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_custom_key_stores_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::CustomKeyStoresListEntry>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = crate::protocol_serde::shape_custom_key_stores_list_entry::de_custom_key_stores_list_entry(tokens, _value)?;
   21         -
                        if let Some(value) = value {
   22         -
                            items.push(value);
   23         -
                        } else {
   24         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                "dense list cannot contain null values",
   26         -
                            ));
   27         -
                        }
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(items))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start array or null",
   35         -
        )),
   36         -
    }
   37         -
}

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

@@ -1,0 +93,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_custom_key_stores_list_entry<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::CustomKeyStoresListEntry>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::CustomKeyStoresListEntryBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "CustomKeyStoreId" => {
   19         -
                            builder = builder.set_custom_key_store_id(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "CustomKeyStoreName" => {
   26         -
                            builder = builder.set_custom_key_store_name(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "CloudHsmClusterId" => {
   33         -
                            builder = builder.set_cloud_hsm_cluster_id(
   34         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   35         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   36         -
                                    .transpose()?,
   37         -
                            );
   38         -
                        }
   39         -
                        "TrustAnchorCertificate" => {
   40         -
                            builder = builder.set_trust_anchor_certificate(
   41         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   42         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   43         -
                                    .transpose()?,
   44         -
                            );
   45         -
                        }
   46         -
                        "ConnectionState" => {
   47         -
                            builder = builder.set_connection_state(
   48         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   49         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ConnectionStateType::from(u.as_ref())))
   50         -
                                    .transpose()?,
   51         -
                            );
   52         -
                        }
   53         -
                        "ConnectionErrorCode" => {
   54         -
                            builder = builder.set_connection_error_code(
   55         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   56         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ConnectionErrorCodeType::from(u.as_ref())))
   57         -
                                    .transpose()?,
   58         -
                            );
   59         -
                        }
   60         -
                        "CreationDate" => {
   61         -
                            builder = builder.set_creation_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   62         -
                                tokens.next(),
   63         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   64         -
                            )?);
   65         -
                        }
   66         -
                        "CustomKeyStoreType" => {
   67         -
                            builder = builder.set_custom_key_store_type(
   68         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   69         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::CustomKeyStoreType::from(u.as_ref())))
   70         -
                                    .transpose()?,
   71         -
                            );
   72         -
                        }
   73         -
                        "XksProxyConfiguration" => {
   74         -
                            builder = builder.set_xks_proxy_configuration(
   75         -
                                crate::protocol_serde::shape_xks_proxy_configuration_type::de_xks_proxy_configuration_type(tokens, _value)?,
   76         -
                            );
   77         -
                        }
   78         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   79         -
                    },
   80         -
                    other => {
   81         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   82         -
                            "expected object key or end object, found: {other:?}"
   83         -
                        )))
   84         -
                    }
   85         -
                }
   86         -
            }
   87         -
            Ok(Some(builder.build()))
   88         -
        }
   89         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   90         -
            "expected start object or null",
   91         -
        )),
   92         -
    }
   93         -
}

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

@@ -1,0 +269,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_decrypt_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::decrypt::DecryptOutput, crate::operation::decrypt::DecryptError> {
    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::decrypt::DecryptError::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::decrypt::DecryptError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::decrypt::DecryptError::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::decrypt::DecryptError::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         -
        "DisabledException" => crate::operation::decrypt::DecryptError::DisabledException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::DisabledExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_disabled_exception::de_disabled_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::decrypt::DecryptError::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         -
        "DryRunOperationException" => crate::operation::decrypt::DecryptError::DryRunOperationException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::DryRunOperationExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_dry_run_operation_exception::de_dry_run_operation_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::decrypt::DecryptError::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         -
        "IncorrectKeyException" => crate::operation::decrypt::DecryptError::IncorrectKeyException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::IncorrectKeyExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_incorrect_key_exception::de_incorrect_key_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::decrypt::DecryptError::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         -
        "InvalidCiphertextException" => crate::operation::decrypt::DecryptError::InvalidCiphertextException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::InvalidCiphertextExceptionBuilder::default();
   85         -
                output = crate::protocol_serde::shape_invalid_ciphertext_exception::de_invalid_ciphertext_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::decrypt::DecryptError::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         -
        "InvalidGrantTokenException" => crate::operation::decrypt::DecryptError::InvalidGrantTokenException({
   96         -
            #[allow(unused_mut)]
   97         -
            let mut tmp = {
   98         -
                #[allow(unused_mut)]
   99         -
                let mut output = crate::types::error::builders::InvalidGrantTokenExceptionBuilder::default();
  100         -
                output =
  101         -
                    crate::protocol_serde::shape_invalid_grant_token_exception::de_invalid_grant_token_exception_json_err(_response_body, output)
  102         -
                        .map_err(crate::operation::decrypt::DecryptError::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         -
        "InvalidKeyUsageException" => crate::operation::decrypt::DecryptError::InvalidKeyUsageException({
  112         -
            #[allow(unused_mut)]
  113         -
            let mut tmp = {
  114         -
                #[allow(unused_mut)]
  115         -
                let mut output = crate::types::error::builders::InvalidKeyUsageExceptionBuilder::default();
  116         -
                output = crate::protocol_serde::shape_invalid_key_usage_exception::de_invalid_key_usage_exception_json_err(_response_body, output)
  117         -
                    .map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  118         -
                let output = output.meta(generic);
  119         -
                output.build()
  120         -
            };
  121         -
            if tmp.message.is_none() {
  122         -
                tmp.message = _error_message;
  123         -
            }
  124         -
            tmp
  125         -
        }),
  126         -
        "KeyUnavailableException" => crate::operation::decrypt::DecryptError::KeyUnavailableException({
  127         -
            #[allow(unused_mut)]
  128         -
            let mut tmp = {
  129         -
                #[allow(unused_mut)]
  130         -
                let mut output = crate::types::error::builders::KeyUnavailableExceptionBuilder::default();
  131         -
                output = crate::protocol_serde::shape_key_unavailable_exception::de_key_unavailable_exception_json_err(_response_body, output)
  132         -
                    .map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  133         -
                let output = output.meta(generic);
  134         -
                output.build()
  135         -
            };
  136         -
            if tmp.message.is_none() {
  137         -
                tmp.message = _error_message;
  138         -
            }
  139         -
            tmp
  140         -
        }),
  141         -
        "KMSInternalException" => crate::operation::decrypt::DecryptError::KmsInternalException({
  142         -
            #[allow(unused_mut)]
  143         -
            let mut tmp = {
  144         -
                #[allow(unused_mut)]
  145         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
  146         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
  147         -
                    .map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  148         -
                let output = output.meta(generic);
  149         -
                output.build()
  150         -
            };
  151         -
            if tmp.message.is_none() {
  152         -
                tmp.message = _error_message;
  153         -
            }
  154         -
            tmp
  155         -
        }),
  156         -
        "KMSInvalidStateException" => crate::operation::decrypt::DecryptError::KmsInvalidStateException({
  157         -
            #[allow(unused_mut)]
  158         -
            let mut tmp = {
  159         -
                #[allow(unused_mut)]
  160         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
  161         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
  162         -
                    .map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  163         -
                let output = output.meta(generic);
  164         -
                output.build()
  165         -
            };
  166         -
            if tmp.message.is_none() {
  167         -
                tmp.message = _error_message;
  168         -
            }
  169         -
            tmp
  170         -
        }),
  171         -
        "NotFoundException" => crate::operation::decrypt::DecryptError::NotFoundException({
  172         -
            #[allow(unused_mut)]
  173         -
            let mut tmp = {
  174         -
                #[allow(unused_mut)]
  175         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
  176         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
  177         -
                    .map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  178         -
                let output = output.meta(generic);
  179         -
                output.build()
  180         -
            };
  181         -
            if tmp.message.is_none() {
  182         -
                tmp.message = _error_message;
  183         -
            }
  184         -
            tmp
  185         -
        }),
  186         -
        _ => crate::operation::decrypt::DecryptError::generic(generic),
  187         -
    })
  188         -
}
  189         -
  190         -
#[allow(clippy::unnecessary_wraps)]
  191         -
pub fn de_decrypt_http_response(
  192         -
    _response_status: u16,
  193         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  194         -
    _response_body: &[u8],
  195         -
) -> std::result::Result<crate::operation::decrypt::DecryptOutput, crate::operation::decrypt::DecryptError> {
  196         -
    Ok({
  197         -
        #[allow(unused_mut)]
  198         -
        let mut output = crate::operation::decrypt::builders::DecryptOutputBuilder::default();
  199         -
        output =
  200         -
            crate::protocol_serde::shape_decrypt::de_decrypt(_response_body, output).map_err(crate::operation::decrypt::DecryptError::unhandled)?;
  201         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  202         -
        output.build()
  203         -
    })
  204         -
}
  205         -
  206         -
pub fn ser_decrypt_input(
  207         -
    input: &crate::operation::decrypt::DecryptInput,
  208         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  209         -
    let mut out = String::new();
  210         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  211         -
    crate::protocol_serde::shape_decrypt_input::ser_decrypt_input_input(&mut object, input)?;
  212         -
    object.finish();
  213         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  214         -
}
  215         -
  216         -
pub(crate) fn de_decrypt(
  217         -
    _value: &[u8],
  218         -
    mut builder: crate::operation::decrypt::builders::DecryptOutputBuilder,
  219         -
) -> ::std::result::Result<crate::operation::decrypt::builders::DecryptOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  220         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  221         -
    let tokens = &mut tokens_owned;
  222         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  223         -
    loop {
  224         -
        match tokens.next().transpose()? {
  225         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  226         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  227         -
                "KeyId" => {
  228         -
                    builder = builder.set_key_id(
  229         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  230         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  231         -
                            .transpose()?,
  232         -
                    );
  233         -
                }
  234         -
                "Plaintext" => {
  235         -
                    builder = builder.set_plaintext(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  236         -
                }
  237         -
                "EncryptionAlgorithm" => {
  238         -
                    builder = builder.set_encryption_algorithm(
  239         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  240         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::EncryptionAlgorithmSpec::from(u.as_ref())))
  241         -
                            .transpose()?,
  242         -
                    );
  243         -
                }
  244         -
                "CiphertextForRecipient" => {
  245         -
                    builder = builder.set_ciphertext_for_recipient(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  246         -
                }
  247         -
                "KeyMaterialId" => {
  248         -
                    builder = builder.set_key_material_id(
  249         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  250         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  251         -
                            .transpose()?,
  252         -
                    );
  253         -
                }
  254         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  255         -
            },
  256         -
            other => {
  257         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  258         -
                    "expected object key or end object, found: {other:?}"
  259         -
                )))
  260         -
            }
  261         -
        }
  262         -
    }
  263         -
    if tokens.next().is_some() {
  264         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  265         -
            "found more JSON tokens after completing parsing",
  266         -
        ));
  267         -
    }
  268         -
    Ok(builder)
  269         -
}