google-cloud-retail-v2 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +18 -6
  4. data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +1220 -0
  5. data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +704 -0
  6. data/lib/google/cloud/retail/v2/catalog_service/rest.rb +52 -0
  7. data/lib/google/cloud/retail/v2/catalog_service.rb +6 -0
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +18 -4
  9. data/lib/google/cloud/retail/v2/completion_service/operations.rb +12 -14
  10. data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +533 -0
  11. data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +828 -0
  12. data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +167 -0
  13. data/lib/google/cloud/retail/v2/completion_service/rest.rb +56 -0
  14. data/lib/google/cloud/retail/v2/completion_service.rb +6 -0
  15. data/lib/google/cloud/retail/v2/control_service/client.rb +18 -6
  16. data/lib/google/cloud/retail/v2/control_service/rest/client.rb +680 -0
  17. data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +345 -0
  18. data/lib/google/cloud/retail/v2/control_service/rest.rb +52 -0
  19. data/lib/google/cloud/retail/v2/control_service.rb +6 -0
  20. data/lib/google/cloud/retail/v2/prediction_service/client.rb +14 -0
  21. data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +486 -0
  22. data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +116 -0
  23. data/lib/google/cloud/retail/v2/prediction_service/rest.rb +52 -0
  24. data/lib/google/cloud/retail/v2/prediction_service.rb +6 -0
  25. data/lib/google/cloud/retail/v2/product_service/client.rb +42 -30
  26. data/lib/google/cloud/retail/v2/product_service/operations.rb +12 -14
  27. data/lib/google/cloud/retail/v2/product_service/rest/client.rb +1649 -0
  28. data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +828 -0
  29. data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +705 -0
  30. data/lib/google/cloud/retail/v2/product_service/rest.rb +54 -0
  31. data/lib/google/cloud/retail/v2/product_service.rb +6 -0
  32. data/lib/google/cloud/retail/v2/rest.rb +44 -0
  33. data/lib/google/cloud/retail/v2/search_service/client.rb +18 -6
  34. data/lib/google/cloud/retail/v2/search_service/rest/client.rb +598 -0
  35. data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +116 -0
  36. data/lib/google/cloud/retail/v2/search_service/rest.rb +55 -0
  37. data/lib/google/cloud/retail/v2/search_service.rb +6 -0
  38. data/lib/google/cloud/retail/v2/serving_config_service/client.rb +18 -6
  39. data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +825 -0
  40. data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +465 -0
  41. data/lib/google/cloud/retail/v2/serving_config_service/rest.rb +52 -0
  42. data/lib/google/cloud/retail/v2/serving_config_service.rb +6 -0
  43. data/lib/google/cloud/retail/v2/user_event_service/client.rb +26 -12
  44. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +12 -14
  45. data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +755 -0
  46. data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +828 -0
  47. data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +347 -0
  48. data/lib/google/cloud/retail/v2/user_event_service/rest.rb +53 -0
  49. data/lib/google/cloud/retail/v2/user_event_service.rb +6 -0
  50. data/lib/google/cloud/retail/v2/version.rb +1 -1
  51. data/lib/google/cloud/retail/v2.rb +5 -0
  52. metadata +58 -8
@@ -0,0 +1,54 @@
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/product_service/credentials"
26
+ require "google/cloud/retail/v2/product_service/paths"
27
+ require "google/cloud/retail/v2/product_service/rest/operations"
28
+ require "google/cloud/retail/v2/product_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Retail
33
+ module V2
34
+ ##
35
+ # Service for ingesting {::Google::Cloud::Retail::V2::Product Product} information
36
+ # of the customer's website.
37
+ #
38
+ # To load this service and instantiate a REST client:
39
+ #
40
+ # require "google/cloud/retail/v2/product_service/rest"
41
+ # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new
42
+ #
43
+ module ProductService
44
+ # Client for the REST transport
45
+ module Rest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
54
+ require "google/cloud/retail/v2/product_service/rest/helpers" if ::File.file? helper_path
@@ -26,6 +26,7 @@ require "google/cloud/retail/v2/product_service/credentials"
26
26
  require "google/cloud/retail/v2/product_service/paths"
27
27
  require "google/cloud/retail/v2/product_service/operations"
28
28
  require "google/cloud/retail/v2/product_service/client"
29
+ require "google/cloud/retail/v2/product_service/rest"
29
30
 
30
31
  module Google
31
32
  module Cloud
@@ -40,6 +41,11 @@ module Google
40
41
  # require "google/cloud/retail/v2/product_service"
41
42
  # client = ::Google::Cloud::Retail::V2::ProductService::Client.new
42
43
  #
44
+ # @example Load this service and instantiate a REST client
45
+ #
46
+ # require "google/cloud/retail/v2/product_service/rest"
47
+ # client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new
48
+ #
43
49
  module ProductService
44
50
  end
45
51
  end
@@ -0,0 +1,44 @@
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/catalog_service/rest"
20
+ require "google/cloud/retail/v2/completion_service/rest"
21
+ require "google/cloud/retail/v2/control_service/rest"
22
+ require "google/cloud/retail/v2/prediction_service/rest"
23
+ require "google/cloud/retail/v2/product_service/rest"
24
+ require "google/cloud/retail/v2/search_service/rest"
25
+ require "google/cloud/retail/v2/serving_config_service/rest"
26
+ require "google/cloud/retail/v2/user_event_service/rest"
27
+ require "google/cloud/retail/v2/version"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Retail
32
+ ##
33
+ # To load just the REST part of this package, including all its services, and instantiate a REST client:
34
+ #
35
+ # @example
36
+ #
37
+ # require "google/cloud/retail/v2/rest"
38
+ # client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new
39
+ #
40
+ module V2
41
+ end
42
+ end
43
+ end
44
+ end
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/retail/v2/search_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -141,6 +142,12 @@ module Google
141
142
  @quota_project_id = @config.quota_project
142
143
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
143
144
 
145
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
144
151
  @search_service_stub = ::Gapic::ServiceStub.new(
145
152
  ::Google::Cloud::Retail::V2::SearchService::Stub,
146
153
  credentials: credentials,
@@ -150,6 +157,13 @@ module Google
150
157
  )
151
158
  end
152
159
 
160
+ ##
161
+ # Get the associated client for mix-in of the Locations.
162
+ #
163
+ # @return [Google::Cloud::Location::Locations::Client]
164
+ #
165
+ attr_reader :location_client
166
+
153
167
  # Service calls
154
168
 
155
169
  ##
@@ -425,13 +439,11 @@ module Google
425
439
  # # Call the search method.
426
440
  # result = client.search request
427
441
  #
428
- # # The returned object is of type Gapic::PagedEnumerable. You can
429
- # # iterate over all elements by calling #each, and the enumerable
430
- # # will lazily make API calls to fetch subsequent pages. Other
431
- # # methods are also available for managing paging directly.
432
- # result.each do |response|
442
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
443
+ # # over elements, and API calls will be issued to fetch pages as needed.
444
+ # result.each do |item|
433
445
  # # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult.
434
- # p response
446
+ # p item
435
447
  # end
436
448
  #
437
449
  def search request, options = nil