Skip to main content

aws_sdk_glue/schema_serde/
shape_view_representation_input.rs

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