Skip to main content

aws_sdk_glue/schema_serde/
shape_put_attachment_output_output.rs

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