private Model removeMembersFromContainers(ModelTransformer transformer, Collection<Shape> removed, Model model) {
        List<Shape> replacements = new ArrayList<>(getStructureReplacements(model, removed));
        replacements.addAll(getUnionReplacements(model, removed));
        replacements.addAll(getEnumReplacements(model, removed));
        replacements.addAll(getIntEnumReplacements(model, removed));
        return transformer.replaceShapes(model, replacements);
    }
Cleans up structure, union, enum, and intEnum shapes after shapes are removed.

<ul>
    <li>Ensures that structure and union shapes are updated to no
    longer reference any removed members.</li>
    <li>Ensures that structure/union members that reference shapes
    that have been removed are also removed.</li>
</ul>
smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanStructureAndUnionMembers.java