aws-sdk-workspaces 1.147.0

AWS SDK for Amazon WorkSpaces
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
static IDCCONFIG_MEMBER_INSTANCE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.workspaces#IDCConfig$InstanceArn", "com.amazonaws.workspaces", "IDCConfig"),
    ::aws_smithy_schema::ShapeType::String,
    "InstanceArn",
    0,
);
static IDCCONFIG_MEMBER_APPLICATION_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces#IDCConfig$ApplicationArn",
        "com.amazonaws.workspaces",
        "IDCConfig",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "ApplicationArn",
    1,
);
static IDCCONFIG_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.workspaces#IDCConfig", "com.amazonaws.workspaces", "IDCConfig"),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&IDCCONFIG_MEMBER_INSTANCE_ARN, &IDCCONFIG_MEMBER_APPLICATION_ARN],
);
impl crate::types::IdcConfig {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &IDCCONFIG_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::IdcConfig {
    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.instance_arn {
            ser.write_string(&IDCCONFIG_MEMBER_INSTANCE_ARN, val)?;
        }
        if let Some(ref val) = self.application_arn {
            ser.write_string(&IDCCONFIG_MEMBER_APPLICATION_ARN, val)?;
        }
        Ok(())
    }
}
impl crate::types::builders::IdcConfigBuilder {
    #[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(&IDCCONFIG_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.instance_arn = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.application_arn = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl crate::types::IdcConfig {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    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())
    }
}