Skip to main content

aws_sdk_glue/schema_serde/
shape_create_blueprint_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static CREATEBLUEPRINTINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue.synthetic#CreateBlueprintInput$Name",
5        "com.amazonaws.glue.synthetic",
6        "CreateBlueprintInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "Name",
10    0,
11);
12static CREATEBLUEPRINTINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue.synthetic#CreateBlueprintInput$Description",
15        "com.amazonaws.glue.synthetic",
16        "CreateBlueprintInput",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "Description",
20    1,
21);
22static CREATEBLUEPRINTINPUT_MEMBER_BLUEPRINT_LOCATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue.synthetic#CreateBlueprintInput$BlueprintLocation",
25        "com.amazonaws.glue.synthetic",
26        "CreateBlueprintInput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "BlueprintLocation",
30    2,
31);
32static CREATEBLUEPRINTINPUT_MEMBER_TAGS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$key", "com.amazonaws.glue", "TagsMap"),
34    ::aws_smithy_schema::ShapeType::String,
35    "key",
36    0,
37);
38static CREATEBLUEPRINTINPUT_MEMBER_TAGS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
39    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$value", "com.amazonaws.glue", "TagsMap"),
40    ::aws_smithy_schema::ShapeType::String,
41    "value",
42    1,
43);
44static CREATEBLUEPRINTINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
45    ::aws_smithy_schema::ShapeId::from_parts(
46        "com.amazonaws.glue.synthetic#CreateBlueprintInput$Tags",
47        "com.amazonaws.glue.synthetic",
48        "CreateBlueprintInput",
49    ),
50    ::aws_smithy_schema::ShapeType::Map,
51    "Tags",
52    3,
53)
54.with_map_members(&CREATEBLUEPRINTINPUT_MEMBER_TAGS_KEY, &CREATEBLUEPRINTINPUT_MEMBER_TAGS_VALUE);
55static CREATEBLUEPRINTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
56    ::aws_smithy_schema::ShapeId::from_parts(
57        "com.amazonaws.glue.synthetic#CreateBlueprintInput",
58        "com.amazonaws.glue.synthetic",
59        "CreateBlueprintInput",
60    ),
61    ::aws_smithy_schema::ShapeType::Structure,
62    &[
63        &CREATEBLUEPRINTINPUT_MEMBER_NAME,
64        &CREATEBLUEPRINTINPUT_MEMBER_DESCRIPTION,
65        &CREATEBLUEPRINTINPUT_MEMBER_BLUEPRINT_LOCATION,
66        &CREATEBLUEPRINTINPUT_MEMBER_TAGS,
67    ],
68)
69.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
70.with_original_name("CreateBlueprintRequest");
71impl crate::operation::create_blueprint::CreateBlueprintInput {
72    /// The schema for this shape.
73    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATEBLUEPRINTINPUT_SCHEMA;
74}
75impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::create_blueprint::CreateBlueprintInput {
76    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
77        Self::SCHEMA
78    }
79
80    #[allow(unused_variables, clippy::diverging_sub_expression)]
81    fn serialize_members(
82        &self,
83        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
84    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
85        if let Some(ref val) = self.name {
86            ser.write_string(&CREATEBLUEPRINTINPUT_MEMBER_NAME, val)?;
87        }
88        if let Some(ref val) = self.description {
89            ser.write_string(&CREATEBLUEPRINTINPUT_MEMBER_DESCRIPTION, val)?;
90        }
91        if let Some(ref val) = self.blueprint_location {
92            ser.write_string(&CREATEBLUEPRINTINPUT_MEMBER_BLUEPRINT_LOCATION, val)?;
93        }
94        if let Some(ref val) = self.tags {
95            ser.write_map(
96                &CREATEBLUEPRINTINPUT_MEMBER_TAGS,
97                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
98                    for (key, value) in val {
99                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
100                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
101                    }
102                    Ok(())
103                },
104            )?;
105        }
106        Ok(())
107    }
108}
109impl crate::operation::create_blueprint::builders::CreateBlueprintInputBuilder {
110    #[allow(
111        unused_variables,
112        unreachable_code,
113        clippy::single_match,
114        clippy::match_single_binding,
115        clippy::diverging_sub_expression
116    )]
117    pub(crate) fn deserialize_members(
118        &mut self,
119        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
120    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
121        deserializer.read_struct(&CREATEBLUEPRINTINPUT_SCHEMA, &mut |member, deser| {
122            match member.member_index() {
123                Some(0) => {
124                    if deser.is_null() {
125                        deser.read_null()?;
126                    } else {
127                        self.name = Some(deser.read_string(member)?);
128                    }
129                }
130                Some(1) => {
131                    if deser.is_null() {
132                        deser.read_null()?;
133                    } else {
134                        self.description = Some(deser.read_string(member)?);
135                    }
136                }
137                Some(2) => {
138                    if deser.is_null() {
139                        deser.read_null()?;
140                    } else {
141                        self.blueprint_location = Some(deser.read_string(member)?);
142                    }
143                }
144                Some(3) => {
145                    if deser.is_null() {
146                        deser.read_null()?;
147                    } else {
148                        self.tags = Some(deser.read_string_string_map(member)?);
149                    }
150                }
151                _ => {}
152            }
153            Ok(())
154        })
155    }
156}
157
158impl crate::operation::create_blueprint::CreateBlueprintInput {
159    /// Deserializes this structure from a [`ShapeDeserializer`].
160    pub fn deserialize(
161        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
162    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
163        let mut builder = Self::builder();
164        builder.deserialize_members(deserializer)?;
165        builder.name = builder.name.or(Some(String::new()));
166        builder.blueprint_location = builder.blueprint_location.or(Some(String::new()));
167        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
168    }
169}