google-cloud-retail-v2 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +240 -40
  4. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  7. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +545 -0
  9. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  10. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  11. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  12. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  13. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  14. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  15. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  16. data/lib/google/cloud/retail/v2/prediction_service/client.rb +66 -70
  17. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  18. data/lib/google/cloud/retail/v2/product_service/client.rb +682 -43
  19. data/lib/google/cloud/retail/v2/product_service/operations.rb +30 -21
  20. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  21. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  22. data/lib/google/cloud/retail/v2/search_service/client.rb +552 -0
  23. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  24. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  25. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  26. data/lib/google/cloud/retail/v2/search_service_pb.rb +133 -0
  27. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  28. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  29. data/lib/google/cloud/retail/v2/user_event_service/client.rb +45 -42
  30. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +30 -21
  31. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  32. data/lib/google/cloud/retail/v2/version.rb +1 -1
  33. data/lib/google/cloud/retail/v2.rb +2 -0
  34. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  35. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  36. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  37. data/proto_docs/google/cloud/retail/v2/completion_service.rb +164 -0
  38. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  39. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  40. data/proto_docs/google/cloud/retail/v2/product.rb +265 -9
  41. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  42. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  43. data/proto_docs/google/cloud/retail/v2/search_service.rb +711 -0
  44. data/proto_docs/google/cloud/retail/v2/user_event.rb +110 -6
  45. data/proto_docs/google/type/date.rb +53 -0
  46. metadata +20 -4
@@ -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,54 @@
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
+ 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/completion_service/credentials"
26
+ require "google/cloud/retail/v2/completion_service/paths"
27
+ require "google/cloud/retail/v2/completion_service/operations"
28
+ require "google/cloud/retail/v2/completion_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Retail
33
+ module V2
34
+ ##
35
+ # Auto-completion service for retail.
36
+ #
37
+ # This feature is only available for users who have Retail Search enabled.
38
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
39
+ # cloud sales if you are interested in using Retail Search.
40
+ #
41
+ # To load this service and instantiate a client:
42
+ #
43
+ # require "google/cloud/retail/v2/completion_service"
44
+ # client = ::Google::Cloud::Retail::V2::CompletionService::Client.new
45
+ #
46
+ module CompletionService
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "completion_service", "helpers.rb"
54
+ require "google/cloud/retail/v2/completion_service/helpers" if ::File.file? helper_path
@@ -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
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
31
+ # cloud sales if you are 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
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
44
+ # cloud sales if you are 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
+ # Please submit a form [here](https://cloud.google.com/contact) to contact
52
+ # cloud sales if you are 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
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Retail::V2::PredictionService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all PredictionService clients:
47
- #
48
- # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all PredictionService clients
47
+ # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -99,19 +98,15 @@ module Google
99
98
  ##
100
99
  # Create a new PredictionService client object.
101
100
  #
102
- # ## Examples
103
- #
104
- # To create a new PredictionService client with the default
105
- # configuration:
101
+ # @example
106
102
  #
107
- # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new
108
105
  #
109
- # To create a new PredictionService client with a custom
110
- # configuration:
111
- #
112
- # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config|
113
- # config.timeout = 10.0
114
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
115
110
  #
116
111
  # @yield [config] Configure the PredictionService client.
117
112
  # @yieldparam config [Client::Configuration]
@@ -131,10 +126,9 @@ module Google
131
126
 
132
127
  # Create credentials
133
128
  credentials = @config.credentials
134
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
135
130
  # but only if the default endpoint does not have a region prefix.
136
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
137
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
138
132
  !@config.endpoint.split(".").first.include?("-")
139
133
  credentials ||= Credentials.default scope: @config.scope,
140
134
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -176,30 +170,10 @@ module Google
176
170
  # @param placement [::String]
177
171
  # Required. Full resource name of the format:
178
172
  # \\{name=projects/*/locations/global/catalogs/default_catalog/placements/*}
179
- # The id of the recommendation engine placement. This id is used to identify
180
- # the set of models that will be used to make the prediction.
181
- #
182
- # We currently support three placements with the following IDs by default:
183
- #
184
- # * `shopping_cart`: Predicts products frequently bought together with one or
185
- # more products in the same shopping session. Commonly displayed after
186
- # `add-to-cart` events, on product detail pages, or on the shopping cart
187
- # page.
188
- #
189
- # * `home_page`: Predicts the next product that a user will most likely
190
- # engage with or purchase based on the shopping or viewing history of the
191
- # specified `userId` or `visitorId`. For example - Recommendations for you.
192
- #
193
- # * `product_detail`: Predicts the next product that a user will most likely
194
- # engage with or purchase. The prediction is based on the shopping or
195
- # viewing history of the specified `userId` or `visitorId` and its
196
- # relevance to a specified `CatalogItem`. Typically used on product detail
197
- # pages. For example - More products like this.
198
- #
199
- # * `recently_viewed_default`: Returns up to 75 products recently viewed by
200
- # the specified `userId` or `visitorId`, most recent ones first. Returns
201
- # nothing if neither of them has viewed any products yet. For example -
202
- # Recently viewed.
173
+ # The ID of the Recommendations AI placement. Before you can request
174
+ # predictions from your model, you must create at least one placement for it.
175
+ # For more information, see [Managing
176
+ # placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
203
177
  #
204
178
  # The full list of available placements can be seen at
205
179
  # https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
@@ -226,6 +200,9 @@ module Google
226
200
  # `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings
227
201
  # with a size limit of 1,000 characters.
228
202
  #
203
+ # Note: "Recently viewed" models don't support tag filtering at the
204
+ # moment.
205
+ #
229
206
  # * filterOutOfStockItems. Restricts predictions to products that do not
230
207
  # have a
231
208
  # stockState value of OUT_OF_STOCK.
@@ -260,16 +237,34 @@ module Google
260
237
  # * `strictFiltering`: Boolean. True by default. If set to false, the service
261
238
  # will return generic (unfiltered) popular products instead of empty if
262
239
  # your filter blocks all prediction results.
240
+ # * `priceRerankLevel`: String. Default empty. If set to be non-empty, then
241
+ # it needs to be one of {'no-price-reranking', 'low-price-reranking',
242
+ # 'medium-price-reranking', 'high-price-reranking'}. This gives
243
+ # request-level control and adjusts prediction results based on product
244
+ # price.
245
+ # * `diversityLevel`: String. Default empty. If set to be non-empty, then
246
+ # it needs to be one of {'no-diversity', 'low-diversity',
247
+ # 'medium-diversity', 'high-diversity', 'auto-diversity'}. This gives
248
+ # request-level control and adjusts prediction results based on product
249
+ # category.
263
250
  # @param labels [::Hash{::String => ::String}]
264
- # The labels for the predict request.
265
- #
266
- # * Label keys can contain lowercase letters, digits and hyphens, must start
267
- # with a letter, and must end with a letter or digit.
268
- # * Non-zero label values can contain lowercase letters, digits and hyphens,
269
- # must start with a letter, and must end with a letter or digit.
270
- # * No more than 64 labels can be associated with a given request.
271
- #
272
- # See https://goo.gl/xmQnxf for more information on and examples of labels.
251
+ # The labels applied to a resource must meet the following requirements:
252
+ #
253
+ # * Each resource can have multiple labels, up to a maximum of 64.
254
+ # * Each label must be a key-value pair.
255
+ # * Keys have a minimum length of 1 character and a maximum length of 63
256
+ # characters, and cannot be empty. Values can be empty, and have a maximum
257
+ # length of 63 characters.
258
+ # * Keys and values can contain only lowercase letters, numeric characters,
259
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
260
+ # international characters are allowed.
261
+ # * The key portion of a label must be unique. However, you can use the same
262
+ # key with multiple resources.
263
+ # * Keys must start with a lowercase letter or international character.
264
+ #
265
+ # See [Google Cloud
266
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
267
+ # for more details.
273
268
  #
274
269
  # @yield [response, operation] Access the result along with the RPC operation
275
270
  # @yieldparam response [::Google::Cloud::Retail::V2::PredictResponse]
@@ -305,7 +300,9 @@ module Google
305
300
  options.apply_defaults timeout: @config.rpcs.predict.timeout,
306
301
  metadata: metadata,
307
302
  retry_policy: @config.rpcs.predict.retry_policy
308
- options.apply_defaults metadata: @config.metadata,
303
+
304
+ options.apply_defaults timeout: @config.timeout,
305
+ metadata: @config.metadata,
309
306
  retry_policy: @config.retry_policy
310
307
 
311
308
  @prediction_service_stub.call_rpc :predict, request, options: options do |response, operation|
@@ -329,22 +326,21 @@ module Google
329
326
  # Configuration can be applied globally to all clients, or to a single client
330
327
  # on construction.
331
328
  #
332
- # # Examples
333
- #
334
- # To modify the global config, setting the timeout for predict
335
- # to 20 seconds, and all remaining timeouts to 10 seconds:
336
- #
337
- # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config|
338
- # config.timeout = 10.0
339
- # config.rpcs.predict.timeout = 20.0
340
- # end
341
- #
342
- # To apply the above configuration only to a new client:
343
- #
344
- # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config|
345
- # config.timeout = 10.0
346
- # config.rpcs.predict.timeout = 20.0
347
- # end
329
+ # @example
330
+ #
331
+ # # Modify the global config, setting the timeout for
332
+ # # predict to 20 seconds,
333
+ # # and all remaining timeouts to 10 seconds.
334
+ # ::Google::Cloud::Retail::V2::PredictionService::Client.configure do |config|
335
+ # config.timeout = 10.0
336
+ # config.rpcs.predict.timeout = 20.0
337
+ # end
338
+ #
339
+ # # Apply the above configuration only to a new client.
340
+ # client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config|
341
+ # config.timeout = 10.0
342
+ # config.rpcs.predict.timeout = 20.0
343
+ # end
348
344
  #
349
345
  # @!attribute [rw] endpoint
350
346
  # The hostname or hostname:port of the service endpoint.