Skip to content

Commit d18b703

Browse files
feat: support async write mode for WriteUserEvent API (#3770)
* feat: support async write mode for WriteUserEvent API feat: support collect GA4 event format with prebuilt whistle rule feat: support exact searchable and retrievable in catalog attribute config feat: deprecate retrievable_fields in product attribute feat: support diversity type in serving config docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 495660792 Source-Link: googleapis/googleapis@0dbe50f Source-Link: googleapis/googleapis-gen@59b8ced Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiNTliOGNlZDA2NmJhMTk2NTdlMDZkNzhjMjAxZTYyMGNhNmFiNzljMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d5ba1b4 commit d18b703

36 files changed

+805
-235
lines changed

packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog.proto

+51-13
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ message CatalogAttribute {
104104

105105
// The status of the indexable option of a catalog attribute.
106106
enum IndexableOption {
107-
// Value used when unset. Defaults to
108-
// [INDEXABLE_ENABLED][google.cloud.retail.v2.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
107+
// Value used when unset.
109108
INDEXABLE_OPTION_UNSPECIFIED = 0;
110109

111110
// Indexable option enabled for an attribute.
@@ -117,8 +116,7 @@ message CatalogAttribute {
117116

118117
// The status of the dynamic facetable option of a catalog attribute.
119118
enum DynamicFacetableOption {
120-
// Value used when unset. Defaults to
121-
// [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
119+
// Value used when unset.
122120
DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0;
123121

124122
// Dynamic facetable option enabled for an attribute.
@@ -130,8 +128,7 @@ message CatalogAttribute {
130128

131129
// The status of the searchable option of a catalog attribute.
132130
enum SearchableOption {
133-
// Value used when unset. Defaults to
134-
// [SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
131+
// Value used when unset.
135132
SEARCHABLE_OPTION_UNSPECIFIED = 0;
136133

137134
// Searchable option enabled for an attribute.
@@ -141,6 +138,32 @@ message CatalogAttribute {
141138
SEARCHABLE_DISABLED = 2;
142139
}
143140

141+
// The status of the exact-searchable option of a catalog attribute.
142+
enum ExactSearchableOption {
143+
// Value used when unset. Defaults to
144+
// [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
145+
EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;
146+
147+
// Exact searchable option enabled for an attribute.
148+
EXACT_SEARCHABLE_ENABLED = 1;
149+
150+
// Exact searchable option disabled for an attribute.
151+
EXACT_SEARCHABLE_DISABLED = 2;
152+
}
153+
154+
// The status of the retrievable option of a catalog attribute.
155+
enum RetrievableOption {
156+
// Value used when unset. Defaults to
157+
// [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
158+
RETRIEVABLE_OPTION_UNSPECIFIED = 0;
159+
160+
// Retrievable option enabled for an attribute.
161+
RETRIEVABLE_ENABLED = 1;
162+
163+
// Retrievable option disabled for an attribute.
164+
RETRIEVABLE_DISABLED = 2;
165+
}
166+
144167
// Required. Attribute name.
145168
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
146169
// `attributes.xyz`.
@@ -164,13 +187,13 @@ message CatalogAttribute {
164187
// APIs. This field is `False` for pre-loaded
165188
// [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s.
166189
//
167-
// Only pre-loaded
168-
// [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s that are
169-
// neither in use by products nor predefined can be deleted.
170-
// [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s that are
171-
// either in use by products or are predefined cannot be deleted; however,
172-
// their configuration properties will reset to default values upon removal
173-
// request.
190+
// Only pre-loaded [catalog
191+
// attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in
192+
// use by products nor predefined can be deleted. [Catalog
193+
// attributes][google.cloud.retail.v2.CatalogAttribute] that are
194+
// either in use by products or are predefined attributes cannot be deleted;
195+
// however, their configuration properties will reset to default values upon
196+
// removal request.
174197
//
175198
// After catalog changes, it takes about 10 minutes for this field to update.
176199
bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -184,12 +207,16 @@ message CatalogAttribute {
184207
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
185208
// are indexed so that it can be filtered, faceted, or boosted in
186209
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
210+
//
211+
// Must be specified, otherwise throws INVALID_FORMAT error.
187212
IndexableOption indexable_option = 5;
188213

189214
// If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
190215
// facet. Could only be DYNAMIC_FACETABLE_DISABLED if
191216
// [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option]
192217
// is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
218+
//
219+
// Must be specified, otherwise throws INVALID_FORMAT error.
193220
DynamicFacetableOption dynamic_facetable_option = 6;
194221

195222
// When
@@ -202,7 +229,18 @@ message CatalogAttribute {
202229
// will not be searchable by text queries in
203230
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as
204231
// there are no text values associated to numerical attributes.
232+
//
233+
// Must be specified, otherwise throws INVALID_FORMAT error.
205234
SearchableOption searchable_option = 7;
235+
236+
// If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
237+
// This property only applies to textual custom attributes and requires
238+
// indexable set to enabled to enable exact-searchable.
239+
ExactSearchableOption exact_searchable_option = 11;
240+
241+
// If RETRIEVABLE_ENABLED, attribute values are retrievable in the search
242+
// results.
243+
RetrievableOption retrievable_option = 12;
206244
}
207245

208246
// Catalog level attribute config.

packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog_service.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ message GetDefaultBranchResponse {
339339
// method.
340340
message GetCompletionConfigRequest {
341341
// Required. Full CompletionConfig resource name. Format:
342-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
342+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
343343
string name = 1 [
344344
(google.api.field_behavior) = REQUIRED,
345345
(google.api.resource_reference) = {

packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto

+5-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ message Condition {
8383
// Value cannot be empty.
8484
// Value can have at most 3 terms if specified as a partial match. Each
8585
// space separated string is considered as one term.
86-
// Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not
87-
// allowed for partial match.
86+
// For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms
87+
// and not allowed for a partial match.
8888
string value = 1;
8989

9090
// Whether this is supposed to be a full or partial match.
@@ -113,6 +113,7 @@ message Condition {
113113
}
114114

115115
// A rule is a condition-action pair
116+
//
116117
// * A condition defines when a rule is to be triggered.
117118
// * An action specifies what occurs on that trigger.
118119
// Currently rules only work for [controls][google.cloud.retail.v2.Control] with
@@ -201,7 +202,8 @@ message Rule {
201202
}
202203

203204
// Creates a set of terms that will be treated as synonyms of each other.
204-
// Example: synonyms of "sneakers" and "shoes".
205+
// Example: synonyms of "sneakers" and "shoes":
206+
//
205207
// * "sneakers" will use a synonym of "shoes".
206208
// * "shoes" will use a synonym of "sneakers".
207209
message TwowaySynonymsAction {

packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto

+7-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2";
3636
// Auto-completion service for retail.
3737
//
3838
// This feature is only available for users who have Retail Search enabled.
39-
// Please enable Retail Search on Cloud Console before using this feature.
39+
// Enable Retail Search on Cloud Console before using this feature.
4040
service CompletionService {
4141
option (google.api.default_host) = "retail.googleapis.com";
4242
option (google.api.oauth_scopes) =
@@ -45,7 +45,7 @@ service CompletionService {
4545
// Completes the specified prefix with keyword suggestions.
4646
//
4747
// This feature is only available for users who have Retail Search enabled.
48-
// Please enable Retail Search on Cloud Console before using this feature.
48+
// Enable Retail Search on Cloud Console before using this feature.
4949
rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
5050
option (google.api.http) = {
5151
get: "/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery"
@@ -60,7 +60,7 @@ service CompletionService {
6060
// are indexed successfully and ready for serving. The process takes hours.
6161
//
6262
// This feature is only available for users who have Retail Search enabled.
63-
// Please enable Retail Search on Cloud Console before using this feature.
63+
// Enable Retail Search on Cloud Console before using this feature.
6464
rpc ImportCompletionData(ImportCompletionDataRequest)
6565
returns (google.longrunning.Operation) {
6666
option (google.api.http) = {
@@ -110,8 +110,10 @@ message CompleteQueryRequest {
110110
// number of language codes is 3.
111111
repeated string language_codes = 3;
112112

113-
// The device type context for completion suggestions.
114-
// It is useful to apply different suggestions on different device types, e.g.
113+
// The device type context for completion suggestions. We recommend that you
114+
// leave this field empty.
115+
//
116+
// It can apply different suggestions on different device types, e.g.
115117
// `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
116118
// types.
117119
//

packages/google-cloud-retail/protos/google/cloud/retail/v2/control.proto

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ message Control {
6060
// characters. Otherwise, an INVALID_ARGUMENT error is thrown.
6161
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
6262

63-
// Output only. List of [serving
64-
// configuration][google.cloud.retail.v2.ServingConfig] ids that are
65-
// associated with this control in the same
63+
// Output only. List of [serving config][google.cloud.retail.v2.ServingConfig]
64+
// ids that are associated with this control in the same
6665
// [Catalog][google.cloud.retail.v2.Catalog].
6766
//
6867
// Note the association is managed via the

packages/google-cloud-retail/protos/google/cloud/retail/v2/prediction_service.proto

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.retail.v2;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
2223
import "google/cloud/retail/v2/user_event.proto";
2324
import "google/protobuf/struct.proto";
2425

@@ -61,7 +62,7 @@ message PredictRequest {
6162
// The ID of the Recommendations AI serving config or placement.
6263
// Before you can request predictions from your model, you must create at
6364
// least one serving config or placement for it. For more information, see
64-
// [Managing serving configurations]
65+
// [Manage serving configs]
6566
// (https://cloud.google.com/retail/docs/manage-configs).
6667
//
6768
// The full list of available serving configs can be seen at
@@ -116,12 +117,11 @@ message PredictRequest {
116117
// * filterOutOfStockItems tag=(-"promotional")
117118
// * filterOutOfStockItems
118119
//
119-
// If your filter blocks all prediction results, the API will return generic
120-
// (unfiltered) popular products. If you only want results strictly matching
121-
// the filters, set `strictFiltering` to True in `PredictRequest.params` to
122-
// receive empty results instead.
123-
// Note that the API will never return items with storageStatus of "EXPIRED"
124-
// or "DELETED" regardless of filter choices.
120+
// If your filter blocks all prediction results, the API will return *no*
121+
// results. If instead you want empty result sets to return generic
122+
// (unfiltered) popular products, set `strictFiltering` to False in
123+
// `PredictRequest.params`. Note that the API will never return items with
124+
// storageStatus of "EXPIRED" or "DELETED" regardless of filter choices.
125125
//
126126
// If `filterSyntaxV2` is set to true under the `params` field, then
127127
// attribute-based expressions are expected instead of the above described
@@ -148,7 +148,7 @@ message PredictRequest {
148148
// * `returnScore`: Boolean. If set to true, the prediction 'score'
149149
// corresponding to each returned product will be set in the
150150
// `results.metadata` field in the prediction response. The given
151-
// 'score' indicates the probability of an product being clicked/purchased
151+
// 'score' indicates the probability of a product being clicked/purchased
152152
// given the user's context and history.
153153
// * `strictFiltering`: Boolean. True by default. If set to false, the service
154154
// will return generic (unfiltered) popular products instead of empty if

packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto

+28-6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ message Product {
104104

105105
oneof expiration {
106106
// The timestamp when this product becomes unavailable for
107-
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
107+
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note
108+
// that this is only applicable to
109+
// [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
110+
// [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and
111+
// ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
112+
// In general, we suggest the users to delete the stale products explicitly,
113+
// instead of using this field to determine staleness.
108114
//
109115
// If it is set, the [Product][google.cloud.retail.v2.Product] is not
110116
// available for
@@ -124,7 +130,13 @@ message Product {
124130
// [expiration_date](https://support.google.com/merchants/answer/6324499).
125131
google.protobuf.Timestamp expire_time = 16;
126132

127-
// Input only. The TTL (time to live) of the product.
133+
// Input only. The TTL (time to live) of the product. Note that this is only
134+
// applicable to [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
135+
// and [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION],
136+
// and ignored for
137+
// [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. In general,
138+
// we suggest the users to delete the stale products explicitly, instead of
139+
// using this field to determine staleness.
128140
//
129141
// If it is set, it must be a non-negative value, and
130142
// [expire_time][google.cloud.retail.v2.Product.expire_time] is set as
@@ -226,7 +238,7 @@ message Product {
226238
//
227239
//
228240
// To represent full path of category, use '>' sign to separate different
229-
// hierarchies. If '>' is part of the category name, please replace it with
241+
// hierarchies. If '>' is part of the category name, replace it with
230242
// other character(s).
231243
//
232244
// For example, if a shoes product belongs to both
@@ -356,7 +368,11 @@ message Product {
356368

357369
// The timestamp when this [Product][google.cloud.retail.v2.Product] becomes
358370
// available for
359-
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
371+
// [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note
372+
// that this is only applicable to
373+
// [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and
374+
// [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and
375+
// ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT].
360376
google.protobuf.Timestamp available_time = 18;
361377

362378
// The online availability of the [Product][google.cloud.retail.v2.Product].
@@ -542,7 +558,9 @@ message Product {
542558
// Note: Returning more fields in
543559
// [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase
544560
// response payload size and serving latency.
545-
google.protobuf.FieldMask retrievable_fields = 30;
561+
//
562+
// This field is deprecated. Use the retrievable site-wide control instead.
563+
google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true];
546564

547565
// Output only. Product variants grouped together on primary product which
548566
// share similar product attributes. It's automatically grouped by
@@ -559,7 +577,11 @@ message Product {
559577
// Output only. A list of local inventories specific to different places.
560578
//
561579
// This is only available for users who have Retail Search enabled, and it can
562-
// be managed by [AddLocalInventories][] and [RemoveLocalInventories][] APIs.
580+
// be managed by
581+
// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
582+
// and
583+
// [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
584+
// APIs.
563585
repeated LocalInventory local_inventories = 35
564586
[(google.api.field_behavior) = OUTPUT_ONLY];
565587
}

0 commit comments

Comments
 (0)