google-cloud-retail-v2 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +2 -2
  4. data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +2 -2
  5. data/lib/google/cloud/retail/v2/common_pb.rb +6 -0
  6. data/lib/google/cloud/retail/v2/completion_service/client.rb +11 -4
  7. data/lib/google/cloud/retail/v2/completion_service/operations.rb +2 -2
  8. data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +11 -4
  9. data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +2 -2
  10. data/lib/google/cloud/retail/v2/completion_service/rest.rb +1 -1
  11. data/lib/google/cloud/retail/v2/completion_service.rb +1 -1
  12. data/lib/google/cloud/retail/v2/completion_service_pb.rb +1 -0
  13. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +1 -1
  14. data/lib/google/cloud/retail/v2/control_service/client.rb +2 -2
  15. data/lib/google/cloud/retail/v2/control_service/rest/client.rb +2 -2
  16. data/lib/google/cloud/retail/v2/model_pb.rb +70 -0
  17. data/lib/google/cloud/retail/v2/model_service/client.rb +1126 -0
  18. data/lib/google/cloud/retail/v2/model_service/credentials.rb +51 -0
  19. data/lib/google/cloud/retail/v2/model_service/operations.rb +768 -0
  20. data/lib/google/cloud/retail/v2/model_service/paths.rb +73 -0
  21. data/lib/google/cloud/retail/v2/model_service/rest/client.rb +904 -0
  22. data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +828 -0
  23. data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +525 -0
  24. data/lib/google/cloud/retail/v2/model_service/rest.rb +64 -0
  25. data/lib/google/cloud/retail/v2/model_service.rb +67 -0
  26. data/lib/google/cloud/retail/v2/model_service_pb.rb +80 -0
  27. data/lib/google/cloud/retail/v2/model_service_services_pb.rb +73 -0
  28. data/lib/google/cloud/retail/v2/prediction_service/client.rb +5 -2
  29. data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +5 -2
  30. data/lib/google/cloud/retail/v2/product_service/client.rb +18 -17
  31. data/lib/google/cloud/retail/v2/product_service/operations.rb +2 -2
  32. data/lib/google/cloud/retail/v2/product_service/rest/client.rb +18 -17
  33. data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +2 -2
  34. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +16 -15
  35. data/lib/google/cloud/retail/v2/rest.rb +1 -0
  36. data/lib/google/cloud/retail/v2/search_service/client.rb +11 -4
  37. data/lib/google/cloud/retail/v2/search_service/rest/client.rb +11 -4
  38. data/lib/google/cloud/retail/v2/search_service_pb.rb +14 -0
  39. data/lib/google/cloud/retail/v2/serving_config_service/client.rb +2 -2
  40. data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +2 -2
  41. data/lib/google/cloud/retail/v2/user_event_pb.rb +1 -0
  42. data/lib/google/cloud/retail/v2/user_event_service/client.rb +3 -3
  43. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +2 -2
  44. data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +3 -3
  45. data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +2 -2
  46. data/lib/google/cloud/retail/v2/version.rb +1 -1
  47. data/lib/google/cloud/retail/v2.rb +1 -0
  48. data/proto_docs/google/api/client.rb +57 -3
  49. data/proto_docs/google/cloud/retail/v2/catalog.rb +11 -6
  50. data/proto_docs/google/cloud/retail/v2/common.rb +15 -1
  51. data/proto_docs/google/cloud/retail/v2/completion_service.rb +10 -2
  52. data/proto_docs/google/cloud/retail/v2/import_config.rb +1 -1
  53. data/proto_docs/google/cloud/retail/v2/model.rb +228 -0
  54. data/proto_docs/google/cloud/retail/v2/model_service.rb +172 -0
  55. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +3 -0
  56. data/proto_docs/google/cloud/retail/v2/product.rb +2 -3
  57. data/proto_docs/google/cloud/retail/v2/search_service.rb +56 -2
  58. data/proto_docs/google/cloud/retail/v2/serving_config.rb +3 -3
  59. data/proto_docs/google/cloud/retail/v2/user_event.rb +7 -0
  60. data/proto_docs/google/cloud/retail/v2/user_event_service.rb +1 -1
  61. metadata +16 -2
@@ -0,0 +1,525 @@
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/retail/v2/model_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Retail
24
+ module V2
25
+ module ModelService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the ModelService 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 create_model REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest]
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::Longrunning::Operation]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Longrunning::Operation]
56
+ # A result object deserialized from the server's reply
57
+ def create_model 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_create_model_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::Longrunning::Operation.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 get_model REST call
83
+ #
84
+ # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest]
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::Cloud::Retail::V2::Model]
91
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
92
+ #
93
+ # @return [::Google::Cloud::Retail::V2::Model]
94
+ # A result object deserialized from the server's reply
95
+ def get_model 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_get_model_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::Cloud::Retail::V2::Model.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 pause_model REST call
121
+ #
122
+ # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest]
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::Retail::V2::Model]
129
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
130
+ #
131
+ # @return [::Google::Cloud::Retail::V2::Model]
132
+ # A result object deserialized from the server's reply
133
+ def pause_model 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_pause_model_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::Retail::V2::Model.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 resume_model REST call
159
+ #
160
+ # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest]
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::Cloud::Retail::V2::Model]
167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
168
+ #
169
+ # @return [::Google::Cloud::Retail::V2::Model]
170
+ # A result object deserialized from the server's reply
171
+ def resume_model 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_resume_model_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::Cloud::Retail::V2::Model.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 delete_model REST call
197
+ #
198
+ # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest]
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::Protobuf::Empty]
205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
206
+ #
207
+ # @return [::Google::Protobuf::Empty]
208
+ # A result object deserialized from the server's reply
209
+ def delete_model 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_delete_model_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::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
228
+
229
+ yield result, operation if block_given?
230
+ result
231
+ end
232
+
233
+ ##
234
+ # Baseline implementation for the list_models REST call
235
+ #
236
+ # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest]
237
+ # A request object representing the call parameters. Required.
238
+ # @param options [::Gapic::CallOptions]
239
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
240
+ #
241
+ # @yield [result, operation] Access the result along with the TransportOperation object
242
+ # @yieldparam result [::Google::Cloud::Retail::V2::ListModelsResponse]
243
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
244
+ #
245
+ # @return [::Google::Cloud::Retail::V2::ListModelsResponse]
246
+ # A result object deserialized from the server's reply
247
+ def list_models request_pb, options = nil
248
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
249
+
250
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_models_request request_pb
251
+ query_string_params = if query_string_params.any?
252
+ query_string_params.to_h { |p| p.split("=", 2) }
253
+ else
254
+ {}
255
+ end
256
+
257
+ response = @client_stub.make_http_request(
258
+ verb,
259
+ uri: uri,
260
+ body: body || "",
261
+ params: query_string_params,
262
+ options: options
263
+ )
264
+ operation = ::Gapic::Rest::TransportOperation.new response
265
+ result = ::Google::Cloud::Retail::V2::ListModelsResponse.decode_json response.body, ignore_unknown_fields: true
266
+
267
+ yield result, operation if block_given?
268
+ result
269
+ end
270
+
271
+ ##
272
+ # Baseline implementation for the update_model REST call
273
+ #
274
+ # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest]
275
+ # A request object representing the call parameters. Required.
276
+ # @param options [::Gapic::CallOptions]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @yield [result, operation] Access the result along with the TransportOperation object
280
+ # @yieldparam result [::Google::Cloud::Retail::V2::Model]
281
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
282
+ #
283
+ # @return [::Google::Cloud::Retail::V2::Model]
284
+ # A result object deserialized from the server's reply
285
+ def update_model request_pb, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
287
+
288
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_model_request request_pb
289
+ query_string_params = if query_string_params.any?
290
+ query_string_params.to_h { |p| p.split("=", 2) }
291
+ else
292
+ {}
293
+ end
294
+
295
+ response = @client_stub.make_http_request(
296
+ verb,
297
+ uri: uri,
298
+ body: body || "",
299
+ params: query_string_params,
300
+ options: options
301
+ )
302
+ operation = ::Gapic::Rest::TransportOperation.new response
303
+ result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true
304
+
305
+ yield result, operation if block_given?
306
+ result
307
+ end
308
+
309
+ ##
310
+ # Baseline implementation for the tune_model REST call
311
+ #
312
+ # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest]
313
+ # A request object representing the call parameters. Required.
314
+ # @param options [::Gapic::CallOptions]
315
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
316
+ #
317
+ # @yield [result, operation] Access the result along with the TransportOperation object
318
+ # @yieldparam result [::Google::Longrunning::Operation]
319
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
320
+ #
321
+ # @return [::Google::Longrunning::Operation]
322
+ # A result object deserialized from the server's reply
323
+ def tune_model request_pb, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
325
+
326
+ verb, uri, query_string_params, body = ServiceStub.transcode_tune_model_request request_pb
327
+ query_string_params = if query_string_params.any?
328
+ query_string_params.to_h { |p| p.split("=", 2) }
329
+ else
330
+ {}
331
+ end
332
+
333
+ response = @client_stub.make_http_request(
334
+ verb,
335
+ uri: uri,
336
+ body: body || "",
337
+ params: query_string_params,
338
+ options: options
339
+ )
340
+ operation = ::Gapic::Rest::TransportOperation.new response
341
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
342
+
343
+ yield result, operation if block_given?
344
+ result
345
+ end
346
+
347
+ ##
348
+ # @private
349
+ #
350
+ # GRPC transcoding helper method for the create_model REST call
351
+ #
352
+ # @param request_pb [::Google::Cloud::Retail::V2::CreateModelRequest]
353
+ # A request object representing the call parameters. Required.
354
+ # @return [Array(String, [String, nil], Hash{String => String})]
355
+ # Uri, Body, Query string parameters
356
+ def self.transcode_create_model_request request_pb
357
+ transcoder = Gapic::Rest::GrpcTranscoder.new
358
+ .with_bindings(
359
+ uri_method: :post,
360
+ uri_template: "/v2/{parent}/models",
361
+ body: "model",
362
+ matches: [
363
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false]
364
+ ]
365
+ )
366
+ transcoder.transcode request_pb
367
+ end
368
+
369
+ ##
370
+ # @private
371
+ #
372
+ # GRPC transcoding helper method for the get_model REST call
373
+ #
374
+ # @param request_pb [::Google::Cloud::Retail::V2::GetModelRequest]
375
+ # A request object representing the call parameters. Required.
376
+ # @return [Array(String, [String, nil], Hash{String => String})]
377
+ # Uri, Body, Query string parameters
378
+ def self.transcode_get_model_request request_pb
379
+ transcoder = Gapic::Rest::GrpcTranscoder.new
380
+ .with_bindings(
381
+ uri_method: :get,
382
+ uri_template: "/v2/{name}",
383
+ matches: [
384
+ ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
385
+ ]
386
+ )
387
+ transcoder.transcode request_pb
388
+ end
389
+
390
+ ##
391
+ # @private
392
+ #
393
+ # GRPC transcoding helper method for the pause_model REST call
394
+ #
395
+ # @param request_pb [::Google::Cloud::Retail::V2::PauseModelRequest]
396
+ # A request object representing the call parameters. Required.
397
+ # @return [Array(String, [String, nil], Hash{String => String})]
398
+ # Uri, Body, Query string parameters
399
+ def self.transcode_pause_model_request request_pb
400
+ transcoder = Gapic::Rest::GrpcTranscoder.new
401
+ .with_bindings(
402
+ uri_method: :post,
403
+ uri_template: "/v2/{name}:pause",
404
+ body: "*",
405
+ matches: [
406
+ ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
407
+ ]
408
+ )
409
+ transcoder.transcode request_pb
410
+ end
411
+
412
+ ##
413
+ # @private
414
+ #
415
+ # GRPC transcoding helper method for the resume_model REST call
416
+ #
417
+ # @param request_pb [::Google::Cloud::Retail::V2::ResumeModelRequest]
418
+ # A request object representing the call parameters. Required.
419
+ # @return [Array(String, [String, nil], Hash{String => String})]
420
+ # Uri, Body, Query string parameters
421
+ def self.transcode_resume_model_request request_pb
422
+ transcoder = Gapic::Rest::GrpcTranscoder.new
423
+ .with_bindings(
424
+ uri_method: :post,
425
+ uri_template: "/v2/{name}:resume",
426
+ body: "*",
427
+ matches: [
428
+ ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
429
+ ]
430
+ )
431
+ transcoder.transcode request_pb
432
+ end
433
+
434
+ ##
435
+ # @private
436
+ #
437
+ # GRPC transcoding helper method for the delete_model REST call
438
+ #
439
+ # @param request_pb [::Google::Cloud::Retail::V2::DeleteModelRequest]
440
+ # A request object representing the call parameters. Required.
441
+ # @return [Array(String, [String, nil], Hash{String => String})]
442
+ # Uri, Body, Query string parameters
443
+ def self.transcode_delete_model_request request_pb
444
+ transcoder = Gapic::Rest::GrpcTranscoder.new
445
+ .with_bindings(
446
+ uri_method: :delete,
447
+ uri_template: "/v2/{name}",
448
+ matches: [
449
+ ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
450
+ ]
451
+ )
452
+ transcoder.transcode request_pb
453
+ end
454
+
455
+ ##
456
+ # @private
457
+ #
458
+ # GRPC transcoding helper method for the list_models REST call
459
+ #
460
+ # @param request_pb [::Google::Cloud::Retail::V2::ListModelsRequest]
461
+ # A request object representing the call parameters. Required.
462
+ # @return [Array(String, [String, nil], Hash{String => String})]
463
+ # Uri, Body, Query string parameters
464
+ def self.transcode_list_models_request request_pb
465
+ transcoder = Gapic::Rest::GrpcTranscoder.new
466
+ .with_bindings(
467
+ uri_method: :get,
468
+ uri_template: "/v2/{parent}/models",
469
+ matches: [
470
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/?$}, false]
471
+ ]
472
+ )
473
+ transcoder.transcode request_pb
474
+ end
475
+
476
+ ##
477
+ # @private
478
+ #
479
+ # GRPC transcoding helper method for the update_model REST call
480
+ #
481
+ # @param request_pb [::Google::Cloud::Retail::V2::UpdateModelRequest]
482
+ # A request object representing the call parameters. Required.
483
+ # @return [Array(String, [String, nil], Hash{String => String})]
484
+ # Uri, Body, Query string parameters
485
+ def self.transcode_update_model_request request_pb
486
+ transcoder = Gapic::Rest::GrpcTranscoder.new
487
+ .with_bindings(
488
+ uri_method: :patch,
489
+ uri_template: "/v2/{model.name}",
490
+ body: "model",
491
+ matches: [
492
+ ["model.name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
493
+ ]
494
+ )
495
+ transcoder.transcode request_pb
496
+ end
497
+
498
+ ##
499
+ # @private
500
+ #
501
+ # GRPC transcoding helper method for the tune_model REST call
502
+ #
503
+ # @param request_pb [::Google::Cloud::Retail::V2::TuneModelRequest]
504
+ # A request object representing the call parameters. Required.
505
+ # @return [Array(String, [String, nil], Hash{String => String})]
506
+ # Uri, Body, Query string parameters
507
+ def self.transcode_tune_model_request request_pb
508
+ transcoder = Gapic::Rest::GrpcTranscoder.new
509
+ .with_bindings(
510
+ uri_method: :post,
511
+ uri_template: "/v2/{name}:tune",
512
+ body: "*",
513
+ matches: [
514
+ ["name", %r{^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/models/[^/]+/?$}, false]
515
+ ]
516
+ )
517
+ transcoder.transcode request_pb
518
+ end
519
+ end
520
+ end
521
+ end
522
+ end
523
+ end
524
+ end
525
+ end
@@ -0,0 +1,64 @@
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/retail/v2/version"
24
+
25
+ require "google/cloud/retail/v2/model_service/credentials"
26
+ require "google/cloud/retail/v2/model_service/paths"
27
+ require "google/cloud/retail/v2/model_service/rest/operations"
28
+ require "google/cloud/retail/v2/model_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Retail
33
+ module V2
34
+ ##
35
+ # Service for performing CRUD operations on models.
36
+ # Recommendation models contain all the metadata necessary to generate a set of
37
+ # models for the `Predict()` API. A model is queried
38
+ # indirectly via a ServingConfig, which associates a model with a
39
+ # given Placement (e.g. Frequently Bought Together on Home Page).
40
+ #
41
+ # This service allows you to do the following:
42
+ #
43
+ # * Initiate training of a model.
44
+ # * Pause training of an existing model.
45
+ # * List all the available models along with their metadata.
46
+ # * Control their tuning schedule.
47
+ #
48
+ # To load this service and instantiate a REST client:
49
+ #
50
+ # require "google/cloud/retail/v2/model_service/rest"
51
+ # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new
52
+ #
53
+ module ModelService
54
+ # Client for the REST transport
55
+ module Rest
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
64
+ require "google/cloud/retail/v2/model_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,67 @@
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/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/retail/v2/version"
24
+
25
+ require "google/cloud/retail/v2/model_service/credentials"
26
+ require "google/cloud/retail/v2/model_service/paths"
27
+ require "google/cloud/retail/v2/model_service/operations"
28
+ require "google/cloud/retail/v2/model_service/client"
29
+ require "google/cloud/retail/v2/model_service/rest"
30
+
31
+ module Google
32
+ module Cloud
33
+ module Retail
34
+ module V2
35
+ ##
36
+ # Service for performing CRUD operations on models.
37
+ # Recommendation models contain all the metadata necessary to generate a set of
38
+ # models for the `Predict()` API. A model is queried
39
+ # indirectly via a ServingConfig, which associates a model with a
40
+ # given Placement (e.g. Frequently Bought Together on Home Page).
41
+ #
42
+ # This service allows you to do the following:
43
+ #
44
+ # * Initiate training of a model.
45
+ # * Pause training of an existing model.
46
+ # * List all the available models along with their metadata.
47
+ # * Control their tuning schedule.
48
+ #
49
+ # @example Load this service and instantiate a gRPC client
50
+ #
51
+ # require "google/cloud/retail/v2/model_service"
52
+ # client = ::Google::Cloud::Retail::V2::ModelService::Client.new
53
+ #
54
+ # @example Load this service and instantiate a REST client
55
+ #
56
+ # require "google/cloud/retail/v2/model_service/rest"
57
+ # client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new
58
+ #
59
+ module ModelService
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+
66
+ helper_path = ::File.join __dir__, "model_service", "helpers.rb"
67
+ require "google/cloud/retail/v2/model_service/helpers" if ::File.file? helper_path