static Optional<MemberShape> memberFromEnumDefinition(
            EnumDefinition definition,
            ShapeId parentId,
            boolean synthesizeName
    ) {
        String name;
        if (!definition.getName().isPresent()) {
            if (canConvertEnumDefinitionToMember(definition, synthesizeName)) {
                name = definition.getValue().replaceAll("[-.:/\\s]+", "_");
            } else {
                return Optional.empty();
            }
        } else {
            name = definition.getName().get();
        }

        try {
            MemberShape.Builder builder = MemberShape.builder()
                    .id(parentId.withMember(name))
                    .target(UnitTypeTrait.UNIT)
                    .addTrait(EnumValueTrait.builder().stringValue(definition.getValue()).build());

            definition.getDocumentation().ifPresent(docs -> builder.addTrait(new DocumentationTrait(docs)));
            if (!definition.getTags().isEmpty()) {
                builder.addTrait(TagsTrait.builder().values(definition.getTags()).build());
            }
            if (definition.isDeprecated()) {
                builder.addTrait(DeprecatedTrait.builder().build());
            }
            if (definition.hasTag("internal")) {
                builder.addTrait(new InternalTrait());
            }

            return Optional.of(builder.build());
        } catch (ShapeIdSyntaxException e) {
            return Optional.empty();
        }
    }
Converts an enum definition to the equivalent enum member shape.

<p>If an enum definition is marked as deprecated, the DeprecatedTrait
is applied to the converted enum member shape.

<p>If an enum definition has an "internal" tag, the InternalTrait is
applied to the converted enum member shape.

@param parentId The {@link ShapeId} of the enum shape.
@param synthesizeName Whether to synthesize a name if possible.
@return An optional member shape representing the enum definition,
        or empty if conversion is impossible.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java