aws-sdk-workspaces 1.146.0

AWS SDK for Amazon WorkSpaces
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
static WORKSPACEAPPLICATIONDEPLOYMENT_MEMBER_ASSOCIATIONS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces#WorkspaceResourceAssociationList$member",
        "com.amazonaws.workspaces",
        "WorkspaceResourceAssociationList",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    "member",
    0,
);
static WORKSPACEAPPLICATIONDEPLOYMENT_MEMBER_ASSOCIATIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces#WorkSpaceApplicationDeployment$Associations",
        "com.amazonaws.workspaces",
        "WorkSpaceApplicationDeployment",
    ),
    ::aws_smithy_schema::ShapeType::List,
    "Associations",
    0,
)
.with_list_member(&WORKSPACEAPPLICATIONDEPLOYMENT_MEMBER_ASSOCIATIONS_MEMBER);
static WORKSPACEAPPLICATIONDEPLOYMENT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces#WorkSpaceApplicationDeployment",
        "com.amazonaws.workspaces",
        "WorkSpaceApplicationDeployment",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&WORKSPACEAPPLICATIONDEPLOYMENT_MEMBER_ASSOCIATIONS],
);
impl crate::types::WorkSpaceApplicationDeployment {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &WORKSPACEAPPLICATIONDEPLOYMENT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::WorkSpaceApplicationDeployment {
    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.associations {
            ser.write_list(
                &WORKSPACEAPPLICATIONDEPLOYMENT_MEMBER_ASSOCIATIONS,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for item in val {
                        ser.write_struct(crate::types::WorkspaceResourceAssociation::SCHEMA, item)?;
                    }
                    Ok(())
                },
            )?;
        }
        Ok(())
    }
}
impl crate::types::builders::WorkSpaceApplicationDeploymentBuilder {
    #[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(&WORKSPACEAPPLICATIONDEPLOYMENT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.associations = Some({
                            let mut container = Vec::new();
                            deser.read_list(member, &mut |deser| {
                                container.push(crate::types::WorkspaceResourceAssociation::deserialize(deser)?);
                                Ok(())
                            })?;
                            container
                        });
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl crate::types::WorkSpaceApplicationDeployment {
    /// 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())
    }
}