action.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. // Copyright 2021 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. import "google/apps/drive/activity/v2/target.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Apps.Drive.Activity.V2";
  21. option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ActionProto";
  24. option java_package = "com.google.apps.drive.activity.v2";
  25. option objc_class_prefix = "GADA";
  26. option php_namespace = "Google\\Apps\\Drive\\Activity\\V2";
  27. // Information about the action.
  28. message Action {
  29. // The type and detailed information about the action.
  30. ActionDetail detail = 1;
  31. // The actor responsible for this action (or empty if all actors are
  32. // responsible).
  33. Actor actor = 3;
  34. // The target this action affects (or empty if affecting all targets). This
  35. // represents the state of the target immediately after this action occurred.
  36. Target target = 4;
  37. // When the action occurred (or empty if same time as entire activity).
  38. oneof time {
  39. // The action occurred at this specific time.
  40. google.protobuf.Timestamp timestamp = 5;
  41. // The action occurred over this time range.
  42. TimeRange time_range = 6;
  43. }
  44. }
  45. // Data describing the type and additional information of an action.
  46. message ActionDetail {
  47. // Data describing the type and additional information of an action.
  48. oneof action_detail {
  49. // An object was created.
  50. Create create = 1;
  51. // An object was edited.
  52. Edit edit = 2;
  53. // An object was moved.
  54. Move move = 3;
  55. // An object was renamed.
  56. Rename rename = 4;
  57. // An object was deleted.
  58. Delete delete = 5;
  59. // A deleted object was restored.
  60. Restore restore = 6;
  61. // The permission on an object was changed.
  62. PermissionChange permission_change = 7;
  63. // A change about comments was made.
  64. Comment comment = 8;
  65. // A change happened in data leak prevention status.
  66. DataLeakPreventionChange dlp_change = 9;
  67. // An object was referenced in an application outside of Drive/Docs.
  68. ApplicationReference reference = 12;
  69. // Settings were changed.
  70. SettingsChange settings_change = 13;
  71. }
  72. }
  73. // An object was created.
  74. message Create {
  75. // An object was created from scratch.
  76. message New {
  77. }
  78. // An object was uploaded into Drive.
  79. message Upload {
  80. }
  81. // An object was created by copying an existing object.
  82. message Copy {
  83. // The original object.
  84. TargetReference original_object = 1;
  85. }
  86. // The origin of the new object.
  87. oneof origin {
  88. // If present, indicates the object was newly created (e.g. as a blank
  89. // document), not derived from a Drive object or external object.
  90. New new = 1;
  91. // If present, indicates the object originated externally and was uploaded
  92. // to Drive.
  93. Upload upload = 2;
  94. // If present, indicates the object was created by copying an existing Drive
  95. // object.
  96. Copy copy = 3;
  97. }
  98. }
  99. // An empty message indicating an object was edited.
  100. message Edit {
  101. }
  102. // An object was moved.
  103. message Move {
  104. // The added parent object(s).
  105. repeated TargetReference added_parents = 1;
  106. // The removed parent object(s).
  107. repeated TargetReference removed_parents = 2;
  108. }
  109. // An object was renamed.
  110. message Rename {
  111. // The previous title of the drive object.
  112. string old_title = 1;
  113. // The new title of the drive object.
  114. string new_title = 2;
  115. }
  116. // An object was deleted.
  117. message Delete {
  118. // The type of deletion.
  119. enum Type {
  120. // Deletion type is not available.
  121. TYPE_UNSPECIFIED = 0;
  122. // An object was put into the trash.
  123. TRASH = 1;
  124. // An object was deleted permanently.
  125. PERMANENT_DELETE = 2;
  126. }
  127. // The type of delete action taken.
  128. Type type = 1;
  129. }
  130. // A deleted object was restored.
  131. message Restore {
  132. // The type of restoration.
  133. enum Type {
  134. // The type is not available.
  135. TYPE_UNSPECIFIED = 0;
  136. // An object was restored from the trash.
  137. UNTRASH = 1;
  138. }
  139. // The type of restore action taken.
  140. Type type = 1;
  141. }
  142. // A change of the permission setting on an item.
  143. message PermissionChange {
  144. // The set of permissions added by this change.
  145. repeated Permission added_permissions = 1;
  146. // The set of permissions removed by this change.
  147. repeated Permission removed_permissions = 2;
  148. }
  149. // The permission setting of an object.
  150. message Permission {
  151. // Represents any user (including a logged out user).
  152. message Anyone {
  153. }
  154. // The [Google Drive permissions
  155. // roles](https://developers.google.com/drive/web/manage-sharing#roles).
  156. enum Role {
  157. // The role is not available.
  158. ROLE_UNSPECIFIED = 0;
  159. // A role granting full access.
  160. OWNER = 1;
  161. // A role granting the ability to manage people and settings.
  162. ORGANIZER = 2;
  163. // A role granting the ability to contribute and manage content.
  164. FILE_ORGANIZER = 3;
  165. // A role granting the ability to contribute content. This role is sometimes
  166. // also known as "writer".
  167. EDITOR = 4;
  168. // A role granting the ability to view and comment on content.
  169. COMMENTER = 5;
  170. // A role granting the ability to view content. This role is sometimes also
  171. // known as "reader".
  172. VIEWER = 6;
  173. // A role granting the ability to view content only after it has been
  174. // published to the web. This role is sometimes also known as "published
  175. // reader". See https://support.google.com/sites/answer/6372880 for more
  176. // information.
  177. PUBLISHED_VIEWER = 7;
  178. }
  179. // Indicates the
  180. // [Google Drive permissions
  181. // role](https://developers.google.com/drive/web/manage-sharing#roles). The
  182. // role determines a user's ability to read, write, and comment on items.
  183. Role role = 1;
  184. // The entity granted the role.
  185. oneof scope {
  186. // The user to whom this permission applies.
  187. User user = 2;
  188. // The group to whom this permission applies.
  189. Group group = 3;
  190. // The domain to whom this permission applies.
  191. Domain domain = 4;
  192. // If set, this permission applies to anyone, even logged out users.
  193. Anyone anyone = 5;
  194. }
  195. // If true, the item can be discovered (e.g. in the user's "Shared with me"
  196. // collection) without needing a link to the item.
  197. bool allow_discovery = 6;
  198. }
  199. // A change about comments on an object.
  200. message Comment {
  201. // A regular posted comment.
  202. message Post {
  203. // More detailed information about the change.
  204. enum Subtype {
  205. // Subtype not available.
  206. SUBTYPE_UNSPECIFIED = 0;
  207. // A post was added.
  208. ADDED = 1;
  209. // A post was deleted.
  210. DELETED = 2;
  211. // A reply was added.
  212. REPLY_ADDED = 3;
  213. // A reply was deleted.
  214. REPLY_DELETED = 4;
  215. // A posted comment was resolved.
  216. RESOLVED = 5;
  217. // A posted comment was reopened.
  218. REOPENED = 6;
  219. }
  220. // The sub-type of this event.
  221. Subtype subtype = 1;
  222. }
  223. // A comment with an assignment.
  224. message Assignment {
  225. // More detailed information about the change.
  226. enum Subtype {
  227. // Subtype not available.
  228. SUBTYPE_UNSPECIFIED = 0;
  229. // An assignment was added.
  230. ADDED = 1;
  231. // An assignment was deleted.
  232. DELETED = 2;
  233. // An assignment reply was added.
  234. REPLY_ADDED = 3;
  235. // An assignment reply was deleted.
  236. REPLY_DELETED = 4;
  237. // An assignment was resolved.
  238. RESOLVED = 5;
  239. // A resolved assignment was reopened.
  240. REOPENED = 6;
  241. // An assignment was reassigned.
  242. REASSIGNED = 7;
  243. }
  244. // The sub-type of this event.
  245. Subtype subtype = 1;
  246. // The user to whom the comment was assigned.
  247. User assigned_user = 7;
  248. }
  249. // A suggestion.
  250. message Suggestion {
  251. // More detailed information about the change.
  252. enum Subtype {
  253. // Subtype not available.
  254. SUBTYPE_UNSPECIFIED = 0;
  255. // A suggestion was added.
  256. ADDED = 1;
  257. // A suggestion was deleted.
  258. DELETED = 2;
  259. // A suggestion reply was added.
  260. REPLY_ADDED = 3;
  261. // A suggestion reply was deleted.
  262. REPLY_DELETED = 4;
  263. // A suggestion was accepted.
  264. ACCEPTED = 7;
  265. // A suggestion was rejected.
  266. REJECTED = 8;
  267. // An accepted suggestion was deleted.
  268. ACCEPT_DELETED = 9;
  269. // A rejected suggestion was deleted.
  270. REJECT_DELETED = 10;
  271. }
  272. // The sub-type of this event.
  273. Subtype subtype = 1;
  274. }
  275. // The type of changed comment.
  276. oneof type {
  277. // A change on a regular posted comment.
  278. Post post = 1;
  279. // A change on an assignment.
  280. Assignment assignment = 2;
  281. // A change on a suggestion.
  282. Suggestion suggestion = 3;
  283. }
  284. // Users who are mentioned in this comment.
  285. repeated User mentioned_users = 7;
  286. }
  287. // A change in the object's data leak prevention status.
  288. message DataLeakPreventionChange {
  289. // The type of the change.
  290. enum Type {
  291. // An update to the DLP state that is neither FLAGGED or CLEARED.
  292. TYPE_UNSPECIFIED = 0;
  293. // Document has been flagged as containing sensitive content.
  294. FLAGGED = 1;
  295. // Document is no longer flagged as containing sensitive content.
  296. CLEARED = 2;
  297. }
  298. // The type of Data Leak Prevention (DLP) change.
  299. Type type = 1;
  300. }
  301. // Activity in applications other than Drive.
  302. message ApplicationReference {
  303. // The type of the action.
  304. enum Type {
  305. // The type is not available.
  306. UNSPECIFIED_REFERENCE_TYPE = 0;
  307. // The links of one or more Drive items were posted.
  308. LINK = 1;
  309. // Comments were made regarding a Drive item.
  310. DISCUSS = 2;
  311. }
  312. // The reference type corresponding to this event.
  313. Type type = 1;
  314. }
  315. // Information about settings changes.
  316. message SettingsChange {
  317. // Information about restriction policy changes to a feature.
  318. message RestrictionChange {
  319. // The feature which had changes to its restriction policy.
  320. enum Feature {
  321. // The feature which changed restriction settings was not available.
  322. FEATURE_UNSPECIFIED = 0;
  323. // When restricted, this prevents items from being shared outside the
  324. // domain.
  325. SHARING_OUTSIDE_DOMAIN = 1;
  326. // When restricted, this prevents direct sharing of individual items.
  327. DIRECT_SHARING = 2;
  328. // When restricted, this prevents actions like copy, download, and print
  329. // that might result in uncontrolled duplicates of items.
  330. ITEM_DUPLICATION = 3;
  331. // When restricted, this prevents use of Drive File Stream.
  332. DRIVE_FILE_STREAM = 4;
  333. }
  334. // The restriction applicable to a feature.
  335. enum Restriction {
  336. // The type of restriction is not available.
  337. RESTRICTION_UNSPECIFIED = 0;
  338. // The feature is available without restriction.
  339. UNRESTRICTED = 1;
  340. // The use of this feature is fully restricted.
  341. FULLY_RESTRICTED = 2;
  342. }
  343. // The feature which had a change in restriction policy.
  344. Feature feature = 1;
  345. // The restriction in place after the change.
  346. Restriction new_restriction = 2;
  347. }
  348. // The set of changes made to restrictions.
  349. repeated RestrictionChange restriction_changes = 1;
  350. }