Skip to content

Commit 4e4e58c

Browse files
Google APIscopybara-github
authored andcommitted
feat: support async write mode for WriteUserEvent API
feat: support collect and import 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 feat: allow set feed id in merchant center link feat: support batch remove catalog attribute config feat: support attribute suggestion in autocomplete feat: support data output to GCS feat: expose the local inventory data in product data retrieval feat: return personal product labels in search response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 495450955
1 parent 483c1ee commit 4e4e58c

20 files changed

Lines changed: 569 additions & 235 deletions

google/cloud/retail/logging/error_log.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ message ErrorContext {
5959
SourceLocation report_location = 2;
6060
}
6161

62-
// The error payload that is populated on LRO import APIs. Including:
63-
// "google.cloud.retail.v2.ProductService.ImportProducts"
64-
// "google.cloud.retail.v2.EventService.ImportUserEvents"
62+
// The error payload that is populated on LRO import APIs, including
63+
// "google.cloud.retail.v2.ProductService.ImportProducts" and
64+
// "google.cloud.retail.v2.EventService.ImportUserEvents".
6565
message ImportErrorContext {
6666
// The operation resource name of the LRO.
6767
string operation_name = 1;

google/cloud/retail/v2alpha/catalog.proto

Lines changed: 71 additions & 18 deletions
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.v2alpha.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.v2alpha.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.v2alpha.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.v2alpha.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.v2alpha.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`.
@@ -165,13 +188,13 @@ message CatalogAttribute {
165188
// APIs. This field is `False` for pre-loaded
166189
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
167190
//
168-
// Only pre-loaded
169-
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
170-
// neither in use by products nor predefined can be deleted.
171-
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
172-
// either in use by products or are predefined cannot be deleted; however,
173-
// their configuration properties will reset to default values upon removal
174-
// request.
191+
// Only pre-loaded [catalog
192+
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are neither
193+
// in use by products nor predefined can be deleted. [Catalog
194+
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are
195+
// either in use by products or are predefined attributes cannot be deleted;
196+
// however, their configuration properties will reset to default values upon
197+
// removal request.
175198
//
176199
// After catalog changes, it takes about 10 minutes for this field to update.
177200
bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -185,12 +208,16 @@ message CatalogAttribute {
185208
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
186209
// are indexed so that it can be filtered, faceted, or boosted in
187210
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
211+
//
212+
// Must be specified, otherwise throws INVALID_FORMAT error.
188213
IndexableOption indexable_option = 5;
189214

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

196223
// When
@@ -203,6 +230,8 @@ message CatalogAttribute {
203230
// will not be searchable by text queries in
204231
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
205232
// as there are no text values associated to numerical attributes.
233+
//
234+
// Must be specified, otherwise throws INVALID_FORMAT error.
206235
SearchableOption searchable_option = 7;
207236

208237
// When
@@ -212,6 +241,15 @@ message CatalogAttribute {
212241
// This option works for categorical features only,
213242
// does not work for numerical features, inventory filtering.
214243
RecommendationsFilteringOption recommendations_filtering_option = 8;
244+
245+
// If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
246+
// This property only applies to textual custom attributes and requires
247+
// indexable set to enabled to enable exact-searchable.
248+
ExactSearchableOption exact_searchable_option = 11;
249+
250+
// If RETRIEVABLE_ENABLED, attribute values are retrievable in the search
251+
// results.
252+
RetrievableOption retrievable_option = 12;
215253
}
216254

217255
// Catalog level attribute config.
@@ -336,21 +374,21 @@ message CompletionConfig {
336374
// will be streamed to the linked branch.
337375
message MerchantCenterLink {
338376
// Required. The linked [Merchant center account
339-
// id](https://developers.google.com/shopping-content/guides/accountstatuses).
377+
// ID](https://developers.google.com/shopping-content/guides/accountstatuses).
340378
// The account must be a standalone account or a sub-account of a MCA.
341379
int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED];
342380

343-
// The branch id (e.g. 0/1/2) within this catalog that products from
381+
// The branch ID (e.g. 0/1/2) within this catalog that products from
344382
// merchant_center_account_id are streamed to. When updating this field, an
345383
// empty value will use the currently configured default branch. However,
346384
// changing the default branch later on won't change the linked branch here.
347385
//
348-
// A single branch id can only have one linked merchant center account id.
386+
// A single branch ID can only have one linked merchant center account ID.
349387
string branch_id = 2;
350388

351389
// String representing the destination to import for, all if left empty.
352-
// List of possible values can be found here.
353-
// [https://support.google.com/merchants/answer/7501026]
390+
// List of possible values is given in [Included
391+
// destination](https://support.google.com/merchants/answer/7501026).
354392
// List of allowed string values:
355393
// "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
356394
// _ads", "Free_listings", "Free_local_listings"
@@ -375,6 +413,21 @@ message MerchantCenterLink {
375413
//
376414
// Example value: `en`.
377415
string language_code = 5;
416+
417+
// Criteria for the Merchant Center feeds to be ingested via the link.
418+
// All offers will be ingested if the list is empty.
419+
// Otherwise the offers will be ingested from selected feeds.
420+
repeated MerchantCenterFeedFilter feeds = 6;
421+
}
422+
423+
// Merchant Center Feed filter criterion.
424+
message MerchantCenterFeedFilter {
425+
// Merchant Center primary feed ID.
426+
int64 primary_feed_id = 1;
427+
428+
// Merchant Center primary feed name. The name is used for the display
429+
// purposes only.
430+
string primary_feed_name = 2;
378431
}
379432

380433
// Configures Merchant Center linking.

google/cloud/retail/v2alpha/catalog_service.proto

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,17 @@ service CatalogService {
186186
};
187187
}
188188

189+
// Removes all specified
190+
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s from the
191+
// [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
192+
rpc BatchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest)
193+
returns (BatchRemoveCatalogAttributesResponse) {
194+
option (google.api.http) = {
195+
post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes"
196+
body: "*"
197+
};
198+
}
199+
189200
// Replaces the specified
190201
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
191202
// [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
@@ -341,7 +352,7 @@ message GetDefaultBranchResponse {
341352
// method.
342353
message GetCompletionConfigRequest {
343354
// Required. Full CompletionConfig resource name. Format:
344-
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
355+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
345356
string name = 1 [
346357
(google.api.field_behavior) = REQUIRED,
347358
(google.api.resource_reference) = {
@@ -449,6 +460,44 @@ message RemoveCatalogAttributeRequest {
449460
string key = 2 [(google.api.field_behavior) = REQUIRED];
450461
}
451462

463+
// Request for
464+
// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]
465+
// method.
466+
message BatchRemoveCatalogAttributesRequest {
467+
// Required. The attributes config resource shared by all catalog attributes
468+
// being deleted. Format:
469+
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
470+
string attributes_config = 1 [
471+
(google.api.field_behavior) = REQUIRED,
472+
(google.api.resource_reference) = {
473+
type: "retail.googleapis.com/AttributesConfig"
474+
}
475+
];
476+
477+
// Required. The attribute name keys of the
478+
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s to
479+
// delete. A maximum of 1000 catalog attributes can be deleted in a batch.
480+
repeated string attribute_keys = 2 [(google.api.field_behavior) = REQUIRED];
481+
}
482+
483+
// Response of the
484+
// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes].
485+
message BatchRemoveCatalogAttributesResponse {
486+
// Catalog attributes that were deleted. Only pre-loaded [catalog
487+
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are
488+
// neither [in
489+
// use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by
490+
// products nor predefined can be deleted.
491+
repeated string deleted_catalog_attributes = 1;
492+
493+
// Catalog attributes that were reset. [Catalog
494+
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are either
495+
// [in use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by products
496+
// or are predefined attributes cannot be deleted; however, their
497+
// configuration properties will reset to default values upon removal request.
498+
repeated string reset_catalog_attributes = 2;
499+
}
500+
452501
// Request for
453502
// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute]
454503
// method.

google/cloud/retail/v2alpha/common.proto

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ enum RecommendationsFilteringOption {
7272
// The use case of Cloud Retail Search.
7373
enum SearchSolutionUseCase {
7474
// The value when it's unspecified. In this case, server behavior defaults to
75-
// [SEARCH_SOLUTION_USE_CASE_SEARCH][].
75+
// [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
7676
SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;
7777

7878
// Search use case. Expects the traffic has a non-empty
@@ -97,8 +97,8 @@ message Condition {
9797
// Value cannot be empty.
9898
// Value can have at most 3 terms if specified as a partial match. Each
9999
// space separated string is considered as one term.
100-
// Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not
101-
// allowed for partial match.
100+
// For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms
101+
// and not allowed for a partial match.
102102
string value = 1;
103103

104104
// Whether this is supposed to be a full or partial match.
@@ -127,10 +127,12 @@ message Condition {
127127
}
128128

129129
// A rule is a condition-action pair
130+
//
130131
// * A condition defines when a rule is to be triggered.
131132
// * An action specifies what occurs on that trigger.
132-
// Currently only boost rules are supported.
133-
// Currently only supported by the search endpoint.
133+
// Currently rules only work for [controls][google.cloud.retail.v2alpha.Control]
134+
// with
135+
// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH].
134136
message Rule {
135137
// A boost action to apply to results matching condition specified above.
136138
message BoostAction {
@@ -216,7 +218,8 @@ message Rule {
216218
}
217219

218220
// Creates a set of terms that will be treated as synonyms of each other.
219-
// Example: synonyms of "sneakers" and "shoes".
221+
// Example: synonyms of "sneakers" and "shoes":
222+
//
220223
// * "sneakers" will use a synonym of "shoes".
221224
// * "shoes" will use a synonym of "sneakers".
222225
message TwowaySynonymsAction {

google/cloud/retail/v2alpha/completion_service.proto

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha";
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: "/v2alpha/{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
//
@@ -148,6 +150,11 @@ message CompleteQueryRequest {
148150
// The maximum allowed max suggestions is 20. If it is set higher, it will be
149151
// capped by 20.
150152
int32 max_suggestions = 5;
153+
154+
// If true, attribute suggestions are enabled and provided in response.
155+
//
156+
// This field is only available for "cloud-retail" dataset.
157+
bool enable_attribute_suggestions = 9;
151158
}
152159

153160
// Response of the auto-complete query.
@@ -175,6 +182,12 @@ message CompleteQueryResponse {
175182
string recent_search = 1;
176183
}
177184

185+
// Resource that represents attribute results.
186+
message AttributeResult {
187+
// The list of suggestions for the attribute.
188+
repeated string suggestions = 1;
189+
}
190+
178191
// Results of the matching suggestions. The result list is ordered and the
179192
// first result is top suggestion.
180193
repeated CompletionResult completion_results = 1;
@@ -207,4 +220,14 @@ message CompleteQueryResponse {
207220
// Recent searches are deduplicated. More recent searches will be reserved
208221
// when duplication happens.
209222
repeated RecentSearchResult recent_search_results = 3;
223+
224+
// A map of matched attribute suggestions. This field is only available for
225+
// "cloud-retail" dataset.
226+
//
227+
// Current supported keys:
228+
//
229+
// * `brands`
230+
//
231+
// * `categories`
232+
map<string, AttributeResult> attribute_results = 4;
210233
}

0 commit comments

Comments
 (0)