public static boolean canConvertToEnum(StringShape shape, boolean synthesizeEnumNames) {
        if (shape.isEnumShape()) {
            return true;
        }

        if (!shape.hasTrait(EnumTrait.class)) {
            LOGGER.info(String.format(
                    "Unable to convert string shape `%s` to enum shape because it doesn't have an enum trait.",
                    shape.getId()));
            return false;
        }

        EnumTrait trait = shape.expectTrait(EnumTrait.class);
        if (!trait.hasNames() && !synthesizeEnumNames) {
            LOGGER.info(String.format(
                    "Unable to convert string shape `%s` to enum shape because it doesn't define names. The "
                            + "`synthesizeNames` option may be able to synthesize the names for you.",
                    shape.getId()));
            return false;
        }

        for (EnumDefinition definition : trait.getValues()) {
            if (!canConvertEnumDefinitionToMember(definition, synthesizeEnumNames)) {
                LOGGER.info(String.format(
                        "Unable to convert string shape `%s` to enum shape because it has at least one value which "
                                + "cannot be safely synthesized into a name: %s",
                        shape.getId(),
                        definition.getValue()));
                return false;
            }
        }

        return true;
    }
Determines whether a given string shape can be converted to an enum shape.

@param shape The string shape to be converted.
@param synthesizeEnumNames Whether synthesizing enum names should be accounted for.
@return Returns true if the string shape can be converted to an enum shape.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java