Skip to main content

aws_sdk_glue/schema_serde/
shape_table_optimizer_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static TABLEOPTIMIZERCONFIGURATION_MEMBER_ROLE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue#TableOptimizerConfiguration$roleArn",
5        "com.amazonaws.glue",
6        "TableOptimizerConfiguration",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "roleArn",
10    0,
11);
12static TABLEOPTIMIZERCONFIGURATION_MEMBER_ENABLED: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue#TableOptimizerConfiguration$enabled",
15        "com.amazonaws.glue",
16        "TableOptimizerConfiguration",
17    ),
18    ::aws_smithy_schema::ShapeType::Boolean,
19    "enabled",
20    1,
21);
22static TABLEOPTIMIZERCONFIGURATION_MEMBER_VPC_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue#TableOptimizerConfiguration$vpcConfiguration",
25        "com.amazonaws.glue",
26        "TableOptimizerConfiguration",
27    ),
28    ::aws_smithy_schema::ShapeType::Union,
29    "vpcConfiguration",
30    2,
31);
32static TABLEOPTIMIZERCONFIGURATION_MEMBER_COMPACTION_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue#TableOptimizerConfiguration$compactionConfiguration",
35        "com.amazonaws.glue",
36        "TableOptimizerConfiguration",
37    ),
38    ::aws_smithy_schema::ShapeType::Structure,
39    "compactionConfiguration",
40    3,
41);
42static TABLEOPTIMIZERCONFIGURATION_MEMBER_RETENTION_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue#TableOptimizerConfiguration$retentionConfiguration",
45        "com.amazonaws.glue",
46        "TableOptimizerConfiguration",
47    ),
48    ::aws_smithy_schema::ShapeType::Structure,
49    "retentionConfiguration",
50    4,
51);
52static TABLEOPTIMIZERCONFIGURATION_MEMBER_ORPHAN_FILE_DELETION_CONFIGURATION: ::aws_smithy_schema::Schema<'static> =
53    ::aws_smithy_schema::Schema::new_member(
54        ::aws_smithy_schema::ShapeId::from_parts(
55            "com.amazonaws.glue#TableOptimizerConfiguration$orphanFileDeletionConfiguration",
56            "com.amazonaws.glue",
57            "TableOptimizerConfiguration",
58        ),
59        ::aws_smithy_schema::ShapeType::Structure,
60        "orphanFileDeletionConfiguration",
61        5,
62    );
63static TABLEOPTIMIZERCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
64    ::aws_smithy_schema::ShapeId::from_parts(
65        "com.amazonaws.glue#TableOptimizerConfiguration",
66        "com.amazonaws.glue",
67        "TableOptimizerConfiguration",
68    ),
69    ::aws_smithy_schema::ShapeType::Structure,
70    &[
71        &TABLEOPTIMIZERCONFIGURATION_MEMBER_ROLE_ARN,
72        &TABLEOPTIMIZERCONFIGURATION_MEMBER_ENABLED,
73        &TABLEOPTIMIZERCONFIGURATION_MEMBER_VPC_CONFIGURATION,
74        &TABLEOPTIMIZERCONFIGURATION_MEMBER_COMPACTION_CONFIGURATION,
75        &TABLEOPTIMIZERCONFIGURATION_MEMBER_RETENTION_CONFIGURATION,
76        &TABLEOPTIMIZERCONFIGURATION_MEMBER_ORPHAN_FILE_DELETION_CONFIGURATION,
77    ],
78);
79impl crate::types::TableOptimizerConfiguration {
80    /// The schema for this shape.
81    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &TABLEOPTIMIZERCONFIGURATION_SCHEMA;
82}
83impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::TableOptimizerConfiguration {
84    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
85        Self::SCHEMA
86    }
87
88    #[allow(unused_variables, clippy::diverging_sub_expression)]
89    fn serialize_members(
90        &self,
91        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
92    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
93        if let Some(ref val) = self.role_arn {
94            ser.write_string(&TABLEOPTIMIZERCONFIGURATION_MEMBER_ROLE_ARN, val)?;
95        }
96        if let Some(ref val) = self.enabled {
97            ser.write_boolean(&TABLEOPTIMIZERCONFIGURATION_MEMBER_ENABLED, *val)?;
98        }
99        if let Some(ref val) = self.vpc_configuration {
100            ser.write_struct(&TABLEOPTIMIZERCONFIGURATION_MEMBER_VPC_CONFIGURATION, val)?;
101        }
102        if let Some(ref val) = self.compaction_configuration {
103            ser.write_struct(&TABLEOPTIMIZERCONFIGURATION_MEMBER_COMPACTION_CONFIGURATION, val)?;
104        }
105        if let Some(ref val) = self.retention_configuration {
106            ser.write_struct(&TABLEOPTIMIZERCONFIGURATION_MEMBER_RETENTION_CONFIGURATION, val)?;
107        }
108        if let Some(ref val) = self.orphan_file_deletion_configuration {
109            ser.write_struct(&TABLEOPTIMIZERCONFIGURATION_MEMBER_ORPHAN_FILE_DELETION_CONFIGURATION, val)?;
110        }
111        Ok(())
112    }
113}
114impl crate::types::builders::TableOptimizerConfigurationBuilder {
115    #[allow(
116        unused_variables,
117        unreachable_code,
118        clippy::single_match,
119        clippy::match_single_binding,
120        clippy::diverging_sub_expression
121    )]
122    pub(crate) fn deserialize_members(
123        &mut self,
124        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
125    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
126        deserializer.read_struct(&TABLEOPTIMIZERCONFIGURATION_SCHEMA, &mut |member, deser| {
127            match member.member_index() {
128                Some(0) => {
129                    if deser.is_null() {
130                        deser.read_null()?;
131                    } else {
132                        self.role_arn = Some(deser.read_string(member)?);
133                    }
134                }
135                Some(1) => {
136                    if deser.is_null() {
137                        deser.read_null()?;
138                    } else {
139                        self.enabled = Some(deser.read_boolean(member)?);
140                    }
141                }
142                Some(2) => {
143                    if deser.is_null() {
144                        deser.read_null()?;
145                    } else {
146                        self.vpc_configuration = Some(crate::types::TableOptimizerVpcConfiguration::deserialize(deser)?);
147                    }
148                }
149                Some(3) => {
150                    if deser.is_null() {
151                        deser.read_null()?;
152                    } else {
153                        self.compaction_configuration = Some(crate::types::CompactionConfiguration::deserialize(deser)?);
154                    }
155                }
156                Some(4) => {
157                    if deser.is_null() {
158                        deser.read_null()?;
159                    } else {
160                        self.retention_configuration = Some(crate::types::RetentionConfiguration::deserialize(deser)?);
161                    }
162                }
163                Some(5) => {
164                    if deser.is_null() {
165                        deser.read_null()?;
166                    } else {
167                        self.orphan_file_deletion_configuration = Some(crate::types::OrphanFileDeletionConfiguration::deserialize(deser)?);
168                    }
169                }
170                _ => {}
171            }
172            Ok(())
173        })
174    }
175}
176
177impl crate::types::TableOptimizerConfiguration {
178    /// Deserializes this structure from a [`ShapeDeserializer`].
179    pub fn deserialize(
180        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
181    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
182        let mut builder = Self::builder();
183        builder.deserialize_members(deserializer)?;
184        Ok(builder.build())
185    }
186}