Skip to main content

aws_sdk_glue/schema_serde/
shape_recipe_step.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static RECIPESTEP_MEMBER_ACTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#RecipeStep$Action", "com.amazonaws.glue", "RecipeStep"),
4    ::aws_smithy_schema::ShapeType::Structure,
5    "Action",
6    0,
7);
8static RECIPESTEP_MEMBER_CONDITION_EXPRESSIONS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
9    ::aws_smithy_schema::ShapeId::from_parts(
10        "com.amazonaws.glue#ConditionExpressionList$member",
11        "com.amazonaws.glue",
12        "ConditionExpressionList",
13    ),
14    ::aws_smithy_schema::ShapeType::Structure,
15    "member",
16    0,
17);
18static RECIPESTEP_MEMBER_CONDITION_EXPRESSIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
19    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#RecipeStep$ConditionExpressions", "com.amazonaws.glue", "RecipeStep"),
20    ::aws_smithy_schema::ShapeType::List,
21    "ConditionExpressions",
22    1,
23)
24.with_list_member(&RECIPESTEP_MEMBER_CONDITION_EXPRESSIONS_MEMBER);
25static RECIPESTEP_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
26    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#RecipeStep", "com.amazonaws.glue", "RecipeStep"),
27    ::aws_smithy_schema::ShapeType::Structure,
28    &[&RECIPESTEP_MEMBER_ACTION, &RECIPESTEP_MEMBER_CONDITION_EXPRESSIONS],
29);
30impl crate::types::RecipeStep {
31    /// The schema for this shape.
32    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RECIPESTEP_SCHEMA;
33}
34impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::RecipeStep {
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.action {
45            ser.write_struct(&RECIPESTEP_MEMBER_ACTION, val)?;
46        }
47        if let Some(ref val) = self.condition_expressions {
48            ser.write_list(
49                &RECIPESTEP_MEMBER_CONDITION_EXPRESSIONS,
50                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
51                    for item in val {
52                        ser.write_struct(crate::types::ConditionExpression::SCHEMA, item)?;
53                    }
54                    Ok(())
55                },
56            )?;
57        }
58        Ok(())
59    }
60}
61impl crate::types::builders::RecipeStepBuilder {
62    #[allow(
63        unused_variables,
64        unreachable_code,
65        clippy::single_match,
66        clippy::match_single_binding,
67        clippy::diverging_sub_expression
68    )]
69    pub(crate) fn deserialize_members(
70        &mut self,
71        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
72    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
73        deserializer.read_struct(&RECIPESTEP_SCHEMA, &mut |member, deser| {
74            match member.member_index() {
75                Some(0) => {
76                    if deser.is_null() {
77                        deser.read_null()?;
78                    } else {
79                        self.action = Some(crate::types::RecipeAction::deserialize(deser)?);
80                    }
81                }
82                Some(1) => {
83                    if deser.is_null() {
84                        deser.read_null()?;
85                    } else {
86                        self.condition_expressions = Some({
87                            let mut container = Vec::new();
88                            deser.read_list(member, &mut |deser| {
89                                container.push(crate::types::ConditionExpression::deserialize(deser)?);
90                                Ok(())
91                            })?;
92                            container
93                        });
94                    }
95                }
96                _ => {}
97            }
98            Ok(())
99        })
100    }
101}
102
103impl crate::types::RecipeStep {
104    /// Deserializes this structure from a [`ShapeDeserializer`].
105    pub fn deserialize(
106        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
107    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
108        let mut builder = Self::builder();
109        builder.deserialize_members(deserializer)?;
110        Ok(builder.build())
111    }
112}