google-cloud-recommendation_engine-v1beta1 0.4.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +10 -12
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +14 -16
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/client.rb +769 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/operations.rb +807 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb +405 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest.rb +53 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service.rb +7 -1
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +6 -8
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/client.rb +512 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb +226 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest.rb +56 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry.rb +7 -1
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +6 -8
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/client.rb +440 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb +108 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest.rb +52 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service.rb +7 -1
- data/lib/google/cloud/recommendation_engine/v1beta1/rest.rb +40 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +14 -16
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +14 -16
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client.rb +765 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations.rb +807 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb +346 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest.rb +53 -0
- data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service.rb +7 -1
- data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
- data/lib/google/cloud/recommendation_engine/v1beta1.rb +7 -2
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +25 -49
- data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +26 -26
- data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +24 -11
- data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +28 -55
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +24 -20
- data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +26 -23
- data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +25 -2
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +27 -55
- data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +26 -34
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/struct.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +25 -8
@@ -0,0 +1,346 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/recommendationengine/v1beta1/user_event_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module RecommendationEngine
|
24
|
+
module V1beta1
|
25
|
+
module UserEventService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the UserEventService service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the write_user_event REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::UserEvent]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def write_user_event request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Baseline implementation for the collect_user_event REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest]
|
85
|
+
# A request object representing the call parameters. Required.
|
86
|
+
# @param options [::Gapic::CallOptions]
|
87
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
#
|
89
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
90
|
+
# @yieldparam result [::Google::Api::HttpBody]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Api::HttpBody]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def collect_user_event request_pb, options = nil
|
96
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
97
|
+
|
98
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_request request_pb
|
99
|
+
query_string_params = if query_string_params.any?
|
100
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
101
|
+
else
|
102
|
+
{}
|
103
|
+
end
|
104
|
+
|
105
|
+
response = @client_stub.make_http_request(
|
106
|
+
verb,
|
107
|
+
uri: uri,
|
108
|
+
body: body || "",
|
109
|
+
params: query_string_params,
|
110
|
+
options: options
|
111
|
+
)
|
112
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
113
|
+
result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Baseline implementation for the list_user_events REST call
|
121
|
+
#
|
122
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest]
|
123
|
+
# A request object representing the call parameters. Required.
|
124
|
+
# @param options [::Gapic::CallOptions]
|
125
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
126
|
+
#
|
127
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
128
|
+
# @yieldparam result [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse]
|
129
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
130
|
+
#
|
131
|
+
# @return [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse]
|
132
|
+
# A result object deserialized from the server's reply
|
133
|
+
def list_user_events request_pb, options = nil
|
134
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
135
|
+
|
136
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_user_events_request request_pb
|
137
|
+
query_string_params = if query_string_params.any?
|
138
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
139
|
+
else
|
140
|
+
{}
|
141
|
+
end
|
142
|
+
|
143
|
+
response = @client_stub.make_http_request(
|
144
|
+
verb,
|
145
|
+
uri: uri,
|
146
|
+
body: body || "",
|
147
|
+
params: query_string_params,
|
148
|
+
options: options
|
149
|
+
)
|
150
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
151
|
+
result = ::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsResponse.decode_json response.body, ignore_unknown_fields: true
|
152
|
+
|
153
|
+
yield result, operation if block_given?
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Baseline implementation for the purge_user_events REST call
|
159
|
+
#
|
160
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest]
|
161
|
+
# A request object representing the call parameters. Required.
|
162
|
+
# @param options [::Gapic::CallOptions]
|
163
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
164
|
+
#
|
165
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
166
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
167
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
168
|
+
#
|
169
|
+
# @return [::Google::Longrunning::Operation]
|
170
|
+
# A result object deserialized from the server's reply
|
171
|
+
def purge_user_events request_pb, options = nil
|
172
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
173
|
+
|
174
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_purge_user_events_request request_pb
|
175
|
+
query_string_params = if query_string_params.any?
|
176
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
177
|
+
else
|
178
|
+
{}
|
179
|
+
end
|
180
|
+
|
181
|
+
response = @client_stub.make_http_request(
|
182
|
+
verb,
|
183
|
+
uri: uri,
|
184
|
+
body: body || "",
|
185
|
+
params: query_string_params,
|
186
|
+
options: options
|
187
|
+
)
|
188
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
189
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
190
|
+
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# Baseline implementation for the import_user_events REST call
|
197
|
+
#
|
198
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest]
|
199
|
+
# A request object representing the call parameters. Required.
|
200
|
+
# @param options [::Gapic::CallOptions]
|
201
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
202
|
+
#
|
203
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
204
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
205
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
206
|
+
#
|
207
|
+
# @return [::Google::Longrunning::Operation]
|
208
|
+
# A result object deserialized from the server's reply
|
209
|
+
def import_user_events request_pb, options = nil
|
210
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
211
|
+
|
212
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_request request_pb
|
213
|
+
query_string_params = if query_string_params.any?
|
214
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
215
|
+
else
|
216
|
+
{}
|
217
|
+
end
|
218
|
+
|
219
|
+
response = @client_stub.make_http_request(
|
220
|
+
verb,
|
221
|
+
uri: uri,
|
222
|
+
body: body || "",
|
223
|
+
params: query_string_params,
|
224
|
+
options: options
|
225
|
+
)
|
226
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
227
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
228
|
+
|
229
|
+
yield result, operation if block_given?
|
230
|
+
result
|
231
|
+
end
|
232
|
+
|
233
|
+
##
|
234
|
+
# @private
|
235
|
+
#
|
236
|
+
# GRPC transcoding helper method for the write_user_event REST call
|
237
|
+
#
|
238
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest]
|
239
|
+
# A request object representing the call parameters. Required.
|
240
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
241
|
+
# Uri, Body, Query string parameters
|
242
|
+
def self.transcode_write_user_event_request request_pb
|
243
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
244
|
+
.with_bindings(
|
245
|
+
uri_method: :post,
|
246
|
+
uri_template: "/v1beta1/{parent}/userEvents:write",
|
247
|
+
body: "user_event",
|
248
|
+
matches: [
|
249
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false]
|
250
|
+
]
|
251
|
+
)
|
252
|
+
transcoder.transcode request_pb
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# @private
|
257
|
+
#
|
258
|
+
# GRPC transcoding helper method for the collect_user_event REST call
|
259
|
+
#
|
260
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest]
|
261
|
+
# A request object representing the call parameters. Required.
|
262
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
263
|
+
# Uri, Body, Query string parameters
|
264
|
+
def self.transcode_collect_user_event_request request_pb
|
265
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
266
|
+
.with_bindings(
|
267
|
+
uri_method: :get,
|
268
|
+
uri_template: "/v1beta1/{parent}/userEvents:collect",
|
269
|
+
matches: [
|
270
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false]
|
271
|
+
]
|
272
|
+
)
|
273
|
+
transcoder.transcode request_pb
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# @private
|
278
|
+
#
|
279
|
+
# GRPC transcoding helper method for the list_user_events REST call
|
280
|
+
#
|
281
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest]
|
282
|
+
# A request object representing the call parameters. Required.
|
283
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
284
|
+
# Uri, Body, Query string parameters
|
285
|
+
def self.transcode_list_user_events_request request_pb
|
286
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
287
|
+
.with_bindings(
|
288
|
+
uri_method: :get,
|
289
|
+
uri_template: "/v1beta1/{parent}/userEvents",
|
290
|
+
matches: [
|
291
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false]
|
292
|
+
]
|
293
|
+
)
|
294
|
+
transcoder.transcode request_pb
|
295
|
+
end
|
296
|
+
|
297
|
+
##
|
298
|
+
# @private
|
299
|
+
#
|
300
|
+
# GRPC transcoding helper method for the purge_user_events REST call
|
301
|
+
#
|
302
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest]
|
303
|
+
# A request object representing the call parameters. Required.
|
304
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
305
|
+
# Uri, Body, Query string parameters
|
306
|
+
def self.transcode_purge_user_events_request request_pb
|
307
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
308
|
+
.with_bindings(
|
309
|
+
uri_method: :post,
|
310
|
+
uri_template: "/v1beta1/{parent}/userEvents:purge",
|
311
|
+
body: "*",
|
312
|
+
matches: [
|
313
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false]
|
314
|
+
]
|
315
|
+
)
|
316
|
+
transcoder.transcode request_pb
|
317
|
+
end
|
318
|
+
|
319
|
+
##
|
320
|
+
# @private
|
321
|
+
#
|
322
|
+
# GRPC transcoding helper method for the import_user_events REST call
|
323
|
+
#
|
324
|
+
# @param request_pb [::Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest]
|
325
|
+
# A request object representing the call parameters. Required.
|
326
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
327
|
+
# Uri, Body, Query string parameters
|
328
|
+
def self.transcode_import_user_events_request request_pb
|
329
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
330
|
+
.with_bindings(
|
331
|
+
uri_method: :post,
|
332
|
+
uri_template: "/v1beta1/{parent}/userEvents:import",
|
333
|
+
body: "*",
|
334
|
+
matches: [
|
335
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/eventStores/[^/]+/?$}, false]
|
336
|
+
]
|
337
|
+
)
|
338
|
+
transcoder.transcode request_pb
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/recommendation_engine/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentials"
|
26
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths"
|
27
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/operations"
|
28
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module RecommendationEngine
|
33
|
+
module V1beta1
|
34
|
+
##
|
35
|
+
# Service for ingesting end user actions on the customer website.
|
36
|
+
#
|
37
|
+
# To load this service and instantiate a REST client:
|
38
|
+
#
|
39
|
+
# require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest"
|
40
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new
|
41
|
+
#
|
42
|
+
module UserEventService
|
43
|
+
# Client for the REST transport
|
44
|
+
module Rest
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
53
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest/helpers" if ::File.file? helper_path
|
@@ -26,6 +26,7 @@ require "google/cloud/recommendation_engine/v1beta1/user_event_service/credentia
|
|
26
26
|
require "google/cloud/recommendation_engine/v1beta1/user_event_service/paths"
|
27
27
|
require "google/cloud/recommendation_engine/v1beta1/user_event_service/operations"
|
28
28
|
require "google/cloud/recommendation_engine/v1beta1/user_event_service/client"
|
29
|
+
require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest"
|
29
30
|
|
30
31
|
module Google
|
31
32
|
module Cloud
|
@@ -34,11 +35,16 @@ module Google
|
|
34
35
|
##
|
35
36
|
# Service for ingesting end user actions on the customer website.
|
36
37
|
#
|
37
|
-
#
|
38
|
+
# @example Load this service and instantiate a gRPC client
|
38
39
|
#
|
39
40
|
# require "google/cloud/recommendation_engine/v1beta1/user_event_service"
|
40
41
|
# client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new
|
41
42
|
#
|
43
|
+
# @example Load this service and instantiate a REST client
|
44
|
+
#
|
45
|
+
# require "google/cloud/recommendation_engine/v1beta1/user_event_service/rest"
|
46
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new
|
47
|
+
#
|
42
48
|
module UserEventService
|
43
49
|
end
|
44
50
|
end
|
@@ -26,13 +26,18 @@ module Google
|
|
26
26
|
module Cloud
|
27
27
|
module RecommendationEngine
|
28
28
|
##
|
29
|
-
#
|
29
|
+
# API client module.
|
30
30
|
#
|
31
|
-
# @example
|
31
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
32
32
|
#
|
33
33
|
# require "google/cloud/recommendation_engine/v1beta1"
|
34
34
|
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
|
35
35
|
#
|
36
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
37
|
+
#
|
38
|
+
# require "google/cloud/recommendation_engine/v1beta1"
|
39
|
+
# client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new
|
40
|
+
#
|
36
41
|
module V1beta1
|
37
42
|
end
|
38
43
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/recommendationengine/v1beta1/catalog.proto
|
3
4
|
|
@@ -6,57 +7,32 @@ require 'google/protobuf'
|
|
6
7
|
require 'google/api/field_behavior_pb'
|
7
8
|
require 'google/cloud/recommendationengine/v1beta1/common_pb'
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
optional :available_quantity, :int64, 6
|
32
|
-
optional :canonical_product_uri, :string, 7
|
33
|
-
repeated :images, :message, 8, "google.cloud.recommendationengine.v1beta1.Image"
|
34
|
-
oneof :price do
|
35
|
-
optional :exact_price, :message, 1, "google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice"
|
36
|
-
optional :price_range, :message, 2, "google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
add_message "google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice" do
|
40
|
-
optional :display_price, :float, 1
|
41
|
-
optional :original_price, :float, 2
|
42
|
-
end
|
43
|
-
add_message "google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange" do
|
44
|
-
optional :min, :float, 1
|
45
|
-
optional :max, :float, 2
|
46
|
-
end
|
47
|
-
add_enum "google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState" do
|
48
|
-
value :STOCK_STATE_UNSPECIFIED, 0
|
49
|
-
value :IN_STOCK, 0
|
50
|
-
value :OUT_OF_STOCK, 1
|
51
|
-
value :PREORDER, 2
|
52
|
-
value :BACKORDER, 3
|
53
|
-
end
|
54
|
-
add_message "google.cloud.recommendationengine.v1beta1.Image" do
|
55
|
-
optional :uri, :string, 1
|
56
|
-
optional :height, :int32, 2
|
57
|
-
optional :width, :int32, 3
|
10
|
+
|
11
|
+
descriptor_data = "\n7google/cloud/recommendationengine/v1beta1/catalog.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x36google/cloud/recommendationengine/v1beta1/common.proto\"\xfe\x03\n\x0b\x43\x61talogItem\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12k\n\x14\x63\x61tegory_hierarchies\x18\x02 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12S\n\x0fitem_attributes\x18\x05 \x01(\x0b\x32\x35.google.cloud.recommendationengine.v1beta1.FeatureMapB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\ritem_group_id\x18\t \x01(\tB\x03\xe0\x41\x01\x12^\n\x10product_metadata\x18\n \x01(\x0b\x32=.google.cloud.recommendationengine.v1beta1.ProductCatalogItemB\x03\xe0\x41\x01H\x00\x1a,\n\x11\x43\x61tegoryHierarchy\x12\x17\n\ncategories\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\x15\n\x13recommendation_type\"\xe6\x06\n\x12ProductCatalogItem\x12\x64\n\x0b\x65xact_price\x18\x01 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPriceB\x03\xe0\x41\x01H\x00\x12\x64\n\x0bprice_range\x18\x02 \x01(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRangeB\x03\xe0\x41\x01H\x00\x12\\\n\x05\x63osts\x18\x03 \x03(\x0b\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.CostsEntryB\x03\xe0\x41\x01\x12\x1a\n\rcurrency_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x62\n\x0bstock_state\x18\x05 \x01(\x0e\x32H.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockStateB\x03\xe0\x41\x01\x12\x1f\n\x12\x61vailable_quantity\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12\"\n\x15\x63\x61nonical_product_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x06images\x18\x08 \x03(\x0b\x32\x30.google.cloud.recommendationengine.v1beta1.ImageB\x03\xe0\x41\x01\x1a\x45\n\nExactPrice\x12\x1a\n\rdisplay_price\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01\x12\x1b\n\x0eoriginal_price\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x1a\x30\n\nPriceRange\x12\x10\n\x03min\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02\x12\x10\n\x03max\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x1a,\n\nCostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\"j\n\nStockState\x12\x1b\n\x17STOCK_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08IN_STOCK\x10\x00\x12\x10\n\x0cOUT_OF_STOCK\x10\x01\x12\x0c\n\x08PREORDER\x10\x02\x12\r\n\tBACKORDER\x10\x03\x1a\x02\x10\x01\x42\x07\n\x05price\"B\n\x05Image\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06height\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05width\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x42\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::V1beta1b\x06proto3"
|
12
|
+
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
|
15
|
+
begin
|
16
|
+
pool.add_serialized_file(descriptor_data)
|
17
|
+
rescue TypeError => e
|
18
|
+
# Compatibility code: will be removed in the next major version.
|
19
|
+
require 'google/protobuf/descriptor_pb'
|
20
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
21
|
+
parsed.clear_dependency
|
22
|
+
serialized = parsed.class.encode(parsed)
|
23
|
+
file = pool.add_serialized_file(serialized)
|
24
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
25
|
+
imports = [
|
26
|
+
["google.cloud.recommendationengine.v1beta1.FeatureMap", "google/cloud/recommendationengine/v1beta1/common.proto"],
|
27
|
+
]
|
28
|
+
imports.each do |type_name, expected_filename|
|
29
|
+
import_file = pool.lookup(type_name).file_descriptor
|
30
|
+
if import_file.name != expected_filename
|
31
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
58
32
|
end
|
59
33
|
end
|
34
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
35
|
+
warn "This will become an error in the next major version."
|
60
36
|
end
|
61
37
|
|
62
38
|
module Google
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/cloud/recommendationengine/v1beta1/catalog_service.proto
|
3
4
|
|
@@ -14,34 +15,33 @@ require 'google/longrunning/operations_pb'
|
|
14
15
|
require 'google/protobuf/empty_pb'
|
15
16
|
require 'google/protobuf/field_mask_pb'
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
add_message "google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest" do
|
42
|
-
optional :name, :string, 1
|
18
|
+
|
19
|
+
descriptor_data = "\n?google/cloud/recommendationengine/v1beta1/catalog_service.proto\x12)google.cloud.recommendationengine.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/recommendationengine/v1beta1/catalog.proto\x1a\x36google/cloud/recommendationengine/v1beta1/import.proto\x1aNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb2\x01\n\x18\x43reateCatalogItemRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\"b\n\x15GetCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\"\xa4\x01\n\x17ListCatalogItemsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+recommendationengine.googleapis.com/Catalog\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x18ListCatalogItemsResponse\x12M\n\rcatalog_items\x18\x01 \x03(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe9\x01\n\x18UpdateCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath\x12Q\n\x0c\x63\x61talog_item\x18\x02 \x01(\x0b\x32\x36.google.cloud.recommendationengine.v1beta1.CatalogItemB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"e\n\x18\x44\x65leteCatalogItemRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3recommendationengine.googleapis.com/CatalogItemPath2\x96\r\n\x0e\x43\x61talogService\x12\xfe\x01\n\x11\x43reateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"l\x82\xd3\xe4\x93\x02P\"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:\x0c\x63\x61talog_item\xda\x41\x13parent,catalog_item\x12\xdc\x01\n\x0eGetCatalogItem\x12@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"P\x82\xd3\xe4\x93\x02\x43\x12\x41/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\xda\x41\x04name\x12\xf5\x01\n\x10ListCatalogItems\x12\x42.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest\x1a\x43.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse\"X\x82\xd3\xe4\x93\x02\x42\x12@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems\xda\x41\rparent,filter\x12\x89\x02\n\x11UpdateCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest\x1a\x36.google.cloud.recommendationengine.v1beta1.CatalogItem\"w\x82\xd3\xe4\x93\x02Q2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}:\x0c\x63\x61talog_item\xda\x41\x1dname,catalog_item,update_mask\x12\xc2\x01\n\x11\x44\x65leteCatalogItem\x12\x43.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02\x43*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}\xda\x41\x04name\x12\x81\x03\n\x12ImportCatalogItems\x12\x44.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest\x1a\x1d.google.longrunning.Operation\"\x85\x02\x82\xd3\xe4\x93\x02L\"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:\x01*\xca\x41\x80\x01\nDgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse\x12\x38google.cloud.recommendationengine.v1beta1.ImportMetadata\xda\x41,parent,request_id,input_config,errors_config\x1aW\xca\x41#recommendationengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x02\n-com.google.cloud.recommendationengine.v1beta1P\x01Zacloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb\xa2\x02\x05RECAI\xaa\x02)Google.Cloud.RecommendationEngine.V1Beta1\xca\x02)Google\\Cloud\\RecommendationEngine\\V1beta1\xea\x02,Google::Cloud::RecommendationEngine::V1beta1b\x06proto3"
|
20
|
+
|
21
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
22
|
+
|
23
|
+
begin
|
24
|
+
pool.add_serialized_file(descriptor_data)
|
25
|
+
rescue TypeError => e
|
26
|
+
# Compatibility code: will be removed in the next major version.
|
27
|
+
require 'google/protobuf/descriptor_pb'
|
28
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
29
|
+
parsed.clear_dependency
|
30
|
+
serialized = parsed.class.encode(parsed)
|
31
|
+
file = pool.add_serialized_file(serialized)
|
32
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
33
|
+
imports = [
|
34
|
+
["google.cloud.recommendationengine.v1beta1.CatalogItem", "google/cloud/recommendationengine/v1beta1/catalog.proto"],
|
35
|
+
["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
|
36
|
+
]
|
37
|
+
imports.each do |type_name, expected_filename|
|
38
|
+
import_file = pool.lookup(type_name).file_descriptor
|
39
|
+
if import_file.name != expected_filename
|
40
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
43
41
|
end
|
44
42
|
end
|
43
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
44
|
+
warn "This will become an error in the next major version."
|
45
45
|
end
|
46
46
|
|
47
47
|
module Google
|