Skip to main content

aws_sdk_glue/schema_serde/
shape_get_tables_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static GETTABLESINPUT_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#GetTablesInput$CatalogId",
5        "com.amazonaws.glue.synthetic",
6        "GetTablesInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "CatalogId",
10    0,
11);
12static GETTABLESINPUT_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#GetTablesInput$DatabaseName",
15        "com.amazonaws.glue.synthetic",
16        "GetTablesInput",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "DatabaseName",
20    1,
21);
22static GETTABLESINPUT_MEMBER_EXPRESSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue.synthetic#GetTablesInput$Expression",
25        "com.amazonaws.glue.synthetic",
26        "GetTablesInput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "Expression",
30    2,
31);
32static GETTABLESINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue.synthetic#GetTablesInput$NextToken",
35        "com.amazonaws.glue.synthetic",
36        "GetTablesInput",
37    ),
38    ::aws_smithy_schema::ShapeType::String,
39    "NextToken",
40    3,
41);
42static GETTABLESINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue.synthetic#GetTablesInput$MaxResults",
45        "com.amazonaws.glue.synthetic",
46        "GetTablesInput",
47    ),
48    ::aws_smithy_schema::ShapeType::Integer,
49    "MaxResults",
50    4,
51);
52static GETTABLESINPUT_MEMBER_TRANSACTION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
53    ::aws_smithy_schema::ShapeId::from_parts(
54        "com.amazonaws.glue.synthetic#GetTablesInput$TransactionId",
55        "com.amazonaws.glue.synthetic",
56        "GetTablesInput",
57    ),
58    ::aws_smithy_schema::ShapeType::String,
59    "TransactionId",
60    5,
61);
62static GETTABLESINPUT_MEMBER_QUERY_AS_OF_TIME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
63    ::aws_smithy_schema::ShapeId::from_parts(
64        "com.amazonaws.glue.synthetic#GetTablesInput$QueryAsOfTime",
65        "com.amazonaws.glue.synthetic",
66        "GetTablesInput",
67    ),
68    ::aws_smithy_schema::ShapeType::Timestamp,
69    "QueryAsOfTime",
70    6,
71);
72static GETTABLESINPUT_MEMBER_AUDIT_CONTEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
73    ::aws_smithy_schema::ShapeId::from_parts(
74        "com.amazonaws.glue.synthetic#GetTablesInput$AuditContext",
75        "com.amazonaws.glue.synthetic",
76        "GetTablesInput",
77    ),
78    ::aws_smithy_schema::ShapeType::Structure,
79    "AuditContext",
80    7,
81);
82static GETTABLESINPUT_MEMBER_RESOURCE_SHARE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
83    ::aws_smithy_schema::ShapeId::from_parts(
84        "com.amazonaws.glue.synthetic#GetTablesInput$ResourceShareType",
85        "com.amazonaws.glue.synthetic",
86        "GetTablesInput",
87    ),
88    ::aws_smithy_schema::ShapeType::String,
89    "ResourceShareType",
90    8,
91);
92static GETTABLESINPUT_MEMBER_INCLUDE_STATUS_DETAILS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
93    ::aws_smithy_schema::ShapeId::from_parts(
94        "com.amazonaws.glue.synthetic#GetTablesInput$IncludeStatusDetails",
95        "com.amazonaws.glue.synthetic",
96        "GetTablesInput",
97    ),
98    ::aws_smithy_schema::ShapeType::Boolean,
99    "IncludeStatusDetails",
100    9,
101);
102static GETTABLESINPUT_MEMBER_ATTRIBUTES_TO_GET_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
103    ::aws_smithy_schema::ShapeId::from_parts(
104        "com.amazonaws.glue#TableAttributesList$member",
105        "com.amazonaws.glue",
106        "TableAttributesList",
107    ),
108    ::aws_smithy_schema::ShapeType::String,
109    "member",
110    0,
111);
112static GETTABLESINPUT_MEMBER_ATTRIBUTES_TO_GET: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
113    ::aws_smithy_schema::ShapeId::from_parts(
114        "com.amazonaws.glue.synthetic#GetTablesInput$AttributesToGet",
115        "com.amazonaws.glue.synthetic",
116        "GetTablesInput",
117    ),
118    ::aws_smithy_schema::ShapeType::List,
119    "AttributesToGet",
120    10,
121)
122.with_list_member(&GETTABLESINPUT_MEMBER_ATTRIBUTES_TO_GET_MEMBER);
123static GETTABLESINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
124    ::aws_smithy_schema::ShapeId::from_parts(
125        "com.amazonaws.glue.synthetic#GetTablesInput",
126        "com.amazonaws.glue.synthetic",
127        "GetTablesInput",
128    ),
129    ::aws_smithy_schema::ShapeType::Structure,
130    &[
131        &GETTABLESINPUT_MEMBER_CATALOG_ID,
132        &GETTABLESINPUT_MEMBER_DATABASE_NAME,
133        &GETTABLESINPUT_MEMBER_EXPRESSION,
134        &GETTABLESINPUT_MEMBER_NEXT_TOKEN,
135        &GETTABLESINPUT_MEMBER_MAX_RESULTS,
136        &GETTABLESINPUT_MEMBER_TRANSACTION_ID,
137        &GETTABLESINPUT_MEMBER_QUERY_AS_OF_TIME,
138        &GETTABLESINPUT_MEMBER_AUDIT_CONTEXT,
139        &GETTABLESINPUT_MEMBER_RESOURCE_SHARE_TYPE,
140        &GETTABLESINPUT_MEMBER_INCLUDE_STATUS_DETAILS,
141        &GETTABLESINPUT_MEMBER_ATTRIBUTES_TO_GET,
142    ],
143)
144.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
145.with_original_name("GetTablesRequest");
146impl crate::operation::get_tables::GetTablesInput {
147    /// The schema for this shape.
148    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETTABLESINPUT_SCHEMA;
149}
150impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::get_tables::GetTablesInput {
151    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
152        Self::SCHEMA
153    }
154
155    #[allow(unused_variables, clippy::diverging_sub_expression)]
156    fn serialize_members(
157        &self,
158        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
159    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
160        if let Some(ref val) = self.catalog_id {
161            ser.write_string(&GETTABLESINPUT_MEMBER_CATALOG_ID, val)?;
162        }
163        if let Some(ref val) = self.database_name {
164            ser.write_string(&GETTABLESINPUT_MEMBER_DATABASE_NAME, val)?;
165        }
166        if let Some(ref val) = self.expression {
167            ser.write_string(&GETTABLESINPUT_MEMBER_EXPRESSION, val)?;
168        }
169        if let Some(ref val) = self.next_token {
170            ser.write_string(&GETTABLESINPUT_MEMBER_NEXT_TOKEN, val)?;
171        }
172        if let Some(ref val) = self.max_results {
173            ser.write_integer(&GETTABLESINPUT_MEMBER_MAX_RESULTS, *val)?;
174        }
175        if let Some(ref val) = self.transaction_id {
176            ser.write_string(&GETTABLESINPUT_MEMBER_TRANSACTION_ID, val)?;
177        }
178        if let Some(ref val) = self.query_as_of_time {
179            ser.write_timestamp(&GETTABLESINPUT_MEMBER_QUERY_AS_OF_TIME, val)?;
180        }
181        if let Some(ref val) = self.audit_context {
182            ser.write_struct(&GETTABLESINPUT_MEMBER_AUDIT_CONTEXT, val)?;
183        }
184        if let Some(ref val) = self.resource_share_type {
185            ser.write_string(&GETTABLESINPUT_MEMBER_RESOURCE_SHARE_TYPE, val.as_str())?;
186        }
187        if let Some(ref val) = self.include_status_details {
188            ser.write_boolean(&GETTABLESINPUT_MEMBER_INCLUDE_STATUS_DETAILS, *val)?;
189        }
190        if let Some(ref val) = self.attributes_to_get {
191            ser.write_list(
192                &GETTABLESINPUT_MEMBER_ATTRIBUTES_TO_GET,
193                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
194                    for item in val {
195                        ser.write_string(&aws_smithy_schema::prelude::STRING, item.as_str())?;
196                    }
197                    Ok(())
198                },
199            )?;
200        }
201        Ok(())
202    }
203}
204impl crate::operation::get_tables::builders::GetTablesInputBuilder {
205    #[allow(
206        unused_variables,
207        unreachable_code,
208        clippy::single_match,
209        clippy::match_single_binding,
210        clippy::diverging_sub_expression
211    )]
212    pub(crate) fn deserialize_members(
213        &mut self,
214        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
215    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
216        deserializer.read_struct(&GETTABLESINPUT_SCHEMA, &mut |member, deser| {
217            match member.member_index() {
218                Some(0) => {
219                    if deser.is_null() {
220                        deser.read_null()?;
221                    } else {
222                        self.catalog_id = Some(deser.read_string(member)?);
223                    }
224                }
225                Some(1) => {
226                    if deser.is_null() {
227                        deser.read_null()?;
228                    } else {
229                        self.database_name = Some(deser.read_string(member)?);
230                    }
231                }
232                Some(2) => {
233                    if deser.is_null() {
234                        deser.read_null()?;
235                    } else {
236                        self.expression = Some(deser.read_string(member)?);
237                    }
238                }
239                Some(3) => {
240                    if deser.is_null() {
241                        deser.read_null()?;
242                    } else {
243                        self.next_token = Some(deser.read_string(member)?);
244                    }
245                }
246                Some(4) => {
247                    if deser.is_null() {
248                        deser.read_null()?;
249                    } else {
250                        self.max_results = Some(deser.read_integer(member)?);
251                    }
252                }
253                Some(5) => {
254                    if deser.is_null() {
255                        deser.read_null()?;
256                    } else {
257                        self.transaction_id = Some(deser.read_string(member)?);
258                    }
259                }
260                Some(6) => {
261                    if deser.is_null() {
262                        deser.read_null()?;
263                    } else {
264                        self.query_as_of_time = Some(deser.read_timestamp(member)?);
265                    }
266                }
267                Some(7) => {
268                    if deser.is_null() {
269                        deser.read_null()?;
270                    } else {
271                        self.audit_context = Some(crate::types::AuditContext::deserialize(deser)?);
272                    }
273                }
274                Some(8) => {
275                    if deser.is_null() {
276                        deser.read_null()?;
277                    } else {
278                        self.resource_share_type = Some(crate::types::TableResourceShareType::from(deser.read_string(member)?.as_str()));
279                    }
280                }
281                Some(9) => {
282                    if deser.is_null() {
283                        deser.read_null()?;
284                    } else {
285                        self.include_status_details = Some(deser.read_boolean(member)?);
286                    }
287                }
288                Some(10) => {
289                    if deser.is_null() {
290                        deser.read_null()?;
291                    } else {
292                        self.attributes_to_get = Some({
293                            let mut container = Vec::new();
294                            deser.read_list(member, &mut |deser| {
295                                container.push(crate::types::TableAttributes::from(
296                                    deser.read_string(&::aws_smithy_schema::prelude::STRING)?.as_str(),
297                                ));
298                                Ok(())
299                            })?;
300                            container
301                        });
302                    }
303                }
304                _ => {}
305            }
306            Ok(())
307        })
308    }
309}
310
311impl crate::operation::get_tables::GetTablesInput {
312    /// Deserializes this structure from a [`ShapeDeserializer`].
313    pub fn deserialize(
314        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
315    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
316        let mut builder = Self::builder();
317        builder.deserialize_members(deserializer)?;
318        builder.database_name = builder.database_name.or(Some(String::new()));
319        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
320    }
321}