@@ -29,6 +29,249 @@ option objc_class_prefix = "RETAIL";
29
29
option php_namespace = "Google\\Cloud\\Retail\\V2beta" ;
30
30
option ruby_package = "Google::Cloud::Retail::V2beta" ;
31
31
32
+ // The type of solution.
33
+ enum SolutionType {
34
+ // Default value.
35
+ SOLUTION_TYPE_UNSPECIFIED = 0 ;
36
+
37
+ // Used for Recommendations AI.
38
+ SOLUTION_TYPE_RECOMMENDATION = 1 ;
39
+
40
+ // Used for Retail Search.
41
+ SOLUTION_TYPE_SEARCH = 2 ;
42
+ }
43
+
44
+ // Metadata that is used to define a condition that triggers an action.
45
+ // A valid condition must specify at least one of 'query_terms' or
46
+ // 'products_filter'. If multiple fields are specified, the condition is met if
47
+ // all the fields are satisfied e.g. if a set of query terms and product_filter
48
+ // are set, then only items matching the product_filter for requests with a
49
+ // query matching the query terms wil get boosted.
50
+ message Condition {
51
+ // Query terms that we want to match on.
52
+ message QueryTerm {
53
+ // The value of the term to match on.
54
+ // Value cannot be empty.
55
+ // Value can have at most 3 terms if specified as a partial match. Each
56
+ // space separated string is considered as one term.
57
+ // Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not
58
+ // allowed for partial match.
59
+ string value = 1 ;
60
+
61
+ // Whether this is supposed to be a full or partial match.
62
+ bool full_match = 2 ;
63
+ }
64
+
65
+ // Used for time-dependent conditions.
66
+ // Example: Want to have rule applied for week long sale.
67
+ message TimeRange {
68
+ // Start of time range. Range is inclusive.
69
+ google.protobuf.Timestamp start_time = 1 ;
70
+
71
+ // End of time range. Range is inclusive.
72
+ google.protobuf.Timestamp end_time = 2 ;
73
+ }
74
+
75
+ // A list (up to 10 entries) of terms to match the query on. If not
76
+ // specified, match all queries.
77
+ // If many query terms are specified, the condition
78
+ // is matched if any of the terms is a match (i.e. using the OR operator).
79
+ repeated QueryTerm query_terms = 1 ;
80
+
81
+ // Range of time(s) specifying when Condition is active.
82
+ // Condition true if any time range matches.
83
+ repeated TimeRange active_time_range = 3 ;
84
+ }
85
+
86
+ // A rule is a condition-action pair
87
+ // * A condition defines when a rule is to be triggered.
88
+ // * An action specifies what occurs on that trigger.
89
+ // Currently only boost rules are supported.
90
+ // Currently only supported by the search endpoint.
91
+ message Rule {
92
+ // A boost action to apply to results matching condition specified above.
93
+ message BoostAction {
94
+ // Strength of the condition boost, which must be in [-1, 1]. Negative
95
+ // boost means demotion. Default is 0.0.
96
+ //
97
+ // Setting to 1.0 gives the item a big promotion. However, it does not
98
+ // necessarily mean that the boosted item will be the top result at all
99
+ // times, nor that other items will be excluded. Results could still be
100
+ // shown even when none of them matches the condition. And results that
101
+ // are significantly more relevant to the search query can still trump
102
+ // your heavily favored but irrelevant items.
103
+ //
104
+ // Setting to -1.0 gives the item a big demotion. However, results that
105
+ // are deeply relevant might still be shown. The item will have an
106
+ // upstream battle to get a fairly high ranking, but it is not blocked out
107
+ // completely.
108
+ //
109
+ // Setting to 0.0 means no boost applied. The boosting condition is
110
+ // ignored.
111
+ float boost = 1 ;
112
+
113
+ // The filter can have a max size of 5000 characters.
114
+ // An expression which specifies which products to apply an action to.
115
+ // The syntax and supported fields are the same as a filter expression. See
116
+ // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]
117
+ // for detail syntax and limitations.
118
+ //
119
+ // Examples:
120
+ //
121
+ // * To boost products with product ID "product_1" or "product_2", and
122
+ // color
123
+ // "Red" or "Blue":<br>
124
+ // *(id: ANY("product_1", "product_2"))<br>*
125
+ // *AND<br>*
126
+ // *(colorFamilies: ANY("Red", "Blue"))<br>*
127
+ string products_filter = 2 ;
128
+ }
129
+
130
+ // * Rule Condition:
131
+ // - No [Condition][query_terms] provided is a global match.
132
+ // - 1 or more [Condition][query_terms] provided is combined with OR
133
+ // operator.
134
+ // * Action Input: The request query and filter that will be applied to the
135
+ // retrieved products, in addition to any filters already provided with the
136
+ // SearchRequest. The AND operator is used to combine the query's existing
137
+ // filters with the filter rule(s). NOTE: May result in 0 results when
138
+ // filters conflict.
139
+ // * Action Result: Filters the returned objects to be ONLY those that passed
140
+ // the filter.
141
+ message FilterAction {
142
+ // A filter to apply on the matching condition results. Supported features:
143
+ //
144
+ // * [filter][google.cloud.retail.v2beta.Rule.FilterAction.filter] must be
145
+ // set.
146
+ // * Filter syntax is identical to
147
+ // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter].
148
+ // See more
149
+ // details at the Retail Search
150
+ // [user guide](/retail/search/docs/filter-and-order#filter).
151
+ // * To filter products with product ID "product_1" or "product_2", and
152
+ // color
153
+ // "Red" or "Blue":<br>
154
+ // *(id: ANY("product_1", "product_2"))<br>*
155
+ // *AND<br>*
156
+ // *(colorFamilies: ANY("Red", "Blue"))<br>*
157
+ string filter = 1 ;
158
+ }
159
+
160
+ // Redirects a shopper to a specific page.
161
+ // * Rule Condition:
162
+ // - Must specify [Condition][query_terms].
163
+ // * Action Input: Request Query
164
+ // * Action Result: Redirects shopper to provided uri.
165
+ message RedirectAction {
166
+ // URL must have length equal or less than 2000 characters.
167
+ string redirect_uri = 1 ;
168
+ }
169
+
170
+ // Creates a set of terms that will be treated as synonyms of each other.
171
+ // Example: synonyms of "sneakers" and "shoes".
172
+ // * "sneakers" will use a synonym of "shoes".
173
+ // * "shoes" will use a synonym of "sneakers".
174
+ message TwowaySynonymsAction {
175
+ // Defines a set of synonyms.
176
+ // Can specify up to 100 synonyms.
177
+ // Must specify at least 2 synonyms.
178
+ repeated string synonyms = 1 ;
179
+ }
180
+
181
+ // Maps a set of terms to a set of synonyms.
182
+ // Set of synonyms will be treated as synonyms of each query term only.
183
+ // `query_terms` will not be treated as synonyms of each other.
184
+ // Example: "sneakers" will use a synonym of "shoes".
185
+ // "shoes" will not use a synonym of "sneakers".
186
+ message OnewaySynonymsAction {
187
+ // Terms from the search query.
188
+ // Will treat synonyms as their synonyms.
189
+ // Not themselves synonyms of the synonyms.
190
+ // Can specify up to 100 terms.
191
+ repeated string query_terms = 3 ;
192
+
193
+ // Defines a set of synonyms.
194
+ // Cannot contain duplicates.
195
+ // Can specify up to 100 synonyms.
196
+ repeated string synonyms = 4 ;
197
+
198
+ // Will be [deprecated = true] post migration;
199
+ repeated string oneway_terms = 2 ;
200
+ }
201
+
202
+ // Prevents `query_term` from being associated with specified terms during
203
+ // search.
204
+ // Example: Don't associate "gShoe" and "cheap".
205
+ message DoNotAssociateAction {
206
+ // Terms from the search query.
207
+ // Will not consider do_not_associate_terms for search if in search query.
208
+ // Can specify up to 100 terms.
209
+ repeated string query_terms = 2 ;
210
+
211
+ // Cannot contain duplicates or the query term.
212
+ // Can specify up to 100 terms.
213
+ repeated string do_not_associate_terms = 3 ;
214
+
215
+ // Will be [deprecated = true] post migration;
216
+ repeated string terms = 1 ;
217
+ }
218
+
219
+ // Replaces a term in the query. Multiple replacement candidates can be
220
+ // specified. All `query_terms` will be replaced with the replacement term.
221
+ // Example: Replace "gShoe" with "google shoe".
222
+ message ReplacementAction {
223
+ // Terms from the search query.
224
+ // Will be replaced by replacement term.
225
+ // Can specify up to 100 terms.
226
+ repeated string query_terms = 2 ;
227
+
228
+ // Term that will be used for replacement.
229
+ string replacement_term = 3 ;
230
+
231
+ // Will be [deprecated = true] post migration;
232
+ string term = 1 ;
233
+ }
234
+
235
+ // Prevents a term in the query from being used in search.
236
+ // Example: Don't search for "shoddy".
237
+ message IgnoreAction {
238
+ // Terms to ignore in the search query.
239
+ repeated string ignore_terms = 1 ;
240
+ }
241
+
242
+ // An action must be provided.
243
+ oneof action {
244
+ // A boost action.
245
+ BoostAction boost_action = 2 ;
246
+
247
+ // Redirects a shopper to a specific page.
248
+ RedirectAction redirect_action = 3 ;
249
+
250
+ // Treats specific term as a synonym with a group of terms.
251
+ // Group of terms will not be treated as synonyms with the specific term.
252
+ OnewaySynonymsAction oneway_synonyms_action = 6 ;
253
+
254
+ // Prevents term from being associated with other terms.
255
+ DoNotAssociateAction do_not_associate_action = 7 ;
256
+
257
+ // Replaces specific terms in the query.
258
+ ReplacementAction replacement_action = 8 ;
259
+
260
+ // Ignores specific terms from query during search.
261
+ IgnoreAction ignore_action = 9 ;
262
+
263
+ // Filters results.
264
+ FilterAction filter_action = 10 ;
265
+
266
+ // Treats a set of terms as synonyms of one another.
267
+ TwowaySynonymsAction twoway_synonyms_action = 11 ;
268
+ }
269
+
270
+ // Required. The condition that triggers the rule.
271
+ // If the condition is empty, the rule will always apply.
272
+ Condition condition = 1 [(google.api.field_behavior ) = REQUIRED ];
273
+ }
274
+
32
275
// An intended audience of the [Product][google.cloud.retail.v2beta.Product] for
33
276
// whom it's sold.
34
277
message Audience {
@@ -100,10 +343,6 @@ message CustomAttribute {
100
343
// The textual values of this custom attribute. For example, `["yellow",
101
344
// "green"]` when the key is "color".
102
345
//
103
- // At most 400 values are allowed. Empty values are not allowed. Each value
104
- // must be a UTF-8 encoded string with a length limit of 256 characters.
105
- // Otherwise, an INVALID_ARGUMENT error is returned.
106
- //
107
346
// Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
108
347
// [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
109
348
// set. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -112,9 +351,6 @@ message CustomAttribute {
112
351
// The numerical values of this custom attribute. For example, `[2.3, 15.4]`
113
352
// when the key is "lengths_cm".
114
353
//
115
- // At most 400 values are allowed.Otherwise, an INVALID_ARGUMENT error is
116
- // returned.
117
- //
118
354
// Exactly one of [text][google.cloud.retail.v2beta.CustomAttribute.text] or
119
355
// [numbers][google.cloud.retail.v2beta.CustomAttribute.numbers] should be
120
356
// set. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -280,7 +516,7 @@ message PriceInfo {
280
516
//
281
517
// Google Merchant Center property
282
518
// [price](https://support.google.com/merchants/answer/6324371). Schema.org
283
- // property [Offer.priceSpecification ](https://schema.org/priceSpecification ).
519
+ // property [Offer.price ](https://schema.org/price ).
284
520
float price = 2 ;
285
521
286
522
// Price of the product without any discount. If zero, by default set to be
0 commit comments