OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Protocol buffer definitions for Drive backend of Syncable FileSystem. | 5 // Protocol buffer definitions for Drive backend of Syncable FileSystem. |
6 | 6 |
7 syntax = "proto2"; | 7 syntax = "proto2"; |
8 | 8 |
9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
10 | 10 |
11 package sync_file_system.drive_backend; | 11 package sync_file_system.drive_backend; |
12 | 12 |
13 enum FileKind { | 13 enum FileKind { |
14 KIND_UNSUPPORTED = 0; | 14 KIND_UNSUPPORTED = 0; |
15 KIND_FILE = 1; | 15 KIND_FILE = 1; |
16 KIND_FOLDER = 2; | 16 KIND_FOLDER = 2; |
17 } | 17 } |
18 | 18 |
19 message ServiceMetadata { | 19 message ServiceMetadata { |
20 optional int64 largest_change_id = 1; | 20 optional int64 largest_change_id = 1; |
21 optional string sync_root_folder_id = 2; | 21 optional string sync_root_folder_id = 2; |
22 } | 22 } |
23 | |
24 message DriveFileMetadata { | |
25 // File ID of the remote file/folder which the DriveFileMetadata tracks. | |
26 required string file_id = 1; | |
27 required string parent_folder_id = 2; | |
28 | |
29 optional string app_id = 3; | |
30 optional bool is_app_root = 4; | |
31 | |
32 // Holds details of file/folder metadata. | |
33 message Details { | |
34 repeated string parent_folder_id = 1; | |
35 optional string title = 2; | |
36 optional FileKind kind = 3; | |
37 optional string md5 = 4; | |
38 optional string etag = 5; | |
39 | |
40 // Creation time and modification time of the resource. | |
41 // Serialized by Time::ToInternalValue. | |
42 optional int64 creation_time = 6; | |
43 optional int64 modification_time = 7; | |
44 | |
45 optional bool deleted = 8; | |
46 optional int64 change_id = 9; | |
47 } | |
48 | |
49 // |synced_details| holds the file details snapshot when the file was | |
50 // fetched through remote-to-local update. | |
51 // This should contain same value as remote_details if |dirty| is false. | |
52 optional Details synced_details = 5; | |
53 | |
54 // |remote_details| holds the latest file details that may not yet be | |
55 // applied to local metadata. | |
56 // This should be updated by each listed ChangeResource. | |
57 optional Details remote_details = 6; | |
58 | |
59 // True if the file is changed since the last update for this file. | |
60 optional bool dirty = 7; | |
61 | |
62 // True if the DriveFileMetadata is active. | |
63 // Remote file content update should only be applied for active | |
64 // DriveFileMetadata. | |
65 // Active DriveFileMetadata must have a unique title under its parent. | |
66 optional bool active = 8; | |
67 | |
68 // Valid only for folders. | |
69 // True indicates the folder contents has not yet been fetched. | |
70 optional bool needs_folder_listing = 9; | |
71 } | |
OLD | NEW |