Skip to main content

aws_sdk_glue/schema_serde/
shape_compaction_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static COMPACTIONCONFIGURATION_MEMBER_ICEBERG_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue#CompactionConfiguration$icebergConfiguration",
5        "com.amazonaws.glue",
6        "CompactionConfiguration",
7    ),
8    ::aws_smithy_schema::ShapeType::Structure,
9    "icebergConfiguration",
10    0,
11);
12static COMPACTIONCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue#CompactionConfiguration",
15        "com.amazonaws.glue",
16        "CompactionConfiguration",
17    ),
18    ::aws_smithy_schema::ShapeType::Structure,
19    &[&COMPACTIONCONFIGURATION_MEMBER_ICEBERG_CONFIGURATION],
20);
21impl crate::types::CompactionConfiguration {
22    /// The schema for this shape.
23    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &COMPACTIONCONFIGURATION_SCHEMA;
24}
25impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::CompactionConfiguration {
26    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
27        Self::SCHEMA
28    }
29
30    #[allow(unused_variables, clippy::diverging_sub_expression)]
31    fn serialize_members(
32        &self,
33        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
34    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
35        if let Some(ref val) = self.iceberg_configuration {
36            ser.write_struct(&COMPACTIONCONFIGURATION_MEMBER_ICEBERG_CONFIGURATION, val)?;
37        }
38        Ok(())
39    }
40}
41impl crate::types::builders::CompactionConfigurationBuilder {
42    #[allow(
43        unused_variables,
44        unreachable_code,
45        clippy::single_match,
46        clippy::match_single_binding,
47        clippy::diverging_sub_expression
48    )]
49    pub(crate) fn deserialize_members(
50        &mut self,
51        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
52    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
53        deserializer.read_struct(&COMPACTIONCONFIGURATION_SCHEMA, &mut |member, deser| {
54            match member.member_index() {
55                Some(0) => {
56                    if deser.is_null() {
57                        deser.read_null()?;
58                    } else {
59                        self.iceberg_configuration = Some(crate::types::IcebergCompactionConfiguration::deserialize(deser)?);
60                    }
61                }
62                _ => {}
63            }
64            Ok(())
65        })
66    }
67}
68
69impl crate::types::CompactionConfiguration {
70    /// Deserializes this structure from a [`ShapeDeserializer`].
71    pub fn deserialize(
72        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
73    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
74        let mut builder = Self::builder();
75        builder.deserialize_members(deserializer)?;
76        Ok(builder.build())
77    }
78}