Skip to main content

aws_sdk_glue/schema_serde/
shape_source_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static SOURCECONFIGURATION_MEMBER_REQUEST_METHOD: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue#SourceConfiguration$RequestMethod",
5        "com.amazonaws.glue",
6        "SourceConfiguration",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "RequestMethod",
10    0,
11);
12static SOURCECONFIGURATION_MEMBER_REQUEST_PATH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue#SourceConfiguration$RequestPath",
15        "com.amazonaws.glue",
16        "SourceConfiguration",
17    ),
18    ::aws_smithy_schema::ShapeType::String,
19    "RequestPath",
20    1,
21);
22static SOURCECONFIGURATION_MEMBER_REQUEST_PARAMETERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue#ConnectorPropertyList$member",
25        "com.amazonaws.glue",
26        "ConnectorPropertyList",
27    ),
28    ::aws_smithy_schema::ShapeType::Structure,
29    "member",
30    0,
31);
32static SOURCECONFIGURATION_MEMBER_REQUEST_PARAMETERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue#SourceConfiguration$RequestParameters",
35        "com.amazonaws.glue",
36        "SourceConfiguration",
37    ),
38    ::aws_smithy_schema::ShapeType::List,
39    "RequestParameters",
40    2,
41)
42.with_list_member(&SOURCECONFIGURATION_MEMBER_REQUEST_PARAMETERS_MEMBER);
43static SOURCECONFIGURATION_MEMBER_RESPONSE_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
44    ::aws_smithy_schema::ShapeId::from_parts(
45        "com.amazonaws.glue#SourceConfiguration$ResponseConfiguration",
46        "com.amazonaws.glue",
47        "SourceConfiguration",
48    ),
49    ::aws_smithy_schema::ShapeType::Structure,
50    "ResponseConfiguration",
51    3,
52);
53static SOURCECONFIGURATION_MEMBER_PAGINATION_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
54    ::aws_smithy_schema::ShapeId::from_parts(
55        "com.amazonaws.glue#SourceConfiguration$PaginationConfiguration",
56        "com.amazonaws.glue",
57        "SourceConfiguration",
58    ),
59    ::aws_smithy_schema::ShapeType::Structure,
60    "PaginationConfiguration",
61    4,
62);
63static SOURCECONFIGURATION_MEMBER_FILTER_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
64    ::aws_smithy_schema::ShapeId::from_parts(
65        "com.amazonaws.glue#SourceConfiguration$FilterConfiguration",
66        "com.amazonaws.glue",
67        "SourceConfiguration",
68    ),
69    ::aws_smithy_schema::ShapeType::Structure,
70    "FilterConfiguration",
71    5,
72);
73static SOURCECONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
74    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#SourceConfiguration", "com.amazonaws.glue", "SourceConfiguration"),
75    ::aws_smithy_schema::ShapeType::Structure,
76    &[
77        &SOURCECONFIGURATION_MEMBER_REQUEST_METHOD,
78        &SOURCECONFIGURATION_MEMBER_REQUEST_PATH,
79        &SOURCECONFIGURATION_MEMBER_REQUEST_PARAMETERS,
80        &SOURCECONFIGURATION_MEMBER_RESPONSE_CONFIGURATION,
81        &SOURCECONFIGURATION_MEMBER_PAGINATION_CONFIGURATION,
82        &SOURCECONFIGURATION_MEMBER_FILTER_CONFIGURATION,
83    ],
84);
85impl crate::types::SourceConfiguration {
86    /// The schema for this shape.
87    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SOURCECONFIGURATION_SCHEMA;
88}
89impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::SourceConfiguration {
90    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
91        Self::SCHEMA
92    }
93
94    #[allow(unused_variables, clippy::diverging_sub_expression)]
95    fn serialize_members(
96        &self,
97        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
98    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
99        if let Some(ref val) = self.request_method {
100            ser.write_string(&SOURCECONFIGURATION_MEMBER_REQUEST_METHOD, val.as_str())?;
101        }
102        if let Some(ref val) = self.request_path {
103            ser.write_string(&SOURCECONFIGURATION_MEMBER_REQUEST_PATH, val)?;
104        }
105        if let Some(ref val) = self.request_parameters {
106            ser.write_list(
107                &SOURCECONFIGURATION_MEMBER_REQUEST_PARAMETERS,
108                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
109                    for item in val {
110                        ser.write_struct(crate::types::ConnectorProperty::SCHEMA, item)?;
111                    }
112                    Ok(())
113                },
114            )?;
115        }
116        if let Some(ref val) = self.response_configuration {
117            ser.write_struct(&SOURCECONFIGURATION_MEMBER_RESPONSE_CONFIGURATION, val)?;
118        }
119        if let Some(ref val) = self.pagination_configuration {
120            ser.write_struct(&SOURCECONFIGURATION_MEMBER_PAGINATION_CONFIGURATION, val)?;
121        }
122        if let Some(ref val) = self.filter_configuration {
123            ser.write_struct(&SOURCECONFIGURATION_MEMBER_FILTER_CONFIGURATION, val)?;
124        }
125        Ok(())
126    }
127}
128impl crate::types::builders::SourceConfigurationBuilder {
129    #[allow(
130        unused_variables,
131        unreachable_code,
132        clippy::single_match,
133        clippy::match_single_binding,
134        clippy::diverging_sub_expression
135    )]
136    pub(crate) fn deserialize_members(
137        &mut self,
138        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
139    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
140        deserializer.read_struct(&SOURCECONFIGURATION_SCHEMA, &mut |member, deser| {
141            match member.member_index() {
142                Some(0) => {
143                    if deser.is_null() {
144                        deser.read_null()?;
145                    } else {
146                        self.request_method = Some(crate::types::HttpMethod::from(deser.read_string(member)?.as_str()));
147                    }
148                }
149                Some(1) => {
150                    if deser.is_null() {
151                        deser.read_null()?;
152                    } else {
153                        self.request_path = Some(deser.read_string(member)?);
154                    }
155                }
156                Some(2) => {
157                    if deser.is_null() {
158                        deser.read_null()?;
159                    } else {
160                        self.request_parameters = Some({
161                            let mut container = Vec::new();
162                            deser.read_list(member, &mut |deser| {
163                                container.push(crate::types::ConnectorProperty::deserialize(deser)?);
164                                Ok(())
165                            })?;
166                            container
167                        });
168                    }
169                }
170                Some(3) => {
171                    if deser.is_null() {
172                        deser.read_null()?;
173                    } else {
174                        self.response_configuration = Some(crate::types::ResponseConfiguration::deserialize(deser)?);
175                    }
176                }
177                Some(4) => {
178                    if deser.is_null() {
179                        deser.read_null()?;
180                    } else {
181                        self.pagination_configuration = Some(crate::types::PaginationConfiguration::deserialize(deser)?);
182                    }
183                }
184                Some(5) => {
185                    if deser.is_null() {
186                        deser.read_null()?;
187                    } else {
188                        self.filter_configuration = Some(crate::types::FilterConfiguration::deserialize(deser)?);
189                    }
190                }
191                _ => {}
192            }
193            Ok(())
194        })
195    }
196}
197
198impl crate::types::SourceConfiguration {
199    /// Deserializes this structure from a [`ShapeDeserializer`].
200    pub fn deserialize(
201        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
202    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
203        let mut builder = Self::builder();
204        builder.deserialize_members(deserializer)?;
205        Ok(builder.build())
206    }
207}