blob: 0b884b6a80a2a31229a18632444e8b75c351a62e [file] [log] [blame]
[email protected]e9b26092012-04-12 18:38:361// 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
7syntax = "proto2";
8
9option optimize_for = LITE_RUNTIME;
10
11package gdata;
12
13// Represents base::PlatformFileInfo.
14message 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]d5875752012-04-20 03:19:4623// Represents GDataEntry.
24message GDataEntryProto {
[email protected]e9b26092012-04-12 18:38:3625 optional PlatformFileInfoProto file_info = 1;
[email protected]fe6be482012-07-19 17:34:0226 optional string base_name = 2;
[email protected]e9b26092012-04-12 18:38:3627 optional string title = 3;
28 optional string resource_id = 4;
[email protected]71c53fd2012-04-14 00:10:1629 optional string edit_url = 5;
[email protected]e9b26092012-04-12 18:38:3630 optional string content_url = 6;
[email protected]113707f42012-04-28 00:34:1331 optional string parent_resource_id = 7;
[email protected]f8949b72012-07-18 22:16:0832 // 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]e9b26092012-04-12 18:38:3637}
38
39// Represents GDataFile.
40message GDataFileProto {
[email protected]d5875752012-04-20 03:19:4641 optional GDataEntryProto gdata_entry = 1;
[email protected]e9b26092012-04-12 18:38:3642 optional uint32 kind = 2;
43 optional string thumbnail_url = 3;
[email protected]71c53fd2012-04-14 00:10:1644 optional string alternate_url = 4;
[email protected]e9b26092012-04-12 18:38:3645 optional string content_mime_type = 5;
[email protected]e9b26092012-04-12 18:38:3646 optional string file_md5 = 8;
47 optional string document_extension = 9;
[email protected]e9b26092012-04-12 18:38:3648 optional bool is_hosted_document = 10;
49}
50
51// Represents GDataDirectory.
52message GDataDirectoryProto {
[email protected]d5875752012-04-20 03:19:4653 optional GDataEntryProto gdata_entry = 1;
[email protected]e9b26092012-04-12 18:38:3654 optional string start_feed_url = 3;
55 optional string next_feed_url = 4;
[email protected]e9b26092012-04-12 18:38:3656 optional uint32 origin = 6;
57 repeated GDataDirectoryProto child_directories = 7;
58 repeated GDataFileProto child_files = 8;
59}
[email protected]12e4c182012-07-12 21:30:0460
[email protected]220e35f2012-07-18 17:32:1661// Container for the root directory and the largest changestamp.
62// TODO(satorux): Remove this: crbug.com/137862
[email protected]e9b26092012-04-12 18:38:3663message GDataRootDirectoryProto {
64 optional GDataDirectoryProto gdata_directory = 1;
65 optional int32 largest_changestamp = 2;
66}
[email protected]12e4c182012-07-12 21:30:0467
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().
71message 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}