1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_replica_settings_description<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::ReplicaSettingsDescription>, ::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::ReplicaSettingsDescriptionBuilder::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 - | "RegionName" => {
|
19 - | builder = builder.set_region_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 - | "ReplicaStatus" => {
|
26 - | builder = builder.set_replica_status(
|
27 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
28 - | .map(|s| s.to_unescaped().map(|u| crate::types::ReplicaStatus::from(u.as_ref())))
|
29 - | .transpose()?,
|
30 - | );
|
31 - | }
|
32 - | "ReplicaBillingModeSummary" => {
|
33 - | builder = builder.set_replica_billing_mode_summary(
|
34 - | crate::protocol_serde::shape_billing_mode_summary::de_billing_mode_summary(tokens, _value)?,
|
35 - | );
|
36 - | }
|
37 - | "ReplicaProvisionedReadCapacityUnits" => {
|
38 - | builder = builder.set_replica_provisioned_read_capacity_units(
|
39 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
40 - | .map(i64::try_from)
|
41 - | .transpose()?,
|
42 - | );
|
43 - | }
|
44 - | "ReplicaProvisionedReadCapacityAutoScalingSettings" => {
|
45 - | builder = builder.set_replica_provisioned_read_capacity_auto_scaling_settings(
|
46 - | crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
|
47 - | );
|
48 - | }
|
49 - | "ReplicaProvisionedWriteCapacityUnits" => {
|
50 - | builder = builder.set_replica_provisioned_write_capacity_units(
|
51 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
52 - | .map(i64::try_from)
|
53 - | .transpose()?,
|
54 - | );
|
55 - | }
|
56 - | "ReplicaProvisionedWriteCapacityAutoScalingSettings" => {
|
57 - | builder = builder.set_replica_provisioned_write_capacity_auto_scaling_settings(
|
58 - | crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
|
59 - | );
|
60 - | }
|
61 - | "ReplicaGlobalSecondaryIndexSettings" => {
|
62 - | builder = builder.set_replica_global_secondary_index_settings(
|
63 - | crate::protocol_serde::shape_replica_global_secondary_index_settings_description_list::de_replica_global_secondary_index_settings_description_list(tokens, _value)?
|
64 - | );
|
65 - | }
|
66 - | "ReplicaTableClassSummary" => {
|
67 - | builder = builder.set_replica_table_class_summary(
|
68 - | crate::protocol_serde::shape_table_class_summary::de_table_class_summary(tokens, _value)?,
|
69 - | );
|
70 - | }
|
71 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
72 - | },
|
73 - | other => {
|
74 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
75 - | "expected object key or end object, found: {other:?}"
|
76 - | )))
|
77 - | }
|
78 - | }
|
79 - | }
|
80 - | Ok(Some(
|
81 - | crate::serde_util::replica_settings_description_correct_errors(builder)
|
82 - | .build()
|
83 - | .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
|
84 - | ))
|
85 - | }
|
86 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
87 - | "expected start object or null",
|
88 - | )),
|
89 - | }
|
90 - | }
|