| // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // |
| // Sync protocol datatype extension for push notifications.. |
| |
| // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change |
| // any fields in this file. |
| |
| syntax = "proto2"; |
| |
| option optimize_for = LITE_RUNTIME; |
| option retain_unknown_fields = true; |
| |
| package sync_pb; |
| |
| import "synced_notification_render.proto"; |
| |
| // This message allows clients to identify a notification they have created. |
| message SyncedNotificationIdentifier { |
| // The application that the notification is a part of. |
| optional string app_id = 1; |
| |
| // Notifications with the same coalescing key (isolated to the same app_id) |
| // will be grouped together when fetched. |
| optional string coalescing_key = 2; |
| } |
| |
| message SyncedNotificationCreator { |
| // The gaia id of the creator. If a notification does not have a clear |
| // creator, skip this and follow the directions below to use a system creator. |
| optional int64 gaia_id = 1; |
| |
| // Indicates that the creator is a "system" creator. Example of these are |
| // notifications sent to the user where the addressee is "Google", such as the |
| // "You have violated our TOS, and have 3 days to fix it or you'll lose your |
| // account" notifications. If is_system is set, gaia_id must not be set and |
| // instead the app_id field must be set. |
| optional bool is_system = 2; |
| |
| // Only set this in the system-creator case. |
| optional string app_id = 3; |
| } |
| |
| message SyncedNotificationRecipients { |
| repeated int64 gaia_id = 1; |
| |
| // For now, only support gaia id recipients. Add more recipient types via |
| // 'repeated Type other_type = X' when necessary. |
| } |
| |
| message SyncedNotification { |
| // A secondary type that is isolated within the same app_id. |
| // |
| // NOTE: For ASBE support purposes this must be in the format [A-Za-z_]+. |
| optional string type = 1; |
| |
| // Whatever string the client entered during creation. If no external_id is |
| // specified, the notification can no longer be identified individually for |
| // fetching/deleting, etc... |
| optional string external_id = 2; |
| |
| // The creator of the notification. |
| optional SyncedNotificationCreator creator = 3; |
| |
| // Client specific data. |
| optional MapData client_data = 4; |
| } |
| |
| message CoalescedSyncedNotification { |
| // An opaque string key used to identify individual coalesced notifications. |
| optional string key = 1; |
| |
| optional string app_id = 2; |
| |
| // All the notifications that are grouped together. |
| repeated SyncedNotification notification = 3; |
| |
| // Data that is used directly by endpoints to render notifications in the case |
| // where no "native" app can handle the notification. |
| optional SyncedNotificationRenderInfo render_info = 4; |
| |
| // Read state will be per coalesced notification. |
| enum ReadState { |
| UNREAD = 1; |
| READ = 2; |
| DISMISSED = 3; |
| } |
| optional ReadState read_state = 5; |
| |
| // The time when the LATEST notification of the coalesced notification is |
| // created (in milliseconds since the linux epoch). |
| optional uint64 creation_time_msec = 6; |
| |
| enum Priority { |
| LOW = 1; |
| STANDARD = 2; |
| HIGH = 3; |
| // We will most likely add at least one more priority in the near future. |
| }; |
| optional Priority priority = 7; |
| } |
| |
| message SyncedNotificationList { |
| repeated CoalescedSyncedNotification coalesced_notification = 1; |
| } |
| |
| // MapData, Data, and ListData are used to sending aribitrary payloads |
| // between instances of applications using Synced Notifications. The |
| // schema atop MapData will be defined by the client application. |
| message MapData { |
| message Entry { |
| optional string key = 1; |
| optional Data value = 2; |
| }; |
| repeated Entry entry = 1; |
| }; |
| |
| message Data { |
| optional bool boolean_value = 1; |
| optional int32 int_value = 2; |
| optional double float_value = 3; |
| optional string string_value = 4; |
| optional ListData list_value = 5; |
| optional MapData map_value = 6; |
| }; |
| |
| message ListData { |
| repeated Data value = 1; |
| }; |