Skip to main content

aws_sdk_glue/schema_serde/
shape_create_connection_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static CREATECONNECTIONINPUT_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#CreateConnectionInput$CatalogId",
5        "com.amazonaws.glue.synthetic",
6        "CreateConnectionInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "CatalogId",
10    0,
11);
12static CREATECONNECTIONINPUT_MEMBER_CONNECTION_INPUT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue.synthetic#CreateConnectionInput$ConnectionInput",
15        "com.amazonaws.glue.synthetic",
16        "CreateConnectionInput",
17    ),
18    ::aws_smithy_schema::ShapeType::Structure,
19    "ConnectionInput",
20    1,
21);
22static CREATECONNECTIONINPUT_MEMBER_TAGS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$key", "com.amazonaws.glue", "TagsMap"),
24    ::aws_smithy_schema::ShapeType::String,
25    "key",
26    0,
27);
28static CREATECONNECTIONINPUT_MEMBER_TAGS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
29    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#TagsMap$value", "com.amazonaws.glue", "TagsMap"),
30    ::aws_smithy_schema::ShapeType::String,
31    "value",
32    1,
33);
34static CREATECONNECTIONINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
35    ::aws_smithy_schema::ShapeId::from_parts(
36        "com.amazonaws.glue.synthetic#CreateConnectionInput$Tags",
37        "com.amazonaws.glue.synthetic",
38        "CreateConnectionInput",
39    ),
40    ::aws_smithy_schema::ShapeType::Map,
41    "Tags",
42    2,
43)
44.with_map_members(&CREATECONNECTIONINPUT_MEMBER_TAGS_KEY, &CREATECONNECTIONINPUT_MEMBER_TAGS_VALUE);
45static CREATECONNECTIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
46    ::aws_smithy_schema::ShapeId::from_parts(
47        "com.amazonaws.glue.synthetic#CreateConnectionInput",
48        "com.amazonaws.glue.synthetic",
49        "CreateConnectionInput",
50    ),
51    ::aws_smithy_schema::ShapeType::Structure,
52    &[
53        &CREATECONNECTIONINPUT_MEMBER_CATALOG_ID,
54        &CREATECONNECTIONINPUT_MEMBER_CONNECTION_INPUT,
55        &CREATECONNECTIONINPUT_MEMBER_TAGS,
56    ],
57)
58.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
59.with_original_name("CreateConnectionRequest");
60impl crate::operation::create_connection::CreateConnectionInput {
61    /// The schema for this shape.
62    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATECONNECTIONINPUT_SCHEMA;
63}
64impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::create_connection::CreateConnectionInput {
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.catalog_id {
75            ser.write_string(&CREATECONNECTIONINPUT_MEMBER_CATALOG_ID, val)?;
76        }
77        if let Some(ref val) = self.connection_input {
78            ser.write_struct(&CREATECONNECTIONINPUT_MEMBER_CONNECTION_INPUT, val)?;
79        }
80        if let Some(ref val) = self.tags {
81            ser.write_map(
82                &CREATECONNECTIONINPUT_MEMBER_TAGS,
83                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
84                    for (key, value) in val {
85                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
86                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
87                    }
88                    Ok(())
89                },
90            )?;
91        }
92        Ok(())
93    }
94}
95impl crate::operation::create_connection::builders::CreateConnectionInputBuilder {
96    #[allow(
97        unused_variables,
98        unreachable_code,
99        clippy::single_match,
100        clippy::match_single_binding,
101        clippy::diverging_sub_expression
102    )]
103    pub(crate) fn deserialize_members(
104        &mut self,
105        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
106    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
107        deserializer.read_struct(&CREATECONNECTIONINPUT_SCHEMA, &mut |member, deser| {
108            match member.member_index() {
109                Some(0) => {
110                    if deser.is_null() {
111                        deser.read_null()?;
112                    } else {
113                        self.catalog_id = Some(deser.read_string(member)?);
114                    }
115                }
116                Some(1) => {
117                    if deser.is_null() {
118                        deser.read_null()?;
119                    } else {
120                        self.connection_input = Some(crate::types::ConnectionInput::deserialize(deser)?);
121                    }
122                }
123                Some(2) => {
124                    if deser.is_null() {
125                        deser.read_null()?;
126                    } else {
127                        self.tags = Some(deser.read_string_string_map(member)?);
128                    }
129                }
130                _ => {}
131            }
132            Ok(())
133        })
134    }
135}
136
137impl crate::operation::create_connection::CreateConnectionInput {
138    /// Deserializes this structure from a [`ShapeDeserializer`].
139    pub fn deserialize(
140        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
141    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
142        let mut builder = Self::builder();
143        builder.deserialize_members(deserializer)?;
144        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
145    }
146}