private Model filterSuppressionTraits(
            Model model,
            Config config,
            List<ValidationEvent> suppressedEvents,
            ModelTransformer transformer
    ) {

        List<Shape> replacementShapes = new ArrayList<>();
        // First filter and '@suppress' traits that didn't suppress anything.
        for (Shape shape : model.getShapesWithTrait(SuppressTrait.class)) {
            SuppressTrait trait = shape.expectTrait(SuppressTrait.class);
            List<String> allowed = new ArrayList<>(trait.getValues());
            allowed.removeIf(value -> !isAllowed(value, config.getEventIdAllowList(), config.getEventIdDenyList()));

            // Only keep IDs that actually acted to suppress an event.
            if (config.getRemoveUnused()) {
                Set<ValidationEvent> matchedEvents = suppressedEvents.stream()
                        .filter(event -> Objects.equals(shape.getId(), event.getShapeId().orElse(null)))
                        .collect(Collectors.toSet());
                allowed.removeIf(value -> matchedEvents.stream().noneMatch(event -> event.containsId(value)));
            }

            if (allowed.isEmpty()) {
                replacementShapes.add(Shape.shapeToBuilder(shape).removeTrait(SuppressTrait.ID).build());
            } else if (!allowed.equals(trait.getValues())) {
                trait = trait.toBuilder().values(allowed).build();
                replacementShapes.add(Shape.shapeToBuilder(shape).addTrait(trait).build());
            }
        }
        return transformer.replaceShapes(model, replacementShapes);
    }
Sets a list of namespaces that cannot be referred to in metadata suppressions.

<p>Metadata suppressions that refer to namespaces in this list,
including "*", will be removed.

<p>This setting cannot be used in tandem with {@code namespaceAllowList}.

@param namespaceDenyList Namespaces to deny.
smithy-build/src/main/java/software/amazon/smithy/build/transforms/FilterSuppressions.java