@Override
    public Model onRemove(ModelTransformer transformer, Collection<Shape> shapes, Model model) {
        Set<ShapeId> removedResources = shapes.stream()
                .filter(Shape::isResourceShape)
                .map(Shape::getId)
                .collect(Collectors.toSet());
        Set<ShapeId> removedOperations = shapes.stream()
                .filter(Shape::isOperationShape)
                .map(Shape::getId)
                .collect(Collectors.toSet());

        Set<Shape> toReplace = getServicesToUpdate(model, removedResources, removedOperations);
        toReplace.addAll(getResourcesToUpdate(model, removedResources, removedOperations));
        return transformer.replaceShapes(model, toReplace);
    }
Removes operation bindings from resources and services when operations
are removed, and removes resource bindings from services and resources when
resources are removed.
smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanBindings.java