static OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.workspaces#OperationNotSupportedException$message",
"com.amazonaws.workspaces",
"OperationNotSupportedException",
),
::aws_smithy_schema::ShapeType::String,
"message",
0,
);
static OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_REASON: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.workspaces#OperationNotSupportedException$reason",
"com.amazonaws.workspaces",
"OperationNotSupportedException",
),
::aws_smithy_schema::ShapeType::String,
"reason",
1,
);
static OPERATIONNOTSUPPORTEDEXCEPTION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.workspaces#OperationNotSupportedException",
"com.amazonaws.workspaces",
"OperationNotSupportedException",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_MESSAGE,
&OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_REASON,
],
);
impl crate::types::error::OperationNotSupportedException {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &OPERATIONNOTSUPPORTEDEXCEPTION_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::error::OperationNotSupportedException {
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> {
if let Some(ref val) = self.message {
ser.write_string(&OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_MESSAGE, val)?;
}
if let Some(ref val) = self.reason {
ser.write_string(&OPERATIONNOTSUPPORTEDEXCEPTION_MEMBER_REASON, val)?;
}
Ok(())
}
}
impl crate::types::error::builders::OperationNotSupportedExceptionBuilder {
#[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(&OPERATIONNOTSUPPORTEDEXCEPTION_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.message = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.reason = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl crate::types::error::OperationNotSupportedException {
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)?;
Ok(builder.build())
}
}