Skip to main content

aws_sdk_glue/schema_serde/
shape_asset_form_input.rs

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