purge_config.proto 6.5 KB

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