Skip to main content

aws_sdk_glue/schema_serde/
shape_batch_get_blueprints_output_output.rs

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