Example #1
0
class Form(EndpointsModel):
  ''' Data Store for Form '''
  creator_email = ndb.StringProperty(default='System')
  creator_name = ndb.StringProperty(default='System')  
  title = ndb.StringProperty(default='')
  description = ndb.TextProperty(default='')  
  form_xml = ndb.TextProperty(default='')
  active_status = ndb.BooleanProperty(default=True)
  created_on = ndb.DateTimeProperty(auto_now_add=True)
  created_by = ndb.StringProperty()
  updated_on = ndb.DateTimeProperty(auto_now=True)
  updated_by = ndb.StringProperty()  
  role_key = ndb.KeyProperty(Role)
  role_name = ndb.StringProperty(default='')
  form_layout = msgprop.EnumProperty(FormLayout, indexed=True, default=FormLayout.VERTICAL)
  form_type = msgprop.EnumProperty(FormType, indexed=True)
  form_slider = msgprop.EnumProperty(FormSlider, indexed=True, default=FormSlider.OFF)
  
  @classmethod
  def get_active_form(cls):
    return cls.query(cls.active_status == True)    
  
  @classmethod
  def get_all_form(cls):
    return cls.query()

  @classmethod
  def get_all_activity_form(cls):
    return cls.query(cls.form_type == FormType.ACTIVITY)
Example #2
0
class Book(ndb.Model):
    """Book - Book object"""
    sbId = ndb.StringProperty()
    title = ndb.StringProperty()
    author = ndb.StringProperty(indexed = False)
    language = msgprop.EnumProperty(Language, indexed = False)
    studentId = ndb.StringProperty()
    checkoutDate = ndb.DateProperty(indexed = False)
    dueDate = ndb.DateProperty()
    checkedOut = ndb.BooleanProperty()
    volume = ndb.StringProperty(indexed = False)
    isbn = ndb.StringProperty(indexed = False)
    price = ndb.StringProperty(indexed = False)
    notes = ndb.StringProperty(indexed = False)
    suggestedGrade = msgprop.EnumProperty(Grade, repeated = True)
    category = ndb.StringProperty()
    publisher = ndb.StringProperty(indexed = False)
    mediaType = msgprop.EnumProperty(Media)
    editionYear = ndb.StringProperty(indexed = False)
    donor = ndb.StringProperty(indexed = False)
    comments = ndb.StringProperty(indexed = False)
    createdBy = ndb.StringProperty(indexed = False)
    createdDate = ndb.DateProperty(indexed = False)
    lastUpdatedBy = ndb.StringProperty(indexed = False)
    lastUpdatedDate = ndb.DateProperty(indexed = False)
    reference = ndb.BooleanProperty(indexed = False)
Example #3
0
class Trip(CsvModel):
    class Direction(messages.Enum):
        A = 0
        B = 1

    class WheelchairAcessible(messages.Enum):
        UNKNOWN = 0
        ACESSIBLE = 1
        INACESSIBLE = 2

    class BikesAllowed(messages.Enum):
        UNKNOWN = 0
        ALLOWED = 1
        NOT_ALLOWED = 2

    _csv_file = 'trips.txt'
    _csv_id = 'trip_id'
    route_id = ndb.KeyProperty(kind='Route', required=True)
    service_id = ndb.KeyProperty(kind='Calendar', required=True)
    trip_headsign = ndb.StringProperty()
    trip_short_name = ndb.StringProperty()
    direction_id = msgprop.EnumProperty(Direction)
    block_id = ndb.KeyProperty(kind='Block')
    shape_id = ndb.KeyProperty(kind='Shape')
    stop_times = ndb.StructuredProperty(StopTime, repeated=True)
    frequencies = ndb.StructuredProperty(TripFrequency, repeated=True)
    wheelchair_accessible = msgprop.EnumProperty(WheelchairAcessible)
    bikes_allowed = msgprop.EnumProperty(BikesAllowed)
Example #4
0
class User(ndb.Model):
  """Model that represents a user and associated login credentials,
  the fundamental identity entity.

  Melange users are backed up by Google Accounts which are used to login
  so that no application specific infrastructure, like password management,
  is required.
  """
  #: A Google Account associated with this user entity.
  account = ndb.UserProperty()

  #: Unique and permanent identifier associated with the Google Account. This
  #: should be assigned to the value of User.user_id() where User is the
  #: User entity referenced in account field.
  account_id = ndb.StringProperty(required=True)

  #: Field storing the status of the user.
  status = msgprop.EnumProperty(Status, default=Status.ACTIVE)

  #: List of programs that the user is a host for.
  host_for = ndb.KeyProperty(repeated=True)

  @property
  def user_id(self):
    """Unique identifier of the user.

    May be displayed publicly and used as parts of various URLs that are
    specific to this user.
    """
    return self.key.id()
Example #5
0
class Job(base.Base):
    """Job details."""

    _props = [
        'account_id',
        'patient_id',
        'status',
        'start_date',
        'end_date',
        'audience',
        'care_types',
        'recommended_wage',
        'wage',
        'additional_info',
    ]

    account_id = ndb.IntegerProperty(required=True)
    patient_id = ndb.IntegerProperty()
    status = msgprop.EnumProperty(JobStatus, default=JobStatus.Open)
    start_date = ndb.DateTimeProperty()
    end_date = ndb.DateTimeProperty()
    audience = ndb.StructuredProperty(JobAudience)
    care_types = ndb.StringProperty(repeated=True)
    recommended_wage = ndb.FloatProperty(indexed=False)
    wage = ndb.FloatProperty(indexed=False)
    additional_info = ndb.TextProperty(indexed=False)
    # jobs.JobInvoice ID.
    invoice_id = ndb.IntegerProperty(indexed=False)
    # jobs.JobApps ID.
    apps_id = ndb.IntegerProperty(indexed=False)

    @property
    def total_minutes(self):
        """Total minutes from start date to end date of the job."""
        return (self.end_date - self.start_date).total_seconds() // 60
Example #6
0
class SwarmingTaskQueueRequest(ndb.Model):
    # State of the request, see SwarmingTaskQueueState for details.
    taskqueue_state = msgprop.EnumProperty(SwarmingTaskQueueState,
                                           indexed=True)

    # Priority of the request, see SwarmingTaskQueuePriority for details.
    taskqueue_priority = ndb.IntegerProperty()

    # Timestamp to order things in the Taskqueue.
    taskqueue_request_time = ndb.DateTimeProperty()

    # Used to uniquely identify the machine this request needs.
    taskqueue_dimensions = ndb.StringProperty()

    # The actual request from waterfall/swarming_task_request's Serialize method.
    swarming_task_request = ndb.TextProperty()

    @staticmethod
    def Create(taskqueue_state=SwarmingTaskQueueState.SCHEDULED,
               taskqueue_priority=SwarmingTaskQueuePriority.FORCE,
               taskqueue_request_time=time_util.GetUTCNow(),
               taskqueue_dimensions=None,
               swarming_task_request=None):
        swarming_task_queue_request = SwarmingTaskQueueRequest()
        swarming_task_queue_request.taskqueue_state = taskqueue_state
        swarming_task_queue_request.taskqueue_priority = taskqueue_priority
        swarming_task_queue_request.taskqueue_request_time = taskqueue_request_time
        swarming_task_queue_request.taskqueue_dimensions = taskqueue_dimensions
        swarming_task_queue_request.swarming_task_request = swarming_task_request
        return swarming_task_queue_request
Example #7
0
class Education(ndb.Model):
  """Model that represents education of a student."""
  #: Unique identifier of the school.
  school_id = ndb.StringProperty(required=False)

  #: Country in which the school is located.
  school_country = ndb.StringProperty(
      required=False, choices=countries.COUNTRIES_AND_TERRITORIES)

  #: Web page of the school.
  web_page = ndb.StringProperty(
      required=False, validator=melange_db.link_validator)

  #: Expected graduation year.
  expected_graduation = ndb.IntegerProperty()

  #: Major of the student.
  major = ndb.StringProperty()

  #: Degree which is currently being pursued by the student.
  degree = msgprop.EnumProperty(Degree)

  #: Grade of the student. This number may not have a consistent meaning across
  #; jurisdictional boundaries (e.g. eighth grade in the United States may
  #: not correspond to eighth standard in another nation).
  grade = ndb.IntegerProperty()
Example #8
0
class Contact(EndpointsModel):
    """A person or group that can be used as a creator or a contact."""
    class ContactType(messages.Enum):
        INDIVIDUAL = 1
        GROUP = 2

    _message_fields_schema = ("id", "acceptTypes", "displayName", "imageUrls",
                              "phoneNumber", "priority", "source", "type")

    user = EndpointsUserProperty(required=True, raise_unauthorized=True)

    acceptTypes = ndb.StringProperty(repeated=True)
    displayName = ndb.StringProperty(required=True)
    imageUrls = ndb.StringProperty(repeated=True)
    phoneNumber = ndb.StringProperty()
    priority = ndb.IntegerProperty()
    source = ndb.StringProperty()
    type = msgprop.EnumProperty(ContactType)

    def IdSet(self, value):
        if not isinstance(value, basestring):
            raise TypeError("ID must be a string.")

        self.UpdateFromKey(ndb.Key("User", self.user.email(), Contact, value))

    @EndpointsAliasProperty(setter=IdSet, required=True)
    def id(self):
        if self.key is not None:
            return self.key.pairs()[1][1]
Example #9
0
    class Command(EndpointsModel):
        class CommandType(messages.Enum):
            TAKE_A_NOTE = 1
            POST_AN_UPDATE = 2

        """A single menu command that is part of a Contact."""
        type = msgprop.EnumProperty(CommandType, required=True)
Example #10
0
class Movies(ndb.Model):
    Title = ndb.StringProperty()
    Year = ndb.IntegerProperty()
    Poster = ndb.StringProperty()
    Released = ndb.DateTimeProperty()
    DVD = ndb.DateTimeProperty()
    Type = msgprop.EnumProperty(MovieTypes)
    Season = ndb.IntegerProperty()
    Episode = ndb.IntegerProperty()
    seriesID = ndb.StringProperty()
    imdbID = ndb.StringProperty()
    imdbRating = ndb.FloatProperty()
    imdbVotes = ndb.IntegerProperty()
    tomatoURL = ndb.StringProperty()
    tomatoMeter = ndb.IntegerProperty()
    tomatoRating = ndb.FloatProperty()
    tomatoReviews = ndb.IntegerProperty()
    tomatoFresh = ndb.IntegerProperty()
    tomatoRotten = ndb.IntegerProperty()
    tomatoUserMeter = ndb.IntegerProperty()
    tomatoUserRating = ndb.FloatProperty()
    tomatoUserReviews = ndb.IntegerProperty()
    Metascore = ndb.IntegerProperty()
    mhid = ndb.StringProperty()
    mh_name = ndb.StringProperty()
    mh_altId = ndb.StringProperty()
    added = ndb.DateTimeProperty(auto_now_add=True)
    updated = ndb.DateTimeProperty(auto_now=True)
Example #11
0
class FullTeamInfo(ndb.Model):
    """Model version of the info available on score reporter for a team."""
    # Score reporter ID.
    id = ndb.StringProperty('sr_u')

    name = ndb.StringProperty('n')

    # TODO(P2): do maps API lookup and change to geo pt.
    #city = ndb.StringProperty('c')

    age_bracket = msgprop.EnumProperty(scores_messages.AgeBracket, 'a')

    division = msgprop.EnumProperty(scores_messages.Division, 'd')

    # Twitter screen name
    screen_name = ndb.StringProperty('t')

    # Team website.
    website = ndb.StringProperty('u')

    # Facebook URL.
    facebook_url = ndb.StringProperty('f')

    # Link to team profile image
    image_link = ndb.StringProperty('i')

    coach = ndb.StringProperty('co')

    asst_coach = ndb.StringProperty('aco')

    @classmethod
    def FromTeamInfo(cls, team_info, division, age_bracket, key=None):
        """Creates a FullTeamInfo object from a sr_crawler.TeamInfo object."""
        return FullTeamInfo(
            id=team_info.id,
            name=team_info.name,
            # city=team_info.city,
            age_bracket=age_bracket,
            division=division,
            website=team_info.website,
            screen_name=team_info.twitter_screenname,
            facebook_url=team_info.facebook_url,
            image_link=team_info.image_link,
            coach=team_info.coach,
            asst_coach=team_info.asst_coach,
            key=key,
        )
class ProjectLogger(ndb.Model):
    project = ndb.KeyProperty()
    message = ndb.TextProperty()
    severity = msgprop.EnumProperty(ProjectLoggerSeverity,
                                    required=True,
                                    default=ProjectLoggerSeverity.INFO)
    created_at = ndb.DateTimeProperty(auto_now_add=True)
    updated_at = ndb.DateTimeProperty(auto_now_add=True)
Example #13
0
class Redirect(EndpointsModel):
  query = ndb.StringProperty()
  redirect_type = msgprop.EnumProperty(RedirectType)
  redirect_url = ndb.StringProperty()
  project = ndb.StringProperty()
  repo = ndb.StringProperty()
  repo_url = ndb.StringProperty()
  git_sha = ndb.StringProperty()
Example #14
0
class RoseboticsTeamMember(EndpointsModel):
    class TeamVisibility(Enum):
        ALL_MEMBERS = 1  # Show my progress to everyone in team
        TEAM_LEADER = 2  # Show my progress to Team Leader only
        NOT_CHOSEN = 3  # Waiting for response from member

    email = ndb.StringProperty()  # user's email address
    visibility = msgprop.EnumProperty(TeamVisibility,
                                      default=TeamVisibility.NOT_CHOSEN)
Example #15
0
class MenuValue(EndpointsModel):
    class MenuValueState(messages.Enum):
        DEFAULT = 1
        PENDING = 2
        CONFIRMED = 3

    displayName = ndb.StringProperty(required=True)
    iconUrl = ndb.StringProperty(required=True)
    state = msgprop.EnumProperty(MenuValueState)
Example #16
0
class ProjectImportInfo(ndb.Model):
    """Contains info how a project was imported.

  Entity key:
    Id is project id from the project registry. Has no parent.
  """
    created_ts = ndb.DateTimeProperty(auto_now_add=True)
    repo_type = msgprop.EnumProperty(RepositoryType, required=True)
    repo_url = ndb.StringProperty(required=True)
Example #17
0
class GlobalConfig(config.GlobalConfig):
  """Server-wide static configuration stored in datastore.

  Typically it is set once during service setup and is never changed.
  """
  # Type of repository where service configs are stored.
  services_config_storage_type = msgprop.EnumProperty(ServiceConfigStorageType)
  # If config storage type is Gitiles, URL to the root of service configs
  # directory.
  services_config_location = ndb.StringProperty()
Example #18
0
class Session(ndb.Model):
    """Session -- Session object"""
    name = ndb.StringProperty(required=True)
    highlights = ndb.StringProperty()
    speaker = ndb.StringProperty()
    startTime = ndb.TimeProperty()
    durationInMinutes = ndb.IntegerProperty()
    typeOfSession = msgprop.EnumProperty(TypeOfSession)
    date = ndb.DateProperty()
    location = ndb.StringProperty()
Example #19
0
class ConnRequest(base.Base):
    """Connection request.

    :key from_id: (int) ID of the account that sent the connection request.
    :key to_id: (int) ID of the account the request was sent to.
    :key status: (.ConnStatus) Status of the connection request.
    """
    from_id = ndb.IntegerProperty(required=True)
    to_id = ndb.IntegerProperty(required=True)
    message = ndb.TextProperty()
    status = msgprop.EnumProperty(ConnStatus, default=ConnStatus.Pending)
Example #20
0
class Subscription(EndpointsModel):
    """Model for subscriptions"""

    _message_fields_schema = ("id", "collection", "userToken", "verifyToken", "operation", "callbackUrl")

    user = EndpointsUserProperty(required=True, raise_unauthorized=True)
    collection = ndb.StringProperty(required=True)
    userToken = ndb.StringProperty(required=True)
    verifyToken = ndb.StringProperty(required=True)
    operation = msgprop.EnumProperty(Operation, repeated=True)
    callbackUrl = ndb.StringProperty(required=True)
Example #21
0
class TripFrequency(CsvModel):
    class ExactTime(messages.Enum):
        APPROXIMATE = 0
        EXACT = 1

    _csv_file = 'frequencies.txt'
    _csv_parent_id = 'trip_id'
    start_time = ndb.StringProperty(required=True)
    end_time = ndb.StringProperty(required=True)
    headway_secs = ndb.IntegerProperty(required=True)
    exact_times = msgprop.EnumProperty(ExactTime)
Example #22
0
class Message(base.Base):
    """Message that belongs to a thread."""
    thread_id = ndb.IntegerProperty(required=True)
    sender_id = ndb.IntegerProperty(indexed=False)
    text = ndb.TextProperty(indexed=False)
    message_type = msgprop.EnumProperty(
        MessageType, default=MessageType.User, indexed=False)
    # List of accounts who hid this message.
    hidden_member_ids = ndb.IntegerProperty(repeated=True)
    # messages.MessageAttachment IDs
    attachment_ids = ndb.IntegerProperty(repeated=True, indexed=False)
Example #23
0
class Tournament(ndb.Model):
    """Information about the score reporter tournament."""
    id_str = ndb.StringProperty('id', required=True)

    # URL for landing page of tournament. The URLs for a given division and
    # age bracket can be computed from this.
    url = ndb.StringProperty('u', required=True)

    name = ndb.StringProperty('n')

    # The specific divisions and age brackets in the tournament.
    sub_tournaments = ndb.StructuredProperty(SubTournament, 's', repeated=True)

    # Day the tournament starts. This must be before any of the games are played.
    start_date = ndb.DateTimeProperty('sd')

    # First day after all games are done. This must be later than the ending
    # of the last game.
    end_date = ndb.DateTimeProperty('ed')

    # Location of tournament
    location = ndb.GeoPtProperty('l')

    last_modified_at = ndb.DateTimeProperty('lu')

    image_url_https = ndb.StringProperty('iu')

    league = msgprop.EnumProperty(scores_messages.League, 'le')

    # True iff this tournament has any game where one of the scores is a positive
    # integer.
    has_started = ndb.BooleanProperty('hs')

    def ToProto(self):
        """Builds a Tournament protobuf object from this instance."""
        tourney = scores_messages.Tournament()
        tourney.id_str = self.id_str
        tourney.url = self.url
        tourney.name = self.name
        tourney.image_url_https = self.image_url_https
        age_brackets = set()
        divisions = set()
        for st in self.sub_tournaments:
            age_brackets.add(st.age_bracket)
            divisions.add(st.division)
        tourney.divisions = sorted(list(divisions))
        tourney.age_brackets = sorted(list(age_brackets))
        tourney.start_date = self.start_date.strftime(
            tweets.DATE_PARSE_FMT_STR)
        tourney.end_date = self.end_date.strftime(tweets.DATE_PARSE_FMT_STR)
        tourney.last_modified_at = self.last_modified_at.strftime(
            tweets.DATE_PARSE_FMT_STR)
        return tourney
Example #24
0
    class TimelineContact(EndpointsModel):
        class ContactType(messages.Enum):
            INDIVIDUAL = 1
            GROUP = 2

        acceptTypes = ndb.StringProperty(repeated=True)
        displayName = ndb.StringProperty()
        id = ndb.StringProperty(required=True)
        imageUrls = ndb.StringProperty(repeated=True)
        phoneNumber = ndb.StringProperty()
        source = ndb.StringProperty()
        type = msgprop.EnumProperty(ContactType)
Example #25
0
class MultiplayerOptions(ndb.Model):
    ndb_mode = msgprop.EnumProperty(
        NDB_MultiGameType, default=NDB_MultiGameType.SIMUSOLO)
    ndb_shared = msgprop.EnumProperty(NDB_ShareType, repeated=True)

    def get_mode(self): return MultiplayerGameType.from_ndb(self.ndb_mode)

    def set_mode(self, mode):         self.ndb_mode = mode.to_ndb()

    def get_shared(self): return [ShareType.from_ndb(ndb_st)
                               for ndb_st in self.ndb_shared]

    def set_shared(self, shared):    self.ndb_shared = [s.to_ndb() for s in shared]

    mode = property(get_mode, set_mode)
    shared = property(get_shared, set_shared)
    enabled = ndb.BooleanProperty(default=False)
    cloned = ndb.BooleanProperty(default=True)
    hints = ndb.BooleanProperty(default=True)
    teams = ndb.PickleProperty(default={})

    @staticmethod
    def from_url(qparams):
        opts = MultiplayerOptions()
        opts.enabled = int(qparams.get("players", 1)) > 1
        if opts.enabled:
            opts.mode = MultiplayerGameType(qparams.get("sync_mode", "None"))
            opts.cloned = qparams.get("sync_gen") != "disjoint"
            opts.hints = bool(opts.cloned and qparams.get("sync_hints"))
            opts.shared = enums_from_strlist(ShareType, qparams.getall("sync_shared"))

            teamsRaw = qparams.get("teams")
            if teamsRaw and opts.mode == MultiplayerGameType.SHARED and opts.cloned:
                cnt = 1
                teams = {}
                for teamRaw in teamsRaw.split("|"):
                    teams[cnt] = [int(p) for p in teamRaw.split(",")]
                    cnt += 1
                opts.teams = teams
        return opts
Example #26
0
class Fare(CsvModel):
    class PaymentMethod(messages.Enum):
        ONBOARD = 0
        BEFORE_BOARDING = 1

    _csv_file = 'fare_attributes.txt'
    _csv_id = 'fare_id'
    price = ndb.FloatProperty(required=True)
    currency_type = ndb.StringProperty(required=True)
    payment_method = msgprop.EnumProperty(PaymentMethod)
    transfers = ndb.IntegerProperty()
    transfer_duration = ndb.IntegerProperty()
    rules = ndb.StructuredProperty(FareRule, repeated=True)
Example #27
0
class StopTime(CsvModel):
    class PickupDropoffType(messages.Enum):
        AVAILABLE = 0
        UNAVAILABLE = 1
        SCHEDULE_WITH_AGENCY = 2
        SCHEDULE_WITH_DRIVER = 3

    class TimePoint(messages.Enum):
        APPROXIMATE = 0
        EXACT = 1

    _csv_file = 'stop_times.txt'
    _csv_parent_id = 'trip_id'
    _csv_list_index = 'stop_sequence'
    arrival_time = ndb.StringProperty()
    departure_time = ndb.StringProperty()
    stop_id = ndb.KeyProperty(kind='Stop', required=True)
    stop_headsign = ndb.StringProperty()
    pickup_type = msgprop.EnumProperty(PickupDropoffType)
    drop_off_type = msgprop.EnumProperty(PickupDropoffType)
    shape_dist_traveled = ndb.FloatProperty()
    timepoint = msgprop.EnumProperty(TimePoint)
Example #28
0
class Stop(CsvModel):
    class LocationType(messages.Enum):
        STOP = 0
        STATION = 1

    class WheelchairBoarding(messages.Enum):
        UNKNOWN = 0
        POSSIBLE = 1
        IMPOSSIBLE = 2

    _csv_file = 'stops.txt'
    _csv_id = 'stop_id'
    stop_code = ndb.StringProperty()
    stop_name = ndb.StringProperty(required=True)
    stop_desc = ndb.TextProperty()
    stop_latlon = ndb.GeoPtProperty(required=True)
    zone_id = ndb.KeyProperty(kind='Zone')
    stop_url = ndb.StringProperty()
    location_type = msgprop.EnumProperty(LocationType)
    parent_station = ndb.KeyProperty(kind='Stop')
    stop_timezone = ndb.StringProperty()
    wheelchair_boarding = msgprop.EnumProperty(WheelchairBoarding)
Example #29
0
class Patient(base.Base):
    """Patient specific details."""
    account_id = ndb.IntegerProperty(required=True)
    care_type = msgprop.EnumProperty(CareService, repeated=True, indexed=False)
    prefix = ndb.StringProperty(indexed=False)
    first = ndb.StringProperty(required=True, indexed=False)
    last = ndb.StringProperty(required=True, indexed=False)
    names = ndb.ComputedProperty(lower_names, repeated=True)
    nickname = ndb.StringProperty(indexed=False)
    relationship = ndb.StringProperty(indexed=False)
    address = ndb.StructuredProperty(Address, indexed=False)
    phone_number = ndb.IntegerProperty(indexed=False)
    notes = ndb.TextProperty()
    age = ndb.IntegerProperty(indexed=False)
    pets = ndb.StringProperty(indexed=False)
    allergies = ndb.StringProperty(indexed=False)
    hobbies = ndb.StringProperty(indexed=False)
    caregiver_expertise = msgprop.EnumProperty(Expertise,
                                               repeated=True,
                                               indexed=False)
    caregiver_gender = msgprop.EnumProperty(Gender, indexed=False)
    soft_delete = ndb.BooleanProperty(default=False, indexed=False)
Example #30
0
    class TimelineContact(EndpointsModel):
        """A person or group that can be used as a creator or a contact."""
        class ContactType(messages.Enum):
            INDIVIDUAL = 1
            GROUP = 2

        acceptTypes = ndb.StringProperty(repeated=True)
        displayName = ndb.StringProperty()
        id = ndb.StringProperty(required=True)
        imageUrls = ndb.StringProperty(repeated=True)
        phoneNumber = ndb.StringProperty()
        source = ndb.StringProperty()
        type = msgprop.EnumProperty(ContactType)