google-cloud-retail-v2 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/cloud/retail/v2/catalog_pb.rb +14 -0
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +19 -7
- data/lib/google/cloud/retail/v2/catalog_service.rb +1 -1
- data/lib/google/cloud/retail/v2/completion_service/client.rb +25 -9
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +12 -14
- data/lib/google/cloud/retail/v2/completion_service.rb +2 -2
- data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +3 -3
- data/lib/google/cloud/retail/v2/control_service/client.rb +18 -6
- data/lib/google/cloud/retail/v2/control_service.rb +1 -1
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +21 -8
- data/lib/google/cloud/retail/v2/prediction_service.rb +1 -1
- data/lib/google/cloud/retail/v2/prediction_service_pb.rb +1 -0
- data/lib/google/cloud/retail/v2/product_service/client.rb +90 -68
- data/lib/google/cloud/retail/v2/product_service/operations.rb +12 -14
- data/lib/google/cloud/retail/v2/product_service.rb +1 -1
- data/lib/google/cloud/retail/v2/product_service_services_pb.rb +48 -38
- data/lib/google/cloud/retail/v2/search_service/client.rb +22 -10
- data/lib/google/cloud/retail/v2/search_service.rb +2 -2
- data/lib/google/cloud/retail/v2/search_service_services_pb.rb +2 -2
- data/lib/google/cloud/retail/v2/serving_config_pb.rb +7 -0
- data/lib/google/cloud/retail/v2/serving_config_service/client.rb +23 -11
- data/lib/google/cloud/retail/v2/serving_config_service.rb +1 -1
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +51 -24
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +12 -14
- data/lib/google/cloud/retail/v2/user_event_service.rb +1 -1
- data/lib/google/cloud/retail/v2/user_event_service_pb.rb +6 -0
- data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +8 -8
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/lib/google/cloud/retail/v2.rb +2 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/retail/v2/catalog.rb +51 -13
- data/proto_docs/google/cloud/retail/v2/catalog_service.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/common.rb +5 -3
- data/proto_docs/google/cloud/retail/v2/completion_service.rb +4 -2
- data/proto_docs/google/cloud/retail/v2/control.rb +2 -3
- data/proto_docs/google/cloud/retail/v2/prediction_service.rb +7 -8
- data/proto_docs/google/cloud/retail/v2/product.rb +27 -5
- data/proto_docs/google/cloud/retail/v2/search_service.rb +15 -8
- data/proto_docs/google/cloud/retail/v2/serving_config.rb +32 -15
- data/proto_docs/google/cloud/retail/v2/serving_config_service.rb +5 -5
- data/proto_docs/google/cloud/retail/v2/user_event.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/user_event_service.rb +24 -8
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +29 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1e74d74b9ec525b0fe2e515035a9201f0385dc8140b2fa6e26305d9e5aa37ab
|
4
|
+
data.tar.gz: 063b0f107d532fe89dbc5f547eec33d12254d5691f0230a955a7e7b2199c4887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52ce66cf0b37660e8757b147f460719f71c5e3d6164fdda364938995ffdc4c693c39fa0e25fcebc0a212004dbd0ce30efa13741faf14ed2d575b4a5bd75c5e47
|
7
|
+
data.tar.gz: 19dbd91993a130ee49808962546d87c98dd81f76c70f2e9024329c2fa41c284c796fa10eee0282883c4f23a37b5a07fae064f6dd86a1acef18dd907d17bb3d6a
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -21,6 +21,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
21
21
|
optional :indexable_option, :enum, 5, "google.cloud.retail.v2.CatalogAttribute.IndexableOption"
|
22
22
|
optional :dynamic_facetable_option, :enum, 6, "google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption"
|
23
23
|
optional :searchable_option, :enum, 7, "google.cloud.retail.v2.CatalogAttribute.SearchableOption"
|
24
|
+
optional :exact_searchable_option, :enum, 11, "google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption"
|
25
|
+
optional :retrievable_option, :enum, 12, "google.cloud.retail.v2.CatalogAttribute.RetrievableOption"
|
24
26
|
end
|
25
27
|
add_enum "google.cloud.retail.v2.CatalogAttribute.AttributeType" do
|
26
28
|
value :UNKNOWN, 0
|
@@ -42,6 +44,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
42
44
|
value :SEARCHABLE_ENABLED, 1
|
43
45
|
value :SEARCHABLE_DISABLED, 2
|
44
46
|
end
|
47
|
+
add_enum "google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption" do
|
48
|
+
value :EXACT_SEARCHABLE_OPTION_UNSPECIFIED, 0
|
49
|
+
value :EXACT_SEARCHABLE_ENABLED, 1
|
50
|
+
value :EXACT_SEARCHABLE_DISABLED, 2
|
51
|
+
end
|
52
|
+
add_enum "google.cloud.retail.v2.CatalogAttribute.RetrievableOption" do
|
53
|
+
value :RETRIEVABLE_OPTION_UNSPECIFIED, 0
|
54
|
+
value :RETRIEVABLE_ENABLED, 1
|
55
|
+
value :RETRIEVABLE_DISABLED, 2
|
56
|
+
end
|
45
57
|
add_message "google.cloud.retail.v2.AttributesConfig" do
|
46
58
|
optional :name, :string, 1
|
47
59
|
map :catalog_attributes, :string, :message, 2, "google.cloud.retail.v2.CatalogAttribute"
|
@@ -78,6 +90,8 @@ module Google
|
|
78
90
|
CatalogAttribute::IndexableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.IndexableOption").enummodule
|
79
91
|
CatalogAttribute::DynamicFacetableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption").enummodule
|
80
92
|
CatalogAttribute::SearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.SearchableOption").enummodule
|
93
|
+
CatalogAttribute::ExactSearchableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption").enummodule
|
94
|
+
CatalogAttribute::RetrievableOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CatalogAttribute.RetrievableOption").enummodule
|
81
95
|
AttributesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.AttributesConfig").msgclass
|
82
96
|
CompletionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionConfig").msgclass
|
83
97
|
Catalog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.Catalog").msgclass
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/retail/v2/catalog_service_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -138,6 +139,12 @@ module Google
|
|
138
139
|
@quota_project_id = @config.quota_project
|
139
140
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
140
141
|
|
142
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
143
|
+
config.credentials = credentials
|
144
|
+
config.quota_project = @quota_project_id
|
145
|
+
config.endpoint = @config.endpoint
|
146
|
+
end
|
147
|
+
|
141
148
|
@catalog_service_stub = ::Gapic::ServiceStub.new(
|
142
149
|
::Google::Cloud::Retail::V2::CatalogService::Stub,
|
143
150
|
credentials: credentials,
|
@@ -147,6 +154,13 @@ module Google
|
|
147
154
|
)
|
148
155
|
end
|
149
156
|
|
157
|
+
##
|
158
|
+
# Get the associated client for mix-in of the Locations.
|
159
|
+
#
|
160
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
161
|
+
#
|
162
|
+
attr_reader :location_client
|
163
|
+
|
150
164
|
# Service calls
|
151
165
|
|
152
166
|
##
|
@@ -213,13 +227,11 @@ module Google
|
|
213
227
|
# # Call the list_catalogs method.
|
214
228
|
# result = client.list_catalogs request
|
215
229
|
#
|
216
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
217
|
-
# #
|
218
|
-
#
|
219
|
-
# # methods are also available for managing paging directly.
|
220
|
-
# result.each do |response|
|
230
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
231
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
232
|
+
# result.each do |item|
|
221
233
|
# # Each element is of type ::Google::Cloud::Retail::V2::Catalog.
|
222
|
-
# p
|
234
|
+
# p item
|
223
235
|
# end
|
224
236
|
#
|
225
237
|
def list_catalogs request, options = nil
|
@@ -608,7 +620,7 @@ module Google
|
|
608
620
|
#
|
609
621
|
# @param name [::String]
|
610
622
|
# Required. Full CompletionConfig resource name. Format:
|
611
|
-
# projects
|
623
|
+
# `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
|
612
624
|
#
|
613
625
|
# @yield [response, operation] Access the result along with the RPC operation
|
614
626
|
# @yieldparam response [::Google::Cloud::Retail::V2::CompletionConfig]
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
##
|
34
34
|
# Service for managing catalog configuration.
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
37
|
#
|
38
38
|
# require "google/cloud/retail/v2/catalog_service"
|
39
39
|
# client = ::Google::Cloud::Retail::V2::CatalogService::Client.new
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/retail/v2/completion_service_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -30,7 +31,7 @@ module Google
|
|
30
31
|
# Auto-completion service for retail.
|
31
32
|
#
|
32
33
|
# This feature is only available for users who have Retail Search enabled.
|
33
|
-
#
|
34
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
34
35
|
#
|
35
36
|
class Client
|
36
37
|
include Paths
|
@@ -147,6 +148,12 @@ module Google
|
|
147
148
|
config.endpoint = @config.endpoint
|
148
149
|
end
|
149
150
|
|
151
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
152
|
+
config.credentials = credentials
|
153
|
+
config.quota_project = @quota_project_id
|
154
|
+
config.endpoint = @config.endpoint
|
155
|
+
end
|
156
|
+
|
150
157
|
@completion_service_stub = ::Gapic::ServiceStub.new(
|
151
158
|
::Google::Cloud::Retail::V2::CompletionService::Stub,
|
152
159
|
credentials: credentials,
|
@@ -163,13 +170,20 @@ module Google
|
|
163
170
|
#
|
164
171
|
attr_reader :operations_client
|
165
172
|
|
173
|
+
##
|
174
|
+
# Get the associated client for mix-in of the Locations.
|
175
|
+
#
|
176
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
177
|
+
#
|
178
|
+
attr_reader :location_client
|
179
|
+
|
166
180
|
# Service calls
|
167
181
|
|
168
182
|
##
|
169
183
|
# Completes the specified prefix with keyword suggestions.
|
170
184
|
#
|
171
185
|
# This feature is only available for users who have Retail Search enabled.
|
172
|
-
#
|
186
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
173
187
|
#
|
174
188
|
# @overload complete_query(request, options = nil)
|
175
189
|
# Pass arguments to `complete_query` via a request object, either of type
|
@@ -214,8 +228,10 @@ module Google
|
|
214
228
|
# Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
|
215
229
|
# number of language codes is 3.
|
216
230
|
# @param device_type [::String]
|
217
|
-
# The device type context for completion suggestions.
|
218
|
-
#
|
231
|
+
# The device type context for completion suggestions. We recommend that you
|
232
|
+
# leave this field empty.
|
233
|
+
#
|
234
|
+
# It can apply different suggestions on different device types, e.g.
|
219
235
|
# `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
|
220
236
|
# types.
|
221
237
|
#
|
@@ -323,7 +339,7 @@ module Google
|
|
323
339
|
# are indexed successfully and ready for serving. The process takes hours.
|
324
340
|
#
|
325
341
|
# This feature is only available for users who have Retail Search enabled.
|
326
|
-
#
|
342
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
327
343
|
#
|
328
344
|
# @overload import_completion_data(request, options = nil)
|
329
345
|
# Pass arguments to `import_completion_data` via a request object, either of type
|
@@ -373,14 +389,14 @@ module Google
|
|
373
389
|
# # Call the import_completion_data method.
|
374
390
|
# result = client.import_completion_data request
|
375
391
|
#
|
376
|
-
# # The returned object is of type Gapic::Operation. You can use
|
377
|
-
# #
|
378
|
-
# #
|
392
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
393
|
+
# # check the status of an operation, cancel it, or wait for results.
|
394
|
+
# # Here is how to wait for a response.
|
379
395
|
# result.wait_until_done! timeout: 60
|
380
396
|
# if result.response?
|
381
397
|
# p result.response
|
382
398
|
# else
|
383
|
-
# puts "
|
399
|
+
# puts "No response received."
|
384
400
|
# end
|
385
401
|
#
|
386
402
|
def import_completion_data request, options = nil
|
@@ -158,13 +158,11 @@ module Google
|
|
158
158
|
# # Call the list_operations method.
|
159
159
|
# result = client.list_operations request
|
160
160
|
#
|
161
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
162
|
-
# #
|
163
|
-
#
|
164
|
-
# # methods are also available for managing paging directly.
|
165
|
-
# result.each do |response|
|
161
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
162
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
163
|
+
# result.each do |item|
|
166
164
|
# # Each element is of type ::Google::Longrunning::Operation.
|
167
|
-
# p
|
165
|
+
# p item
|
168
166
|
# end
|
169
167
|
#
|
170
168
|
def list_operations request, options = nil
|
@@ -253,14 +251,14 @@ module Google
|
|
253
251
|
# # Call the get_operation method.
|
254
252
|
# result = client.get_operation request
|
255
253
|
#
|
256
|
-
# # The returned object is of type Gapic::Operation. You can use
|
257
|
-
# #
|
258
|
-
# #
|
254
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
255
|
+
# # check the status of an operation, cancel it, or wait for results.
|
256
|
+
# # Here is how to wait for a response.
|
259
257
|
# result.wait_until_done! timeout: 60
|
260
258
|
# if result.response?
|
261
259
|
# p result.response
|
262
260
|
# else
|
263
|
-
# puts "
|
261
|
+
# puts "No response received."
|
264
262
|
# end
|
265
263
|
#
|
266
264
|
def get_operation request, options = nil
|
@@ -540,14 +538,14 @@ module Google
|
|
540
538
|
# # Call the wait_operation method.
|
541
539
|
# result = client.wait_operation request
|
542
540
|
#
|
543
|
-
# # The returned object is of type Gapic::Operation. You can use
|
544
|
-
# #
|
545
|
-
# #
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
543
|
+
# # Here is how to wait for a response.
|
546
544
|
# result.wait_until_done! timeout: 60
|
547
545
|
# if result.response?
|
548
546
|
# p result.response
|
549
547
|
# else
|
550
|
-
# puts "
|
548
|
+
# puts "No response received."
|
551
549
|
# end
|
552
550
|
#
|
553
551
|
def wait_operation request, options = nil
|
@@ -35,9 +35,9 @@ module Google
|
|
35
35
|
# Auto-completion service for retail.
|
36
36
|
#
|
37
37
|
# This feature is only available for users who have Retail Search enabled.
|
38
|
-
#
|
38
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
39
39
|
#
|
40
|
-
#
|
40
|
+
# @example Load this service and instantiate a gRPC client
|
41
41
|
#
|
42
42
|
# require "google/cloud/retail/v2/completion_service"
|
43
43
|
# client = ::Google::Cloud::Retail::V2::CompletionService::Client.new
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# Auto-completion service for retail.
|
28
28
|
#
|
29
29
|
# This feature is only available for users who have Retail Search enabled.
|
30
|
-
#
|
30
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
31
31
|
class Service
|
32
32
|
|
33
33
|
include ::GRPC::GenericService
|
@@ -39,7 +39,7 @@ module Google
|
|
39
39
|
# Completes the specified prefix with keyword suggestions.
|
40
40
|
#
|
41
41
|
# This feature is only available for users who have Retail Search enabled.
|
42
|
-
#
|
42
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
43
43
|
rpc :CompleteQuery, ::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Google::Cloud::Retail::V2::CompleteQueryResponse
|
44
44
|
# Bulk import of processed completion dataset.
|
45
45
|
#
|
@@ -49,7 +49,7 @@ module Google
|
|
49
49
|
# are indexed successfully and ready for serving. The process takes hours.
|
50
50
|
#
|
51
51
|
# This feature is only available for users who have Retail Search enabled.
|
52
|
-
#
|
52
|
+
# Enable Retail Search on Cloud Console before using this feature.
|
53
53
|
rpc :ImportCompletionData, ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Google::Longrunning::Operation
|
54
54
|
end
|
55
55
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/retail/v2/control_service_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -133,6 +134,12 @@ module Google
|
|
133
134
|
@quota_project_id = @config.quota_project
|
134
135
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
135
136
|
|
137
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
138
|
+
config.credentials = credentials
|
139
|
+
config.quota_project = @quota_project_id
|
140
|
+
config.endpoint = @config.endpoint
|
141
|
+
end
|
142
|
+
|
136
143
|
@control_service_stub = ::Gapic::ServiceStub.new(
|
137
144
|
::Google::Cloud::Retail::V2::ControlService::Stub,
|
138
145
|
credentials: credentials,
|
@@ -142,6 +149,13 @@ module Google
|
|
142
149
|
)
|
143
150
|
end
|
144
151
|
|
152
|
+
##
|
153
|
+
# Get the associated client for mix-in of the Locations.
|
154
|
+
#
|
155
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
156
|
+
#
|
157
|
+
attr_reader :location_client
|
158
|
+
|
145
159
|
# Service calls
|
146
160
|
|
147
161
|
##
|
@@ -570,13 +584,11 @@ module Google
|
|
570
584
|
# # Call the list_controls method.
|
571
585
|
# result = client.list_controls request
|
572
586
|
#
|
573
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
574
|
-
# #
|
575
|
-
#
|
576
|
-
# # methods are also available for managing paging directly.
|
577
|
-
# result.each do |response|
|
587
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
588
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
589
|
+
# result.each do |item|
|
578
590
|
# # Each element is of type ::Google::Cloud::Retail::V2::Control.
|
579
|
-
# p
|
591
|
+
# p item
|
580
592
|
# end
|
581
593
|
#
|
582
594
|
def list_controls request, options = nil
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
##
|
34
34
|
# Service for modifying Control.
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
37
|
#
|
38
38
|
# require "google/cloud/retail/v2/control_service"
|
39
39
|
# client = ::Google::Cloud::Retail::V2::ControlService::Client.new
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/retail/v2/prediction_service_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -138,6 +139,12 @@ module Google
|
|
138
139
|
@quota_project_id = @config.quota_project
|
139
140
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
140
141
|
|
142
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
143
|
+
config.credentials = credentials
|
144
|
+
config.quota_project = @quota_project_id
|
145
|
+
config.endpoint = @config.endpoint
|
146
|
+
end
|
147
|
+
|
141
148
|
@prediction_service_stub = ::Gapic::ServiceStub.new(
|
142
149
|
::Google::Cloud::Retail::V2::PredictionService::Stub,
|
143
150
|
credentials: credentials,
|
@@ -147,6 +154,13 @@ module Google
|
|
147
154
|
)
|
148
155
|
end
|
149
156
|
|
157
|
+
##
|
158
|
+
# Get the associated client for mix-in of the Locations.
|
159
|
+
#
|
160
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
161
|
+
#
|
162
|
+
attr_reader :location_client
|
163
|
+
|
150
164
|
# Service calls
|
151
165
|
|
152
166
|
##
|
@@ -177,7 +191,7 @@ module Google
|
|
177
191
|
# The ID of the Recommendations AI serving config or placement.
|
178
192
|
# Before you can request predictions from your model, you must create at
|
179
193
|
# least one serving config or placement for it. For more information, see
|
180
|
-
# [
|
194
|
+
# [Manage serving configs]
|
181
195
|
# (https://cloud.google.com/retail/docs/manage-configs).
|
182
196
|
#
|
183
197
|
# The full list of available serving configs can be seen at
|
@@ -228,12 +242,11 @@ module Google
|
|
228
242
|
# * filterOutOfStockItems tag=(-"promotional")
|
229
243
|
# * filterOutOfStockItems
|
230
244
|
#
|
231
|
-
# If your filter blocks all prediction results, the API will return
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
# or "DELETED" regardless of filter choices.
|
245
|
+
# If your filter blocks all prediction results, the API will return *no*
|
246
|
+
# results. If instead you want empty result sets to return generic
|
247
|
+
# (unfiltered) popular products, set `strictFiltering` to False in
|
248
|
+
# `PredictRequest.params`. Note that the API will never return items with
|
249
|
+
# storageStatus of "EXPIRED" or "DELETED" regardless of filter choices.
|
237
250
|
#
|
238
251
|
# If `filterSyntaxV2` is set to true under the `params` field, then
|
239
252
|
# attribute-based expressions are expected instead of the above described
|
@@ -258,7 +271,7 @@ module Google
|
|
258
271
|
# * `returnScore`: Boolean. If set to true, the prediction 'score'
|
259
272
|
# corresponding to each returned product will be set in the
|
260
273
|
# `results.metadata` field in the prediction response. The given
|
261
|
-
# 'score' indicates the probability of
|
274
|
+
# 'score' indicates the probability of a product being clicked/purchased
|
262
275
|
# given the user's context and history.
|
263
276
|
# * `strictFiltering`: Boolean. True by default. If set to false, the service
|
264
277
|
# will return generic (unfiltered) popular products instead of empty if
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
##
|
34
34
|
# Service for making recommendation prediction.
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
37
|
#
|
38
38
|
# require "google/cloud/retail/v2/prediction_service"
|
39
39
|
# client = ::Google::Cloud::Retail::V2::PredictionService::Client.new
|