xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1alpha/purge_config.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.cloud.discoveryengine.v1alpha;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/discoveryengine/v1alpha/import_config.proto";
22import "google/protobuf/timestamp.proto";
23import "google/rpc/status.proto";
24
25option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
26option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
27option java_multiple_files = true;
28option java_outer_classname = "PurgeConfigProto";
29option java_package = "com.google.cloud.discoveryengine.v1alpha";
30option objc_class_prefix = "DISCOVERYENGINE";
31option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
32option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
33
34// Request message for PurgeUserEvents method.
35message PurgeUserEventsRequest {
36  // Required. The resource name of the catalog under which the events are
37  // created. The format is
38  // `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
39  string parent = 1 [
40    (google.api.field_behavior) = REQUIRED,
41    (google.api.resource_reference) = {
42      type: "discoveryengine.googleapis.com/DataStore"
43    }
44  ];
45
46  // Required. The filter string to specify the events to be deleted with a
47  // length limit of 5,000 characters. The eligible fields for filtering are:
48  //
49  // * `eventType`: Double quoted
50  // [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
51  // string.
52  // * `eventTime`: in ISO 8601 "zulu" format.
53  // * `userPseudoId`: Double quoted string. Specifying this will delete all
54  //   events associated with a visitor.
55  // * `userId`: Double quoted string. Specifying this will delete all events
56  //   associated with a user.
57  //
58  // Examples:
59  //
60  // * Deleting all events in a time range:
61  //   `eventTime > "2012-04-23T18:25:43.511Z"
62  //   eventTime < "2012-04-23T18:30:43.511Z"`
63  // * Deleting specific eventType:
64  //   `eventType = "search"`
65  // * Deleting all events for a specific visitor:
66  //   `userPseudoId = "visitor1024"`
67  // * Deleting all events inside a DataStore:
68  //   `*`
69  //
70  // The filtering fields are assumed to have an implicit AND.
71  string filter = 2 [(google.api.field_behavior) = REQUIRED];
72
73  // The `force` field is currently not supported. Purge user event requests
74  // will permanently delete all purgeable events. Once the development is
75  // complete:
76  // If `force` is set to false, the method will return the expected
77  // purge count without deleting any user events. This field will default to
78  // false if not included in the request.
79  bool force = 3;
80}
81
82// Response of the PurgeUserEventsRequest. If the long running operation is
83// successfully done, then this message is returned by the
84// google.longrunning.Operations.response field.
85message PurgeUserEventsResponse {
86  // The total count of events purged as a result of the operation.
87  int64 purge_count = 1;
88}
89
90// Metadata related to the progress of the PurgeUserEvents operation.
91// This will be returned by the google.longrunning.Operation.metadata field.
92message PurgeUserEventsMetadata {
93  // Operation create time.
94  google.protobuf.Timestamp create_time = 1;
95
96  // Operation last update time. If the operation is done, this is also the
97  // finish time.
98  google.protobuf.Timestamp update_time = 2;
99
100  // Count of entries that were deleted successfully.
101  int64 success_count = 3;
102
103  // Count of entries that encountered errors while processing.
104  int64 failure_count = 4;
105}
106
107// Configuration of destination for Purge related errors.
108message PurgeErrorConfig {
109  // Required. Errors destination.
110  oneof destination {
111    // Cloud Storage prefix for purge errors. This must be an empty,
112    // existing Cloud Storage directory. Purge errors are written to
113    // sharded files in this directory, one per line, as a JSON-encoded
114    // `google.rpc.Status` message.
115    string gcs_prefix = 1;
116  }
117}
118
119// Request message for
120// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
121// method.
122message PurgeDocumentsRequest {
123  // The desired input source for the purging documents based on document ids.
124  oneof source {
125    // Cloud Storage location for the input content.
126    // Supported `data_schema`:
127    // * `document_id`: One valid
128    // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] per line.
129    GcsSource gcs_source = 5;
130  }
131
132  // Required. The parent resource name, such as
133  // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
134  string parent = 1 [
135    (google.api.field_behavior) = REQUIRED,
136    (google.api.resource_reference) = {
137      type: "discoveryengine.googleapis.com/Branch"
138    }
139  ];
140
141  // Required. Filter matching documents to purge. Only currently supported
142  // value is
143  // `*` (all items).
144  string filter = 2 [(google.api.field_behavior) = REQUIRED];
145
146  // The desired location of errors incurred during the purge.
147  PurgeErrorConfig error_config = 7;
148
149  // Actually performs the purge. If `force` is set to false, return the
150  // expected purge count without deleting any documents.
151  bool force = 3;
152}
153
154// Response message for
155// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
156// method. If the long running operation is successfully done, then this message
157// is returned by the google.longrunning.Operations.response field.
158message PurgeDocumentsResponse {
159  // The total count of documents purged as a result of the operation.
160  int64 purge_count = 1;
161
162  // A sample of document names that will be deleted. Only populated if `force`
163  // is set to false. A max of 100 names will be returned and the names are
164  // chosen at random.
165  repeated string purge_sample = 2 [(google.api.resource_reference) = {
166    type: "discoveryengine.googleapis.com/Document"
167  }];
168}
169
170// Metadata related to the progress of the PurgeDocuments operation.
171// This will be returned by the google.longrunning.Operation.metadata field.
172message PurgeDocumentsMetadata {
173  // Operation create time.
174  google.protobuf.Timestamp create_time = 1;
175
176  // Operation last update time. If the operation is done, this is also the
177  // finish time.
178  google.protobuf.Timestamp update_time = 2;
179
180  // Count of entries that were deleted successfully.
181  int64 success_count = 3;
182
183  // Count of entries that encountered errors while processing.
184  int64 failure_count = 4;
185
186  // Count of entries that were ignored as entries were not found.
187  int64 ignored_count = 5;
188}
189
190// Request message for
191// [CompletionService.PurgeSuggestionDenyListEntries][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeSuggestionDenyListEntries]
192// method.
193message PurgeSuggestionDenyListEntriesRequest {
194  // Required. The parent data store resource name for which to import denylist
195  // entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
196  string parent = 1 [
197    (google.api.field_behavior) = REQUIRED,
198    (google.api.resource_reference) = {
199      type: "discoveryengine.googleapis.com/DataStore"
200    }
201  ];
202}
203
204// Response message for
205// [CompletionService.PurgeSuggestionDenyListEntries][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeSuggestionDenyListEntries]
206// method.
207message PurgeSuggestionDenyListEntriesResponse {
208  // Number of suggestion deny list entries purged.
209  int64 purge_count = 1;
210
211  // A sample of errors encountered while processing the request.
212  repeated google.rpc.Status error_samples = 2;
213}
214
215// Metadata related to the progress of the PurgeSuggestionDenyListEntries
216// operation. This is returned by the google.longrunning.Operation.metadata
217// field.
218message PurgeSuggestionDenyListEntriesMetadata {
219  // Operation create time.
220  google.protobuf.Timestamp create_time = 1;
221
222  // Operation last update time. If the operation is done, this is also the
223  // finish time.
224  google.protobuf.Timestamp update_time = 2;
225}
226