Skip to main content

aws_sdk_glue/schema_serde/
shape_integration_table_properties.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static INTEGRATIONTABLEPROPERTIES_MEMBER_RESOURCE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue#IntegrationTableProperties$ResourceArn",
5        "com.amazonaws.glue",
6        "IntegrationTableProperties",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "ResourceArn",
10    0,
11);
12static INTEGRATIONTABLEPROPERTIES_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue#IntegrationTableProperties$TableName",
15        "com.amazonaws.glue",
16        "IntegrationTableProperties",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "TableName",
20    1,
21);
22static INTEGRATIONTABLEPROPERTIES_MEMBER_SOURCE_TABLE_CONFIG: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue#IntegrationTableProperties$SourceTableConfig",
25        "com.amazonaws.glue",
26        "IntegrationTableProperties",
27    ),
28    ::aws_smithy_schema::ShapeType::Structure,
29    "SourceTableConfig",
30    2,
31);
32static INTEGRATIONTABLEPROPERTIES_MEMBER_TARGET_TABLE_CONFIG: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue#IntegrationTableProperties$TargetTableConfig",
35        "com.amazonaws.glue",
36        "IntegrationTableProperties",
37    ),
38    ::aws_smithy_schema::ShapeType::Structure,
39    "TargetTableConfig",
40    3,
41);
42static INTEGRATIONTABLEPROPERTIES_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue#IntegrationTableProperties",
45        "com.amazonaws.glue",
46        "IntegrationTableProperties",
47    ),
48    ::aws_smithy_schema::ShapeType::Structure,
49    &[
50        &INTEGRATIONTABLEPROPERTIES_MEMBER_RESOURCE_ARN,
51        &INTEGRATIONTABLEPROPERTIES_MEMBER_TABLE_NAME,
52        &INTEGRATIONTABLEPROPERTIES_MEMBER_SOURCE_TABLE_CONFIG,
53        &INTEGRATIONTABLEPROPERTIES_MEMBER_TARGET_TABLE_CONFIG,
54    ],
55);
56impl crate::types::IntegrationTableProperties {
57    /// The schema for this shape.
58    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INTEGRATIONTABLEPROPERTIES_SCHEMA;
59}
60impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::IntegrationTableProperties {
61    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
62        Self::SCHEMA
63    }
64
65    #[allow(unused_variables, clippy::diverging_sub_expression)]
66    fn serialize_members(
67        &self,
68        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
69    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
70        {
71            let val = &self.resource_arn;
72            ser.write_string(&INTEGRATIONTABLEPROPERTIES_MEMBER_RESOURCE_ARN, val)?;
73        }
74        {
75            let val = &self.table_name;
76            ser.write_string(&INTEGRATIONTABLEPROPERTIES_MEMBER_TABLE_NAME, val)?;
77        }
78        if let Some(ref val) = self.source_table_config {
79            ser.write_struct(&INTEGRATIONTABLEPROPERTIES_MEMBER_SOURCE_TABLE_CONFIG, val)?;
80        }
81        if let Some(ref val) = self.target_table_config {
82            ser.write_struct(&INTEGRATIONTABLEPROPERTIES_MEMBER_TARGET_TABLE_CONFIG, val)?;
83        }
84        Ok(())
85    }
86}
87impl crate::types::builders::IntegrationTablePropertiesBuilder {
88    #[allow(
89        unused_variables,
90        unreachable_code,
91        clippy::single_match,
92        clippy::match_single_binding,
93        clippy::diverging_sub_expression
94    )]
95    pub(crate) fn deserialize_members(
96        &mut self,
97        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
98    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
99        deserializer.read_struct(&INTEGRATIONTABLEPROPERTIES_SCHEMA, &mut |member, deser| {
100            match member.member_index() {
101                Some(0) => {
102                    self.resource_arn = Some(deser.read_string(member)?);
103                }
104                Some(1) => {
105                    self.table_name = Some(deser.read_string(member)?);
106                }
107                Some(2) => {
108                    if deser.is_null() {
109                        deser.read_null()?;
110                    } else {
111                        self.source_table_config = Some(crate::types::SourceTableConfig::deserialize(deser)?);
112                    }
113                }
114                Some(3) => {
115                    if deser.is_null() {
116                        deser.read_null()?;
117                    } else {
118                        self.target_table_config = Some(crate::types::TargetTableConfig::deserialize(deser)?);
119                    }
120                }
121                _ => {}
122            }
123            Ok(())
124        })
125    }
126}
127
128impl crate::types::IntegrationTableProperties {
129    /// Deserializes this structure from a [`ShapeDeserializer`].
130    pub fn deserialize(
131        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
132    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
133        let mut builder = Self::builder();
134        builder.deserialize_members(deserializer)?;
135        builder.resource_arn = builder.resource_arn.or(Some(String::new()));
136        builder.table_name = builder.table_name.or(Some(String::new()));
137        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
138    }
139}