static EnumDefinition enumDefinitionFromMember(MemberShape member) {
        EnumDefinition.Builder builder = EnumDefinition.builder().name(member.getMemberName());

        String traitValue = member
                .getTrait(EnumValueTrait.class)
                .flatMap(EnumValueTrait::getStringValue)
                .orElseThrow(() -> new IllegalStateException("Enum definitions can only be made for string enums."));
        builder.value(traitValue);
        member.getTrait(DocumentationTrait.class).ifPresent(docTrait -> builder.documentation(docTrait.getValue()));
        member.getTrait(DeprecatedTrait.class).ifPresent(deprecatedTrait -> builder.deprecated(true));

        List<String> tags = member.getTrait(TagsTrait.class)
                .map(StringListTrait::getValues)
                .orElse(Collections.emptyList());

        builder.tags(tags);
        if (member.hasTrait(InternalTrait.ID) && !tags.contains("internal")) {
            builder.addTag("internal");
        }
        return builder.build();
    }
Converts an enum member into an equivalent enum definition object.

@param member The enum member to convert.
@return An {@link EnumDefinition} representing the given member.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java