google-cloud-retail-v2 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/LICENSE.md +188 -190
- data/README.md +3 -3
- data/lib/google/cloud/retail/v2.rb +2 -0
- data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +211 -15
- data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
- data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
- data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
- data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
- data/lib/google/cloud/retail/v2/completion_service/client.rb +546 -0
- data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +655 -0
- data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
- data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
- data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
- data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +41 -43
- data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
- data/lib/google/cloud/retail/v2/product_service/client.rb +643 -18
- data/lib/google/cloud/retail/v2/product_service/operations.rb +11 -11
- data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
- data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
- data/lib/google/cloud/retail/v2/search_service.rb +53 -0
- data/lib/google/cloud/retail/v2/search_service/client.rb +541 -0
- data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
- data/lib/google/cloud/retail/v2/search_service_pb.rb +131 -0
- data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
- data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +12 -15
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +11 -11
- data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/httpbody.rb +4 -3
- data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
- data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
- data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
- data/proto_docs/google/cloud/retail/v2/completion_service.rb +162 -0
- data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
- data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
- data/proto_docs/google/cloud/retail/v2/product.rb +266 -10
- data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
- data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/search_service.rb +820 -0
- data/proto_docs/google/cloud/retail/v2/user_event.rb +95 -3
- data/proto_docs/google/type/date.rb +53 -0
- metadata +32 -10
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Retail
|
23
|
+
module V2
|
24
|
+
module CompletionService
|
25
|
+
# Path helper methods for the CompletionService API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Catalog resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}/catalogs/{catalog}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
# @param catalog [String]
|
37
|
+
#
|
38
|
+
# @return [::String]
|
39
|
+
def catalog_path project:, location:, catalog:
|
40
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/locations/#{location}/catalogs/#{catalog}"
|
44
|
+
end
|
45
|
+
|
46
|
+
extend self
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/retail/v2/completion_service.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/retail/v2/common_pb'
|
11
|
+
require 'google/cloud/retail/v2/import_config_pb'
|
12
|
+
require 'google/longrunning/operations_pb'
|
13
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
|
+
add_file("google/cloud/retail/v2/completion_service.proto", :syntax => :proto3) do
|
15
|
+
add_message "google.cloud.retail.v2.CompleteQueryRequest" do
|
16
|
+
optional :catalog, :string, 1
|
17
|
+
optional :query, :string, 2
|
18
|
+
optional :visitor_id, :string, 7
|
19
|
+
repeated :language_codes, :string, 3
|
20
|
+
optional :device_type, :string, 4
|
21
|
+
optional :dataset, :string, 6
|
22
|
+
optional :max_suggestions, :int32, 5
|
23
|
+
end
|
24
|
+
add_message "google.cloud.retail.v2.CompleteQueryResponse" do
|
25
|
+
repeated :completion_results, :message, 1, "google.cloud.retail.v2.CompleteQueryResponse.CompletionResult"
|
26
|
+
optional :attribution_token, :string, 2
|
27
|
+
repeated :recent_search_results, :message, 3, "google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult"
|
28
|
+
end
|
29
|
+
add_message "google.cloud.retail.v2.CompleteQueryResponse.CompletionResult" do
|
30
|
+
optional :suggestion, :string, 1
|
31
|
+
map :attributes, :string, :message, 2, "google.cloud.retail.v2.CustomAttribute"
|
32
|
+
end
|
33
|
+
add_message "google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult" do
|
34
|
+
optional :recent_search, :string, 1
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
module Google
|
40
|
+
module Cloud
|
41
|
+
module Retail
|
42
|
+
module V2
|
43
|
+
CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryRequest").msgclass
|
44
|
+
CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse").msgclass
|
45
|
+
CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.CompletionResult").msgclass
|
46
|
+
CompleteQueryResponse::RecentSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult").msgclass
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/retail/v2/completion_service.proto for package 'Google.Cloud.Retail.V2'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2020 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/retail/v2/completion_service_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Retail
|
25
|
+
module V2
|
26
|
+
module CompletionService
|
27
|
+
# Auto-completion service for retail.
|
28
|
+
#
|
29
|
+
# This feature is only available for users who have Retail Search enabled.
|
30
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
31
|
+
# interested in using Retail Search.
|
32
|
+
class Service
|
33
|
+
|
34
|
+
include GRPC::GenericService
|
35
|
+
|
36
|
+
self.marshal_class_method = :encode
|
37
|
+
self.unmarshal_class_method = :decode
|
38
|
+
self.service_name = 'google.cloud.retail.v2.CompletionService'
|
39
|
+
|
40
|
+
# Completes the specified prefix with keyword suggestions.
|
41
|
+
#
|
42
|
+
# This feature is only available for users who have Retail Search enabled.
|
43
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
44
|
+
# interested in using Retail Search.
|
45
|
+
rpc :CompleteQuery, ::Google::Cloud::Retail::V2::CompleteQueryRequest, ::Google::Cloud::Retail::V2::CompleteQueryResponse
|
46
|
+
# Bulk import of processed completion dataset.
|
47
|
+
#
|
48
|
+
# Request processing may be synchronous. Partial updating is not supported.
|
49
|
+
#
|
50
|
+
# This feature is only available for users who have Retail Search enabled.
|
51
|
+
# Contact Retail Support (retail-search-support@google.com) if you are
|
52
|
+
# interested in using Retail Search.
|
53
|
+
rpc :ImportCompletionData, ::Google::Cloud::Retail::V2::ImportCompletionDataRequest, ::Google::Longrunning::Operation
|
54
|
+
end
|
55
|
+
|
56
|
+
Stub = Service.rpc_stub_class
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -5,11 +5,13 @@ require 'google/protobuf'
|
|
5
5
|
|
6
6
|
require 'google/api/annotations_pb'
|
7
7
|
require 'google/api/field_behavior_pb'
|
8
|
+
require 'google/api/resource_pb'
|
8
9
|
require 'google/cloud/retail/v2/product_pb'
|
9
10
|
require 'google/cloud/retail/v2/user_event_pb'
|
10
11
|
require 'google/protobuf/field_mask_pb'
|
11
12
|
require 'google/protobuf/timestamp_pb'
|
12
13
|
require 'google/rpc/status_pb'
|
14
|
+
require 'google/type/date_pb'
|
13
15
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
16
|
add_file("google/cloud/retail/v2/import_config.proto", :syntax => :proto3) do
|
15
17
|
add_message "google.cloud.retail.v2.GcsSource" do
|
@@ -22,6 +24,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
22
24
|
optional :table_id, :string, 2
|
23
25
|
optional :gcs_staging_dir, :string, 3
|
24
26
|
optional :data_schema, :string, 4
|
27
|
+
oneof :partition do
|
28
|
+
optional :partition_date, :message, 6, "google.type.Date"
|
29
|
+
end
|
25
30
|
end
|
26
31
|
add_message "google.cloud.retail.v2.ProductInlineSource" do
|
27
32
|
repeated :products, :message, 1, "google.cloud.retail.v2.Product"
|
@@ -36,15 +41,28 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
36
41
|
end
|
37
42
|
add_message "google.cloud.retail.v2.ImportProductsRequest" do
|
38
43
|
optional :parent, :string, 1
|
44
|
+
optional :request_id, :string, 6
|
39
45
|
optional :input_config, :message, 2, "google.cloud.retail.v2.ProductInputConfig"
|
40
46
|
optional :errors_config, :message, 3, "google.cloud.retail.v2.ImportErrorsConfig"
|
41
47
|
optional :update_mask, :message, 4, "google.protobuf.FieldMask"
|
48
|
+
optional :reconciliation_mode, :enum, 5, "google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode"
|
49
|
+
optional :notification_pubsub_topic, :string, 7
|
50
|
+
end
|
51
|
+
add_enum "google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode" do
|
52
|
+
value :RECONCILIATION_MODE_UNSPECIFIED, 0
|
53
|
+
value :INCREMENTAL, 1
|
54
|
+
value :FULL, 2
|
42
55
|
end
|
43
56
|
add_message "google.cloud.retail.v2.ImportUserEventsRequest" do
|
44
57
|
optional :parent, :string, 1
|
45
58
|
optional :input_config, :message, 2, "google.cloud.retail.v2.UserEventInputConfig"
|
46
59
|
optional :errors_config, :message, 3, "google.cloud.retail.v2.ImportErrorsConfig"
|
47
60
|
end
|
61
|
+
add_message "google.cloud.retail.v2.ImportCompletionDataRequest" do
|
62
|
+
optional :parent, :string, 1
|
63
|
+
optional :input_config, :message, 2, "google.cloud.retail.v2.CompletionDataInputConfig"
|
64
|
+
optional :notification_pubsub_topic, :string, 3
|
65
|
+
end
|
48
66
|
add_message "google.cloud.retail.v2.ProductInputConfig" do
|
49
67
|
oneof :source do
|
50
68
|
optional :product_inline_source, :message, 1, "google.cloud.retail.v2.ProductInlineSource"
|
@@ -59,11 +77,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
59
77
|
optional :big_query_source, :message, 3, "google.cloud.retail.v2.BigQuerySource"
|
60
78
|
end
|
61
79
|
end
|
80
|
+
add_message "google.cloud.retail.v2.CompletionDataInputConfig" do
|
81
|
+
oneof :source do
|
82
|
+
optional :big_query_source, :message, 1, "google.cloud.retail.v2.BigQuerySource"
|
83
|
+
end
|
84
|
+
end
|
62
85
|
add_message "google.cloud.retail.v2.ImportMetadata" do
|
63
86
|
optional :create_time, :message, 1, "google.protobuf.Timestamp"
|
64
87
|
optional :update_time, :message, 2, "google.protobuf.Timestamp"
|
65
88
|
optional :success_count, :int64, 3
|
66
89
|
optional :failure_count, :int64, 4
|
90
|
+
optional :request_id, :string, 5
|
91
|
+
optional :notification_pubsub_topic, :string, 6
|
67
92
|
end
|
68
93
|
add_message "google.cloud.retail.v2.ImportProductsResponse" do
|
69
94
|
repeated :error_samples, :message, 1, "google.rpc.Status"
|
@@ -78,6 +103,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
78
103
|
optional :joined_events_count, :int64, 1
|
79
104
|
optional :unjoined_events_count, :int64, 2
|
80
105
|
end
|
106
|
+
add_message "google.cloud.retail.v2.ImportCompletionDataResponse" do
|
107
|
+
repeated :error_samples, :message, 1, "google.rpc.Status"
|
108
|
+
end
|
81
109
|
end
|
82
110
|
end
|
83
111
|
|
@@ -91,13 +119,17 @@ module Google
|
|
91
119
|
UserEventInlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInlineSource").msgclass
|
92
120
|
ImportErrorsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportErrorsConfig").msgclass
|
93
121
|
ImportProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest").msgclass
|
122
|
+
ImportProductsRequest::ReconciliationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode").enummodule
|
94
123
|
ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsRequest").msgclass
|
124
|
+
ImportCompletionDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataRequest").msgclass
|
95
125
|
ProductInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ProductInputConfig").msgclass
|
96
126
|
UserEventInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventInputConfig").msgclass
|
127
|
+
CompletionDataInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.CompletionDataInputConfig").msgclass
|
97
128
|
ImportMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportMetadata").msgclass
|
98
129
|
ImportProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportProductsResponse").msgclass
|
99
130
|
ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportUserEventsResponse").msgclass
|
100
131
|
UserEventImportSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.UserEventImportSummary").msgclass
|
132
|
+
ImportCompletionDataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.retail.v2.ImportCompletionDataResponse").msgclass
|
101
133
|
end
|
102
134
|
end
|
103
135
|
end
|
@@ -60,17 +60,14 @@ module Google
|
|
60
60
|
parent_config = while namespace.any?
|
61
61
|
parent_name = namespace.join "::"
|
62
62
|
parent_const = const_get parent_name
|
63
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
64
|
namespace.pop
|
65
65
|
end
|
66
66
|
default_config = Client::Configuration.new parent_config
|
67
67
|
|
68
68
|
default_config.timeout = 60.0
|
69
69
|
default_config.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [14, 4]
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
74
71
|
}
|
75
72
|
|
76
73
|
default_config
|
@@ -139,9 +136,9 @@ module Google
|
|
139
136
|
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
140
137
|
@config.endpoint == Client.configure.endpoint &&
|
141
138
|
!@config.endpoint.split(".").first.include?("-")
|
142
|
-
credentials ||= Credentials.default scope:
|
139
|
+
credentials ||= Credentials.default scope: @config.scope,
|
143
140
|
enable_self_signed_jwt: enable_self_signed_jwt
|
144
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
141
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
145
142
|
credentials = Credentials.new credentials, scope: @config.scope
|
146
143
|
end
|
147
144
|
@quota_project_id = @config.quota_project
|
@@ -179,30 +176,10 @@ module Google
|
|
179
176
|
# @param placement [::String]
|
180
177
|
# Required. Full resource name of the format:
|
181
178
|
# \\{name=projects/*/locations/global/catalogs/default_catalog/placements/*}
|
182
|
-
# The
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
# * `shopping_cart`: Predicts products frequently bought together with one or
|
188
|
-
# more products in the same shopping session. Commonly displayed after
|
189
|
-
# `add-to-cart` events, on product detail pages, or on the shopping cart
|
190
|
-
# page.
|
191
|
-
#
|
192
|
-
# * `home_page`: Predicts the next product that a user will most likely
|
193
|
-
# engage with or purchase based on the shopping or viewing history of the
|
194
|
-
# specified `userId` or `visitorId`. For example - Recommendations for you.
|
195
|
-
#
|
196
|
-
# * `product_detail`: Predicts the next product that a user will most likely
|
197
|
-
# engage with or purchase. The prediction is based on the shopping or
|
198
|
-
# viewing history of the specified `userId` or `visitorId` and its
|
199
|
-
# relevance to a specified `CatalogItem`. Typically used on product detail
|
200
|
-
# pages. For example - More products like this.
|
201
|
-
#
|
202
|
-
# * `recently_viewed_default`: Returns up to 75 products recently viewed by
|
203
|
-
# the specified `userId` or `visitorId`, most recent ones first. Returns
|
204
|
-
# nothing if neither of them has viewed any products yet. For example -
|
205
|
-
# Recently viewed.
|
179
|
+
# The ID of the Recommendations AI placement. Before you can request
|
180
|
+
# predictions from your model, you must create at least one placement for it.
|
181
|
+
# For more information, see [Managing
|
182
|
+
# placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
|
206
183
|
#
|
207
184
|
# The full list of available placements can be seen at
|
208
185
|
# https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
|
@@ -229,6 +206,9 @@ module Google
|
|
229
206
|
# `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
|
230
207
|
# with a size limit of 1,000 characters.
|
231
208
|
#
|
209
|
+
# Note: "Recently viewed" models don't support tag filtering at the
|
210
|
+
# moment.
|
211
|
+
#
|
232
212
|
# * filterOutOfStockItems. Restricts predictions to products that do not
|
233
213
|
# have a
|
234
214
|
# stockState value of OUT_OF_STOCK.
|
@@ -263,16 +243,34 @@ module Google
|
|
263
243
|
# * `strictFiltering`: Boolean. True by default. If set to false, the service
|
264
244
|
# will return generic (unfiltered) popular products instead of empty if
|
265
245
|
# your filter blocks all prediction results.
|
246
|
+
# * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
|
247
|
+
# it needs to be one of {'no-price-reranking', 'low-price-reranking',
|
248
|
+
# 'medium-price-reranking', 'high-price-reranking'}. This gives
|
249
|
+
# request-level control and adjusts prediction results based on product
|
250
|
+
# price.
|
251
|
+
# * `diversityLevel`: String. Default empty. If set to be non-empty, then
|
252
|
+
# it needs to be one of {'no-diversity', 'low-diversity',
|
253
|
+
# 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
|
254
|
+
# request-level control and adjusts prediction results based on product
|
255
|
+
# category.
|
266
256
|
# @param labels [::Hash{::String => ::String}]
|
267
|
-
# The labels
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
257
|
+
# The labels applied to a resource must meet the following requirements:
|
258
|
+
#
|
259
|
+
# * Each resource can have multiple labels, up to a maximum of 64.
|
260
|
+
# * Each label must be a key-value pair.
|
261
|
+
# * Keys have a minimum length of 1 character and a maximum length of 63
|
262
|
+
# characters, and cannot be empty. Values can be empty, and have a maximum
|
263
|
+
# length of 63 characters.
|
264
|
+
# * Keys and values can contain only lowercase letters, numeric characters,
|
265
|
+
# underscores, and dashes. All characters must use UTF-8 encoding, and
|
266
|
+
# international characters are allowed.
|
267
|
+
# * The key portion of a label must be unique. However, you can use the same
|
268
|
+
# key with multiple resources.
|
269
|
+
# * Keys must start with a lowercase letter or international character.
|
270
|
+
#
|
271
|
+
# See [Google Cloud
|
272
|
+
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
273
|
+
# for more details.
|
276
274
|
#
|
277
275
|
# @yield [response, operation] Access the result along with the RPC operation
|
278
276
|
# @yieldparam response [::Google::Cloud::Retail::V2::PredictResponse]
|
@@ -411,7 +409,7 @@ module Google
|
|
411
409
|
config_attr :scope, nil, ::String, ::Array, nil
|
412
410
|
config_attr :lib_name, nil, ::String, nil
|
413
411
|
config_attr :lib_version, nil, ::String, nil
|
414
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
412
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
415
413
|
config_attr :interceptors, nil, ::Array, nil
|
416
414
|
config_attr :timeout, nil, ::Numeric, nil
|
417
415
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -432,7 +430,7 @@ module Google
|
|
432
430
|
def rpcs
|
433
431
|
@rpcs ||= begin
|
434
432
|
parent_rpcs = nil
|
435
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
433
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
436
434
|
Rpcs.new parent_rpcs
|
437
435
|
end
|
438
436
|
end
|
@@ -463,7 +461,7 @@ module Google
|
|
463
461
|
|
464
462
|
# @private
|
465
463
|
def initialize parent_rpcs = nil
|
466
|
-
predict_config = parent_rpcs
|
464
|
+
predict_config = parent_rpcs.predict if parent_rpcs.respond_to? :predict
|
467
465
|
@predict = ::Gapic::Config::Method.new predict_config
|
468
466
|
|
469
467
|
yield self if block_given?
|
@@ -7,6 +7,7 @@ require 'google/api/annotations_pb'
|
|
7
7
|
require 'google/api/field_behavior_pb'
|
8
8
|
require 'google/api/resource_pb'
|
9
9
|
require 'google/cloud/retail/v2/common_pb'
|
10
|
+
require 'google/protobuf/duration_pb'
|
10
11
|
require 'google/protobuf/field_mask_pb'
|
11
12
|
require 'google/protobuf/timestamp_pb'
|
12
13
|
require 'google/protobuf/wrappers_pb'
|
@@ -17,17 +18,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
17
18
|
optional :id, :string, 2
|
18
19
|
optional :type, :enum, 3, "google.cloud.retail.v2.Product.Type"
|
19
20
|
optional :primary_product_id, :string, 4
|
21
|
+
repeated :collection_member_ids, :string, 5
|
22
|
+
optional :gtin, :string, 6
|
20
23
|
repeated :categories, :string, 7
|
21
24
|
optional :title, :string, 8
|
25
|
+
repeated :brands, :string, 9
|
22
26
|
optional :description, :string, 10
|
27
|
+
optional :language_code, :string, 11
|
23
28
|
map :attributes, :string, :message, 12, "google.cloud.retail.v2.CustomAttribute"
|
24
29
|
repeated :tags, :string, 13
|
25
30
|
optional :price_info, :message, 14, "google.cloud.retail.v2.PriceInfo"
|
31
|
+
optional :rating, :message, 15, "google.cloud.retail.v2.Rating"
|
26
32
|
optional :available_time, :message, 18, "google.protobuf.Timestamp"
|
27
33
|
optional :availability, :enum, 19, "google.cloud.retail.v2.Product.Availability"
|
28
34
|
optional :available_quantity, :message, 20, "google.protobuf.Int32Value"
|
35
|
+
repeated :fulfillment_info, :message, 21, "google.cloud.retail.v2.FulfillmentInfo"
|
29
36
|
optional :uri, :string, 22
|
30
37
|
repeated :images, :message, 23, "google.cloud.retail.v2.Image"
|
38
|
+
optional :audience, :message, 24, "google.cloud.retail.v2.Audience"
|
39
|
+
optional :color_info, :message, 25, "google.cloud.retail.v2.ColorInfo"
|
40
|
+
repeated :sizes, :string, 26
|
41
|
+
repeated :materials, :string, 27
|
42
|
+
repeated :patterns, :string, 28
|
43
|
+
repeated :conditions, :string, 29
|
44
|
+
repeated :promotions, :message, 34, "google.cloud.retail.v2.Promotion"
|
45
|
+
optional :publish_time, :message, 33, "google.protobuf.Timestamp"
|
46
|
+
optional :retrievable_fields, :message, 30, "google.protobuf.FieldMask"
|
47
|
+
repeated :variants, :message, 31, "google.cloud.retail.v2.Product"
|
48
|
+
oneof :expiration do
|
49
|
+
optional :expire_time, :message, 16, "google.protobuf.Timestamp"
|
50
|
+
optional :ttl, :message, 17, "google.protobuf.Duration"
|
51
|
+
end
|
31
52
|
end
|
32
53
|
add_enum "google.cloud.retail.v2.Product.Type" do
|
33
54
|
value :TYPE_UNSPECIFIED, 0
|