def EnumPropertyToProto(prop, index):
  enum = prop._enum_type
  kwargs = GetKeywordArgs(prop)
  return messages.EnumField(enum, index, **kwargs)
Converts an enum property from a model to a message field.
dataset/ETHPy150Open GoogleCloudPlatform/endpoints-proto-datastore/endpoints_proto_datastore/ndb/utils.py/EnumPropertyToProto