Skip to main content

aws_sdk_glue/schema_serde/
shape_get_connection_input_input.rs

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