Skip to content

Commit fe82a75

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add restricted Retail Search features for Retail API v2alpha.
PiperOrigin-RevId: 386944882
1 parent 28ccba2 commit fe82a75

17 files changed

Lines changed: 2880 additions & 134 deletions
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.retail.logging;
18+
19+
import "google/api/annotations.proto";
20+
import "google/protobuf/struct.proto";
21+
import "google/rpc/status.proto";
22+
23+
option csharp_namespace = "Google.Cloud.Retail.Logging";
24+
option go_package = "google.golang.org/genproto/googleapis/cloud/retail/logging;logging";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "ErrorLogProto";
27+
option java_package = "com.google.cloud.retail.logging";
28+
option objc_class_prefix = "RETAIL";
29+
option php_namespace = "Google\\Cloud\\Retail\\Logging";
30+
option ruby_package = "Google::Cloud::Retail::Logging";
31+
32+
// Describes a running service that sends errors.
33+
message ServiceContext {
34+
// An identifier of the service.
35+
// For example, "retail.googleapis.com".
36+
string service = 1;
37+
}
38+
39+
// HTTP request data that is related to a reported error.
40+
message HttpRequestContext {
41+
// The HTTP response status code for the request.
42+
int32 response_status_code = 1;
43+
}
44+
45+
// Indicates a location in the source code of the service for which
46+
// errors are reported.
47+
message SourceLocation {
48+
// Human-readable name of a function or method.
49+
// For example, "google.cloud.retail.v2.UserEventService.ImportUserEvents".
50+
string function_name = 1;
51+
}
52+
53+
// A description of the context in which an error occurred.
54+
message ErrorContext {
55+
// The HTTP request which was processed when the error was triggered.
56+
HttpRequestContext http_request = 1;
57+
58+
// The location in the source code where the decision was made to
59+
// report the error, usually the place where it was logged.
60+
SourceLocation report_location = 2;
61+
}
62+
63+
// The error payload that is populated on LRO import APIs. Including:
64+
// "google.cloud.retail.v2.ProductService.ImportProducts"
65+
// "google.cloud.retail.v2.EventService.ImportUserEvents"
66+
message ImportErrorContext {
67+
// The operation resource name of the LRO.
68+
string operation_name = 1;
69+
70+
// Cloud Storage file path of the import source.
71+
// Can be set for batch operation error.
72+
string gcs_path = 2;
73+
74+
// Line number of the content in file.
75+
// Should be empty for permission or batch operation error.
76+
string line_number = 3;
77+
78+
// Detailed content which caused the error.
79+
// Should be empty for permission or batch operation error.
80+
oneof line_content {
81+
// The detailed content which caused the error on importing a catalog item.
82+
string catalog_item = 4;
83+
84+
// The detailed content which caused the error on importing a product.
85+
string product = 5;
86+
87+
// The detailed content which caused the error on importing a user event.
88+
string user_event = 6;
89+
}
90+
}
91+
92+
// An error log which is reported to the Error Reporting system.
93+
// This proto a superset of
94+
// google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent.
95+
message ErrorLog {
96+
// The service context in which this error has occurred.
97+
ServiceContext service_context = 1;
98+
99+
// A description of the context in which the error occurred.
100+
ErrorContext context = 2;
101+
102+
// A message describing the error.
103+
string message = 3;
104+
105+
// The RPC status associated with the error log.
106+
google.rpc.Status status = 4;
107+
108+
// The API request payload, represented as a protocol buffer.
109+
//
110+
// Most API request types are supported. For example:
111+
//
112+
// "type.googleapis.com/google.cloud.retail.v2.ProductService.CreateProductRequest"
113+
// "type.googleapis.com/google.cloud.retail.v2.UserEventService.WriteUserEventRequest"
114+
google.protobuf.Struct request_payload = 5;
115+
116+
// The API response payload, represented as a protocol buffer.
117+
//
118+
// This is used to log some "soft errors", where the response is valid but we
119+
// consider there are some quality issues like unjoined events.
120+
//
121+
// The following API responses are supported and no PII is included:
122+
// "google.cloud.retail.v2.PredictionService.Predict"
123+
// "google.cloud.retail.v2.UserEventService.WriteUserEvent"
124+
// "google.cloud.retail.v2.UserEventService.CollectUserEvent"
125+
google.protobuf.Struct response_payload = 6;
126+
127+
// The error payload that is populated on LRO import APIs.
128+
ImportErrorContext import_payload = 7;
129+
}

google/cloud/retail/v2alpha/BUILD.bazel

Lines changed: 89 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -9,54 +9,29 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# This is an API workspace, having public visibility by default makes perfect sense.
13+
package(default_visibility = ["//visibility:public"])
14+
1215
##############################################################################
1316
# Common
1417
##############################################################################
1518
load("@rules_proto//proto:defs.bzl", "proto_library")
16-
load(
17-
"@com_google_googleapis_imports//:imports.bzl",
18-
"csharp_gapic_assembly_pkg",
19-
"csharp_gapic_library",
20-
"csharp_grpc_library",
21-
"csharp_proto_library",
22-
"go_gapic_assembly_pkg",
23-
"go_gapic_library",
24-
"go_proto_library",
25-
"go_test",
26-
"java_gapic_assembly_gradle_pkg",
27-
"java_gapic_library",
28-
"java_gapic_test",
29-
"java_grpc_library",
30-
"java_proto_library",
31-
"nodejs_gapic_assembly_pkg",
32-
"nodejs_gapic_library",
33-
"proto_library_with_info",
34-
"py_gapic_assembly_pkg",
35-
"py_gapic_library",
36-
"ruby_gapic_assembly_pkg",
37-
"ruby_cloud_gapic_library",
38-
"ruby_grpc_library",
39-
"ruby_proto_library",
40-
"php_gapic_assembly_pkg",
41-
"php_gapic_library",
42-
"php_grpc_library",
43-
"php_proto_library",
44-
)
45-
46-
# This is an API workspace, having public visibility by default makes perfect sense.
47-
package(default_visibility = ["//visibility:public"])
19+
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
4820

4921
proto_library(
5022
name = "retail_proto",
5123
srcs = [
5224
"catalog.proto",
5325
"catalog_service.proto",
5426
"common.proto",
27+
"completion_service.proto",
28+
"export_config.proto",
5529
"import_config.proto",
5630
"prediction_service.proto",
5731
"product.proto",
5832
"product_service.proto",
5933
"purge_config.proto",
34+
"search_service.proto",
6035
"user_event.proto",
6136
"user_event_service.proto",
6237
],
@@ -68,6 +43,7 @@ proto_library(
6843
"//google/api:resource_proto",
6944
"//google/longrunning:operations_proto",
7045
"//google/rpc:status_proto",
46+
"//google/type:date_proto",
7147
"@com_google_protobuf//:duration_proto",
7248
"@com_google_protobuf//:empty_proto",
7349
"@com_google_protobuf//:field_mask_proto",
@@ -85,6 +61,18 @@ proto_library_with_info(
8561
],
8662
)
8763

64+
##############################################################################
65+
# Java
66+
##############################################################################
67+
load(
68+
"@com_google_googleapis_imports//:imports.bzl",
69+
"java_gapic_assembly_gradle_pkg",
70+
"java_gapic_library",
71+
"java_gapic_test",
72+
"java_grpc_library",
73+
"java_proto_library",
74+
)
75+
8876
java_proto_library(
8977
name = "retail_java_proto",
9078
deps = [":retail_proto"],
@@ -113,8 +101,10 @@ java_gapic_test(
113101
name = "retail_java_gapic_test_suite",
114102
test_classes = [
115103
"com.google.cloud.retail.v2alpha.CatalogServiceClientTest",
104+
"com.google.cloud.retail.v2alpha.CompletionServiceClientTest",
116105
"com.google.cloud.retail.v2alpha.PredictionServiceClientTest",
117106
"com.google.cloud.retail.v2alpha.ProductServiceClientTest",
107+
"com.google.cloud.retail.v2alpha.SearchServiceClientTest",
118108
"com.google.cloud.retail.v2alpha.UserEventServiceClientTest",
119109
],
120110
runtime_deps = [":retail_java_gapic_test"],
@@ -131,6 +121,17 @@ java_gapic_assembly_gradle_pkg(
131121
],
132122
)
133123

124+
##############################################################################
125+
# Go
126+
##############################################################################
127+
load(
128+
"@com_google_googleapis_imports//:imports.bzl",
129+
"go_gapic_assembly_pkg",
130+
"go_gapic_library",
131+
"go_proto_library",
132+
"go_test",
133+
)
134+
134135
go_proto_library(
135136
name = "retail_go_proto",
136137
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@@ -141,6 +142,7 @@ go_proto_library(
141142
"//google/api:httpbody_go_proto",
142143
"//google/longrunning:longrunning_go_proto",
143144
"//google/rpc:status_go_proto",
145+
"//google/type:date_go_proto",
144146
],
145147
)
146148

@@ -149,6 +151,7 @@ go_gapic_library(
149151
srcs = [":retail_proto_with_info"],
150152
grpc_service_config = "retail_grpc_service_config.json",
151153
importpath = "cloud.google.com/go/retail/apiv2alpha;retail",
154+
metadata = True,
152155
service_yaml = "retail_v2alpha.yaml",
153156
deps = [
154157
":retail_go_proto",
@@ -173,11 +176,21 @@ go_gapic_assembly_pkg(
173176
name = "gapi-cloud-retail-v2alpha-go",
174177
deps = [
175178
":retail_go_gapic",
179+
":retail_go_gapic_srcjar-metadata.srcjar",
176180
":retail_go_gapic_srcjar-test.srcjar",
177181
":retail_go_proto",
178182
],
179183
)
180184

185+
##############################################################################
186+
# Python
187+
##############################################################################
188+
load(
189+
"@com_google_googleapis_imports//:imports.bzl",
190+
"py_gapic_assembly_pkg",
191+
"py_gapic_library",
192+
)
193+
181194
py_gapic_library(
182195
name = "retail_py_gapic",
183196
srcs = [":retail_proto"],
@@ -192,6 +205,17 @@ py_gapic_assembly_pkg(
192205
],
193206
)
194207

208+
##############################################################################
209+
# PHP
210+
##############################################################################
211+
load(
212+
"@com_google_googleapis_imports//:imports.bzl",
213+
"php_gapic_assembly_pkg",
214+
"php_gapic_library",
215+
"php_grpc_library",
216+
"php_proto_library",
217+
)
218+
195219
php_proto_library(
196220
name = "retail_php_proto",
197221
deps = [":retail_proto"],
@@ -224,6 +248,15 @@ php_gapic_assembly_pkg(
224248
],
225249
)
226250

251+
##############################################################################
252+
# Node.js
253+
##############################################################################
254+
load(
255+
"@com_google_googleapis_imports//:imports.bzl",
256+
"nodejs_gapic_assembly_pkg",
257+
"nodejs_gapic_library",
258+
)
259+
227260
nodejs_gapic_library(
228261
name = "retail_nodejs_gapic",
229262
package_name = "@google-cloud/retail",
@@ -243,6 +276,17 @@ nodejs_gapic_assembly_pkg(
243276
],
244277
)
245278

279+
##############################################################################
280+
# Ruby
281+
##############################################################################
282+
load(
283+
"@com_google_googleapis_imports//:imports.bzl",
284+
"ruby_cloud_gapic_library",
285+
"ruby_gapic_assembly_pkg",
286+
"ruby_grpc_library",
287+
"ruby_proto_library",
288+
)
289+
246290
ruby_proto_library(
247291
name = "retail_ruby_proto",
248292
deps = [":retail_proto"],
@@ -256,7 +300,7 @@ ruby_grpc_library(
256300

257301
ruby_cloud_gapic_library(
258302
name = "retail_ruby_gapic",
259-
srcs = [":retail_proto_with_info",],
303+
srcs = [":retail_proto_with_info"],
260304
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-retail-v2alpha"],
261305
grpc_service_config = "retail_grpc_service_config.json",
262306
deps = [
@@ -275,6 +319,17 @@ ruby_gapic_assembly_pkg(
275319
],
276320
)
277321

322+
##############################################################################
323+
# C#
324+
##############################################################################
325+
load(
326+
"@com_google_googleapis_imports//:imports.bzl",
327+
"csharp_gapic_assembly_pkg",
328+
"csharp_gapic_library",
329+
"csharp_grpc_library",
330+
"csharp_proto_library",
331+
)
332+
278333
csharp_proto_library(
279334
name = "retail_csharp_proto",
280335
deps = [":retail_proto"],

0 commit comments

Comments
 (0)