AWS SDK

AWS SDK

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

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

@@ -1,0 +44,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_decrypt_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::decrypt::DecryptInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.ciphertext_blob {
    7         -
        object.key("CiphertextBlob").string_unchecked(&::aws_smithy_types::base64::encode(var_1));
    8         -
    }
    9         -
    if let Some(var_2) = &input.encryption_context {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("EncryptionContext").start_object();
   12         -
        for (key_4, value_5) in var_2 {
   13         -
            {
   14         -
                object_3.key(key_4.as_str()).string(value_5.as_str());
   15         -
            }
   16         -
        }
   17         -
        object_3.finish();
   18         -
    }
   19         -
    if let Some(var_6) = &input.grant_tokens {
   20         -
        let mut array_7 = object.key("GrantTokens").start_array();
   21         -
        for item_8 in var_6 {
   22         -
            {
   23         -
                array_7.value().string(item_8.as_str());
   24         -
            }
   25         -
        }
   26         -
        array_7.finish();
   27         -
    }
   28         -
    if let Some(var_9) = &input.key_id {
   29         -
        object.key("KeyId").string(var_9.as_str());
   30         -
    }
   31         -
    if let Some(var_10) = &input.encryption_algorithm {
   32         -
        object.key("EncryptionAlgorithm").string(var_10.as_str());
   33         -
    }
   34         -
    if let Some(var_11) = &input.recipient {
   35         -
        #[allow(unused_mut)]
   36         -
        let mut object_12 = object.key("Recipient").start_object();
   37         -
        crate::protocol_serde::shape_recipient_info::ser_recipient_info(&mut object_12, var_11)?;
   38         -
        object_12.finish();
   39         -
    }
   40         -
    if let Some(var_13) = &input.dry_run {
   41         -
        object.key("DryRun").boolean(*var_13);
   42         -
    }
   43         -
    Ok(())
   44         -
}

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

@@ -1,0 +106,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_delete_alias_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::delete_alias::DeleteAliasOutput, crate::operation::delete_alias::DeleteAliasError> {
    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::delete_alias::DeleteAliasError::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::delete_alias::DeleteAliasError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::delete_alias::DeleteAliasError::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::delete_alias::DeleteAliasError::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         -
        "KMSInternalException" => crate::operation::delete_alias::DeleteAliasError::KmsInternalException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::delete_alias::DeleteAliasError::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         -
        "KMSInvalidStateException" => crate::operation::delete_alias::DeleteAliasError::KmsInvalidStateException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::delete_alias::DeleteAliasError::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         -
        "NotFoundException" => crate::operation::delete_alias::DeleteAliasError::NotFoundException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::delete_alias::DeleteAliasError::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         -
        _ => crate::operation::delete_alias::DeleteAliasError::generic(generic),
   81         -
    })
   82         -
}
   83         -
   84         -
#[allow(clippy::unnecessary_wraps)]
   85         -
pub fn de_delete_alias_http_response(
   86         -
    _response_status: u16,
   87         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   88         -
    _response_body: &[u8],
   89         -
) -> std::result::Result<crate::operation::delete_alias::DeleteAliasOutput, crate::operation::delete_alias::DeleteAliasError> {
   90         -
    Ok({
   91         -
        #[allow(unused_mut)]
   92         -
        let mut output = crate::operation::delete_alias::builders::DeleteAliasOutputBuilder::default();
   93         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   94         -
        output.build()
   95         -
    })
   96         -
}
   97         -
   98         -
pub fn ser_delete_alias_input(
   99         -
    input: &crate::operation::delete_alias::DeleteAliasInput,
  100         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  101         -
    let mut out = String::new();
  102         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  103         -
    crate::protocol_serde::shape_delete_alias_input::ser_delete_alias_input_input(&mut object, input)?;
  104         -
    object.finish();
  105         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  106         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_delete_alias_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::delete_alias::DeleteAliasInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.alias_name {
    7         -
        object.key("AliasName").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

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

@@ -1,0 +124,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_delete_custom_key_store_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
    9         -
    crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => return Err(crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "CustomKeyStoreHasCMKsException" => crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::CustomKeyStoreHasCmKsException({
   24         -
            #[allow(unused_mut)]
   25         -
            let mut tmp = {
   26         -
                #[allow(unused_mut)]
   27         -
                let mut output = crate::types::error::builders::CustomKeyStoreHasCmKsExceptionBuilder::default();
   28         -
                output = crate::protocol_serde::shape_custom_key_store_has_cmks_exception::de_custom_key_store_has_cmks_exception_json_err(
   29         -
                    _response_body,
   30         -
                    output,
   31         -
                )
   32         -
                .map_err(crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::unhandled)?;
   33         -
                let output = output.meta(generic);
   34         -
                output.build()
   35         -
            };
   36         -
            if tmp.message.is_none() {
   37         -
                tmp.message = _error_message;
   38         -
            }
   39         -
            tmp
   40         -
        }),
   41         -
        "CustomKeyStoreInvalidStateException" => {
   42         -
            crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::CustomKeyStoreInvalidStateException({
   43         -
                #[allow(unused_mut)]
   44         -
                let mut tmp = {
   45         -
                    #[allow(unused_mut)]
   46         -
                    let mut output = crate::types::error::builders::CustomKeyStoreInvalidStateExceptionBuilder::default();
   47         -
                    output =
   48         -
                        crate::protocol_serde::shape_custom_key_store_invalid_state_exception::de_custom_key_store_invalid_state_exception_json_err(
   49         -
                            _response_body,
   50         -
                            output,
   51         -
                        )
   52         -
                        .map_err(crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::unhandled)?;
   53         -
                    let output = output.meta(generic);
   54         -
                    output.build()
   55         -
                };
   56         -
                if tmp.message.is_none() {
   57         -
                    tmp.message = _error_message;
   58         -
                }
   59         -
                tmp
   60         -
            })
   61         -
        }
   62         -
        "CustomKeyStoreNotFoundException" => crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::CustomKeyStoreNotFoundException({
   63         -
            #[allow(unused_mut)]
   64         -
            let mut tmp = {
   65         -
                #[allow(unused_mut)]
   66         -
                let mut output = crate::types::error::builders::CustomKeyStoreNotFoundExceptionBuilder::default();
   67         -
                output = crate::protocol_serde::shape_custom_key_store_not_found_exception::de_custom_key_store_not_found_exception_json_err(
   68         -
                    _response_body,
   69         -
                    output,
   70         -
                )
   71         -
                .map_err(crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError::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::delete_custom_key_store::DeleteCustomKeyStoreError::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::delete_custom_key_store::DeleteCustomKeyStoreError::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::delete_custom_key_store::DeleteCustomKeyStoreError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_delete_custom_key_store_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<
  105         -
    crate::operation::delete_custom_key_store::DeleteCustomKeyStoreOutput,
  106         -
    crate::operation::delete_custom_key_store::DeleteCustomKeyStoreError,
  107         -
> {
  108         -
    Ok({
  109         -
        #[allow(unused_mut)]
  110         -
        let mut output = crate::operation::delete_custom_key_store::builders::DeleteCustomKeyStoreOutputBuilder::default();
  111         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  112         -
        output.build()
  113         -
    })
  114         -
}
  115         -
  116         -
pub fn ser_delete_custom_key_store_input(
  117         -
    input: &crate::operation::delete_custom_key_store::DeleteCustomKeyStoreInput,
  118         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  119         -
    let mut out = String::new();
  120         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  121         -
    crate::protocol_serde::shape_delete_custom_key_store_input::ser_delete_custom_key_store_input_input(&mut object, input)?;
  122         -
    object.finish();
  123         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  124         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_delete_custom_key_store_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::delete_custom_key_store::DeleteCustomKeyStoreInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.custom_key_store_id {
    7         -
        object.key("CustomKeyStoreId").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

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

@@ -1,0 +198,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_delete_imported_key_material_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialOutput,
    9         -
    crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => {
   19         -
            return Err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "DependencyTimeoutException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::DependencyTimeoutException({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   32         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::unhandled)?;
   34         -
                let output = output.meta(generic);
   35         -
                output.build()
   36         -
            };
   37         -
            if tmp.message.is_none() {
   38         -
                tmp.message = _error_message;
   39         -
            }
   40         -
            tmp
   41         -
        }),
   42         -
        "InvalidArnException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::InvalidArnException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::InvalidArnExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_invalid_arn_exception::de_invalid_arn_exception_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::unhandled)?;
   49         -
                let output = output.meta(generic);
   50         -
                output.build()
   51         -
            };
   52         -
            if tmp.message.is_none() {
   53         -
                tmp.message = _error_message;
   54         -
            }
   55         -
            tmp
   56         -
        }),
   57         -
        "KMSInternalException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::KmsInternalException({
   58         -
            #[allow(unused_mut)]
   59         -
            let mut tmp = {
   60         -
                #[allow(unused_mut)]
   61         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
   62         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
   63         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::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         -
        "KMSInvalidStateException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::KmsInvalidStateException({
   73         -
            #[allow(unused_mut)]
   74         -
            let mut tmp = {
   75         -
                #[allow(unused_mut)]
   76         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
   77         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
   78         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::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         -
        "NotFoundException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::NotFoundException({
   88         -
            #[allow(unused_mut)]
   89         -
            let mut tmp = {
   90         -
                #[allow(unused_mut)]
   91         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   92         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   93         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::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         -
        "UnsupportedOperationException" => {
  103         -
            crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::UnsupportedOperationException({
  104         -
                #[allow(unused_mut)]
  105         -
                let mut tmp = {
  106         -
                    #[allow(unused_mut)]
  107         -
                    let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default();
  108         -
                    output = crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err(
  109         -
                        _response_body,
  110         -
                        output,
  111         -
                    )
  112         -
                    .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::unhandled)?;
  113         -
                    let output = output.meta(generic);
  114         -
                    output.build()
  115         -
                };
  116         -
                if tmp.message.is_none() {
  117         -
                    tmp.message = _error_message;
  118         -
                }
  119         -
                tmp
  120         -
            })
  121         -
        }
  122         -
        _ => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::generic(generic),
  123         -
    })
  124         -
}
  125         -
  126         -
#[allow(clippy::unnecessary_wraps)]
  127         -
pub fn de_delete_imported_key_material_http_response(
  128         -
    _response_status: u16,
  129         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  130         -
    _response_body: &[u8],
  131         -
) -> std::result::Result<
  132         -
    crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialOutput,
  133         -
    crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError,
  134         -
> {
  135         -
    Ok({
  136         -
        #[allow(unused_mut)]
  137         -
        let mut output = crate::operation::delete_imported_key_material::builders::DeleteImportedKeyMaterialOutputBuilder::default();
  138         -
        output = crate::protocol_serde::shape_delete_imported_key_material::de_delete_imported_key_material(_response_body, output)
  139         -
            .map_err(crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::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_delete_imported_key_material_input(
  146         -
    input: &crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialInput,
  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_delete_imported_key_material_input::ser_delete_imported_key_material_input_input(&mut object, input)?;
  151         -
    object.finish();
  152         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  153         -
}
  154         -
  155         -
pub(crate) fn de_delete_imported_key_material(
  156         -
    _value: &[u8],
  157         -
    mut builder: crate::operation::delete_imported_key_material::builders::DeleteImportedKeyMaterialOutputBuilder,
  158         -
) -> ::std::result::Result<
  159         -
    crate::operation::delete_imported_key_material::builders::DeleteImportedKeyMaterialOutputBuilder,
  160         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  161         -
> {
  162         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  163         -
    let tokens = &mut tokens_owned;
  164         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  165         -
    loop {
  166         -
        match tokens.next().transpose()? {
  167         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  168         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  169         -
                "KeyId" => {
  170         -
                    builder = builder.set_key_id(
  171         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  172         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  173         -
                            .transpose()?,
  174         -
                    );
  175         -
                }
  176         -
                "KeyMaterialId" => {
  177         -
                    builder = builder.set_key_material_id(
  178         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  179         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  180         -
                            .transpose()?,
  181         -
                    );
  182         -
                }
  183         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  184         -
            },
  185         -
            other => {
  186         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  187         -
                    "expected object key or end object, found: {other:?}"
  188         -
                )))
  189         -
            }
  190         -
        }
  191         -
    }
  192         -
    if tokens.next().is_some() {
  193         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  194         -
            "found more JSON tokens after completing parsing",
  195         -
        ));
  196         -
    }
  197         -
    Ok(builder)
  198         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_delete_imported_key_material_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialInput,
    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.key_material_id {
   10         -
        object.key("KeyMaterialId").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/aws-sdk/sdk/kms/src/protocol_serde/shape_dependency_timeout_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_dependency_timeout_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::DependencyTimeoutExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::DependencyTimeoutExceptionBuilder, ::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_derive_shared_secret.rs

@@ -1,0 +248,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_derive_shared_secret_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
    9         -
    crate::operation::derive_shared_secret::DeriveSharedSecretError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => return Err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "DependencyTimeoutException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::DependencyTimeoutException({
   24         -
            #[allow(unused_mut)]
   25         -
            let mut tmp = {
   26         -
                #[allow(unused_mut)]
   27         -
                let mut output = crate::types::error::builders::DependencyTimeoutExceptionBuilder::default();
   28         -
                output = crate::protocol_serde::shape_dependency_timeout_exception::de_dependency_timeout_exception_json_err(_response_body, output)
   29         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   30         -
                let output = output.meta(generic);
   31         -
                output.build()
   32         -
            };
   33         -
            if tmp.message.is_none() {
   34         -
                tmp.message = _error_message;
   35         -
            }
   36         -
            tmp
   37         -
        }),
   38         -
        "DisabledException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::DisabledException({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::DisabledExceptionBuilder::default();
   43         -
                output = crate::protocol_serde::shape_disabled_exception::de_disabled_exception_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   45         -
                let output = output.meta(generic);
   46         -
                output.build()
   47         -
            };
   48         -
            if tmp.message.is_none() {
   49         -
                tmp.message = _error_message;
   50         -
            }
   51         -
            tmp
   52         -
        }),
   53         -
        "DryRunOperationException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::DryRunOperationException({
   54         -
            #[allow(unused_mut)]
   55         -
            let mut tmp = {
   56         -
                #[allow(unused_mut)]
   57         -
                let mut output = crate::types::error::builders::DryRunOperationExceptionBuilder::default();
   58         -
                output = crate::protocol_serde::shape_dry_run_operation_exception::de_dry_run_operation_exception_json_err(_response_body, output)
   59         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   60         -
                let output = output.meta(generic);
   61         -
                output.build()
   62         -
            };
   63         -
            if tmp.message.is_none() {
   64         -
                tmp.message = _error_message;
   65         -
            }
   66         -
            tmp
   67         -
        }),
   68         -
        "InvalidGrantTokenException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::InvalidGrantTokenException({
   69         -
            #[allow(unused_mut)]
   70         -
            let mut tmp = {
   71         -
                #[allow(unused_mut)]
   72         -
                let mut output = crate::types::error::builders::InvalidGrantTokenExceptionBuilder::default();
   73         -
                output =
   74         -
                    crate::protocol_serde::shape_invalid_grant_token_exception::de_invalid_grant_token_exception_json_err(_response_body, output)
   75         -
                        .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   76         -
                let output = output.meta(generic);
   77         -
                output.build()
   78         -
            };
   79         -
            if tmp.message.is_none() {
   80         -
                tmp.message = _error_message;
   81         -
            }
   82         -
            tmp
   83         -
        }),
   84         -
        "InvalidKeyUsageException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::InvalidKeyUsageException({
   85         -
            #[allow(unused_mut)]
   86         -
            let mut tmp = {
   87         -
                #[allow(unused_mut)]
   88         -
                let mut output = crate::types::error::builders::InvalidKeyUsageExceptionBuilder::default();
   89         -
                output = crate::protocol_serde::shape_invalid_key_usage_exception::de_invalid_key_usage_exception_json_err(_response_body, output)
   90         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        "KeyUnavailableException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::KeyUnavailableException({
  100         -
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::KeyUnavailableExceptionBuilder::default();
  104         -
                output = crate::protocol_serde::shape_key_unavailable_exception::de_key_unavailable_exception_json_err(_response_body, output)
  105         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
  106         -
                let output = output.meta(generic);
  107         -
                output.build()
  108         -
            };
  109         -
            if tmp.message.is_none() {
  110         -
                tmp.message = _error_message;
  111         -
            }
  112         -
            tmp
  113         -
        }),
  114         -
        "KMSInternalException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::KmsInternalException({
  115         -
            #[allow(unused_mut)]
  116         -
            let mut tmp = {
  117         -
                #[allow(unused_mut)]
  118         -
                let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
  119         -
                output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
  120         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
  121         -
                let output = output.meta(generic);
  122         -
                output.build()
  123         -
            };
  124         -
            if tmp.message.is_none() {
  125         -
                tmp.message = _error_message;
  126         -
            }
  127         -
            tmp
  128         -
        }),
  129         -
        "KMSInvalidStateException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::KmsInvalidStateException({
  130         -
            #[allow(unused_mut)]
  131         -
            let mut tmp = {
  132         -
                #[allow(unused_mut)]
  133         -
                let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
  134         -
                output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
  135         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
  136         -
                let output = output.meta(generic);
  137         -
                output.build()
  138         -
            };
  139         -
            if tmp.message.is_none() {
  140         -
                tmp.message = _error_message;
  141         -
            }
  142         -
            tmp
  143         -
        }),
  144         -
        "NotFoundException" => crate::operation::derive_shared_secret::DeriveSharedSecretError::NotFoundException({
  145         -
            #[allow(unused_mut)]
  146         -
            let mut tmp = {
  147         -
                #[allow(unused_mut)]
  148         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
  149         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
  150         -
                    .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
  151         -
                let output = output.meta(generic);
  152         -
                output.build()
  153         -
            };
  154         -
            if tmp.message.is_none() {
  155         -
                tmp.message = _error_message;
  156         -
            }
  157         -
            tmp
  158         -
        }),
  159         -
        _ => crate::operation::derive_shared_secret::DeriveSharedSecretError::generic(generic),
  160         -
    })
  161         -
}
  162         -
  163         -
#[allow(clippy::unnecessary_wraps)]
  164         -
pub fn de_derive_shared_secret_http_response(
  165         -
    _response_status: u16,
  166         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  167         -
    _response_body: &[u8],
  168         -
) -> std::result::Result<
  169         -
    crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
  170         -
    crate::operation::derive_shared_secret::DeriveSharedSecretError,
  171         -
> {
  172         -
    Ok({
  173         -
        #[allow(unused_mut)]
  174         -
        let mut output = crate::operation::derive_shared_secret::builders::DeriveSharedSecretOutputBuilder::default();
  175         -
        output = crate::protocol_serde::shape_derive_shared_secret::de_derive_shared_secret(_response_body, output)
  176         -
            .map_err(crate::operation::derive_shared_secret::DeriveSharedSecretError::unhandled)?;
  177         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  178         -
        output.build()
  179         -
    })
  180         -
}
  181         -
  182         -
pub fn ser_derive_shared_secret_input(
  183         -
    input: &crate::operation::derive_shared_secret::DeriveSharedSecretInput,
  184         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  185         -
    let mut out = String::new();
  186         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  187         -
    crate::protocol_serde::shape_derive_shared_secret_input::ser_derive_shared_secret_input_input(&mut object, input)?;
  188         -
    object.finish();
  189         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  190         -
}
  191         -
  192         -
pub(crate) fn de_derive_shared_secret(
  193         -
    _value: &[u8],
  194         -
    mut builder: crate::operation::derive_shared_secret::builders::DeriveSharedSecretOutputBuilder,
  195         -
) -> ::std::result::Result<
  196         -
    crate::operation::derive_shared_secret::builders::DeriveSharedSecretOutputBuilder,
  197         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  198         -
> {
  199         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  200         -
    let tokens = &mut tokens_owned;
  201         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  202         -
    loop {
  203         -
        match tokens.next().transpose()? {
  204         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  205         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  206         -
                "KeyId" => {
  207         -
                    builder = builder.set_key_id(
  208         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  209         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  210         -
                            .transpose()?,
  211         -
                    );
  212         -
                }
  213         -
                "SharedSecret" => {
  214         -
                    builder = builder.set_shared_secret(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  215         -
                }
  216         -
                "CiphertextForRecipient" => {
  217         -
                    builder = builder.set_ciphertext_for_recipient(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  218         -
                }
  219         -
                "KeyAgreementAlgorithm" => {
  220         -
                    builder = builder.set_key_agreement_algorithm(
  221         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  222         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::KeyAgreementAlgorithmSpec::from(u.as_ref())))
  223         -
                            .transpose()?,
  224         -
                    );
  225         -
                }
  226         -
                "KeyOrigin" => {
  227         -
                    builder = builder.set_key_origin(
  228         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  229         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::OriginType::from(u.as_ref())))
  230         -
                            .transpose()?,
  231         -
                    );
  232         -
                }
  233         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  234         -
            },
  235         -
            other => {
  236         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  237         -
                    "expected object key or end object, found: {other:?}"
  238         -
                )))
  239         -
            }
  240         -
        }
  241         -
    }
  242         -
    if tokens.next().is_some() {
  243         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  244         -
            "found more JSON tokens after completing parsing",
  245         -
        ));
  246         -
    }
  247         -
    Ok(builder)
  248         -
}

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

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_derive_shared_secret_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::derive_shared_secret::DeriveSharedSecretInput,
    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.key_agreement_algorithm {
   10         -
        object.key("KeyAgreementAlgorithm").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.public_key {
   13         -
        object.key("PublicKey").string_unchecked(&::aws_smithy_types::base64::encode(var_3));
   14         -
    }
   15         -
    if let Some(var_4) = &input.grant_tokens {
   16         -
        let mut array_5 = object.key("GrantTokens").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.dry_run {
   25         -
        object.key("DryRun").boolean(*var_7);
   26         -
    }
   27         -
    if let Some(var_8) = &input.recipient {
   28         -
        #[allow(unused_mut)]
   29         -
        let mut object_9 = object.key("Recipient").start_object();
   30         -
        crate::protocol_serde::shape_recipient_info::ser_recipient_info(&mut object_9, var_8)?;
   31         -
        object_9.finish();
   32         -
    }
   33         -
    Ok(())
   34         -
}

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

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

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

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_custom_key_stores_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.custom_key_store_id {
    7         -
        object.key("CustomKeyStoreId").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.custom_key_store_name {
   10         -
        object.key("CustomKeyStoreName").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         -
}

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

@@ -1,0 +140,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_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::describe_key::DescribeKeyOutput, crate::operation::describe_key::DescribeKeyError> {
    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::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "DependencyTimeoutException" => crate::operation::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::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::describe_key::DescribeKeyError::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         -
        "NotFoundException" => crate::operation::describe_key::DescribeKeyError::NotFoundException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::describe_key::DescribeKeyError::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         -
        _ => crate::operation::describe_key::DescribeKeyError::generic(generic),
   81         -
    })
   82         -
}
   83         -
   84         -
#[allow(clippy::unnecessary_wraps)]
   85         -
pub fn de_describe_key_http_response(
   86         -
    _response_status: u16,
   87         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   88         -
    _response_body: &[u8],
   89         -
) -> std::result::Result<crate::operation::describe_key::DescribeKeyOutput, crate::operation::describe_key::DescribeKeyError> {
   90         -
    Ok({
   91         -
        #[allow(unused_mut)]
   92         -
        let mut output = crate::operation::describe_key::builders::DescribeKeyOutputBuilder::default();
   93         -
        output = crate::protocol_serde::shape_describe_key::de_describe_key(_response_body, output)
   94         -
            .map_err(crate::operation::describe_key::DescribeKeyError::unhandled)?;
   95         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   96         -
        output.build()
   97         -
    })
   98         -
}
   99         -
  100         -
pub fn ser_describe_key_input(
  101         -
    input: &crate::operation::describe_key::DescribeKeyInput,
  102         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  103         -
    let mut out = String::new();
  104         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  105         -
    crate::protocol_serde::shape_describe_key_input::ser_describe_key_input_input(&mut object, input)?;
  106         -
    object.finish();
  107         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  108         -
}
  109         -
  110         -
pub(crate) fn de_describe_key(
  111         -
    _value: &[u8],
  112         -
    mut builder: crate::operation::describe_key::builders::DescribeKeyOutputBuilder,
  113         -
) -> ::std::result::Result<crate::operation::describe_key::builders::DescribeKeyOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  114         -
{
  115         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  116         -
    let tokens = &mut tokens_owned;
  117         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  118         -
    loop {
  119         -
        match tokens.next().transpose()? {
  120         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  121         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  122         -
                "KeyMetadata" => {
  123         -
                    builder = builder.set_key_metadata(crate::protocol_serde::shape_key_metadata::de_key_metadata(tokens, _value)?);
  124         -
                }
  125         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  126         -
            },
  127         -
            other => {
  128         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  129         -
                    "expected object key or end object, found: {other:?}"
  130         -
                )))
  131         -
            }
  132         -
        }
  133         -
    }
  134         -
    if tokens.next().is_some() {
  135         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  136         -
            "found more JSON tokens after completing parsing",
  137         -
        ));
  138         -
    }
  139         -
    Ok(builder)
  140         -
}