pub struct Builder { /* private fields */ }
Expand description
A builder for LocalSecondaryIndexDescription
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn index_name(self, input: impl Into<String>) -> Self
pub fn index_name(self, input: impl Into<String>) -> Self
Represents the name of the local secondary index.
sourcepub fn set_index_name(self, input: Option<String>) -> Self
pub fn set_index_name(self, input: Option<String>) -> Self
Represents the name of the local secondary index.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn key_schema(self, input: KeySchemaElement) -> Self
pub fn key_schema(self, input: KeySchemaElement) -> Self
Appends an item to key_schema
.
To override the contents of this collection use set_key_schema
.
The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:
-
HASH
- partition key -
RANGE
- sort key
The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
sourcepub fn set_key_schema(self, input: Option<Vec<KeySchemaElement>>) -> Self
pub fn set_key_schema(self, input: Option<Vec<KeySchemaElement>>) -> Self
The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:
-
HASH
- partition key -
RANGE
- sort key
The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn projection(self, input: Projection) -> Self
pub fn projection(self, input: Projection) -> Self
Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
sourcepub fn set_projection(self, input: Option<Projection>) -> Self
pub fn set_projection(self, input: Option<Projection>) -> Self
Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn index_size_bytes(self, input: i64) -> Self
pub fn index_size_bytes(self, input: i64) -> Self
The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
sourcepub fn set_index_size_bytes(self, input: Option<i64>) -> Self
pub fn set_index_size_bytes(self, input: Option<i64>) -> Self
The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn item_count(self, input: i64) -> Self
pub fn item_count(self, input: i64) -> Self
The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
sourcepub fn set_item_count(self, input: Option<i64>) -> Self
pub fn set_item_count(self, input: Option<i64>) -> Self
The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn index_arn(self, input: impl Into<String>) -> Self
pub fn index_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) that uniquely identifies the index.
sourcepub fn set_index_arn(self, input: Option<String>) -> Self
pub fn set_index_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) that uniquely identifies the index.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> LocalSecondaryIndexDescription
pub fn build(self) -> LocalSecondaryIndexDescription
Consumes the builder and constructs a LocalSecondaryIndexDescription
.
Examples found in repository?
10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163
pub(crate) fn deser_structure_crate_model_local_secondary_index_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LocalSecondaryIndexDescription>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::local_secondary_index_description::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"IndexName" => {
builder = builder.set_index_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"KeySchema" => {
builder = builder.set_key_schema(
crate::json_deser::deser_list_com_amazonaws_dynamodb_key_schema(tokens)?
);
}
"Projection" => {
builder = builder.set_projection(
crate::json_deser::deser_structure_crate_model_projection(
tokens,
)?,
);
}
"IndexSizeBytes" => {
builder = builder.set_index_size_bytes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"ItemCount" => {
builder = builder.set_item_count(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::try_from)
.transpose()?,
);
}
"IndexArn" => {
builder = builder.set_index_arn(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}