action.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  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. 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. // Label was changed.
  72. AppliedLabelChange applied_label_change = 19;
  73. }
  74. }
  75. // An object was created.
  76. message Create {
  77. // An object was created from scratch.
  78. message New {
  79. }
  80. // An object was uploaded into Drive.
  81. message Upload {
  82. }
  83. // An object was created by copying an existing object.
  84. message Copy {
  85. // The original object.
  86. TargetReference original_object = 1;
  87. }
  88. // The origin of the new object.
  89. oneof origin {
  90. // If present, indicates the object was newly created (e.g. as a blank
  91. // document), not derived from a Drive object or external object.
  92. New new = 1;
  93. // If present, indicates the object originated externally and was uploaded
  94. // to Drive.
  95. Upload upload = 2;
  96. // If present, indicates the object was created by copying an existing Drive
  97. // object.
  98. Copy copy = 3;
  99. }
  100. }
  101. // An empty message indicating an object was edited.
  102. message Edit {
  103. }
  104. // An object was moved.
  105. message Move {
  106. // The added parent object(s).
  107. repeated TargetReference added_parents = 1;
  108. // The removed parent object(s).
  109. repeated TargetReference removed_parents = 2;
  110. }
  111. // An object was renamed.
  112. message Rename {
  113. // The previous title of the drive object.
  114. string old_title = 1;
  115. // The new title of the drive object.
  116. string new_title = 2;
  117. }
  118. // An object was deleted.
  119. message Delete {
  120. // The type of deletion.
  121. enum Type {
  122. // Deletion type is not available.
  123. TYPE_UNSPECIFIED = 0;
  124. // An object was put into the trash.
  125. TRASH = 1;
  126. // An object was deleted permanently.
  127. PERMANENT_DELETE = 2;
  128. }
  129. // The type of delete action taken.
  130. Type type = 1;
  131. }
  132. // A deleted object was restored.
  133. message Restore {
  134. // The type of restoration.
  135. enum Type {
  136. // The type is not available.
  137. TYPE_UNSPECIFIED = 0;
  138. // An object was restored from the trash.
  139. UNTRASH = 1;
  140. }
  141. // The type of restore action taken.
  142. Type type = 1;
  143. }
  144. // A change of the permission setting on an item.
  145. message PermissionChange {
  146. // The set of permissions added by this change.
  147. repeated Permission added_permissions = 1;
  148. // The set of permissions removed by this change.
  149. repeated Permission removed_permissions = 2;
  150. }
  151. // The permission setting of an object.
  152. message Permission {
  153. // The [Google Drive permissions
  154. // roles](https://developers.google.com/drive/web/manage-sharing#roles).
  155. enum Role {
  156. // The role is not available.
  157. ROLE_UNSPECIFIED = 0;
  158. // A role granting full access.
  159. OWNER = 1;
  160. // A role granting the ability to manage people and settings.
  161. ORGANIZER = 2;
  162. // A role granting the ability to contribute and manage content.
  163. FILE_ORGANIZER = 3;
  164. // A role granting the ability to contribute content. This role is sometimes
  165. // also known as "writer".
  166. EDITOR = 4;
  167. // A role granting the ability to view and comment on content.
  168. COMMENTER = 5;
  169. // A role granting the ability to view content. This role is sometimes also
  170. // known as "reader".
  171. VIEWER = 6;
  172. // A role granting the ability to view content only after it has been
  173. // published to the web. This role is sometimes also known as "published
  174. // reader". See https://support.google.com/sites/answer/6372880 for more
  175. // information.
  176. PUBLISHED_VIEWER = 7;
  177. }
  178. // Represents any user (including a logged out user).
  179. message Anyone {
  180. }
  181. // Indicates the
  182. // [Google Drive permissions
  183. // role](https://developers.google.com/drive/web/manage-sharing#roles). The
  184. // role determines a user's ability to read, write, and comment on items.
  185. Role role = 1;
  186. // The entity granted the role.
  187. oneof scope {
  188. // The user to whom this permission applies.
  189. User user = 2;
  190. // The group to whom this permission applies.
  191. Group group = 3;
  192. // The domain to whom this permission applies.
  193. Domain domain = 4;
  194. // If set, this permission applies to anyone, even logged out users.
  195. Anyone anyone = 5;
  196. }
  197. // If true, the item can be discovered (e.g. in the user's "Shared with me"
  198. // collection) without needing a link to the item.
  199. bool allow_discovery = 6;
  200. }
  201. // A change about comments on an object.
  202. message Comment {
  203. // A regular posted comment.
  204. message Post {
  205. // More detailed information about the change.
  206. enum Subtype {
  207. // Subtype not available.
  208. SUBTYPE_UNSPECIFIED = 0;
  209. // A post was added.
  210. ADDED = 1;
  211. // A post was deleted.
  212. DELETED = 2;
  213. // A reply was added.
  214. REPLY_ADDED = 3;
  215. // A reply was deleted.
  216. REPLY_DELETED = 4;
  217. // A posted comment was resolved.
  218. RESOLVED = 5;
  219. // A posted comment was reopened.
  220. REOPENED = 6;
  221. }
  222. // The sub-type of this event.
  223. Subtype subtype = 1;
  224. }
  225. // A comment with an assignment.
  226. message Assignment {
  227. // More detailed information about the change.
  228. enum Subtype {
  229. // Subtype not available.
  230. SUBTYPE_UNSPECIFIED = 0;
  231. // An assignment was added.
  232. ADDED = 1;
  233. // An assignment was deleted.
  234. DELETED = 2;
  235. // An assignment reply was added.
  236. REPLY_ADDED = 3;
  237. // An assignment reply was deleted.
  238. REPLY_DELETED = 4;
  239. // An assignment was resolved.
  240. RESOLVED = 5;
  241. // A resolved assignment was reopened.
  242. REOPENED = 6;
  243. // An assignment was reassigned.
  244. REASSIGNED = 7;
  245. }
  246. // The sub-type of this event.
  247. Subtype subtype = 1;
  248. // The user to whom the comment was assigned.
  249. User assigned_user = 7;
  250. }
  251. // A suggestion.
  252. message Suggestion {
  253. // More detailed information about the change.
  254. enum Subtype {
  255. // Subtype not available.
  256. SUBTYPE_UNSPECIFIED = 0;
  257. // A suggestion was added.
  258. ADDED = 1;
  259. // A suggestion was deleted.
  260. DELETED = 2;
  261. // A suggestion reply was added.
  262. REPLY_ADDED = 3;
  263. // A suggestion reply was deleted.
  264. REPLY_DELETED = 4;
  265. // A suggestion was accepted.
  266. ACCEPTED = 7;
  267. // A suggestion was rejected.
  268. REJECTED = 8;
  269. // An accepted suggestion was deleted.
  270. ACCEPT_DELETED = 9;
  271. // A rejected suggestion was deleted.
  272. REJECT_DELETED = 10;
  273. }
  274. // The sub-type of this event.
  275. Subtype subtype = 1;
  276. }
  277. // The type of changed comment.
  278. oneof type {
  279. // A change on a regular posted comment.
  280. Post post = 1;
  281. // A change on an assignment.
  282. Assignment assignment = 2;
  283. // A change on a suggestion.
  284. Suggestion suggestion = 3;
  285. }
  286. // Users who are mentioned in this comment.
  287. repeated User mentioned_users = 7;
  288. }
  289. // A change in the object's data leak prevention status.
  290. message DataLeakPreventionChange {
  291. // The type of the change.
  292. enum Type {
  293. // An update to the DLP state that is neither FLAGGED or CLEARED.
  294. TYPE_UNSPECIFIED = 0;
  295. // Document has been flagged as containing sensitive content.
  296. FLAGGED = 1;
  297. // Document is no longer flagged as containing sensitive content.
  298. CLEARED = 2;
  299. }
  300. // The type of Data Leak Prevention (DLP) change.
  301. Type type = 1;
  302. }
  303. // Activity in applications other than Drive.
  304. message ApplicationReference {
  305. // The type of the action.
  306. enum Type {
  307. // The type is not available.
  308. UNSPECIFIED_REFERENCE_TYPE = 0;
  309. // The links of one or more Drive items were posted.
  310. LINK = 1;
  311. // Comments were made regarding a Drive item.
  312. DISCUSS = 2;
  313. }
  314. // The reference type corresponding to this event.
  315. Type type = 1;
  316. }
  317. // Information about settings changes.
  318. message SettingsChange {
  319. // Information about restriction policy changes to a feature.
  320. message RestrictionChange {
  321. // The feature which had changes to its restriction policy.
  322. enum Feature {
  323. // The feature which changed restriction settings was not available.
  324. FEATURE_UNSPECIFIED = 0;
  325. // When restricted, this prevents items from being shared outside the
  326. // domain.
  327. SHARING_OUTSIDE_DOMAIN = 1;
  328. // When restricted, this prevents direct sharing of individual items.
  329. DIRECT_SHARING = 2;
  330. // When restricted, this prevents actions like copy, download, and print
  331. // that might result in uncontrolled duplicates of items.
  332. ITEM_DUPLICATION = 3;
  333. // When restricted, this prevents use of Drive File Stream.
  334. DRIVE_FILE_STREAM = 4;
  335. }
  336. // The restriction applicable to a feature.
  337. enum Restriction {
  338. // The type of restriction is not available.
  339. RESTRICTION_UNSPECIFIED = 0;
  340. // The feature is available without restriction.
  341. UNRESTRICTED = 1;
  342. // The use of this feature is fully restricted.
  343. FULLY_RESTRICTED = 2;
  344. }
  345. // The feature which had a change in restriction policy.
  346. Feature feature = 1;
  347. // The restriction in place after the change.
  348. Restriction new_restriction = 2;
  349. }
  350. // The set of changes made to restrictions.
  351. repeated RestrictionChange restriction_changes = 1;
  352. }
  353. // Label changes that were made on the Target.
  354. message AppliedLabelChange {
  355. // A change made to a Label on the Target.
  356. message AppliedLabelChangeDetail {
  357. // Change to a Field value.
  358. message FieldValueChange {
  359. // Contains a value of a Field.
  360. message FieldValue {
  361. // Wrapper for Text Field value.
  362. message Text {
  363. // Value of Text Field.
  364. optional string value = 1;
  365. }
  366. // Wrapper for Text List Field value.
  367. message TextList {
  368. // Text values.
  369. repeated Text values = 1;
  370. }
  371. // Wrapper for Selection Field value as combined value/display_name
  372. // pair for selected choice.
  373. message Selection {
  374. // Selection value as Field Choice ID.
  375. optional string value = 1;
  376. // Selection value as human-readable display string.
  377. optional string display_name = 2;
  378. }
  379. // Wrapper for SelectionList Field value.
  380. message SelectionList {
  381. // Selection values.
  382. repeated Selection values = 1;
  383. }
  384. // Wrapper for Integer Field value.
  385. message Integer {
  386. // Integer value.
  387. optional int64 value = 1;
  388. }
  389. // Wrapper for User Field value.
  390. message SingleUser {
  391. // User value as email.
  392. optional string value = 1;
  393. }
  394. // Wrapper for UserList Field value.
  395. message UserList {
  396. // User values.
  397. repeated SingleUser values = 1;
  398. }
  399. // Wrapper for Date Field value.
  400. message Date {
  401. // Date value.
  402. optional google.protobuf.Timestamp value = 1;
  403. }
  404. // Field values for all Field types.
  405. oneof value {
  406. // Text Field value.
  407. Text text = 1;
  408. // Text List Field value.
  409. TextList text_list = 3;
  410. // Selection Field value.
  411. Selection selection = 4;
  412. // Selection List Field value.
  413. SelectionList selection_list = 5;
  414. // Integer Field value.
  415. Integer integer = 6;
  416. // User Field value.
  417. SingleUser user = 7;
  418. // User List Field value.
  419. UserList user_list = 8;
  420. // Date Field value.
  421. Date date = 9;
  422. }
  423. }
  424. // The ID of this field. Field IDs are unique within a Label.
  425. optional string field_id = 1;
  426. // The value that was previously set on the field. If not present,
  427. // the field was newly set. At least one of {old_value|new_value} is
  428. // always set.
  429. optional FieldValue old_value = 2;
  430. // The value that is now set on the field. If not present, the field was
  431. // cleared. At least one of {old_value|new_value} is always set.
  432. optional FieldValue new_value = 3;
  433. // The human-readable display name for this field.
  434. optional string display_name = 4;
  435. }
  436. // The type of Label change
  437. enum Type {
  438. // The type of change to this Label is not available.
  439. TYPE_UNSPECIFIED = 0;
  440. // The identified Label was added to the Target.
  441. LABEL_ADDED = 1;
  442. // The identified Label was removed from the Target.
  443. LABEL_REMOVED = 2;
  444. // Field values were changed on the Target.
  445. LABEL_FIELD_VALUE_CHANGED = 3;
  446. // The Label was applied as a side-effect of Drive item creation.
  447. LABEL_APPLIED_BY_ITEM_CREATE = 4;
  448. }
  449. // The Label name representing the Label that changed.
  450. // This name always contains the revision of the Label that was used
  451. // when this Action occurred. The format is
  452. // `labels/id@revision`.
  453. string label = 1;
  454. // The types of changes made to the Label on the Target.
  455. repeated Type types = 2;
  456. // The human-readable title of the label that changed.
  457. string title = 3;
  458. // Field Changes. Only present if `types` contains
  459. // `LABEL_FIELD_VALUE_CHANGED`.
  460. repeated FieldValueChange field_changes = 4;
  461. }
  462. // Changes that were made to the Label on the Target.
  463. repeated AppliedLabelChangeDetail changes = 1;
  464. }