private Collection<Shape> getModifiedOperations(Model model, Collection<Shape> removed) {
        Set<ShapeId> removedIds = new HashSet<>();
        for (Shape shape : removed) {
            removedIds.add(shape.getId());
        }

        List<Shape> modifiedShapes = new ArrayList<>();
        for (OperationShape operation : model.getOperationShapes()) {
            OperationShape.Builder builder = transformInput(removedIds, operation);
            builder = transformOutput(removedIds, operation, builder);
            builder = transformErrors(removedIds, operation, builder);
            if (builder != null) {
                modifiedShapes.add(builder.build());
            }
        }
        return modifiedShapes;
    }
Removes references to removed structures from operation
input, output, and errors.
smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanOperationStructures.java