AWS SDK

AWS SDK

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_item_response.rs

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_item_response<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ItemResponse>, ::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::ItemResponseBuilder::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         -
                        "Item" => {
   19         -
                            builder = builder.set_item(crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens, _value)?);
   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         -
            Ok(Some(builder.build()))
   31         -
        }
   32         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33         -
            "expected start object or null",
   34         -
        )),
   35         -
    }
   36         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_item_response_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_key.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_key<'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::AttributeValue>>,
    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_attribute_value::de_attribute_value(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/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_key_list.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_key_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>>,
    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::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        let value = crate::protocol_serde::shape_key::de_key(tokens, _value)?;
   24         -
                        if let Some(value) = value {
   25         -
                            items.push(value);
   26         -
                        } else {
   27         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                "dense list cannot contain null values",
   29         -
                            ));
   30         -
                        }
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(items))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start array or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_key_schema.rs

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

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_key_schema_element.rs

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_key_schema_element(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::KeySchemaElement,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("AttributeName").string(input.attribute_name.as_str());
    8         -
    }
    9         -
    {
   10         -
        object.key("KeyType").string(input.key_type.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_key_schema_element<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
    _value: &'a [u8],
   18         -
) -> ::std::result::Result<Option<crate::types::KeySchemaElement>, ::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::KeySchemaElementBuilder::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         -
                        "AttributeName" => {
   32         -
                            builder = builder.set_attribute_name(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        "KeyType" => {
   39         -
                            builder = builder.set_key_type(
   40         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   41         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::KeyType::from(u.as_ref())))
   42         -
                                    .transpose()?,
   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(crate::serde_util::key_schema_element_correct_errors(builder).build().map_err(
   55         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   56         -
            )?))
   57         -
        }
   58         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   59         -
            "expected start object or null",
   60         -
        )),
   61         -
    }
   62         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_keys_and_attributes.rs

@@ -1,0 +108,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_keys_and_attributes(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::KeysAndAttributes,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        let mut array_1 = object.key("Keys").start_array();
    8         -
        for item_2 in &input.keys {
    9         -
            {
   10         -
                #[allow(unused_mut)]
   11         -
                let mut object_3 = array_1.value().start_object();
   12         -
                for (key_4, value_5) in item_2 {
   13         -
                    {
   14         -
                        #[allow(unused_mut)]
   15         -
                        let mut object_6 = object_3.key(key_4.as_str()).start_object();
   16         -
                        crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_6, value_5)?;
   17         -
                        object_6.finish();
   18         -
                    }
   19         -
                }
   20         -
                object_3.finish();
   21         -
            }
   22         -
        }
   23         -
        array_1.finish();
   24         -
    }
   25         -
    if let Some(var_7) = &input.attributes_to_get {
   26         -
        let mut array_8 = object.key("AttributesToGet").start_array();
   27         -
        for item_9 in var_7 {
   28         -
            {
   29         -
                array_8.value().string(item_9.as_str());
   30         -
            }
   31         -
        }
   32         -
        array_8.finish();
   33         -
    }
   34         -
    if let Some(var_10) = &input.consistent_read {
   35         -
        object.key("ConsistentRead").boolean(*var_10);
   36         -
    }
   37         -
    if let Some(var_11) = &input.projection_expression {
   38         -
        object.key("ProjectionExpression").string(var_11.as_str());
   39         -
    }
   40         -
    if let Some(var_12) = &input.expression_attribute_names {
   41         -
        #[allow(unused_mut)]
   42         -
        let mut object_13 = object.key("ExpressionAttributeNames").start_object();
   43         -
        for (key_14, value_15) in var_12 {
   44         -
            {
   45         -
                object_13.key(key_14.as_str()).string(value_15.as_str());
   46         -
            }
   47         -
        }
   48         -
        object_13.finish();
   49         -
    }
   50         -
    Ok(())
   51         -
}
   52         -
   53         -
pub(crate) fn de_keys_and_attributes<'a, I>(
   54         -
    tokens: &mut ::std::iter::Peekable<I>,
   55         -
    _value: &'a [u8],
   56         -
) -> ::std::result::Result<Option<crate::types::KeysAndAttributes>, ::aws_smithy_json::deserialize::error::DeserializeError>
   57         -
where
   58         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   59         -
{
   60         -
    match tokens.next().transpose()? {
   61         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   62         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   63         -
            #[allow(unused_mut)]
   64         -
            let mut builder = crate::types::builders::KeysAndAttributesBuilder::default();
   65         -
            loop {
   66         -
                match tokens.next().transpose()? {
   67         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   68         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   69         -
                        "Keys" => {
   70         -
                            builder = builder.set_keys(crate::protocol_serde::shape_key_list::de_key_list(tokens, _value)?);
   71         -
                        }
   72         -
                        "AttributesToGet" => {
   73         -
                            builder = builder
   74         -
                                .set_attributes_to_get(crate::protocol_serde::shape_attribute_name_list::de_attribute_name_list(tokens, _value)?);
   75         -
                        }
   76         -
                        "ConsistentRead" => {
   77         -
                            builder = builder.set_consistent_read(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   78         -
                        }
   79         -
                        "ProjectionExpression" => {
   80         -
                            builder = builder.set_projection_expression(
   81         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   82         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   83         -
                                    .transpose()?,
   84         -
                            );
   85         -
                        }
   86         -
                        "ExpressionAttributeNames" => {
   87         -
                            builder = builder.set_expression_attribute_names(
   88         -
                                crate::protocol_serde::shape_expression_attribute_name_map::de_expression_attribute_name_map(tokens, _value)?,
   89         -
                            );
   90         -
                        }
   91         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   92         -
                    },
   93         -
                    other => {
   94         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   95         -
                            "expected object key or end object, found: {other:?}"
   96         -
                        )))
   97         -
                    }
   98         -
                }
   99         -
            }
  100         -
            Ok(Some(crate::serde_util::keys_and_attributes_correct_errors(builder).build().map_err(
  101         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
  102         -
            )?))
  103         -
        }
  104         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  105         -
            "expected start object or null",
  106         -
        )),
  107         -
    }
  108         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_kinesis_data_stream_destination.rs

@@ -1,0 +64,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kinesis_data_stream_destination<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::KinesisDataStreamDestination>, ::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::KinesisDataStreamDestinationBuilder::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         -
                        "StreamArn" => {
   19         -
                            builder = builder.set_stream_arn(
   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         -
                        "DestinationStatus" => {
   26         -
                            builder = builder.set_destination_status(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::DestinationStatus::from(u.as_ref())))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "DestinationStatusDescription" => {
   33         -
                            builder = builder.set_destination_status_description(
   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         -
                        "ApproximateCreationDateTimePrecision" => {
   40         -
                            builder = builder.set_approximate_creation_date_time_precision(
   41         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   42         -
                                    .map(|s| {
   43         -
                                        s.to_unescaped()
   44         -
                                            .map(|u| crate::types::ApproximateCreationDateTimePrecision::from(u.as_ref()))
   45         -
                                    })
   46         -
                                    .transpose()?,
   47         -
                            );
   48         -
                        }
   49         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   50         -
                    },
   51         -
                    other => {
   52         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   53         -
                            "expected object key or end object, found: {other:?}"
   54         -
                        )))
   55         -
                    }
   56         -
                }
   57         -
            }
   58         -
            Ok(Some(builder.build()))
   59         -
        }
   60         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   61         -
            "expected start object or null",
   62         -
        )),
   63         -
    }
   64         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_kinesis_data_stream_destinations.rs

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

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

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

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_attribute_value.rs

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

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_backups.rs

@@ -1,0 +117,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_backups_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_backups::ListBackupsOutput, crate::operation::list_backups::ListBackupsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_backups::ListBackupsError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_backups::ListBackupsError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InternalServerError" => crate::operation::list_backups::ListBackupsError::InternalServerError({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_backups::ListBackupsError::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         -
        "InvalidEndpointException" => crate::operation::list_backups::ListBackupsError::InvalidEndpointException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InvalidEndpointExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_backups::ListBackupsError::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         -
        _ => crate::operation::list_backups::ListBackupsError::generic(generic),
   51         -
    })
   52         -
}
   53         -
   54         -
#[allow(clippy::unnecessary_wraps)]
   55         -
pub fn de_list_backups_http_response(
   56         -
    _response_status: u16,
   57         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   58         -
    _response_body: &[u8],
   59         -
) -> std::result::Result<crate::operation::list_backups::ListBackupsOutput, crate::operation::list_backups::ListBackupsError> {
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::list_backups::builders::ListBackupsOutputBuilder::default();
   63         -
        output = crate::protocol_serde::shape_list_backups::de_list_backups(_response_body, output)
   64         -
            .map_err(crate::operation::list_backups::ListBackupsError::unhandled)?;
   65         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   66         -
        output.build()
   67         -
    })
   68         -
}
   69         -
   70         -
pub fn ser_list_backups_input(
   71         -
    input: &crate::operation::list_backups::ListBackupsInput,
   72         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   73         -
    let mut out = String::new();
   74         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   75         -
    crate::protocol_serde::shape_list_backups_input::ser_list_backups_input_input(&mut object, input)?;
   76         -
    object.finish();
   77         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   78         -
}
   79         -
   80         -
pub(crate) fn de_list_backups(
   81         -
    _value: &[u8],
   82         -
    mut builder: crate::operation::list_backups::builders::ListBackupsOutputBuilder,
   83         -
) -> ::std::result::Result<crate::operation::list_backups::builders::ListBackupsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
   84         -
{
   85         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   86         -
    let tokens = &mut tokens_owned;
   87         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   88         -
    loop {
   89         -
        match tokens.next().transpose()? {
   90         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   91         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   92         -
                "BackupSummaries" => {
   93         -
                    builder = builder.set_backup_summaries(crate::protocol_serde::shape_backup_summaries::de_backup_summaries(tokens, _value)?);
   94         -
                }
   95         -
                "LastEvaluatedBackupArn" => {
   96         -
                    builder = builder.set_last_evaluated_backup_arn(
   97         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   98         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   99         -
                            .transpose()?,
  100         -
                    );
  101         -
                }
  102         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  103         -
            },
  104         -
            other => {
  105         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  106         -
                    "expected object key or end object, found: {other:?}"
  107         -
                )))
  108         -
            }
  109         -
        }
  110         -
    }
  111         -
    if tokens.next().is_some() {
  112         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  113         -
            "found more JSON tokens after completing parsing",
  114         -
        ));
  115         -
    }
  116         -
    Ok(builder)
  117         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_backups_input.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_backups_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_backups::ListBackupsInput,
    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.limit {
   10         -
        object.key("Limit").number(
   11         -
            #[allow(clippy::useless_conversion)]
   12         -
            ::aws_smithy_types::Number::NegInt((*var_2).into()),
   13         -
        );
   14         -
    }
   15         -
    if let Some(var_3) = &input.time_range_lower_bound {
   16         -
        object
   17         -
            .key("TimeRangeLowerBound")
   18         -
            .date_time(var_3, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   19         -
    }
   20         -
    if let Some(var_4) = &input.time_range_upper_bound {
   21         -
        object
   22         -
            .key("TimeRangeUpperBound")
   23         -
            .date_time(var_4, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   24         -
    }
   25         -
    if let Some(var_5) = &input.exclusive_start_backup_arn {
   26         -
        object.key("ExclusiveStartBackupArn").string(var_5.as_str());
   27         -
    }
   28         -
    if let Some(var_6) = &input.backup_type {
   29         -
        object.key("BackupType").string(var_6.as_str());
   30         -
    }
   31         -
    Ok(())
   32         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_contributor_insights.rs

@@ -1,0 +131,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_contributor_insights_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::list_contributor_insights::ListContributorInsightsOutput,
    9         -
    crate::operation::list_contributor_insights::ListContributorInsightsError,
   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::list_contributor_insights::ListContributorInsightsError::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::list_contributor_insights::ListContributorInsightsError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "InternalServerError" => crate::operation::list_contributor_insights::ListContributorInsightsError::InternalServerError({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   32         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::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         -
        "ResourceNotFoundException" => crate::operation::list_contributor_insights::ListContributorInsightsError::ResourceNotFoundException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::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         -
        _ => crate::operation::list_contributor_insights::ListContributorInsightsError::generic(generic),
   58         -
    })
   59         -
}
   60         -
   61         -
#[allow(clippy::unnecessary_wraps)]
   62         -
pub fn de_list_contributor_insights_http_response(
   63         -
    _response_status: u16,
   64         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   65         -
    _response_body: &[u8],
   66         -
) -> std::result::Result<
   67         -
    crate::operation::list_contributor_insights::ListContributorInsightsOutput,
   68         -
    crate::operation::list_contributor_insights::ListContributorInsightsError,
   69         -
> {
   70         -
    Ok({
   71         -
        #[allow(unused_mut)]
   72         -
        let mut output = crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder::default();
   73         -
        output = crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights(_response_body, output)
   74         -
            .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled)?;
   75         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   76         -
        output.build()
   77         -
    })
   78         -
}
   79         -
   80         -
pub fn ser_list_contributor_insights_input(
   81         -
    input: &crate::operation::list_contributor_insights::ListContributorInsightsInput,
   82         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   83         -
    let mut out = String::new();
   84         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   85         -
    crate::protocol_serde::shape_list_contributor_insights_input::ser_list_contributor_insights_input_input(&mut object, input)?;
   86         -
    object.finish();
   87         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   88         -
}
   89         -
   90         -
pub(crate) fn de_list_contributor_insights(
   91         -
    _value: &[u8],
   92         -
    mut builder: crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder,
   93         -
) -> ::std::result::Result<
   94         -
    crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder,
   95         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   96         -
> {
   97         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   98         -
    let tokens = &mut tokens_owned;
   99         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  100         -
    loop {
  101         -
        match tokens.next().transpose()? {
  102         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  103         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  104         -
                "ContributorInsightsSummaries" => {
  105         -
                    builder = builder.set_contributor_insights_summaries(
  106         -
                        crate::protocol_serde::shape_contributor_insights_summaries::de_contributor_insights_summaries(tokens, _value)?,
  107         -
                    );
  108         -
                }
  109         -
                "NextToken" => {
  110         -
                    builder = builder.set_next_token(
  111         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  112         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  113         -
                            .transpose()?,
  114         -
                    );
  115         -
                }
  116         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  117         -
            },
  118         -
            other => {
  119         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  120         -
                    "expected object key or end object, found: {other:?}"
  121         -
                )))
  122         -
            }
  123         -
        }
  124         -
    }
  125         -
    if tokens.next().is_some() {
  126         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  127         -
            "found more JSON tokens after completing parsing",
  128         -
        ));
  129         -
    }
  130         -
    Ok(builder)
  131         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_contributor_insights_input.rs

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_list_contributor_insights_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::list_contributor_insights::ListContributorInsightsInput,
    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.next_token {
   10         -
        object.key("NextToken").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.max_results {
   13         -
        object.key("MaxResults").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((*var_3).into()),
   16         -
        );
   17         -
    }
   18         -
    Ok(())
   19         -
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/protocol_serde/shape_list_exports.rs

@@ -1,0 +117,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_exports_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_exports::ListExportsOutput, crate::operation::list_exports::ListExportsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::list_exports::ListExportsError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_exports::ListExportsError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InternalServerError" => crate::operation::list_exports::ListExportsError::InternalServerError({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_exports::ListExportsError::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         -
        "LimitExceededException" => crate::operation::list_exports::ListExportsError::LimitExceededException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::list_exports::ListExportsError::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         -
        _ => crate::operation::list_exports::ListExportsError::generic(generic),
   51         -
    })
   52         -
}
   53         -
   54         -
#[allow(clippy::unnecessary_wraps)]
   55         -
pub fn de_list_exports_http_response(
   56         -
    _response_status: u16,
   57         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   58         -
    _response_body: &[u8],
   59         -
) -> std::result::Result<crate::operation::list_exports::ListExportsOutput, crate::operation::list_exports::ListExportsError> {
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::list_exports::builders::ListExportsOutputBuilder::default();
   63         -
        output = crate::protocol_serde::shape_list_exports::de_list_exports(_response_body, output)
   64         -
            .map_err(crate::operation::list_exports::ListExportsError::unhandled)?;
   65         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   66         -
        output.build()
   67         -
    })
   68         -
}
   69         -
   70         -
pub fn ser_list_exports_input(
   71         -
    input: &crate::operation::list_exports::ListExportsInput,
   72         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   73         -
    let mut out = String::new();
   74         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   75         -
    crate::protocol_serde::shape_list_exports_input::ser_list_exports_input_input(&mut object, input)?;
   76         -
    object.finish();
   77         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   78         -
}
   79         -
   80         -
pub(crate) fn de_list_exports(
   81         -
    _value: &[u8],
   82         -
    mut builder: crate::operation::list_exports::builders::ListExportsOutputBuilder,
   83         -
) -> ::std::result::Result<crate::operation::list_exports::builders::ListExportsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
   84         -
{
   85         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   86         -
    let tokens = &mut tokens_owned;
   87         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   88         -
    loop {
   89         -
        match tokens.next().transpose()? {
   90         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   91         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   92         -
                "ExportSummaries" => {
   93         -
                    builder = builder.set_export_summaries(crate::protocol_serde::shape_export_summaries::de_export_summaries(tokens, _value)?);
   94         -
                }
   95         -
                "NextToken" => {
   96         -
                    builder = builder.set_next_token(
   97         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   98         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   99         -
                            .transpose()?,
  100         -
                    );
  101         -
                }
  102         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  103         -
            },
  104         -
            other => {
  105         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  106         -
                    "expected object key or end object, found: {other:?}"
  107         -
                )))
  108         -
            }
  109         -
        }
  110         -
    }
  111         -
    if tokens.next().is_some() {
  112         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  113         -
            "found more JSON tokens after completing parsing",
  114         -
        ));
  115         -
    }
  116         -
    Ok(builder)
  117         -
}