Skip to main content

aws_sdk_glue/schema_serde/
shape_create_integration_input_input.rs

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