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 // Sync protocol datatype extension for push notifications..
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8 // any fields in this file.
12 option optimize_for = LITE_RUNTIME;
13 option retain_unknown_fields = true;
17 import "synced_notification_render.proto";
19 // This message allows clients to identify a notification they have created.
20 message SyncedNotificationIdentifier {
21 // The application that the notification is a part of.
22 optional string app_id = 1;
24 // Notifications with the same coalescing key (isolated to the same app_id)
25 // will be grouped together when fetched.
26 optional string coalescing_key = 2;
29 message SyncedNotificationCreator {
30 // The gaia id of the creator. If a notification does not have a clear
31 // creator, skip this and follow the directions below to use a system creator.
32 optional int64 gaia_id = 1;
34 // Indicates that the creator is a "system" creator. Example of these are
35 // notifications sent to the user where the addressee is "Google", such as the
36 // "You have violated our TOS, and have 3 days to fix it or you'll lose your
37 // account" notifications. If is_system is set, gaia_id must not be set and
38 // instead the app_id field must be set.
39 optional bool is_system = 2;
41 // Only set this in the system-creator case.
42 optional string app_id = 3;
45 message SyncedNotificationRecipients {
46 repeated int64 gaia_id = 1;
48 // For now, only support gaia id recipients. Add more recipient types via
49 // 'repeated Type other_type = X' when necessary.
52 message SyncedNotification {
53 // A secondary type that is isolated within the same app_id.
55 // NOTE: For ASBE support purposes this must be in the format [A-Za-z_]+.
56 optional string type = 1;
58 // Whatever string the client entered during creation. If no external_id is
59 // specified, the notification can no longer be identified individually for
60 // fetching/deleting, etc...
61 optional string external_id = 2;
63 // The creator of the notification.
64 optional SyncedNotificationCreator creator = 3;
66 // Client specific data.
67 optional MapData client_data = 4;
70 message CoalescedSyncedNotification {
71 // An opaque string key used to identify individual coalesced notifications.
72 optional string key = 1;
74 optional string app_id = 2;
76 // All the notifications that are grouped together.
77 repeated SyncedNotification notification = 3;
79 // Data that is used directly by endpoints to render notifications in the case
80 // where no "native" app can handle the notification.
81 optional SyncedNotificationRenderInfo render_info = 4;
83 // Read state will be per coalesced notification.
89 optional ReadState read_state = 5;
91 // The time when the LATEST notification of the coalesced notification is
92 // created (in milliseconds since the linux epoch).
93 optional uint64 creation_time_msec = 6;
99 // We will most likely add at least one more priority in the near future.
101 optional Priority priority = 7;
104 message SyncedNotificationList {
105 repeated CoalescedSyncedNotification coalesced_notification = 1;
108 // MapData, Data, and ListData are used to sending aribitrary payloads
109 // between instances of applications using Synced Notifications. The
110 // schema atop MapData will be defined by the client application.
113 optional string key = 1;
114 optional Data value = 2;
116 repeated Entry entry = 1;
120 optional bool boolean_value = 1;
121 optional int32 int_value = 2;
122 optional double float_value = 3;
123 optional string string_value = 4;
124 optional ListData list_value = 5;
125 optional MapData map_value = 6;
129 repeated Data value = 1;