Skip to main content

aws_sdk_glue/schema_serde/
shape_assets_export_result.rs

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