private Map<ShapeId, ShapeId> getRenamedShapes(Config config, Model model) {
        Map<ShapeId, ShapeId> shapesToRename = getRenamedShapesConnectedToService(config, model);
        Set<ShapeId> taggedShapesToInclude = getTaggedShapesToInclude(config.getIncludeTagged(), model);

        for (ShapeId id : taggedShapesToInclude) {
            ShapeId updatedShapeId = updateNamespace(id, config.getNamespace());
            // If new shape ID already exists in map of shapes to rename, skip
            // including the additional shape to avoid a conflict.
            if (!shapesToRename.containsValue(updatedShapeId)) {
                shapesToRename.put(id, updatedShapeId);
            }
        }

        return shapesToRename;
    }
Gets the set of tags that are retained in the model.

@return Returns the tags to retain.
smithy-build/src/main/java/software/amazon/smithy/build/transforms/FlattenNamespaces.java