xref: /aosp_15_r20/external/googleapis/google/apps/drive/activity/v2/target.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.apps.drive.activity.v2;
18
19import "google/apps/drive/activity/v2/actor.proto";
20import "google/apps/drive/activity/v2/common.proto";
21
22option csharp_namespace = "Google.Apps.Drive.Activity.V2";
23option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";
24option java_multiple_files = true;
25option java_outer_classname = "TargetProto";
26option java_package = "com.google.apps.drive.activity.v2";
27option objc_class_prefix = "GADA";
28option php_namespace = "Google\\Apps\\Drive\\Activity\\V2";
29
30// Information about the target of activity.
31//
32// For more information on how activity history is shared with users, see
33// [Activity history
34// visibility](https://developers.google.com/drive/activity/v2#activityhistory).
35message Target {
36  // The type of target object.
37  oneof object {
38    // The target is a Drive item.
39    DriveItem drive_item = 1;
40
41    // The target is a shared drive.
42    Drive drive = 5;
43
44    // The target is a comment on a Drive file.
45    FileComment file_comment = 3;
46  }
47
48  // This field is deprecated; please use the `drive` field instead.
49  TeamDrive team_drive = 2 [deprecated = true];
50}
51
52// A lightweight reference to the target of activity.
53message TargetReference {
54  // The type of target object.
55  oneof object {
56    // The target is a Drive item.
57    DriveItemReference drive_item = 1;
58
59    // The target is a shared drive.
60    DriveReference drive = 3;
61  }
62
63  // This field is deprecated; please use the `drive` field instead.
64  TeamDriveReference team_drive = 2 [deprecated = true];
65}
66
67// A comment on a file.
68message FileComment {
69  // The comment in the discussion thread. This identifier is an opaque string
70  // compatible with the Drive API; see
71  // https://developers.google.com/drive/v3/reference/comments/get
72  string legacy_comment_id = 1;
73
74  // The discussion thread to which the comment was added. This identifier is an
75  // opaque string compatible with the Drive API and references the first
76  // comment in a discussion; see
77  // https://developers.google.com/drive/v3/reference/comments/get
78  string legacy_discussion_id = 2;
79
80  // The link to the discussion thread containing this comment, for example,
81  // `https://docs.google.com/DOCUMENT_ID/edit?disco=THREAD_ID`.
82  string link_to_discussion = 3;
83
84  // The Drive item containing this comment.
85  DriveItem parent = 4;
86}
87
88// A Drive item, such as a file or folder.
89message DriveItem {
90  // This item is deprecated; please see `DriveFile` instead.
91  message File {
92    option deprecated = true;
93  }
94
95  // This item is deprecated; please see `DriveFolder` instead.
96  message Folder {
97    option deprecated = true;
98
99    // This item is deprecated; please see `DriveFolder.Type` instead.
100    enum Type {
101      option deprecated = true;
102
103      // This item is deprecated; please see `DriveFolder.Type` instead.
104      TYPE_UNSPECIFIED = 0;
105
106      // This item is deprecated; please see `DriveFolder.Type` instead.
107      MY_DRIVE_ROOT = 1;
108
109      // This item is deprecated; please see `DriveFolder.Type` instead.
110      TEAM_DRIVE_ROOT = 2;
111
112      // This item is deprecated; please see `DriveFolder.Type` instead.
113      STANDARD_FOLDER = 3;
114    }
115
116    // This field is deprecated; please see `DriveFolder.type` instead.
117    Type type = 6;
118  }
119
120  // A Drive item which is a file.
121  message DriveFile {}
122
123  // A Drive item which is a folder.
124  message DriveFolder {
125    // The type of a Drive folder.
126    enum Type {
127      // The folder type is unknown.
128      TYPE_UNSPECIFIED = 0;
129
130      // The folder is the root of a user's MyDrive.
131      MY_DRIVE_ROOT = 1;
132
133      // The folder is the root of a shared drive.
134      SHARED_DRIVE_ROOT = 2;
135
136      // The folder is a standard, non-root, folder.
137      STANDARD_FOLDER = 3;
138    }
139
140    // The type of Drive folder.
141    Type type = 6;
142  }
143
144  // The target Drive item. The format is `items/ITEM_ID`.
145  string name = 1;
146
147  // The title of the Drive item.
148  string title = 2;
149
150  // This field is deprecated; please use the `driveFile` field instead.
151  File file = 3 [deprecated = true];
152
153  // This field is deprecated; please use the `driveFolder` field instead.
154  Folder folder = 4 [deprecated = true];
155
156  // If present, this describes the type of the Drive item.
157  oneof item_type {
158    // The Drive item is a file.
159    DriveFile drive_file = 8;
160
161    // The Drive item is a folder. Includes information about the type of
162    // folder.
163    DriveFolder drive_folder = 9;
164  }
165
166  // The MIME type of the Drive item.  See
167  // https://developers.google.com/drive/v3/web/mime-types.
168  string mime_type = 6;
169
170  // Information about the owner of this Drive item.
171  Owner owner = 7;
172}
173
174// Information about the owner of a Drive item.
175message Owner {
176  // The owner of the Drive item.
177  oneof owner {
178    // The user that owns the Drive item.
179    User user = 1;
180
181    // The drive that owns the item.
182    DriveReference drive = 4;
183  }
184
185  // This field is deprecated; please use the `drive` field instead.
186  TeamDriveReference team_drive = 2 [deprecated = true];
187
188  // The domain of the Drive item owner.
189  Domain domain = 3;
190}
191
192// This item is deprecated; please see `Drive` instead.
193message TeamDrive {
194  option deprecated = true;
195
196  // This field is deprecated; please see `Drive.name` instead.
197  string name = 1;
198
199  // This field is deprecated; please see `Drive.title` instead.
200  string title = 2;
201
202  // This field is deprecated; please see `Drive.root` instead.
203  DriveItem root = 3;
204}
205
206// Information about a shared drive.
207message Drive {
208  // The resource name of the shared drive. The format is
209  // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific collection
210  // ID for this resource name.
211  string name = 1;
212
213  // The title of the shared drive.
214  string title = 2;
215
216  // The root of this shared drive.
217  DriveItem root = 3;
218}
219
220// A lightweight reference to a Drive item, such as a file or folder.
221message DriveItemReference {
222  // The target Drive item. The format is `items/ITEM_ID`.
223  string name = 1;
224
225  // The title of the Drive item.
226  string title = 2;
227
228  // This field is deprecated; please use the `driveFile` field instead.
229  DriveItem.File file = 3 [deprecated = true];
230
231  // This field is deprecated; please use the `driveFolder` field instead.
232  DriveItem.Folder folder = 4 [deprecated = true];
233
234  // If present, this describes the type of the Drive item.
235  oneof item_type {
236    // The Drive item is a file.
237    DriveItem.DriveFile drive_file = 8;
238
239    // The Drive item is a folder. Includes information about the type of
240    // folder.
241    DriveItem.DriveFolder drive_folder = 9;
242  }
243}
244
245// This item is deprecated; please see `DriveReference` instead.
246message TeamDriveReference {
247  option deprecated = true;
248
249  // This field is deprecated; please see `DriveReference.name` instead.
250  string name = 1;
251
252  // This field is deprecated; please see `DriveReference.title` instead.
253  string title = 2;
254}
255
256// A lightweight reference to a shared drive.
257message DriveReference {
258  // The resource name of the shared drive. The format is
259  // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific collection
260  // ID for this resource name.
261  string name = 1;
262
263  // The title of the shared drive.
264  string title = 2;
265}
266