Skip to main content

aws_sdk_glue/schema_serde/
shape_starting_event_batch_condition.rs

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