Skip to main content

aws_sdk_glue/schema_serde/
shape_create_crawler_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static CREATECRAWLERINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Name",
5        "com.amazonaws.glue.synthetic",
6        "CreateCrawlerInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "Name",
10    0,
11);
12static CREATECRAWLERINPUT_MEMBER_ROLE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Role",
15        "com.amazonaws.glue.synthetic",
16        "CreateCrawlerInput",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "Role",
20    1,
21);
22static CREATECRAWLERINPUT_MEMBER_DATABASE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue.synthetic#CreateCrawlerInput$DatabaseName",
25        "com.amazonaws.glue.synthetic",
26        "CreateCrawlerInput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "DatabaseName",
30    2,
31);
32static CREATECRAWLERINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Description",
35        "com.amazonaws.glue.synthetic",
36        "CreateCrawlerInput",
37    ),
38    ::aws_smithy_schema::ShapeType::String,
39    "Description",
40    3,
41);
42static CREATECRAWLERINPUT_MEMBER_TARGETS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Targets",
45        "com.amazonaws.glue.synthetic",
46        "CreateCrawlerInput",
47    ),
48    ::aws_smithy_schema::ShapeType::Structure,
49    "Targets",
50    4,
51);
52static CREATECRAWLERINPUT_MEMBER_SCHEDULE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
53    ::aws_smithy_schema::ShapeId::from_parts(
54        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Schedule",
55        "com.amazonaws.glue.synthetic",
56        "CreateCrawlerInput",
57    ),
58    ::aws_smithy_schema::ShapeType::String,
59    "Schedule",
60    5,
61);
62static CREATECRAWLERINPUT_MEMBER_CLASSIFIERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
63    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#ClassifierNameList$member", "com.amazonaws.glue", "ClassifierNameList"),
64    ::aws_smithy_schema::ShapeType::String,
65    "member",
66    0,
67);
68static CREATECRAWLERINPUT_MEMBER_CLASSIFIERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
69    ::aws_smithy_schema::ShapeId::from_parts(
70        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Classifiers",
71        "com.amazonaws.glue.synthetic",
72        "CreateCrawlerInput",
73    ),
74    ::aws_smithy_schema::ShapeType::List,
75    "Classifiers",
76    6,
77)
78.with_list_member(&CREATECRAWLERINPUT_MEMBER_CLASSIFIERS_MEMBER);
79static CREATECRAWLERINPUT_MEMBER_TABLE_PREFIX: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
80    ::aws_smithy_schema::ShapeId::from_parts(
81        "com.amazonaws.glue.synthetic#CreateCrawlerInput$TablePrefix",
82        "com.amazonaws.glue.synthetic",
83        "CreateCrawlerInput",
84    ),
85    ::aws_smithy_schema::ShapeType::String,
86    "TablePrefix",
87    7,
88);
89static CREATECRAWLERINPUT_MEMBER_SCHEMA_CHANGE_POLICY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
90    ::aws_smithy_schema::ShapeId::from_parts(
91        "com.amazonaws.glue.synthetic#CreateCrawlerInput$SchemaChangePolicy",
92        "com.amazonaws.glue.synthetic",
93        "CreateCrawlerInput",
94    ),
95    ::aws_smithy_schema::ShapeType::Structure,
96    "SchemaChangePolicy",
97    8,
98);
99static CREATECRAWLERINPUT_MEMBER_RECRAWL_POLICY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
100    ::aws_smithy_schema::ShapeId::from_parts(
101        "com.amazonaws.glue.synthetic#CreateCrawlerInput$RecrawlPolicy",
102        "com.amazonaws.glue.synthetic",
103        "CreateCrawlerInput",
104    ),
105    ::aws_smithy_schema::ShapeType::Structure,
106    "RecrawlPolicy",
107    9,
108);
109static CREATECRAWLERINPUT_MEMBER_LINEAGE_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
110    ::aws_smithy_schema::ShapeId::from_parts(
111        "com.amazonaws.glue.synthetic#CreateCrawlerInput$LineageConfiguration",
112        "com.amazonaws.glue.synthetic",
113        "CreateCrawlerInput",
114    ),
115    ::aws_smithy_schema::ShapeType::Structure,
116    "LineageConfiguration",
117    10,
118);
119static CREATECRAWLERINPUT_MEMBER_LAKE_FORMATION_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
120    ::aws_smithy_schema::ShapeId::from_parts(
121        "com.amazonaws.glue.synthetic#CreateCrawlerInput$LakeFormationConfiguration",
122        "com.amazonaws.glue.synthetic",
123        "CreateCrawlerInput",
124    ),
125    ::aws_smithy_schema::ShapeType::Structure,
126    "LakeFormationConfiguration",
127    11,
128);
129static CREATECRAWLERINPUT_MEMBER_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
130    ::aws_smithy_schema::ShapeId::from_parts(
131        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Configuration",
132        "com.amazonaws.glue.synthetic",
133        "CreateCrawlerInput",
134    ),
135    ::aws_smithy_schema::ShapeType::String,
136    "Configuration",
137    12,
138);
139static CREATECRAWLERINPUT_MEMBER_CRAWLER_SECURITY_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
140    ::aws_smithy_schema::ShapeId::from_parts(
141        "com.amazonaws.glue.synthetic#CreateCrawlerInput$CrawlerSecurityConfiguration",
142        "com.amazonaws.glue.synthetic",
143        "CreateCrawlerInput",
144    ),
145    ::aws_smithy_schema::ShapeType::String,
146    "CrawlerSecurityConfiguration",
147    13,
148);
149static CREATECRAWLERINPUT_MEMBER_TAGS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
150    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$key", "com.amazonaws.glue", "TagsMap"),
151    ::aws_smithy_schema::ShapeType::String,
152    "key",
153    0,
154);
155static CREATECRAWLERINPUT_MEMBER_TAGS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
156    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$value", "com.amazonaws.glue", "TagsMap"),
157    ::aws_smithy_schema::ShapeType::String,
158    "value",
159    1,
160);
161static CREATECRAWLERINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
162    ::aws_smithy_schema::ShapeId::from_parts(
163        "com.amazonaws.glue.synthetic#CreateCrawlerInput$Tags",
164        "com.amazonaws.glue.synthetic",
165        "CreateCrawlerInput",
166    ),
167    ::aws_smithy_schema::ShapeType::Map,
168    "Tags",
169    14,
170)
171.with_map_members(&CREATECRAWLERINPUT_MEMBER_TAGS_KEY, &CREATECRAWLERINPUT_MEMBER_TAGS_VALUE);
172static CREATECRAWLERINPUT_MEMBER_CATALOG_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
173    ::aws_smithy_schema::ShapeId::from_parts(
174        "com.amazonaws.glue.synthetic#CreateCrawlerInput$CatalogId",
175        "com.amazonaws.glue.synthetic",
176        "CreateCrawlerInput",
177    ),
178    ::aws_smithy_schema::ShapeType::String,
179    "CatalogId",
180    15,
181);
182static CREATECRAWLERINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
183    ::aws_smithy_schema::ShapeId::from_parts(
184        "com.amazonaws.glue.synthetic#CreateCrawlerInput",
185        "com.amazonaws.glue.synthetic",
186        "CreateCrawlerInput",
187    ),
188    ::aws_smithy_schema::ShapeType::Structure,
189    &[
190        &CREATECRAWLERINPUT_MEMBER_NAME,
191        &CREATECRAWLERINPUT_MEMBER_ROLE,
192        &CREATECRAWLERINPUT_MEMBER_DATABASE_NAME,
193        &CREATECRAWLERINPUT_MEMBER_DESCRIPTION,
194        &CREATECRAWLERINPUT_MEMBER_TARGETS,
195        &CREATECRAWLERINPUT_MEMBER_SCHEDULE,
196        &CREATECRAWLERINPUT_MEMBER_CLASSIFIERS,
197        &CREATECRAWLERINPUT_MEMBER_TABLE_PREFIX,
198        &CREATECRAWLERINPUT_MEMBER_SCHEMA_CHANGE_POLICY,
199        &CREATECRAWLERINPUT_MEMBER_RECRAWL_POLICY,
200        &CREATECRAWLERINPUT_MEMBER_LINEAGE_CONFIGURATION,
201        &CREATECRAWLERINPUT_MEMBER_LAKE_FORMATION_CONFIGURATION,
202        &CREATECRAWLERINPUT_MEMBER_CONFIGURATION,
203        &CREATECRAWLERINPUT_MEMBER_CRAWLER_SECURITY_CONFIGURATION,
204        &CREATECRAWLERINPUT_MEMBER_TAGS,
205        &CREATECRAWLERINPUT_MEMBER_CATALOG_ID,
206    ],
207)
208.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
209.with_original_name("CreateCrawlerRequest");
210impl crate::operation::create_crawler::CreateCrawlerInput {
211    /// The schema for this shape.
212    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATECRAWLERINPUT_SCHEMA;
213}
214impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::create_crawler::CreateCrawlerInput {
215    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
216        Self::SCHEMA
217    }
218
219    #[allow(unused_variables, clippy::diverging_sub_expression)]
220    fn serialize_members(
221        &self,
222        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
223    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
224        if let Some(ref val) = self.name {
225            ser.write_string(&CREATECRAWLERINPUT_MEMBER_NAME, val)?;
226        }
227        if let Some(ref val) = self.role {
228            ser.write_string(&CREATECRAWLERINPUT_MEMBER_ROLE, val)?;
229        }
230        if let Some(ref val) = self.database_name {
231            ser.write_string(&CREATECRAWLERINPUT_MEMBER_DATABASE_NAME, val)?;
232        }
233        if let Some(ref val) = self.description {
234            ser.write_string(&CREATECRAWLERINPUT_MEMBER_DESCRIPTION, val)?;
235        }
236        if let Some(ref val) = self.targets {
237            ser.write_struct(&CREATECRAWLERINPUT_MEMBER_TARGETS, val)?;
238        }
239        if let Some(ref val) = self.schedule {
240            ser.write_string(&CREATECRAWLERINPUT_MEMBER_SCHEDULE, val)?;
241        }
242        if let Some(ref val) = self.classifiers {
243            ser.write_list(
244                &CREATECRAWLERINPUT_MEMBER_CLASSIFIERS,
245                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
246                    for item in val {
247                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
248                    }
249                    Ok(())
250                },
251            )?;
252        }
253        if let Some(ref val) = self.table_prefix {
254            ser.write_string(&CREATECRAWLERINPUT_MEMBER_TABLE_PREFIX, val)?;
255        }
256        if let Some(ref val) = self.schema_change_policy {
257            ser.write_struct(&CREATECRAWLERINPUT_MEMBER_SCHEMA_CHANGE_POLICY, val)?;
258        }
259        if let Some(ref val) = self.recrawl_policy {
260            ser.write_struct(&CREATECRAWLERINPUT_MEMBER_RECRAWL_POLICY, val)?;
261        }
262        if let Some(ref val) = self.lineage_configuration {
263            ser.write_struct(&CREATECRAWLERINPUT_MEMBER_LINEAGE_CONFIGURATION, val)?;
264        }
265        if let Some(ref val) = self.lake_formation_configuration {
266            ser.write_struct(&CREATECRAWLERINPUT_MEMBER_LAKE_FORMATION_CONFIGURATION, val)?;
267        }
268        if let Some(ref val) = self.configuration {
269            ser.write_string(&CREATECRAWLERINPUT_MEMBER_CONFIGURATION, val)?;
270        }
271        if let Some(ref val) = self.crawler_security_configuration {
272            ser.write_string(&CREATECRAWLERINPUT_MEMBER_CRAWLER_SECURITY_CONFIGURATION, val)?;
273        }
274        if let Some(ref val) = self.tags {
275            ser.write_map(
276                &CREATECRAWLERINPUT_MEMBER_TAGS,
277                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
278                    for (key, value) in val {
279                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
280                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
281                    }
282                    Ok(())
283                },
284            )?;
285        }
286        if let Some(ref val) = self.catalog_id {
287            ser.write_string(&CREATECRAWLERINPUT_MEMBER_CATALOG_ID, val)?;
288        }
289        Ok(())
290    }
291}
292impl crate::operation::create_crawler::builders::CreateCrawlerInputBuilder {
293    #[allow(
294        unused_variables,
295        unreachable_code,
296        clippy::single_match,
297        clippy::match_single_binding,
298        clippy::diverging_sub_expression
299    )]
300    pub(crate) fn deserialize_members(
301        &mut self,
302        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
303    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
304        deserializer.read_struct(&CREATECRAWLERINPUT_SCHEMA, &mut |member, deser| {
305            match member.member_index() {
306                Some(0) => {
307                    if deser.is_null() {
308                        deser.read_null()?;
309                    } else {
310                        self.name = Some(deser.read_string(member)?);
311                    }
312                }
313                Some(1) => {
314                    if deser.is_null() {
315                        deser.read_null()?;
316                    } else {
317                        self.role = Some(deser.read_string(member)?);
318                    }
319                }
320                Some(2) => {
321                    if deser.is_null() {
322                        deser.read_null()?;
323                    } else {
324                        self.database_name = Some(deser.read_string(member)?);
325                    }
326                }
327                Some(3) => {
328                    if deser.is_null() {
329                        deser.read_null()?;
330                    } else {
331                        self.description = Some(deser.read_string(member)?);
332                    }
333                }
334                Some(4) => {
335                    if deser.is_null() {
336                        deser.read_null()?;
337                    } else {
338                        self.targets = Some(crate::types::CrawlerTargets::deserialize(deser)?);
339                    }
340                }
341                Some(5) => {
342                    if deser.is_null() {
343                        deser.read_null()?;
344                    } else {
345                        self.schedule = Some(deser.read_string(member)?);
346                    }
347                }
348                Some(6) => {
349                    if deser.is_null() {
350                        deser.read_null()?;
351                    } else {
352                        self.classifiers = Some(deser.read_string_list(member)?);
353                    }
354                }
355                Some(7) => {
356                    if deser.is_null() {
357                        deser.read_null()?;
358                    } else {
359                        self.table_prefix = Some(deser.read_string(member)?);
360                    }
361                }
362                Some(8) => {
363                    if deser.is_null() {
364                        deser.read_null()?;
365                    } else {
366                        self.schema_change_policy = Some(crate::types::SchemaChangePolicy::deserialize(deser)?);
367                    }
368                }
369                Some(9) => {
370                    if deser.is_null() {
371                        deser.read_null()?;
372                    } else {
373                        self.recrawl_policy = Some(crate::types::RecrawlPolicy::deserialize(deser)?);
374                    }
375                }
376                Some(10) => {
377                    if deser.is_null() {
378                        deser.read_null()?;
379                    } else {
380                        self.lineage_configuration = Some(crate::types::LineageConfiguration::deserialize(deser)?);
381                    }
382                }
383                Some(11) => {
384                    if deser.is_null() {
385                        deser.read_null()?;
386                    } else {
387                        self.lake_formation_configuration = Some(crate::types::LakeFormationConfiguration::deserialize(deser)?);
388                    }
389                }
390                Some(12) => {
391                    if deser.is_null() {
392                        deser.read_null()?;
393                    } else {
394                        self.configuration = Some(deser.read_string(member)?);
395                    }
396                }
397                Some(13) => {
398                    if deser.is_null() {
399                        deser.read_null()?;
400                    } else {
401                        self.crawler_security_configuration = Some(deser.read_string(member)?);
402                    }
403                }
404                Some(14) => {
405                    if deser.is_null() {
406                        deser.read_null()?;
407                    } else {
408                        self.tags = Some(deser.read_string_string_map(member)?);
409                    }
410                }
411                Some(15) => {
412                    if deser.is_null() {
413                        deser.read_null()?;
414                    } else {
415                        self.catalog_id = Some(deser.read_string(member)?);
416                    }
417                }
418                _ => {}
419            }
420            Ok(())
421        })
422    }
423}
424
425impl crate::operation::create_crawler::CreateCrawlerInput {
426    /// Deserializes this structure from a [`ShapeDeserializer`].
427    pub fn deserialize(
428        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
429    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
430        let mut builder = Self::builder();
431        builder.deserialize_members(deserializer)?;
432        builder.name = builder.name.or(Some(String::new()));
433        builder.role = builder.role.or(Some(String::new()));
434        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
435    }
436}