1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Protocol buffer definitions for the user's contacts.
9 option optimize_for = LITE_RUNTIME;
13 // A contact, roughly based on the GData Contact kind:
14 // https://developers.google.com/gdata/docs/2.0/elements#gdContactKind
15 // All strings are UTF-8 with Unicode byte order marks stripped out.
19 // Provider-assigned unique identifier.
20 optional string contact_id = 1;
22 // Last time at which this contact was updated within the upstream provider,
23 // as given by base::Time::ToInternalValue().
24 optional int64 update_time = 2;
26 // Has the contact been deleted recently within the upstream provider?
27 optional bool deleted = 3 [default = false];
29 // Affinity between the user and this contact, in the range [0.0, 1.0].
30 // Unset if the affinity is unknown.
31 optional float affinity = 15;
33 // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdName.
34 optional string full_name = 4;
35 optional string given_name = 5;
36 optional string additional_name = 6;
37 optional string family_name = 7;
38 optional string name_prefix = 8;
39 optional string name_suffix = 9;
41 // Raw photo data as supplied by the provider. This data is untrusted and
42 // must be decoded within a sandbox by e.g. ImageDecoder before being used.
43 // Unset if no photo is available.
44 optional bytes raw_untrusted_photo = 10;
46 // Describes an address-like message's type.
55 optional Relation relation = 1 [default = OTHER];
56 optional string label = 2;
59 message EmailAddress {
61 optional string address = 1;
62 optional AddressType type = 2;
63 optional bool primary = 3 [default = false];
65 repeated EmailAddress email_addresses = 11;
69 optional string number = 1;
70 optional AddressType type = 2;
71 optional bool primary = 3 [default = false];
73 repeated PhoneNumber phone_numbers = 12;
75 message PostalAddress {
77 optional string address = 1;
78 optional AddressType type = 2;
79 optional bool primary = 3 [default = false];
81 repeated PostalAddress postal_addresses = 13;
83 message InstantMessagingAddress {
85 optional string address = 1;
86 // Taken from https://developers.google.com/gdata/docs/2.0/elements#gdIm.
98 optional Protocol protocol = 2 [default = OTHER];
99 optional AddressType type = 3;
100 optional bool primary = 4 [default = false];
102 repeated InstantMessagingAddress instant_messaging_addresses = 14;
105 // Singleton message used by ContactDatabase to store update-related metadata.
106 message UpdateMetadata {
109 // Time at which the last successful update was started, as given by
110 // base::Time::ToInternalValue().
111 optional int64 last_update_start_time = 1;
113 // Latest time that we've seen in a contact's |update_time| field. Note that
114 // the time may have come from a deleted contact that has been discarded.
115 optional int64 last_contact_update_time = 2;