aws_sdk_glue/schema_serde/
shape_pagination_configuration.rs1static PAGINATIONCONFIGURATION_MEMBER_CURSOR_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts(
4 "com.amazonaws.glue#PaginationConfiguration$CursorConfiguration",
5 "com.amazonaws.glue",
6 "PaginationConfiguration",
7 ),
8 ::aws_smithy_schema::ShapeType::Structure,
9 "CursorConfiguration",
10 0,
11);
12static PAGINATIONCONFIGURATION_MEMBER_OFFSET_CONFIGURATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13 ::aws_smithy_schema::ShapeId::from_parts(
14 "com.amazonaws.glue#PaginationConfiguration$OffsetConfiguration",
15 "com.amazonaws.glue",
16 "PaginationConfiguration",
17 ),
18 ::aws_smithy_schema::ShapeType::Structure,
19 "OffsetConfiguration",
20 1,
21);
22static PAGINATIONCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
23 ::aws_smithy_schema::ShapeId::from_parts(
24 "com.amazonaws.glue#PaginationConfiguration",
25 "com.amazonaws.glue",
26 "PaginationConfiguration",
27 ),
28 ::aws_smithy_schema::ShapeType::Structure,
29 &[
30 &PAGINATIONCONFIGURATION_MEMBER_CURSOR_CONFIGURATION,
31 &PAGINATIONCONFIGURATION_MEMBER_OFFSET_CONFIGURATION,
32 ],
33);
34impl crate::types::PaginationConfiguration {
35 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PAGINATIONCONFIGURATION_SCHEMA;
37}
38impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::PaginationConfiguration {
39 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
40 Self::SCHEMA
41 }
42
43 #[allow(unused_variables, clippy::diverging_sub_expression)]
44 fn serialize_members(
45 &self,
46 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
47 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
48 if let Some(ref val) = self.cursor_configuration {
49 ser.write_struct(&PAGINATIONCONFIGURATION_MEMBER_CURSOR_CONFIGURATION, val)?;
50 }
51 if let Some(ref val) = self.offset_configuration {
52 ser.write_struct(&PAGINATIONCONFIGURATION_MEMBER_OFFSET_CONFIGURATION, val)?;
53 }
54 Ok(())
55 }
56}
57impl crate::types::builders::PaginationConfigurationBuilder {
58 #[allow(
59 unused_variables,
60 unreachable_code,
61 clippy::single_match,
62 clippy::match_single_binding,
63 clippy::diverging_sub_expression
64 )]
65 pub(crate) fn deserialize_members(
66 &mut self,
67 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
68 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
69 deserializer.read_struct(&PAGINATIONCONFIGURATION_SCHEMA, &mut |member, deser| {
70 match member.member_index() {
71 Some(0) => {
72 if deser.is_null() {
73 deser.read_null()?;
74 } else {
75 self.cursor_configuration = Some(crate::types::CursorConfiguration::deserialize(deser)?);
76 }
77 }
78 Some(1) => {
79 if deser.is_null() {
80 deser.read_null()?;
81 } else {
82 self.offset_configuration = Some(crate::types::OffsetConfiguration::deserialize(deser)?);
83 }
84 }
85 _ => {}
86 }
87 Ok(())
88 })
89 }
90}
91
92impl crate::types::PaginationConfiguration {
93 pub fn deserialize(
95 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
96 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
97 let mut builder = Self::builder();
98 builder.deserialize_members(deserializer)?;
99 Ok(builder.build())
100 }
101}