static SEMANTICERROR_MEMBER_PROBLEM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.appconfigcloudextension#SemanticError$problem",
"com.amazonaws.appconfigcloudextension",
"SemanticError",
),
::aws_smithy_schema::ShapeType::String,
"problem",
0,
);
static SEMANTICERROR_MEMBER_ITEM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.appconfigcloudextension#SemanticError$item",
"com.amazonaws.appconfigcloudextension",
"SemanticError",
),
::aws_smithy_schema::ShapeType::String,
"item",
1,
);
static SEMANTICERROR_MEMBER_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.appconfigcloudextension#SemanticError$value",
"com.amazonaws.appconfigcloudextension",
"SemanticError",
),
::aws_smithy_schema::ShapeType::String,
"value",
2,
);
static SEMANTICERROR_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.appconfigcloudextension#SemanticError",
"com.amazonaws.appconfigcloudextension",
"SemanticError",
),
::aws_smithy_schema::ShapeType::Structure,
&[&SEMANTICERROR_MEMBER_PROBLEM, &SEMANTICERROR_MEMBER_ITEM, &SEMANTICERROR_MEMBER_VALUE],
);
impl crate::types::SemanticError {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SEMANTICERROR_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::SemanticError {
fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
Self::SCHEMA
}
#[allow(unused_variables, clippy::diverging_sub_expression)]
fn serialize_members(
&self,
ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
{
let val = &self.problem;
ser.write_string(&SEMANTICERROR_MEMBER_PROBLEM, val)?;
}
if let Some(ref val) = self.item {
ser.write_string(&SEMANTICERROR_MEMBER_ITEM, val)?;
}
if let Some(ref val) = self.value {
ser.write_string(&SEMANTICERROR_MEMBER_VALUE, val)?;
}
Ok(())
}
}
impl crate::types::builders::SemanticErrorBuilder {
#[allow(
unused_variables,
unreachable_code,
clippy::single_match,
clippy::match_single_binding,
clippy::diverging_sub_expression
)]
pub(crate) fn deserialize_members(
&mut self,
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
deserializer.read_struct(&SEMANTICERROR_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
self.problem = Some(deser.read_string(member)?);
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.item = Some(deser.read_string(member)?);
}
}
Some(2) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.value = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl crate::types::SemanticError {
pub fn deserialize(
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
let mut builder = Self::builder();
builder.deserialize_members(deserializer)?;
builder.problem = builder.problem.or(Some(String::new()));
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}