aws_sdk_glue/schema_serde/
shape_distribution_results_options.rs1static DISTRIBUTIONRESULTSOPTIONS_MEMBER_WRITE_DISTRIBUTION_RESULTS_ENABLED: ::aws_smithy_schema::Schema<'static> =
3 ::aws_smithy_schema::Schema::new_member(
4 ::aws_smithy_schema::ShapeId::from_parts(
5 "com.amazonaws.glue#DistributionResultsOptions$WriteDistributionResultsEnabled",
6 "com.amazonaws.glue",
7 "DistributionResultsOptions",
8 ),
9 ::aws_smithy_schema::ShapeType::Boolean,
10 "WriteDistributionResultsEnabled",
11 0,
12 );
13static DISTRIBUTIONRESULTSOPTIONS_MEMBER_CATALOG_TABLE_CONFIG: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
14 ::aws_smithy_schema::ShapeId::from_parts(
15 "com.amazonaws.glue#DistributionResultsOptions$CatalogTableConfig",
16 "com.amazonaws.glue",
17 "DistributionResultsOptions",
18 ),
19 ::aws_smithy_schema::ShapeType::Structure,
20 "CatalogTableConfig",
21 1,
22);
23static DISTRIBUTIONRESULTSOPTIONS_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
24 ::aws_smithy_schema::ShapeId::from_parts(
25 "com.amazonaws.glue#DistributionResultsOptions",
26 "com.amazonaws.glue",
27 "DistributionResultsOptions",
28 ),
29 ::aws_smithy_schema::ShapeType::Structure,
30 &[
31 &DISTRIBUTIONRESULTSOPTIONS_MEMBER_WRITE_DISTRIBUTION_RESULTS_ENABLED,
32 &DISTRIBUTIONRESULTSOPTIONS_MEMBER_CATALOG_TABLE_CONFIG,
33 ],
34);
35impl crate::types::DistributionResultsOptions {
36 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DISTRIBUTIONRESULTSOPTIONS_SCHEMA;
38}
39impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::DistributionResultsOptions {
40 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
41 Self::SCHEMA
42 }
43
44 #[allow(unused_variables, clippy::diverging_sub_expression)]
45 fn serialize_members(
46 &self,
47 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
48 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
49 if let Some(ref val) = self.write_distribution_results_enabled {
50 ser.write_boolean(&DISTRIBUTIONRESULTSOPTIONS_MEMBER_WRITE_DISTRIBUTION_RESULTS_ENABLED, *val)?;
51 }
52 if let Some(ref val) = self.catalog_table_config {
53 ser.write_struct(&DISTRIBUTIONRESULTSOPTIONS_MEMBER_CATALOG_TABLE_CONFIG, val)?;
54 }
55 Ok(())
56 }
57}
58impl crate::types::builders::DistributionResultsOptionsBuilder {
59 #[allow(
60 unused_variables,
61 unreachable_code,
62 clippy::single_match,
63 clippy::match_single_binding,
64 clippy::diverging_sub_expression
65 )]
66 pub(crate) fn deserialize_members(
67 &mut self,
68 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
69 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
70 deserializer.read_struct(&DISTRIBUTIONRESULTSOPTIONS_SCHEMA, &mut |member, deser| {
71 match member.member_index() {
72 Some(0) => {
73 if deser.is_null() {
74 deser.read_null()?;
75 } else {
76 self.write_distribution_results_enabled = Some(deser.read_boolean(member)?);
77 }
78 }
79 Some(1) => {
80 if deser.is_null() {
81 deser.read_null()?;
82 } else {
83 self.catalog_table_config = Some(crate::types::CatalogTableConfigOptions::deserialize(deser)?);
84 }
85 }
86 _ => {}
87 }
88 Ok(())
89 })
90 }
91}
92
93impl crate::types::DistributionResultsOptions {
94 pub fn deserialize(
96 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
97 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
98 let mut builder = Self::builder();
99 builder.deserialize_members(deserializer)?;
100 Ok(builder.build())
101 }
102}