target.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. syntax = "proto3";
  15. package google.apps.drive.activity.v2;
  16. import "google/apps/drive/activity/v2/actor.proto";
  17. import "google/apps/drive/activity/v2/common.proto";
  18. option csharp_namespace = "Google.Apps.Drive.Activity.V2";
  19. option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "TargetProto";
  22. option java_package = "com.google.apps.drive.activity.v2";
  23. option objc_class_prefix = "GADA";
  24. option php_namespace = "Google\\Apps\\Drive\\Activity\\V2";
  25. // Information about the target of activity.
  26. message Target {
  27. // The type of target object.
  28. oneof object {
  29. // The target is a Drive item.
  30. DriveItem drive_item = 1;
  31. // The target is a shared drive.
  32. Drive drive = 5;
  33. // The target is a comment on a Drive file.
  34. FileComment file_comment = 3;
  35. }
  36. // This field is deprecated; please use the `drive` field instead.
  37. TeamDrive team_drive = 2 [deprecated = true];
  38. }
  39. // A lightweight reference to the target of activity.
  40. message TargetReference {
  41. // The type of target object.
  42. oneof object {
  43. // The target is a Drive item.
  44. DriveItemReference drive_item = 1;
  45. // The target is a shared drive.
  46. DriveReference drive = 3;
  47. }
  48. // This field is deprecated; please use the `drive` field instead.
  49. TeamDriveReference team_drive = 2 [deprecated = true];
  50. }
  51. // A comment on a file.
  52. message FileComment {
  53. // The comment in the discussion thread. This identifier is an opaque string
  54. // compatible with the Drive API; see
  55. // https://developers.google.com/drive/v3/reference/comments/get
  56. string legacy_comment_id = 1;
  57. // The discussion thread to which the comment was added. This identifier is an
  58. // opaque string compatible with the Drive API and references the first
  59. // comment in a discussion; see
  60. // https://developers.google.com/drive/v3/reference/comments/get
  61. string legacy_discussion_id = 2;
  62. // The link to the discussion thread containing this comment, for example,
  63. // `https://docs.google.com/DOCUMENT_ID/edit?disco=THREAD_ID`.
  64. string link_to_discussion = 3;
  65. // The Drive item containing this comment.
  66. DriveItem parent = 4;
  67. }
  68. // A Drive item, such as a file or folder.
  69. message DriveItem {
  70. // This item is deprecated; please see `DriveFile` instead.
  71. message File {
  72. option deprecated = true;
  73. }
  74. // This item is deprecated; please see `DriveFolder` instead.
  75. message Folder {
  76. option deprecated = true;
  77. // This item is deprecated; please see `DriveFolder.Type` instead.
  78. enum Type {
  79. option deprecated = true;
  80. // This item is deprecated; please see `DriveFolder.Type` instead.
  81. TYPE_UNSPECIFIED = 0;
  82. // This item is deprecated; please see `DriveFolder.Type` instead.
  83. MY_DRIVE_ROOT = 1;
  84. // This item is deprecated; please see `DriveFolder.Type` instead.
  85. TEAM_DRIVE_ROOT = 2;
  86. // This item is deprecated; please see `DriveFolder.Type` instead.
  87. STANDARD_FOLDER = 3;
  88. }
  89. // This field is deprecated; please see `DriveFolder.type` instead.
  90. Type type = 6;
  91. }
  92. // A Drive item which is a file.
  93. message DriveFile {
  94. }
  95. // A Drive item which is a folder.
  96. message DriveFolder {
  97. // The type of a Drive folder.
  98. enum Type {
  99. // The folder type is unknown.
  100. TYPE_UNSPECIFIED = 0;
  101. // The folder is the root of a user's MyDrive.
  102. MY_DRIVE_ROOT = 1;
  103. // The folder is the root of a shared drive.
  104. SHARED_DRIVE_ROOT = 2;
  105. // The folder is a standard, non-root, folder.
  106. STANDARD_FOLDER = 3;
  107. }
  108. // The type of Drive folder.
  109. Type type = 6;
  110. }
  111. // The target Drive item. The format is `items/ITEM_ID`.
  112. string name = 1;
  113. // The title of the Drive item.
  114. string title = 2;
  115. // This field is deprecated; please use the `driveFile` field instead.
  116. File file = 3 [deprecated = true];
  117. // This field is deprecated; please use the `driveFolder` field instead.
  118. Folder folder = 4 [deprecated = true];
  119. // If present, this describes the type of the Drive item.
  120. oneof item_type {
  121. // The Drive item is a file.
  122. DriveFile drive_file = 8;
  123. // The Drive item is a folder. Includes information about the type of
  124. // folder.
  125. DriveFolder drive_folder = 9;
  126. }
  127. // The MIME type of the Drive item. See
  128. // https://developers.google.com/drive/v3/web/mime-types.
  129. string mime_type = 6;
  130. // Information about the owner of this Drive item.
  131. Owner owner = 7;
  132. }
  133. // Information about the owner of a Drive item.
  134. message Owner {
  135. // The owner of the Drive item.
  136. oneof owner {
  137. // The user that owns the Drive item.
  138. User user = 1;
  139. // The drive that owns the item.
  140. DriveReference drive = 4;
  141. }
  142. // This field is deprecated; please use the `drive` field instead.
  143. TeamDriveReference team_drive = 2 [deprecated = true];
  144. // The domain of the Drive item owner.
  145. Domain domain = 3;
  146. }
  147. // This item is deprecated; please see `Drive` instead.
  148. message TeamDrive {
  149. option deprecated = true;
  150. // This field is deprecated; please see `Drive.name` instead.
  151. string name = 1;
  152. // This field is deprecated; please see `Drive.title` instead.
  153. string title = 2;
  154. // This field is deprecated; please see `Drive.root` instead.
  155. DriveItem root = 3;
  156. }
  157. // Information about a shared drive.
  158. message Drive {
  159. // The resource name of the shared drive. The format is
  160. // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific collection
  161. // ID for this resource name.
  162. string name = 1;
  163. // The title of the shared drive.
  164. string title = 2;
  165. // The root of this shared drive.
  166. DriveItem root = 3;
  167. }
  168. // A lightweight reference to a Drive item, such as a file or folder.
  169. message DriveItemReference {
  170. // The target Drive item. The format is `items/ITEM_ID`.
  171. string name = 1;
  172. // The title of the Drive item.
  173. string title = 2;
  174. // This field is deprecated; please use the `driveFile` field instead.
  175. DriveItem.File file = 3 [deprecated = true];
  176. // This field is deprecated; please use the `driveFolder` field instead.
  177. DriveItem.Folder folder = 4 [deprecated = true];
  178. // If present, this describes the type of the Drive item.
  179. oneof item_type {
  180. // The Drive item is a file.
  181. DriveItem.DriveFile drive_file = 8;
  182. // The Drive item is a folder. Includes information about the type of
  183. // folder.
  184. DriveItem.DriveFolder drive_folder = 9;
  185. }
  186. }
  187. // This item is deprecated; please see `DriveReference` instead.
  188. message TeamDriveReference {
  189. option deprecated = true;
  190. // This field is deprecated; please see `DriveReference.name` instead.
  191. string name = 1;
  192. // This field is deprecated; please see `DriveReference.title` instead.
  193. string title = 2;
  194. }
  195. // A lightweight reference to a shared drive.
  196. message DriveReference {
  197. // The resource name of the shared drive. The format is
  198. // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific collection
  199. // ID for this resource name.
  200. string name = 1;
  201. // The title of the shared drive.
  202. string title = 2;
  203. }