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
15syntax = "proto3";
16
17package google.cloud.retail.v2;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21
22option csharp_namespace = "Google.Cloud.Retail.V2";
23option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb";
24option java_multiple_files = true;
25option java_outer_classname = "PurgeConfigProto";
26option java_package = "com.google.cloud.retail.v2";
27option objc_class_prefix = "RETAIL";
28option php_namespace = "Google\\Cloud\\Retail\\V2";
29option ruby_package = "Google::Cloud::Retail::V2";
30
31// Metadata related to the progress of the Purge operation.
32// This will be returned by the google.longrunning.Operation.metadata field.
33message PurgeMetadata {}
34
35// Request message for PurgeUserEvents method.
36message PurgeUserEventsRequest {
37  // Required. The resource name of the catalog under which the events are
38  // created. The format is
39  // `projects/${projectId}/locations/global/catalogs/${catalogId}`
40  string parent = 1 [
41    (google.api.field_behavior) = REQUIRED,
42    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
43  ];
44
45  // Required. The filter string to specify the events to be deleted with a
46  // length limit of 5,000 characters. Empty string filter is not allowed. The
47  // eligible fields for filtering are:
48  //
49  // * `eventType`: Double quoted
50  // [UserEvent.event_type][google.cloud.retail.v2.UserEvent.event_type] string.
51  // * `eventTime`: in ISO 8601 "zulu" format.
52  // * `visitorId`: Double quoted string. Specifying this will delete all
53  //   events associated with a visitor.
54  // * `userId`: Double quoted string. Specifying this will delete all events
55  //   associated with a user.
56  //
57  // Examples:
58  //
59  // * Deleting all events in a time range:
60  //   `eventTime > "2012-04-23T18:25:43.511Z"
61  //   eventTime < "2012-04-23T18:30:43.511Z"`
62  // * Deleting specific eventType in time range:
63  //   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
64  // * Deleting all events for a specific visitor:
65  //   `visitorId = "visitor1024"`
66  //
67  // The filtering fields are assumed to have an implicit AND.
68  string filter = 2 [(google.api.field_behavior) = REQUIRED];
69
70  // Actually perform the purge.
71  // If `force` is set to false, the method will return the expected purge count
72  // without deleting any user events.
73  bool force = 3;
74}
75
76// Response of the PurgeUserEventsRequest. If the long running operation is
77// successfully done, then this message is returned by the
78// google.longrunning.Operations.response field.
79message PurgeUserEventsResponse {
80  // The total count of events purged as a result of the operation.
81  int64 purged_events_count = 1;
82}
83