private Set<Shape> getResourcesToUpdate(Model model, Set<ShapeId> resources, Set<ShapeId> operations) {
        return model.shapes(ResourceShape.class)
                .filter(resource -> containsAny(resource.getAllOperations(), operations)
                        || containsAny(resource.getResources(), resources))
                .map(resource -> {
                    ResourceShape.Builder builder = resource.toBuilder();
                    resources.forEach(builder::removeResource);
                    operations.forEach(builder::removeFromAllOperationBindings);
                    return builder.build();
                })
                .collect(Collectors.toSet());
    }
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