xref: /aosp_15_r20/external/googleapis/google/apps/drive/activity/v2/query_drive_activity_request.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
19option csharp_namespace = "Google.Apps.Drive.Activity.V2";
20option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";
21option java_multiple_files = true;
22option java_outer_classname = "QueryDriveActivityRequestProto";
23option java_package = "com.google.apps.drive.activity.v2";
24option objc_class_prefix = "GADA";
25option php_namespace = "Google\\Apps\\Drive\\Activity\\V2";
26
27// The request message for querying Drive activity.
28message QueryDriveActivityRequest {
29  // The primary criteria in the query. The default is
30  // ancestorName = `items/root`, if no key is specified.
31  oneof key {
32    // Return activities for this Drive item. The format is
33    // `items/ITEM_ID`.
34    string item_name = 1;
35
36    // Return activities for this Drive folder, plus all children and
37    // descendants. The format is `items/ITEM_ID`.
38    string ancestor_name = 2;
39  }
40
41  // Details on how to consolidate related actions that make up the activity. If
42  // not set, then related actions aren't consolidated.
43  ConsolidationStrategy consolidation_strategy = 5;
44
45  // The minimum number of activities desired in the response; the server
46  // attempts to return at least this quantity. The server may also return fewer
47  // activities if it has a partial response ready before the request times out.
48  // If not set, a default value is used.
49  int32 page_size = 6;
50
51  // The token identifies which page of results to return. Set this to the
52  // next_page_token value returned from a previous query to obtain the
53  // following page of results. If not set, the first page of results is
54  // returned.
55  string page_token = 7;
56
57  // The filtering for items returned from this query request. The format of the
58  // filter string is a sequence of expressions, joined by an optional "AND",
59  // where each expression is of the form "field operator value".
60  //
61  // Supported fields:
62  //
63  //   - `time`: Uses numerical operators on date values either in
64  //     terms of milliseconds since Jan 1, 1970 or in <a
65  //     href="https://www.rfc-editor.org/rfc/rfc3339" target="_blank">RFC
66  //     3339</a> format. Examples:
67  //       - `time > 1452409200000 AND time <= 1492812924310`
68  //       - `time >= "2016-01-10T01:02:03-05:00"`
69  //
70  //   - `detail.action_detail_case`: Uses the "has" operator (:) and
71  //     either a singular value or a list of allowed action types enclosed in
72  //     parentheses, separated by a space. To exclude a result from the
73  //     response, prepend a hyphen (`-`) to the beginning of the filter string.
74  //     Examples:
75  //       - `detail.action_detail_case:RENAME`
76  //       - `detail.action_detail_case:(CREATE RESTORE)`
77  //       - `-detail.action_detail_case:MOVE`
78  //
79  string filter = 8;
80}
81
82// How the individual activities are consolidated. If a set of activities is
83// related they can be consolidated into one combined activity, such as one
84// actor performing the same action on multiple targets, or multiple actors
85// performing the same action on a single target. The strategy defines the rules
86// for which activities are related.
87message ConsolidationStrategy {
88  // A strategy that does no consolidation of individual activities.
89  message NoConsolidation {}
90
91  // A strategy that consolidates activities using the grouping rules from the
92  // legacy V1 Activity API. Similar actions occurring within a window of time
93  // can be grouped across multiple targets (such as moving a set of files at
94  // once) or multiple actors (such as several users editing the same item).
95  // Grouping rules for this strategy are specific to each type of action.
96  message Legacy {}
97
98  // How the individual activities are consolidated.
99  oneof strategy {
100    // The individual activities are not consolidated.
101    NoConsolidation none = 1;
102
103    // The individual activities are consolidated using the legacy strategy.
104    Legacy legacy = 2;
105  }
106}
107