aws_sdk_glue/schema_serde/
shape_task_run_properties.rs1static TASKRUNPROPERTIES_MEMBER_TASK_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TaskRunProperties$TaskType", "com.amazonaws.glue", "TaskRunProperties"),
4 ::aws_smithy_schema::ShapeType::String,
5 "TaskType",
6 0,
7);
8static TASKRUNPROPERTIES_MEMBER_IMPORT_LABELS_TASK_RUN_PROPERTIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
9 ::aws_smithy_schema::ShapeId::from_parts(
10 "com.amazonaws.glue#TaskRunProperties$ImportLabelsTaskRunProperties",
11 "com.amazonaws.glue",
12 "TaskRunProperties",
13 ),
14 ::aws_smithy_schema::ShapeType::Structure,
15 "ImportLabelsTaskRunProperties",
16 1,
17);
18static TASKRUNPROPERTIES_MEMBER_EXPORT_LABELS_TASK_RUN_PROPERTIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
19 ::aws_smithy_schema::ShapeId::from_parts(
20 "com.amazonaws.glue#TaskRunProperties$ExportLabelsTaskRunProperties",
21 "com.amazonaws.glue",
22 "TaskRunProperties",
23 ),
24 ::aws_smithy_schema::ShapeType::Structure,
25 "ExportLabelsTaskRunProperties",
26 2,
27);
28static TASKRUNPROPERTIES_MEMBER_LABELING_SET_GENERATION_TASK_RUN_PROPERTIES: ::aws_smithy_schema::Schema<'static> =
29 ::aws_smithy_schema::Schema::new_member(
30 ::aws_smithy_schema::ShapeId::from_parts(
31 "com.amazonaws.glue#TaskRunProperties$LabelingSetGenerationTaskRunProperties",
32 "com.amazonaws.glue",
33 "TaskRunProperties",
34 ),
35 ::aws_smithy_schema::ShapeType::Structure,
36 "LabelingSetGenerationTaskRunProperties",
37 3,
38 );
39static TASKRUNPROPERTIES_MEMBER_FIND_MATCHES_TASK_RUN_PROPERTIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
40 ::aws_smithy_schema::ShapeId::from_parts(
41 "com.amazonaws.glue#TaskRunProperties$FindMatchesTaskRunProperties",
42 "com.amazonaws.glue",
43 "TaskRunProperties",
44 ),
45 ::aws_smithy_schema::ShapeType::Structure,
46 "FindMatchesTaskRunProperties",
47 4,
48);
49static TASKRUNPROPERTIES_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
50 ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TaskRunProperties", "com.amazonaws.glue", "TaskRunProperties"),
51 ::aws_smithy_schema::ShapeType::Structure,
52 &[
53 &TASKRUNPROPERTIES_MEMBER_TASK_TYPE,
54 &TASKRUNPROPERTIES_MEMBER_IMPORT_LABELS_TASK_RUN_PROPERTIES,
55 &TASKRUNPROPERTIES_MEMBER_EXPORT_LABELS_TASK_RUN_PROPERTIES,
56 &TASKRUNPROPERTIES_MEMBER_LABELING_SET_GENERATION_TASK_RUN_PROPERTIES,
57 &TASKRUNPROPERTIES_MEMBER_FIND_MATCHES_TASK_RUN_PROPERTIES,
58 ],
59);
60impl crate::types::TaskRunProperties {
61 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &TASKRUNPROPERTIES_SCHEMA;
63}
64impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::TaskRunProperties {
65 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
66 Self::SCHEMA
67 }
68
69 #[allow(unused_variables, clippy::diverging_sub_expression)]
70 fn serialize_members(
71 &self,
72 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
73 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
74 if let Some(ref val) = self.task_type {
75 ser.write_string(&TASKRUNPROPERTIES_MEMBER_TASK_TYPE, val.as_str())?;
76 }
77 if let Some(ref val) = self.import_labels_task_run_properties {
78 ser.write_struct(&TASKRUNPROPERTIES_MEMBER_IMPORT_LABELS_TASK_RUN_PROPERTIES, val)?;
79 }
80 if let Some(ref val) = self.export_labels_task_run_properties {
81 ser.write_struct(&TASKRUNPROPERTIES_MEMBER_EXPORT_LABELS_TASK_RUN_PROPERTIES, val)?;
82 }
83 if let Some(ref val) = self.labeling_set_generation_task_run_properties {
84 ser.write_struct(&TASKRUNPROPERTIES_MEMBER_LABELING_SET_GENERATION_TASK_RUN_PROPERTIES, val)?;
85 }
86 if let Some(ref val) = self.find_matches_task_run_properties {
87 ser.write_struct(&TASKRUNPROPERTIES_MEMBER_FIND_MATCHES_TASK_RUN_PROPERTIES, val)?;
88 }
89 Ok(())
90 }
91}
92impl crate::types::builders::TaskRunPropertiesBuilder {
93 #[allow(
94 unused_variables,
95 unreachable_code,
96 clippy::single_match,
97 clippy::match_single_binding,
98 clippy::diverging_sub_expression
99 )]
100 pub(crate) fn deserialize_members(
101 &mut self,
102 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
103 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
104 deserializer.read_struct(&TASKRUNPROPERTIES_SCHEMA, &mut |member, deser| {
105 match member.member_index() {
106 Some(0) => {
107 if deser.is_null() {
108 deser.read_null()?;
109 } else {
110 self.task_type = Some(crate::types::TaskType::from(deser.read_string(member)?.as_str()));
111 }
112 }
113 Some(1) => {
114 if deser.is_null() {
115 deser.read_null()?;
116 } else {
117 self.import_labels_task_run_properties = Some(crate::types::ImportLabelsTaskRunProperties::deserialize(deser)?);
118 }
119 }
120 Some(2) => {
121 if deser.is_null() {
122 deser.read_null()?;
123 } else {
124 self.export_labels_task_run_properties = Some(crate::types::ExportLabelsTaskRunProperties::deserialize(deser)?);
125 }
126 }
127 Some(3) => {
128 if deser.is_null() {
129 deser.read_null()?;
130 } else {
131 self.labeling_set_generation_task_run_properties =
132 Some(crate::types::LabelingSetGenerationTaskRunProperties::deserialize(deser)?);
133 }
134 }
135 Some(4) => {
136 if deser.is_null() {
137 deser.read_null()?;
138 } else {
139 self.find_matches_task_run_properties = Some(crate::types::FindMatchesTaskRunProperties::deserialize(deser)?);
140 }
141 }
142 _ => {}
143 }
144 Ok(())
145 })
146 }
147}
148
149impl crate::types::TaskRunProperties {
150 pub fn deserialize(
152 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
153 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
154 let mut builder = Self::builder();
155 builder.deserialize_members(deserializer)?;
156 Ok(builder.build())
157 }
158}