aws_sdk_securityhub/protocol_serde/
shape_aws_athena_work_group_configuration_result_configuration_details.rs1pub fn ser_aws_athena_work_group_configuration_result_configuration_details(
3 object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
4 input: &crate::types::AwsAthenaWorkGroupConfigurationResultConfigurationDetails,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6 if let Some(var_1) = &input.encryption_configuration {
7 #[allow(unused_mut)]
8 let mut object_2 = object.key("EncryptionConfiguration").start_object();
9 crate::protocol_serde::shape_aws_athena_work_group_configuration_result_configuration_encryption_configuration_details::ser_aws_athena_work_group_configuration_result_configuration_encryption_configuration_details(&mut object_2, var_1)?;
10 object_2.finish();
11 }
12 Ok(())
13}
14
15pub(crate) fn de_aws_athena_work_group_configuration_result_configuration_details<'a, I>(
16 tokens: &mut ::std::iter::Peekable<I>,
17 _value: &'a [u8],
18) -> ::std::result::Result<
19 Option<crate::types::AwsAthenaWorkGroupConfigurationResultConfigurationDetails>,
20 ::aws_smithy_json::deserialize::error::DeserializeError,
21>
22where
23 I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
24{
25 match tokens.next().transpose()? {
26 Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
27 Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
28 #[allow(unused_mut)]
29 let mut builder = crate::types::builders::AwsAthenaWorkGroupConfigurationResultConfigurationDetailsBuilder::default();
30 loop {
31 match tokens.next().transpose()? {
32 Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
33 Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
34 "EncryptionConfiguration" => {
35 builder = builder.set_encryption_configuration(
36 crate::protocol_serde::shape_aws_athena_work_group_configuration_result_configuration_encryption_configuration_details::de_aws_athena_work_group_configuration_result_configuration_encryption_configuration_details(tokens, _value)?
37 );
38 }
39 _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
40 },
41 other => {
42 return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
43 "expected object key or end object, found: {other:?}"
44 )))
45 }
46 }
47 }
48 Ok(Some(builder.build()))
49 }
50 _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
51 "expected start object or null",
52 )),
53 }
54}