Skip to main content

aws_sdk_glue/schema_serde/
shape_get_partitions_input_input.rs

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