private List<ValidationEvent> validateCamelCasing(Model model, List<MemberShape> memberShapes, String scope) {
        int upperCamelMemberNamesCount = 0;
        int lowerCamelMemberNamesCount = 0;
        Set<MemberShape> nonUpperCamelMemberShapes = new HashSet<>();
        Set<MemberShape> nonLowerCamelMemberShapes = new HashSet<>();

        for (MemberShape memberShape : memberShapes) {
            // Exclude members of enums from CamelCase validation,
            // as they're intended to be CAPS_SNAKE.
            // Also exclude list and map members as their names are constant.
            Shape container = model.expectShape(memberShape.getContainer());
            if (!container.isEnumShape() && !container.isIntEnumShape()
                    && !container.isListShape()
                    && !container.isMapShape()) {
                if (MemberNameHandling.UPPER.getRegex().matcher(memberShape.getMemberName()).find()) {
                    upperCamelMemberNamesCount++;
                } else {
                    nonUpperCamelMemberShapes.add(memberShape);
                }
                if (MemberNameHandling.LOWER.getRegex().matcher(memberShape.getMemberName()).find()) {
                    lowerCamelMemberNamesCount++;
                } else {
                    nonLowerCamelMemberShapes.add(memberShape);
                }
            }
        }

        // Member shapes are expected to be either upper or lower, depending on the config (and in AUTO mode, the model)
        Set<MemberShape> violatingMemberShapes = new HashSet<>();
        String memberNameHandling = config.getMemberNames().toString();
        if (MemberNameHandling.AUTO.equals(config.getMemberNames())) {
            if (upperCamelMemberNamesCount > lowerCamelMemberNamesCount) {
                violatingMemberShapes = nonUpperCamelMemberShapes;
                memberNameHandling = MemberNameHandling.UPPER.toString();
            } else {
                violatingMemberShapes = nonLowerCamelMemberShapes;
                memberNameHandling = MemberNameHandling.LOWER.toString();
            }
        } else if (MemberNameHandling.UPPER.equals(config.getMemberNames())) {
            violatingMemberShapes = nonUpperCamelMemberShapes;
        } else if (MemberNameHandling.LOWER.equals(config.getMemberNames())) {
            violatingMemberShapes = nonLowerCamelMemberShapes;
        }

        String finalMemberNameHandling = memberNameHandling;
        return violatingMemberShapes.stream()
                .map(shape -> danger(shape,
                        format(
                                "Member shape member name, `%s`, is not %s camel case;"
                                        + " members in the %s must all use %s camel case.",
                                shape.getMemberName(),
                                finalMemberNameHandling,
                                scope,
                                finalMemberNameHandling)))
                .collect(Collectors.toList());
    }
Member names are serialized using either all lower camel or all upper camel, but not a mixture.
smithy-linters/src/main/java/software/amazon/smithy/linters/CamelCaseValidator.java