[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 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. | ||||
4 | // | ||||
5 | // Protocol buffer definitions for serializing GData files and directories. | ||||
6 | |||||
7 | syntax = "proto2"; | ||||
8 | |||||
9 | option optimize_for = LITE_RUNTIME; | ||||
10 | |||||
11 | package gdata; | ||||
12 | |||||
13 | // Represents base::PlatformFileInfo. | ||||
14 | message PlatformFileInfoProto { | ||||
15 | optional int64 size = 1; | ||||
16 | optional bool is_directory = 2; | ||||
17 | optional bool is_symbolic_link = 3; | ||||
18 | optional int64 last_modified = 4; | ||||
19 | optional int64 last_accessed = 5; | ||||
20 | optional int64 creation_time = 6; | ||||
21 | } | ||||
22 | |||||
[email protected] | d587575 | 2012-04-20 03:19:46 | [diff] [blame] | 23 | // Represents GDataEntry. |
24 | message GDataEntryProto { | ||||
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 25 | optional PlatformFileInfoProto file_info = 1; |
[email protected] | fe6be48 | 2012-07-19 17:34:02 | [diff] [blame^] | 26 | optional string base_name = 2; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 27 | optional string title = 3; |
28 | optional string resource_id = 4; | ||||
[email protected] | 71c53fd | 2012-04-14 00:10:16 | [diff] [blame] | 29 | optional string edit_url = 5; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 30 | optional string content_url = 6; |
[email protected] | 113707f4 | 2012-04-28 00:34:13 | [diff] [blame] | 31 | optional string parent_resource_id = 7; |
[email protected] | f8949b7 | 2012-07-18 22:16:08 | [diff] [blame] | 32 | // For a file, this is "resumable-edit-media" URL, used to update an |
33 | // existing file. For a directory, this is "resumable-create-media" URL, | ||||
34 | // used to upload a new file to that directory. See | ||||
35 | // https://developers.google.com/google-apps/documents-list/ | ||||
36 | optional string upload_url = 8; | ||||
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 37 | } |
38 | |||||
39 | // Represents GDataFile. | ||||
40 | message GDataFileProto { | ||||
[email protected] | d587575 | 2012-04-20 03:19:46 | [diff] [blame] | 41 | optional GDataEntryProto gdata_entry = 1; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 42 | optional uint32 kind = 2; |
43 | optional string thumbnail_url = 3; | ||||
[email protected] | 71c53fd | 2012-04-14 00:10:16 | [diff] [blame] | 44 | optional string alternate_url = 4; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 45 | optional string content_mime_type = 5; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 46 | optional string file_md5 = 8; |
47 | optional string document_extension = 9; | ||||
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 48 | optional bool is_hosted_document = 10; |
49 | } | ||||
50 | |||||
51 | // Represents GDataDirectory. | ||||
52 | message GDataDirectoryProto { | ||||
[email protected] | d587575 | 2012-04-20 03:19:46 | [diff] [blame] | 53 | optional GDataEntryProto gdata_entry = 1; |
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 54 | optional string start_feed_url = 3; |
55 | optional string next_feed_url = 4; | ||||
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 56 | optional uint32 origin = 6; |
57 | repeated GDataDirectoryProto child_directories = 7; | ||||
58 | repeated GDataFileProto child_files = 8; | ||||
59 | } | ||||
[email protected] | 12e4c18 | 2012-07-12 21:30:04 | [diff] [blame] | 60 | |
[email protected] | 220e35f | 2012-07-18 17:32:16 | [diff] [blame] | 61 | // Container for the root directory and the largest changestamp. |
62 | // TODO(satorux): Remove this: crbug.com/137862 | ||||
[email protected] | e9b2609 | 2012-04-12 18:38:36 | [diff] [blame] | 63 | message GDataRootDirectoryProto { |
64 | optional GDataDirectoryProto gdata_directory = 1; | ||||
65 | optional int32 largest_changestamp = 2; | ||||
66 | } | ||||
[email protected] | 12e4c18 | 2012-07-12 21:30:04 | [diff] [blame] | 67 | |
68 | // Message to store information of an existing cache file. | ||||
69 | // Cache files are stored in 'tmp' or 'persistent' directory under the | ||||
70 | // root cache directory. See GDataCache::GetCacheRootPath(). | ||||
71 | message GDataCacheEntry { | ||||
72 | // MD5 of the cache file. "local" if the file is locally modified. | ||||
73 | optional string md5 = 1; | ||||
74 | |||||
75 | // True if the file is present locally. | ||||
76 | optional bool is_present = 2; | ||||
77 | |||||
78 | // True if the file is pinned (i.e. available offline). | ||||
79 | optional bool is_pinned = 3; | ||||
80 | |||||
81 | // True if the file is dirty (i.e. modified locally). | ||||
82 | optional bool is_dirty = 4; | ||||
83 | |||||
84 | // True if the file is a mounted archive file. | ||||
85 | optional bool is_mounted = 5; | ||||
86 | |||||
87 | // True if the file is in the persistent directory. | ||||
88 | optional bool is_persistent = 6; | ||||
89 | |||||
90 | // When adding a new state, be sure to update TestGDataCacheState and test | ||||
91 | // functions defined in gdata_test_util.cc. | ||||
92 | } |