Skip to main content

aws_sdk_glue/schema_serde/
shape_get_table_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static GETTABLEINPUT_MEMBER_CATALOG_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue.synthetic#GetTableInput$CatalogId",
5        "com.amazonaws.glue.synthetic",
6        "GetTableInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "CatalogId",
10    0,
11);
12static GETTABLEINPUT_MEMBER_DATABASE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue.synthetic#GetTableInput$DatabaseName",
15        "com.amazonaws.glue.synthetic",
16        "GetTableInput",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "DatabaseName",
20    1,
21);
22static GETTABLEINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue.synthetic#GetTableInput$Name",
25        "com.amazonaws.glue.synthetic",
26        "GetTableInput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "Name",
30    2,
31);
32static GETTABLEINPUT_MEMBER_TRANSACTION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue.synthetic#GetTableInput$TransactionId",
35        "com.amazonaws.glue.synthetic",
36        "GetTableInput",
37    ),
38    ::aws_smithy_schema::ShapeType::String,
39    "TransactionId",
40    3,
41);
42static GETTABLEINPUT_MEMBER_QUERY_AS_OF_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue.synthetic#GetTableInput$QueryAsOfTime",
45        "com.amazonaws.glue.synthetic",
46        "GetTableInput",
47    ),
48    ::aws_smithy_schema::ShapeType::Timestamp,
49    "QueryAsOfTime",
50    4,
51);
52static GETTABLEINPUT_MEMBER_AUDIT_CONTEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
53    ::aws_smithy_schema::ShapeId::from_parts(
54        "com.amazonaws.glue.synthetic#GetTableInput$AuditContext",
55        "com.amazonaws.glue.synthetic",
56        "GetTableInput",
57    ),
58    ::aws_smithy_schema::ShapeType::Structure,
59    "AuditContext",
60    5,
61);
62static GETTABLEINPUT_MEMBER_INCLUDE_STATUS_DETAILS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
63    ::aws_smithy_schema::ShapeId::from_parts(
64        "com.amazonaws.glue.synthetic#GetTableInput$IncludeStatusDetails",
65        "com.amazonaws.glue.synthetic",
66        "GetTableInput",
67    ),
68    ::aws_smithy_schema::ShapeType::Boolean,
69    "IncludeStatusDetails",
70    6,
71);
72static GETTABLEINPUT_MEMBER_ATTRIBUTES_TO_GET_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
73    ::aws_smithy_schema::ShapeId::from_parts(
74        "com.amazonaws.glue#TableAttributesList$member",
75        "com.amazonaws.glue",
76        "TableAttributesList",
77    ),
78    ::aws_smithy_schema::ShapeType::String,
79    "member",
80    0,
81);
82static GETTABLEINPUT_MEMBER_ATTRIBUTES_TO_GET: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
83    ::aws_smithy_schema::ShapeId::from_parts(
84        "com.amazonaws.glue.synthetic#GetTableInput$AttributesToGet",
85        "com.amazonaws.glue.synthetic",
86        "GetTableInput",
87    ),
88    ::aws_smithy_schema::ShapeType::List,
89    "AttributesToGet",
90    7,
91)
92.with_list_member(&GETTABLEINPUT_MEMBER_ATTRIBUTES_TO_GET_MEMBER);
93static GETTABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
94    ::aws_smithy_schema::ShapeId::from_parts(
95        "com.amazonaws.glue.synthetic#GetTableInput",
96        "com.amazonaws.glue.synthetic",
97        "GetTableInput",
98    ),
99    ::aws_smithy_schema::ShapeType::Structure,
100    &[
101        &GETTABLEINPUT_MEMBER_CATALOG_ID,
102        &GETTABLEINPUT_MEMBER_DATABASE_NAME,
103        &GETTABLEINPUT_MEMBER_NAME,
104        &GETTABLEINPUT_MEMBER_TRANSACTION_ID,
105        &GETTABLEINPUT_MEMBER_QUERY_AS_OF_TIME,
106        &GETTABLEINPUT_MEMBER_AUDIT_CONTEXT,
107        &GETTABLEINPUT_MEMBER_INCLUDE_STATUS_DETAILS,
108        &GETTABLEINPUT_MEMBER_ATTRIBUTES_TO_GET,
109    ],
110)
111.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
112.with_original_name("GetTableRequest");
113impl crate::operation::get_table::GetTableInput {
114    /// The schema for this shape.
115    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETTABLEINPUT_SCHEMA;
116}
117impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::get_table::GetTableInput {
118    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
119        Self::SCHEMA
120    }
121
122    #[allow(unused_variables, clippy::diverging_sub_expression)]
123    fn serialize_members(
124        &self,
125        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
126    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
127        if let Some(ref val) = self.catalog_id {
128            ser.write_string(&GETTABLEINPUT_MEMBER_CATALOG_ID, val)?;
129        }
130        if let Some(ref val) = self.database_name {
131            ser.write_string(&GETTABLEINPUT_MEMBER_DATABASE_NAME, val)?;
132        }
133        if let Some(ref val) = self.name {
134            ser.write_string(&GETTABLEINPUT_MEMBER_NAME, val)?;
135        }
136        if let Some(ref val) = self.transaction_id {
137            ser.write_string(&GETTABLEINPUT_MEMBER_TRANSACTION_ID, val)?;
138        }
139        if let Some(ref val) = self.query_as_of_time {
140            ser.write_timestamp(&GETTABLEINPUT_MEMBER_QUERY_AS_OF_TIME, val)?;
141        }
142        if let Some(ref val) = self.audit_context {
143            ser.write_struct(&GETTABLEINPUT_MEMBER_AUDIT_CONTEXT, val)?;
144        }
145        if let Some(ref val) = self.include_status_details {
146            ser.write_boolean(&GETTABLEINPUT_MEMBER_INCLUDE_STATUS_DETAILS, *val)?;
147        }
148        if let Some(ref val) = self.attributes_to_get {
149            ser.write_list(
150                &GETTABLEINPUT_MEMBER_ATTRIBUTES_TO_GET,
151                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
152                    for item in val {
153                        ser.write_string(&aws_smithy_schema::prelude::STRING, item.as_str())?;
154                    }
155                    Ok(())
156                },
157            )?;
158        }
159        Ok(())
160    }
161}
162impl crate::operation::get_table::builders::GetTableInputBuilder {
163    #[allow(
164        unused_variables,
165        unreachable_code,
166        clippy::single_match,
167        clippy::match_single_binding,
168        clippy::diverging_sub_expression
169    )]
170    pub(crate) fn deserialize_members(
171        &mut self,
172        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
173    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
174        deserializer.read_struct(&GETTABLEINPUT_SCHEMA, &mut |member, deser| {
175            match member.member_index() {
176                Some(0) => {
177                    if deser.is_null() {
178                        deser.read_null()?;
179                    } else {
180                        self.catalog_id = Some(deser.read_string(member)?);
181                    }
182                }
183                Some(1) => {
184                    if deser.is_null() {
185                        deser.read_null()?;
186                    } else {
187                        self.database_name = Some(deser.read_string(member)?);
188                    }
189                }
190                Some(2) => {
191                    if deser.is_null() {
192                        deser.read_null()?;
193                    } else {
194                        self.name = Some(deser.read_string(member)?);
195                    }
196                }
197                Some(3) => {
198                    if deser.is_null() {
199                        deser.read_null()?;
200                    } else {
201                        self.transaction_id = Some(deser.read_string(member)?);
202                    }
203                }
204                Some(4) => {
205                    if deser.is_null() {
206                        deser.read_null()?;
207                    } else {
208                        self.query_as_of_time = Some(deser.read_timestamp(member)?);
209                    }
210                }
211                Some(5) => {
212                    if deser.is_null() {
213                        deser.read_null()?;
214                    } else {
215                        self.audit_context = Some(crate::types::AuditContext::deserialize(deser)?);
216                    }
217                }
218                Some(6) => {
219                    if deser.is_null() {
220                        deser.read_null()?;
221                    } else {
222                        self.include_status_details = Some(deser.read_boolean(member)?);
223                    }
224                }
225                Some(7) => {
226                    if deser.is_null() {
227                        deser.read_null()?;
228                    } else {
229                        self.attributes_to_get = Some({
230                            let mut container = Vec::new();
231                            deser.read_list(member, &mut |deser| {
232                                container.push(crate::types::TableAttributes::from(
233                                    deser.read_string(&::aws_smithy_schema::prelude::STRING)?.as_str(),
234                                ));
235                                Ok(())
236                            })?;
237                            container
238                        });
239                    }
240                }
241                _ => {}
242            }
243            Ok(())
244        })
245    }
246}
247
248impl crate::operation::get_table::GetTableInput {
249    /// Deserializes this structure from a [`ShapeDeserializer`].
250    pub fn deserialize(
251        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
252    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
253        let mut builder = Self::builder();
254        builder.deserialize_members(deserializer)?;
255        builder.database_name = builder.database_name.or(Some(String::new()));
256        builder.name = builder.name.or(Some(String::new()));
257        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
258    }
259}