Skip to main content

aws_sdk_glue/schema_serde/
shape_integration_error.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static INTEGRATIONERROR_MEMBER_ERROR_CODE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#IntegrationError$ErrorCode", "com.amazonaws.glue", "IntegrationError"),
4    ::aws_smithy_schema::ShapeType::String,
5    "ErrorCode",
6    0,
7);
8static INTEGRATIONERROR_MEMBER_ERROR_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
9    ::aws_smithy_schema::ShapeId::from_parts(
10        "com.amazonaws.glue#IntegrationError$ErrorMessage",
11        "com.amazonaws.glue",
12        "IntegrationError",
13    ),
14    ::aws_smithy_schema::ShapeType::String,
15    "ErrorMessage",
16    1,
17);
18static INTEGRATIONERROR_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
19    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.glue#IntegrationError", "com.amazonaws.glue", "IntegrationError"),
20    ::aws_smithy_schema::ShapeType::Structure,
21    &[&INTEGRATIONERROR_MEMBER_ERROR_CODE, &INTEGRATIONERROR_MEMBER_ERROR_MESSAGE],
22);
23impl crate::types::IntegrationError {
24    /// The schema for this shape.
25    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INTEGRATIONERROR_SCHEMA;
26}
27impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::IntegrationError {
28    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
29        Self::SCHEMA
30    }
31
32    #[allow(unused_variables, clippy::diverging_sub_expression)]
33    fn serialize_members(
34        &self,
35        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
36    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
37        if let Some(ref val) = self.error_code {
38            ser.write_string(&INTEGRATIONERROR_MEMBER_ERROR_CODE, val)?;
39        }
40        if let Some(ref val) = self.error_message {
41            ser.write_string(&INTEGRATIONERROR_MEMBER_ERROR_MESSAGE, val)?;
42        }
43        Ok(())
44    }
45}
46impl crate::types::builders::IntegrationErrorBuilder {
47    #[allow(
48        unused_variables,
49        unreachable_code,
50        clippy::single_match,
51        clippy::match_single_binding,
52        clippy::diverging_sub_expression
53    )]
54    pub(crate) fn deserialize_members(
55        &mut self,
56        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
57    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
58        deserializer.read_struct(&INTEGRATIONERROR_SCHEMA, &mut |member, deser| {
59            match member.member_index() {
60                Some(0) => {
61                    if deser.is_null() {
62                        deser.read_null()?;
63                    } else {
64                        self.error_code = Some(deser.read_string(member)?);
65                    }
66                }
67                Some(1) => {
68                    if deser.is_null() {
69                        deser.read_null()?;
70                    } else {
71                        self.error_message = Some(deser.read_string(member)?);
72                    }
73                }
74                _ => {}
75            }
76            Ok(())
77        })
78    }
79}
80
81impl crate::types::IntegrationError {
82    /// Deserializes this structure from a [`ShapeDeserializer`].
83    pub fn deserialize(
84        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
85    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
86        let mut builder = Self::builder();
87        builder.deserialize_members(deserializer)?;
88        Ok(builder.build())
89    }
90}