Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_restore_table_from_backup_input.rs

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_restore_table_from_backup_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::restore_table_from_backup::RestoreTableFromBackupInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.target_table_name {
    7         -
        object.key("TargetTableName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.backup_arn {
   10         -
        object.key("BackupArn").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.billing_mode_override {
   13         -
        object.key("BillingModeOverride").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.global_secondary_index_override {
   16         -
        let mut array_5 = object.key("GlobalSecondaryIndexOverride").start_array();
   17         -
        for item_6 in var_4 {
   18         -
            {
   19         -
                #[allow(unused_mut)]
   20         -
                let mut object_7 = array_5.value().start_object();
   21         -
                crate::protocol_serde::shape_global_secondary_index::ser_global_secondary_index(&mut object_7, item_6)?;
   22         -
                object_7.finish();
   23         -
            }
   24         -
        }
   25         -
        array_5.finish();
   26         -
    }
   27         -
    if let Some(var_8) = &input.local_secondary_index_override {
   28         -
        let mut array_9 = object.key("LocalSecondaryIndexOverride").start_array();
   29         -
        for item_10 in var_8 {
   30         -
            {
   31         -
                #[allow(unused_mut)]
   32         -
                let mut object_11 = array_9.value().start_object();
   33         -
                crate::protocol_serde::shape_local_secondary_index::ser_local_secondary_index(&mut object_11, item_10)?;
   34         -
                object_11.finish();
   35         -
            }
   36         -
        }
   37         -
        array_9.finish();
   38         -
    }
   39         -
    if let Some(var_12) = &input.provisioned_throughput_override {
   40         -
        #[allow(unused_mut)]
   41         -
        let mut object_13 = object.key("ProvisionedThroughputOverride").start_object();
   42         -
        crate::protocol_serde::shape_provisioned_throughput::ser_provisioned_throughput(&mut object_13, var_12)?;
   43         -
        object_13.finish();
   44         -
    }
   45         -
    if let Some(var_14) = &input.sse_specification_override {
   46         -
        #[allow(unused_mut)]
   47         -
        let mut object_15 = object.key("SSESpecificationOverride").start_object();
   48         -
        crate::protocol_serde::shape_sse_specification::ser_sse_specification(&mut object_15, var_14)?;
   49         -
        object_15.finish();
   50         -
    }
   51         -
    Ok(())
   52         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_restore_table_to_point_in_time.rs

@@ -1,0 +209,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_restore_table_to_point_in_time_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::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
    9         -
    crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
   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::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InternalServerError" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InternalServerError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "InvalidEndpointException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidEndpointError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        "InvalidRestoreTimeException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidRestoreTimeError({
   53         -
            #[allow(unused_mut)]
   54         -
            let mut tmp = {
   55         -
                #[allow(unused_mut)]
   56         -
                let mut output = crate::types::error::builders::InvalidRestoreTimeErrorBuilder::default();
   57         -
                output =
   58         -
                    crate::protocol_serde::shape_invalid_restore_time_exception::de_invalid_restore_time_exception_json_err(_response_body, output)
   59         -
                        .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::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         -
        "LimitExceededException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::LimitExceededError({
   69         -
            #[allow(unused_mut)]
   70         -
            let mut tmp = {
   71         -
                #[allow(unused_mut)]
   72         -
                let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
   73         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   74         -
                    .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
   75         -
                let output = output.meta(generic);
   76         -
                output.build()
   77         -
            };
   78         -
            if tmp.message.is_none() {
   79         -
                tmp.message = _error_message;
   80         -
            }
   81         -
            tmp
   82         -
        }),
   83         -
        "PointInTimeRecoveryUnavailableException" => {
   84         -
            crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::PointInTimeRecoveryUnavailableError({
   85         -
                #[allow(unused_mut)]
   86         -
                let mut tmp = {
   87         -
                    #[allow(unused_mut)]
   88         -
                    let mut output = crate::types::error::builders::PointInTimeRecoveryUnavailableErrorBuilder::default();
   89         -
                    output = crate::protocol_serde::shape_point_in_time_recovery_unavailable_exception::de_point_in_time_recovery_unavailable_exception_json_err(_response_body, output).map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
   90         -
                    let output = output.meta(generic);
   91         -
                    output.build()
   92         -
                };
   93         -
                if tmp.message.is_none() {
   94         -
                    tmp.message = _error_message;
   95         -
                }
   96         -
                tmp
   97         -
            })
   98         -
        }
   99         -
        "TableAlreadyExistsException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableAlreadyExistsError({
  100         -
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::TableAlreadyExistsErrorBuilder::default();
  104         -
                output =
  105         -
                    crate::protocol_serde::shape_table_already_exists_exception::de_table_already_exists_exception_json_err(_response_body, output)
  106         -
                        .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
  107         -
                let output = output.meta(generic);
  108         -
                output.build()
  109         -
            };
  110         -
            if tmp.message.is_none() {
  111         -
                tmp.message = _error_message;
  112         -
            }
  113         -
            tmp
  114         -
        }),
  115         -
        "TableInUseException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableInUseError({
  116         -
            #[allow(unused_mut)]
  117         -
            let mut tmp = {
  118         -
                #[allow(unused_mut)]
  119         -
                let mut output = crate::types::error::builders::TableInUseErrorBuilder::default();
  120         -
                output = crate::protocol_serde::shape_table_in_use_exception::de_table_in_use_exception_json_err(_response_body, output)
  121         -
                    .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
  122         -
                let output = output.meta(generic);
  123         -
                output.build()
  124         -
            };
  125         -
            if tmp.message.is_none() {
  126         -
                tmp.message = _error_message;
  127         -
            }
  128         -
            tmp
  129         -
        }),
  130         -
        "TableNotFoundException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableNotFoundError({
  131         -
            #[allow(unused_mut)]
  132         -
            let mut tmp = {
  133         -
                #[allow(unused_mut)]
  134         -
                let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
  135         -
                output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
  136         -
                    .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
  137         -
                let output = output.meta(generic);
  138         -
                output.build()
  139         -
            };
  140         -
            if tmp.message.is_none() {
  141         -
                tmp.message = _error_message;
  142         -
            }
  143         -
            tmp
  144         -
        }),
  145         -
        _ => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::generic(generic),
  146         -
    })
  147         -
}
  148         -
  149         -
#[allow(clippy::unnecessary_wraps)]
  150         -
pub fn de_restore_table_to_point_in_time_http_response(
  151         -
    _response_status: u16,
  152         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  153         -
    _response_body: &[u8],
  154         -
) -> std::result::Result<
  155         -
    crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
  156         -
    crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
  157         -
> {
  158         -
    Ok({
  159         -
        #[allow(unused_mut)]
  160         -
        let mut output = crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeOutputBuilder::default();
  161         -
        output = crate::protocol_serde::shape_restore_table_to_point_in_time::de_restore_table_to_point_in_time(_response_body, output)
  162         -
            .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
  163         -
        output.build()
  164         -
    })
  165         -
}
  166         -
  167         -
pub fn ser_restore_table_to_point_in_time_input(
  168         -
    input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
  169         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  170         -
    let mut out = String::new();
  171         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  172         -
    crate::protocol_serde::shape_restore_table_to_point_in_time_input::ser_restore_table_to_point_in_time_input_input(&mut object, input)?;
  173         -
    object.finish();
  174         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  175         -
}
  176         -
  177         -
pub(crate) fn de_restore_table_to_point_in_time(
  178         -
    _value: &[u8],
  179         -
    mut builder: crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeOutputBuilder,
  180         -
) -> ::std::result::Result<
  181         -
    crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeOutputBuilder,
  182         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  183         -
> {
  184         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  185         -
    let tokens = &mut tokens_owned;
  186         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  187         -
    loop {
  188         -
        match tokens.next().transpose()? {
  189         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  190         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  191         -
                "TableDescription" => {
  192         -
                    builder = builder.set_table_description(crate::protocol_serde::shape_table_description::de_table_description(tokens, _value)?);
  193         -
                }
  194         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  195         -
            },
  196         -
            other => {
  197         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  198         -
                    "expected object key or end object, found: {other:?}"
  199         -
                )))
  200         -
            }
  201         -
        }
  202         -
    }
  203         -
    if tokens.next().is_some() {
  204         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  205         -
            "found more JSON tokens after completing parsing",
  206         -
        ));
  207         -
    }
  208         -
    Ok(builder)
  209         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_restore_table_to_point_in_time_input.rs

@@ -1,0 +63,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_restore_table_to_point_in_time_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.source_table_arn {
    7         -
        object.key("SourceTableArn").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.source_table_name {
   10         -
        object.key("SourceTableName").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.target_table_name {
   13         -
        object.key("TargetTableName").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.use_latest_restorable_time {
   16         -
        object.key("UseLatestRestorableTime").boolean(*var_4);
   17         -
    }
   18         -
    if let Some(var_5) = &input.restore_date_time {
   19         -
        object
   20         -
            .key("RestoreDateTime")
   21         -
            .date_time(var_5, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   22         -
    }
   23         -
    if let Some(var_6) = &input.billing_mode_override {
   24         -
        object.key("BillingModeOverride").string(var_6.as_str());
   25         -
    }
   26         -
    if let Some(var_7) = &input.global_secondary_index_override {
   27         -
        let mut array_8 = object.key("GlobalSecondaryIndexOverride").start_array();
   28         -
        for item_9 in var_7 {
   29         -
            {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut object_10 = array_8.value().start_object();
   32         -
                crate::protocol_serde::shape_global_secondary_index::ser_global_secondary_index(&mut object_10, item_9)?;
   33         -
                object_10.finish();
   34         -
            }
   35         -
        }
   36         -
        array_8.finish();
   37         -
    }
   38         -
    if let Some(var_11) = &input.local_secondary_index_override {
   39         -
        let mut array_12 = object.key("LocalSecondaryIndexOverride").start_array();
   40         -
        for item_13 in var_11 {
   41         -
            {
   42         -
                #[allow(unused_mut)]
   43         -
                let mut object_14 = array_12.value().start_object();
   44         -
                crate::protocol_serde::shape_local_secondary_index::ser_local_secondary_index(&mut object_14, item_13)?;
   45         -
                object_14.finish();
   46         -
            }
   47         -
        }
   48         -
        array_12.finish();
   49         -
    }
   50         -
    if let Some(var_15) = &input.provisioned_throughput_override {
   51         -
        #[allow(unused_mut)]
   52         -
        let mut object_16 = object.key("ProvisionedThroughputOverride").start_object();
   53         -
        crate::protocol_serde::shape_provisioned_throughput::ser_provisioned_throughput(&mut object_16, var_15)?;
   54         -
        object_16.finish();
   55         -
    }
   56         -
    if let Some(var_17) = &input.sse_specification_override {
   57         -
        #[allow(unused_mut)]
   58         -
        let mut object_18 = object.key("SSESpecificationOverride").start_object();
   59         -
        crate::protocol_serde::shape_sse_specification::ser_sse_specification(&mut object_18, var_17)?;
   60         -
        object_18.finish();
   61         -
    }
   62         -
    Ok(())
   63         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_scan.rs

@@ -1,0 +172,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_scan_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::scan::ScanOutput, crate::operation::scan::ScanError> {
    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::scan::ScanError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::scan::ScanError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::scan::ScanError::InternalServerError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::scan::ScanError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
   29         -
            if tmp.message.is_none() {
   30         -
                tmp.message = _error_message;
   31         -
            }
   32         -
            tmp
   33         -
        }),
   34         -
        "InvalidEndpointException" => crate::operation::scan::ScanError::InvalidEndpointError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::scan::ScanError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
   44         -
            if tmp.message.is_none() {
   45         -
                tmp.message = _error_message;
   46         -
            }
   47         -
            tmp
   48         -
        }),
   49         -
        "ProvisionedThroughputExceededException" => {
   50         -
            crate::operation::scan::ScanError::ProvisionedThroughputExceededError({
   51         -
                #[allow(unused_mut)]
   52         -
                let mut tmp = {
   53         -
                    #[allow(unused_mut)]
   54         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   55         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::scan::ScanError::unhandled)?;
   56         -
                    let output = output.meta(generic);
   57         -
                    output.build()
   58         -
                };
   59         -
                if tmp.message.is_none() {
   60         -
                    tmp.message = _error_message;
   61         -
                }
   62         -
                tmp
   63         -
            })
   64         -
        }
   65         -
        "RequestLimitExceeded" => crate::operation::scan::ScanError::RequestLimitExceeded({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
   70         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::scan::ScanError::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         -
        "ResourceNotFoundException" => crate::operation::scan::ScanError::ResourceNotFoundError({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   85         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::scan::ScanError::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::scan::ScanError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_scan_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<crate::operation::scan::ScanOutput, crate::operation::scan::ScanError> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::scan::builders::ScanOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_scan::de_scan(_response_body, output).map_err(crate::operation::scan::ScanError::unhandled)?;
  109         -
        output.build()
  110         -
    })
  111         -
}
  112         -
  113         -
pub fn ser_scan_input(
  114         -
    input: &crate::operation::scan::ScanInput,
  115         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  116         -
    let mut out = String::new();
  117         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  118         -
    crate::protocol_serde::shape_scan_input::ser_scan_input_input(&mut object, input)?;
  119         -
    object.finish();
  120         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  121         -
}
  122         -
  123         -
pub(crate) fn de_scan(
  124         -
    _value: &[u8],
  125         -
    mut builder: crate::operation::scan::builders::ScanOutputBuilder,
  126         -
) -> ::std::result::Result<crate::operation::scan::builders::ScanOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  127         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  128         -
    let tokens = &mut tokens_owned;
  129         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  130         -
    loop {
  131         -
        match tokens.next().transpose()? {
  132         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  133         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  134         -
                "Items" => {
  135         -
                    builder = builder.set_items(crate::protocol_serde::shape_item_list::de_item_list(tokens, _value)?);
  136         -
                }
  137         -
                "Count" => {
  138         -
                    builder = builder.set_count(
  139         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  140         -
                            .map(i32::try_from)
  141         -
                            .transpose()?,
  142         -
                    );
  143         -
                }
  144         -
                "ScannedCount" => {
  145         -
                    builder = builder.set_scanned_count(
  146         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  147         -
                            .map(i32::try_from)
  148         -
                            .transpose()?,
  149         -
                    );
  150         -
                }
  151         -
                "LastEvaluatedKey" => {
  152         -
                    builder = builder.set_last_evaluated_key(crate::protocol_serde::shape_key::de_key(tokens, _value)?);
  153         -
                }
  154         -
                "ConsumedCapacity" => {
  155         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity::de_consumed_capacity(tokens, _value)?);
  156         -
                }
  157         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  158         -
            },
  159         -
            other => {
  160         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  161         -
                    "expected object key or end object, found: {other:?}"
  162         -
                )))
  163         -
            }
  164         -
        }
  165         -
    }
  166         -
    if tokens.next().is_some() {
  167         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  168         -
            "found more JSON tokens after completing parsing",
  169         -
        ));
  170         -
    }
  171         -
    Ok(builder)
  172         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_scan_input.rs

@@ -1,0 +107,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_scan_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::scan::ScanInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.table_name {
    7         -
        object.key("TableName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.index_name {
   10         -
        object.key("IndexName").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.attributes_to_get {
   13         -
        let mut array_4 = object.key("AttributesToGet").start_array();
   14         -
        for item_5 in var_3 {
   15         -
            {
   16         -
                array_4.value().string(item_5.as_str());
   17         -
            }
   18         -
        }
   19         -
        array_4.finish();
   20         -
    }
   21         -
    if let Some(var_6) = &input.limit {
   22         -
        object.key("Limit").number(
   23         -
            #[allow(clippy::useless_conversion)]
   24         -
            ::aws_smithy_types::Number::NegInt((*var_6).into()),
   25         -
        );
   26         -
    }
   27         -
    if let Some(var_7) = &input.select {
   28         -
        object.key("Select").string(var_7.as_str());
   29         -
    }
   30         -
    if let Some(var_8) = &input.scan_filter {
   31         -
        #[allow(unused_mut)]
   32         -
        let mut object_9 = object.key("ScanFilter").start_object();
   33         -
        for (key_10, value_11) in var_8 {
   34         -
            {
   35         -
                #[allow(unused_mut)]
   36         -
                let mut object_12 = object_9.key(key_10.as_str()).start_object();
   37         -
                crate::protocol_serde::shape_condition::ser_condition(&mut object_12, value_11)?;
   38         -
                object_12.finish();
   39         -
            }
   40         -
        }
   41         -
        object_9.finish();
   42         -
    }
   43         -
    if let Some(var_13) = &input.conditional_operator {
   44         -
        object.key("ConditionalOperator").string(var_13.as_str());
   45         -
    }
   46         -
    if let Some(var_14) = &input.exclusive_start_key {
   47         -
        #[allow(unused_mut)]
   48         -
        let mut object_15 = object.key("ExclusiveStartKey").start_object();
   49         -
        for (key_16, value_17) in var_14 {
   50         -
            {
   51         -
                #[allow(unused_mut)]
   52         -
                let mut object_18 = object_15.key(key_16.as_str()).start_object();
   53         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_18, value_17)?;
   54         -
                object_18.finish();
   55         -
            }
   56         -
        }
   57         -
        object_15.finish();
   58         -
    }
   59         -
    if let Some(var_19) = &input.return_consumed_capacity {
   60         -
        object.key("ReturnConsumedCapacity").string(var_19.as_str());
   61         -
    }
   62         -
    if let Some(var_20) = &input.total_segments {
   63         -
        object.key("TotalSegments").number(
   64         -
            #[allow(clippy::useless_conversion)]
   65         -
            ::aws_smithy_types::Number::NegInt((*var_20).into()),
   66         -
        );
   67         -
    }
   68         -
    if let Some(var_21) = &input.segment {
   69         -
        object.key("Segment").number(
   70         -
            #[allow(clippy::useless_conversion)]
   71         -
            ::aws_smithy_types::Number::NegInt((*var_21).into()),
   72         -
        );
   73         -
    }
   74         -
    if let Some(var_22) = &input.projection_expression {
   75         -
        object.key("ProjectionExpression").string(var_22.as_str());
   76         -
    }
   77         -
    if let Some(var_23) = &input.filter_expression {
   78         -
        object.key("FilterExpression").string(var_23.as_str());
   79         -
    }
   80         -
    if let Some(var_24) = &input.expression_attribute_names {
   81         -
        #[allow(unused_mut)]
   82         -
        let mut object_25 = object.key("ExpressionAttributeNames").start_object();
   83         -
        for (key_26, value_27) in var_24 {
   84         -
            {
   85         -
                object_25.key(key_26.as_str()).string(value_27.as_str());
   86         -
            }
   87         -
        }
   88         -
        object_25.finish();
   89         -
    }
   90         -
    if let Some(var_28) = &input.expression_attribute_values {
   91         -
        #[allow(unused_mut)]
   92         -
        let mut object_29 = object.key("ExpressionAttributeValues").start_object();
   93         -
        for (key_30, value_31) in var_28 {
   94         -
            {
   95         -
                #[allow(unused_mut)]
   96         -
                let mut object_32 = object_29.key(key_30.as_str()).start_object();
   97         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_32, value_31)?;
   98         -
                object_32.finish();
   99         -
            }
  100         -
        }
  101         -
        object_29.finish();
  102         -
    }
  103         -
    if let Some(var_33) = &input.consistent_read {
  104         -
        object.key("ConsistentRead").boolean(*var_33);
  105         -
    }
  106         -
    Ok(())
  107         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_secondary_indexes_capacity_map.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_secondary_indexes_capacity_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::Capacity>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = crate::protocol_serde::shape_capacity::de_capacity(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_source_table_details.rs

@@ -1,0 +91,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_source_table_details<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::SourceTableDetails>, ::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::SourceTableDetailsBuilder::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         -
                        "TableName" => {
   19         -
                            builder = builder.set_table_name(
   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         -
                        "TableId" => {
   26         -
                            builder = builder.set_table_id(
   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         -
                        "TableArn" => {
   33         -
                            builder = builder.set_table_arn(
   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         -
                        "TableSizeBytes" => {
   40         -
                            builder = builder.set_table_size_bytes(
   41         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   42         -
                                    .map(i64::try_from)
   43         -
                                    .transpose()?,
   44         -
                            );
   45         -
                        }
   46         -
                        "KeySchema" => {
   47         -
                            builder = builder.set_key_schema(crate::protocol_serde::shape_key_schema::de_key_schema(tokens, _value)?);
   48         -
                        }
   49         -
                        "TableCreationDateTime" => {
   50         -
                            builder = builder.set_table_creation_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   51         -
                                tokens.next(),
   52         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   53         -
                            )?);
   54         -
                        }
   55         -
                        "ProvisionedThroughput" => {
   56         -
                            builder = builder.set_provisioned_throughput(
   57         -
                                crate::protocol_serde::shape_provisioned_throughput::de_provisioned_throughput(tokens, _value)?,
   58         -
                            );
   59         -
                        }
   60         -
                        "ItemCount" => {
   61         -
                            builder = builder.set_item_count(
   62         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   63         -
                                    .map(i64::try_from)
   64         -
                                    .transpose()?,
   65         -
                            );
   66         -
                        }
   67         -
                        "BillingMode" => {
   68         -
                            builder = builder.set_billing_mode(
   69         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   70         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::BillingMode::from(u.as_ref())))
   71         -
                                    .transpose()?,
   72         -
                            );
   73         -
                        }
   74         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   75         -
                    },
   76         -
                    other => {
   77         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   78         -
                            "expected object key or end object, found: {other:?}"
   79         -
                        )))
   80         -
                    }
   81         -
                }
   82         -
            }
   83         -
            Ok(Some(crate::serde_util::source_table_details_correct_errors(builder).build().map_err(
   84         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   85         -
            )?))
   86         -
        }
   87         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   88         -
            "expected start object or null",
   89         -
        )),
   90         -
    }
   91         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_source_table_feature_details.rs

@@ -1,0 +56,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_source_table_feature_details<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::SourceTableFeatureDetails>, ::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::SourceTableFeatureDetailsBuilder::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         -
                        "LocalSecondaryIndexes" => {
   19         -
                            builder = builder.set_local_secondary_indexes(
   20         -
                                crate::protocol_serde::shape_local_secondary_indexes::de_local_secondary_indexes(tokens, _value)?,
   21         -
                            );
   22         -
                        }
   23         -
                        "GlobalSecondaryIndexes" => {
   24         -
                            builder = builder.set_global_secondary_indexes(
   25         -
                                crate::protocol_serde::shape_global_secondary_indexes::de_global_secondary_indexes(tokens, _value)?,
   26         -
                            );
   27         -
                        }
   28         -
                        "StreamDescription" => {
   29         -
                            builder = builder.set_stream_description(crate::protocol_serde::shape_stream_specification::de_stream_specification(
   30         -
                                tokens, _value,
   31         -
                            )?);
   32         -
                        }
   33         -
                        "TimeToLiveDescription" => {
   34         -
                            builder = builder.set_time_to_live_description(
   35         -
                                crate::protocol_serde::shape_time_to_live_description::de_time_to_live_description(tokens, _value)?,
   36         -
                            );
   37         -
                        }
   38         -
                        "SSEDescription" => {
   39         -
                            builder = builder.set_sse_description(crate::protocol_serde::shape_sse_description::de_sse_description(tokens, _value)?);
   40         -
                        }
   41         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   42         -
                    },
   43         -
                    other => {
   44         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   45         -
                            "expected object key or end object, found: {other:?}"
   46         -
                        )))
   47         -
                    }
   48         -
                }
   49         -
            }
   50         -
            Ok(Some(builder.build()))
   51         -
        }
   52         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53         -
            "expected start object or null",
   54         -
        )),
   55         -
    }
   56         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_sse_description.rs

@@ -1,0 +60,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sse_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::SseDescription>, ::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::SseDescriptionBuilder::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         -
                        "Status" => {
   19         -
                            builder = builder.set_status(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::SseStatus::from(u.as_ref())))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "SSEType" => {
   26         -
                            builder = builder.set_sse_type(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::SseType::from(u.as_ref())))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "KMSMasterKeyArn" => {
   33         -
                            builder = builder.set_kms_master_key_arn(
   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         -
                        "InaccessibleEncryptionDateTime" => {
   40         -
                            builder = builder.set_inaccessible_encryption_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   41         -
                                tokens.next(),
   42         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   43         -
                            )?);
   44         -
                        }
   45         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   46         -
                    },
   47         -
                    other => {
   48         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   49         -
                            "expected object key or end object, found: {other:?}"
   50         -
                        )))
   51         -
                    }
   52         -
                }
   53         -
            }
   54         -
            Ok(Some(builder.build()))
   55         -
        }
   56         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   57         -
            "expected start object or null",
   58         -
        )),
   59         -
    }
   60         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_sse_specification.rs

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_sse_specification(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::SseSpecification,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.enabled {
    7         -
        object.key("Enabled").boolean(*var_1);
    8         -
    }
    9         -
    if let Some(var_2) = &input.sse_type {
   10         -
        object.key("SSEType").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.kms_master_key_id {
   13         -
        object.key("KMSMasterKeyId").string(var_3.as_str());
   14         -
    }
   15         -
    Ok(())
   16         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_stream_specification.rs

@@ -1,0 +58,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_stream_specification(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::StreamSpecification,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("StreamEnabled").boolean(input.stream_enabled);
    8         -
    }
    9         -
    if let Some(var_1) = &input.stream_view_type {
   10         -
        object.key("StreamViewType").string(var_1.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_stream_specification<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
    _value: &'a [u8],
   18         -
) -> ::std::result::Result<Option<crate::types::StreamSpecification>, ::aws_smithy_json::deserialize::error::DeserializeError>
   19         -
where
   20         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   21         -
{
   22         -
    match tokens.next().transpose()? {
   23         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   25         -
            #[allow(unused_mut)]
   26         -
            let mut builder = crate::types::builders::StreamSpecificationBuilder::default();
   27         -
            loop {
   28         -
                match tokens.next().transpose()? {
   29         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   30         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   31         -
                        "StreamEnabled" => {
   32         -
                            builder = builder.set_stream_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   33         -
                        }
   34         -
                        "StreamViewType" => {
   35         -
                            builder = builder.set_stream_view_type(
   36         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   37         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::StreamViewType::from(u.as_ref())))
   38         -
                                    .transpose()?,
   39         -
                            );
   40         -
                        }
   41         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   42         -
                    },
   43         -
                    other => {
   44         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   45         -
                            "expected object key or end object, found: {other:?}"
   46         -
                        )))
   47         -
                    }
   48         -
                }
   49         -
            }
   50         -
            Ok(Some(crate::serde_util::stream_specification_correct_errors(builder).build().map_err(
   51         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   52         -
            )?))
   53         -
        }
   54         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   55         -
            "expected start object or null",
   56         -
        )),
   57         -
    }
   58         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_string_set_attribute_value.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_string_set_attribute_value<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::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 = ::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         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_table_already_exists_exception.rs

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