Skip to main content

aws_sdk_glue/schema_serde/
shape_update_registry_input_input.rs

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