private void validateShapeId(boolean expectMember) {
        if (expectMember) {
            if (!getId().hasMember()) {
                throw new SourceException(String.format(
                        "Shapes of type `%s` must contain a member in their shape ID. Found `%s`",
                        getType(),
                        getId()), getSourceLocation());
            }
        } else if (getId().hasMember()) {
            throw new SourceException(String.format(
                    "Shapes of type `%s` cannot contain a member in their shape ID. Found `%s`",
                    getType(),
                    getId()), getSourceLocation());
        }
    }
Validates that a shape ID has or does not have a member.

@param expectMember Whether or not a member is expected.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/Shape.java