1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_configuration_item<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::ConfigurationItem>, ::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::ConfigurationItemBuilder::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 - | "version" => {
|
19 - | builder = builder.set_version(
|
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 - | "accountId" => {
|
26 - | builder = builder.set_account_id(
|
27 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
28 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
29 - | .transpose()?,
|
30 - | );
|
31 - | }
|
32 - | "configurationItemCaptureTime" => {
|
33 - | builder = builder.set_configuration_item_capture_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
34 - | tokens.next(),
|
35 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
36 - | )?);
|
37 - | }
|
38 - | "configurationItemStatus" => {
|
39 - | builder = builder.set_configuration_item_status(
|
40 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
41 - | .map(|s| s.to_unescaped().map(|u| crate::types::ConfigurationItemStatus::from(u.as_ref())))
|
42 - | .transpose()?,
|
43 - | );
|
44 - | }
|
45 - | "configurationStateId" => {
|
46 - | builder = builder.set_configuration_state_id(
|
47 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
48 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
49 - | .transpose()?,
|
50 - | );
|
51 - | }
|
52 - | "configurationItemMD5Hash" => {
|
53 - | builder = builder.set_configuration_item_md5_hash(
|
54 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
55 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
56 - | .transpose()?,
|
57 - | );
|
58 - | }
|
59 - | "arn" => {
|
60 - | builder = builder.set_arn(
|
61 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
62 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
63 - | .transpose()?,
|
64 - | );
|
65 - | }
|
66 - | "resourceType" => {
|
67 - | builder = builder.set_resource_type(
|
68 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
69 - | .map(|s| s.to_unescaped().map(|u| crate::types::ResourceType::from(u.as_ref())))
|
70 - | .transpose()?,
|
71 - | );
|
72 - | }
|
73 - | "resourceId" => {
|
74 - | builder = builder.set_resource_id(
|
75 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
76 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
77 - | .transpose()?,
|
78 - | );
|
79 - | }
|
80 - | "resourceName" => {
|
81 - | builder = builder.set_resource_name(
|
82 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
83 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
84 - | .transpose()?,
|
85 - | );
|
86 - | }
|
87 - | "awsRegion" => {
|
88 - | builder = builder.set_aws_region(
|
89 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
90 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
91 - | .transpose()?,
|
92 - | );
|
93 - | }
|
94 - | "availabilityZone" => {
|
95 - | builder = builder.set_availability_zone(
|
96 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
97 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
98 - | .transpose()?,
|
99 - | );
|
100 - | }
|
101 - | "resourceCreationTime" => {
|
102 - | builder = builder.set_resource_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
103 - | tokens.next(),
|
104 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
105 - | )?);
|
106 - | }
|
107 - | "tags" => {
|
108 - | builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value)?);
|
109 - | }
|
110 - | "relatedEvents" => {
|
111 - | builder =
|
112 - | builder.set_related_events(crate::protocol_serde::shape_related_event_list::de_related_event_list(tokens, _value)?);
|
113 - | }
|
114 - | "relationships" => {
|
115 - | builder =
|
116 - | builder.set_relationships(crate::protocol_serde::shape_relationship_list::de_relationship_list(tokens, _value)?);
|
117 - | }
|
118 - | "configuration" => {
|
119 - | builder = builder.set_configuration(
|
120 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
121 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
122 - | .transpose()?,
|
123 - | );
|
124 - | }
|
125 - | "supplementaryConfiguration" => {
|
126 - | builder = builder.set_supplementary_configuration(
|
127 - | crate::protocol_serde::shape_supplementary_configuration::de_supplementary_configuration(tokens, _value)?,
|
128 - | );
|
129 - | }
|
130 - | "recordingFrequency" => {
|
131 - | builder = builder.set_recording_frequency(
|
132 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
133 - | .map(|s| s.to_unescaped().map(|u| crate::types::RecordingFrequency::from(u.as_ref())))
|
134 - | .transpose()?,
|
135 - | );
|
136 - | }
|
137 - | "configurationItemDeliveryTime" => {
|
138 - | builder = builder.set_configuration_item_delivery_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
139 - | tokens.next(),
|
140 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
141 - | )?);
|
142 - | }
|
143 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
144 - | },
|
145 - | other => {
|
146 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
147 - | "expected object key or end object, found: {other:?}"
|
148 - | )))
|
149 - | }
|
150 - | }
|
151 - | }
|
152 - | Ok(Some(builder.build()))
|
153 - | }
|
154 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
155 - | "expected start object or null",
|
156 - | )),
|
157 - | }
|
158 - | }
|