Skip to main content

aws_sdk_glue/schema_serde/
shape_batch_create_partition_output_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static BATCHCREATEPARTITIONOUTPUT_MEMBER_ERRORS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#PartitionErrors$member", "com.amazonaws.glue", "PartitionErrors"),
4    ::aws_smithy_schema::ShapeType::Structure,
5    "member",
6    0,
7);
8static BATCHCREATEPARTITIONOUTPUT_MEMBER_ERRORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
9    ::aws_smithy_schema::ShapeId::from_parts(
10        "com.amazonaws.glue.synthetic#BatchCreatePartitionOutput$Errors",
11        "com.amazonaws.glue.synthetic",
12        "BatchCreatePartitionOutput",
13    ),
14    ::aws_smithy_schema::ShapeType::List,
15    "Errors",
16    0,
17)
18.with_list_member(&BATCHCREATEPARTITIONOUTPUT_MEMBER_ERRORS_MEMBER);
19static BATCHCREATEPARTITIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
20    ::aws_smithy_schema::ShapeId::from_parts(
21        "com.amazonaws.glue.synthetic#BatchCreatePartitionOutput",
22        "com.amazonaws.glue.synthetic",
23        "BatchCreatePartitionOutput",
24    ),
25    ::aws_smithy_schema::ShapeType::Structure,
26    &[&BATCHCREATEPARTITIONOUTPUT_MEMBER_ERRORS],
27)
28.with_original_name("BatchCreatePartitionResponse");
29impl crate::operation::batch_create_partition::BatchCreatePartitionOutput {
30    /// The schema for this shape.
31    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &BATCHCREATEPARTITIONOUTPUT_SCHEMA;
32}
33impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::batch_create_partition::BatchCreatePartitionOutput {
34    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
35        Self::SCHEMA
36    }
37
38    #[allow(unused_variables, clippy::diverging_sub_expression)]
39    fn serialize_members(
40        &self,
41        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
42    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
43        if let Some(ref val) = self.errors {
44            ser.write_list(
45                &BATCHCREATEPARTITIONOUTPUT_MEMBER_ERRORS,
46                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
47                    for item in val {
48                        ser.write_struct(crate::types::PartitionError::SCHEMA, item)?;
49                    }
50                    Ok(())
51                },
52            )?;
53        }
54        Ok(())
55    }
56}
57impl crate::operation::batch_create_partition::builders::BatchCreatePartitionOutputBuilder {
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(&BATCHCREATEPARTITIONOUTPUT_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.errors = Some({
76                            let mut container = Vec::new();
77                            deser.read_list(member, &mut |deser| {
78                                container.push(crate::types::PartitionError::deserialize(deser)?);
79                                Ok(())
80                            })?;
81                            container
82                        });
83                    }
84                }
85                _ => {}
86            }
87            Ok(())
88        })
89    }
90}
91
92impl crate::operation::batch_create_partition::BatchCreatePartitionOutput {
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}