• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.v2alpha;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
24option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
25option java_multiple_files = true;
26option java_outer_classname = "PurgeConfigProto";
27option java_package = "com.google.cloud.retail.v2alpha";
28option objc_class_prefix = "RETAIL";
29option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
30option ruby_package = "Google::Cloud::Retail::V2alpha";
31
32// Metadata related to the progress of the Purge operation.
33// This will be returned by the google.longrunning.Operation.metadata field.
34message PurgeMetadata {}
35
36// Metadata related to the progress of the PurgeProducts operation.
37// This will be returned by the google.longrunning.Operation.metadata field.
38message PurgeProductsMetadata {
39  // Operation create time.
40  google.protobuf.Timestamp create_time = 1;
41
42  // Operation last update time. If the operation is done, this is also the
43  // finish time.
44  google.protobuf.Timestamp update_time = 2;
45
46  // Count of entries that were deleted successfully.
47  int64 success_count = 3;
48
49  // Count of entries that encountered errors while processing.
50  int64 failure_count = 4;
51}
52
53// Request message for PurgeProducts method.
54message PurgeProductsRequest {
55  // Required. The resource name of the branch under which the products are
56  // created. The format is
57  // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}`
58  string parent = 1 [
59    (google.api.field_behavior) = REQUIRED,
60    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
61  ];
62
63  // Required. The filter string to specify the products to be deleted with a
64  // length limit of 5,000 characters.
65  //
66  // Empty string filter is not allowed. "*" implies delete all items in a
67  // branch.
68  //
69  // The eligible fields for filtering are:
70  //
71  // * `availability`: Double quoted
72  // [Product.availability][google.cloud.retail.v2alpha.Product.availability]
73  // string.
74  // * `create_time` : in ISO 8601 "zulu" format.
75  //
76  // Supported syntax:
77  //
78  // * Comparators (">", "<", ">=", "<=", "=").
79  //   Examples:
80  //   * create_time <= "2015-02-13T17:05:46Z"
81  //   * availability = "IN_STOCK"
82  //
83  // * Conjunctions ("AND")
84  //   Examples:
85  //   * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER"
86  //
87  // * Disjunctions ("OR")
88  //   Examples:
89  //   * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK"
90  //
91  // * Can support nested queries.
92  //   Examples:
93  //   * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER")
94  //   OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK")
95  //
96  // * Filter Limits:
97  //   * Filter should not contain more than 6 conditions.
98  //   * Max nesting depth should not exceed 2 levels.
99  //
100  // Examples queries:
101  // * Delete back order products created before a timestamp.
102  //   create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER"
103  string filter = 2 [(google.api.field_behavior) = REQUIRED];
104
105  // Actually perform the purge.
106  // If `force` is set to false, the method will return the expected purge count
107  // without deleting any products.
108  bool force = 3;
109}
110
111// Response of the PurgeProductsRequest. If the long running operation is
112// successfully done, then this message is returned by the
113// google.longrunning.Operations.response field.
114message PurgeProductsResponse {
115  // The total count of products purged as a result of the operation.
116  int64 purge_count = 1;
117
118  // A sample of the product names that will be deleted.
119  // Only populated if `force` is set to false. A max of 100 names will be
120  // returned and the names are chosen at random.
121  repeated string purge_sample = 2 [
122    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
123  ];
124}
125
126// Request message for PurgeUserEvents method.
127message PurgeUserEventsRequest {
128  // Required. The resource name of the catalog under which the events are
129  // created. The format is
130  // `projects/${projectId}/locations/global/catalogs/${catalogId}`
131  string parent = 1 [
132    (google.api.field_behavior) = REQUIRED,
133    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
134  ];
135
136  // Required. The filter string to specify the events to be deleted with a
137  // length limit of 5,000 characters. Empty string filter is not allowed. The
138  // eligible fields for filtering are:
139  //
140  // * `eventType`: Double quoted
141  // [UserEvent.event_type][google.cloud.retail.v2alpha.UserEvent.event_type]
142  // string.
143  // * `eventTime`: in ISO 8601 "zulu" format.
144  // * `visitorId`: Double quoted string. Specifying this will delete all
145  //   events associated with a visitor.
146  // * `userId`: Double quoted string. Specifying this will delete all events
147  //   associated with a user.
148  //
149  // Examples:
150  //
151  // * Deleting all events in a time range:
152  //   `eventTime > "2012-04-23T18:25:43.511Z"
153  //   eventTime < "2012-04-23T18:30:43.511Z"`
154  // * Deleting specific eventType in time range:
155  //   `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"`
156  // * Deleting all events for a specific visitor:
157  //   `visitorId = "visitor1024"`
158  //
159  // The filtering fields are assumed to have an implicit AND.
160  string filter = 2 [(google.api.field_behavior) = REQUIRED];
161
162  // Actually perform the purge.
163  // If `force` is set to false, the method will return the expected purge count
164  // without deleting any user events.
165  bool force = 3;
166}
167
168// Response of the PurgeUserEventsRequest. If the long running operation is
169// successfully done, then this message is returned by the
170// google.longrunning.Operations.response field.
171message PurgeUserEventsResponse {
172  // The total count of events purged as a result of the operation.
173  int64 purged_events_count = 1;
174}
175