Skip to content

Commit 4a9f933

Browse files
Google APIscopybara-github
authored andcommitted
feat: add merchant center link service
feat: support per-entity search and autocomplete feat: expose facets and product counts in autocomplete feat: add model get API feat: allow cascaded deletion on primary product feat: support new filter syntax for recommendation feat: expose A/B experiment info in search response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 523140513
1 parent 5fd971f commit 4a9f933

16 files changed

Lines changed: 455 additions & 36 deletions

google/cloud/retail/v2alpha/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ proto_library(
2929
"control_service.proto",
3030
"export_config.proto",
3131
"import_config.proto",
32+
"merchant_center_account_link.proto",
33+
"merchant_center_account_link_service.proto",
3234
"model.proto",
3335
"model_service.proto",
3436
"prediction_service.proto",
@@ -117,6 +119,8 @@ java_gapic_test(
117119
"com.google.cloud.retail.v2alpha.CompletionServiceClientTest",
118120
"com.google.cloud.retail.v2alpha.ControlServiceClientHttpJsonTest",
119121
"com.google.cloud.retail.v2alpha.ControlServiceClientTest",
122+
"com.google.cloud.retail.v2alpha.MerchantCenterAccountLinkServiceClientHttpJsonTest",
123+
"com.google.cloud.retail.v2alpha.MerchantCenterAccountLinkServiceClientTest",
120124
"com.google.cloud.retail.v2alpha.ModelServiceClientHttpJsonTest",
121125
"com.google.cloud.retail.v2alpha.ModelServiceClientTest",
122126
"com.google.cloud.retail.v2alpha.PredictionServiceClientHttpJsonTest",

google/cloud/retail/v2alpha/catalog.proto

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ message CatalogAttribute {
140140

141141
// The status of the exact-searchable option of a catalog attribute.
142142
enum ExactSearchableOption {
143-
// Value used when unset. Defaults to
144-
// [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
143+
// Value used when unset.
145144
EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;
146145

147146
// Exact searchable option enabled for an attribute.
@@ -153,8 +152,7 @@ message CatalogAttribute {
153152

154153
// The status of the retrievable option of a catalog attribute.
155154
enum RetrievableOption {
156-
// Value used when unset. Defaults to
157-
// [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
155+
// Value used when unset.
158156
RETRIEVABLE_OPTION_UNSPECIFIED = 0;
159157

160158
// Retrievable option enabled for an attribute.
@@ -171,6 +169,10 @@ message CatalogAttribute {
171169
// characters and underscores. For example, an attribute named
172170
// `attributes.abc_xyz` can be indexed, but an attribute named
173171
// `attributes.abc-xyz` cannot be indexed.
172+
//
173+
// If the attribute key starts with `attributes.`, then the attribute is a
174+
// custom attribute. Attributes such as `brands`, `patterns`, and `title` are
175+
// built-in and called system attributes.
174176
string key = 1 [(google.api.field_behavior) = REQUIRED];
175177

176178
// Output only. Indicates whether this attribute has been used by any
@@ -244,11 +246,14 @@ message CatalogAttribute {
244246

245247
// If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
246248
// This property only applies to textual custom attributes and requires
247-
// indexable set to enabled to enable exact-searchable.
249+
// indexable set to enabled to enable exact-searchable. If unset, the server
250+
// behavior defaults to
251+
// [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
248252
ExactSearchableOption exact_searchable_option = 11;
249253

250254
// If RETRIEVABLE_ENABLED, attribute values are retrievable in the search
251-
// results.
255+
// results. If unset, the server behavior defaults to
256+
// [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
252257
RetrievableOption retrievable_option = 12;
253258
}
254259

google/cloud/retail/v2alpha/common.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ message ColorInfo {
378378
// it is expected to have only 1 color. May consider using single "Mixed"
379379
// instead of multiple values.
380380
//
381-
// A maximum of 25 colors are allowed. Each value must be a UTF-8 encoded
381+
// A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded
382382
// string with a length limit of 128 characters. Otherwise, an
383383
// INVALID_ARGUMENT error is returned.
384384
//

google/cloud/retail/v2alpha/completion_service.proto

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/retail/v2alpha/common.proto";
2424
import "google/cloud/retail/v2alpha/import_config.proto";
25+
import "google/cloud/retail/v2alpha/search_service.proto";
2526
import "google/longrunning/operations.proto";
2627

2728
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
@@ -33,7 +34,7 @@ option objc_class_prefix = "RETAIL";
3334
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
3435
option ruby_package = "Google::Cloud::Retail::V2alpha";
3536

36-
// Auto-completion service for retail.
37+
// Autocomplete service for retail.
3738
//
3839
// This feature is only available for users who have Retail Search enabled.
3940
// Enable Retail Search on Cloud Console before using this feature.
@@ -74,7 +75,7 @@ service CompletionService {
7475
}
7576
}
7677

77-
// Auto-complete parameters.
78+
// Autocomplete parameters.
7879
message CompleteQueryRequest {
7980
// Required. Catalog for which the completion is performed.
8081
//
@@ -155,9 +156,17 @@ message CompleteQueryRequest {
155156
//
156157
// This field is only available for "cloud-retail" dataset.
157158
bool enable_attribute_suggestions = 9;
159+
160+
// The entity for customers that may run multiple different entities, domains,
161+
// sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
162+
// `google.com`, `youtube.com`, etc.
163+
// If this is set, it should be exactly matched with
164+
// [UserEvent.entity][google.cloud.retail.v2alpha.UserEvent.entity] to get
165+
// per-entity autocomplete results.
166+
string entity = 10;
158167
}
159168

160-
// Response of the auto-complete query.
169+
// Response of the autocomplete query.
161170
message CompleteQueryResponse {
162171
// Resource that represents completion results.
163172
message CompletionResult {
@@ -174,6 +183,19 @@ message CompleteQueryResponse {
174183
// [UserEvent.product_details][google.cloud.retail.v2alpha.UserEvent.product_details]
175184
// is imported properly.
176185
map<string, CustomAttribute> attributes = 2;
186+
187+
// Facet information for the suggestion term. Gives the number of items
188+
// resulting from a search with this suggestion term for each facet.
189+
//
190+
// This is an experimental feature for limited customers. Please reach out
191+
// to the support team if you would like to receive this information.
192+
repeated SearchResponse.Facet facets = 3;
193+
194+
// Total number of products associated with a search with this suggestion.
195+
//
196+
// This is an experimental feature for limited customers. Please reach out
197+
// to the support team if you would like to receive this information.
198+
int32 total_product_count = 4;
177199
}
178200

179201
// Recent search of this user.

google/cloud/retail/v2alpha/import_config.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ message BigQuerySource {
126126
// The schema is available here:
127127
// https://support.google.com/analytics/answer/7029846.
128128
//
129-
// Supported values for auto-completion imports:
129+
// Supported values for autocomplete imports:
130130
//
131131
// * `suggestions` (default): One JSON completion suggestion per line.
132132
// * `denylist`: One JSON deny suggestion per line.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.retail.v2alpha;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/timestamp.proto";
22+
23+
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
24+
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "MerchantCenterAccountLinkProto";
27+
option java_package = "com.google.cloud.retail.v2alpha";
28+
option objc_class_prefix = "RETAIL";
29+
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
30+
option ruby_package = "Google::Cloud::Retail::V2alpha";
31+
32+
// Represents a link between a Merchant Center account and a branch.
33+
// Once a link is established, products from the linked merchant center account
34+
// will be streamed to the linked branch.
35+
message MerchantCenterAccountLink {
36+
option (google.api.resource) = {
37+
type: "retail.googleapis.com/MerchantCenterAccountLink"
38+
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}"
39+
};
40+
41+
// Merchant Center Feed filter criterion.
42+
message MerchantCenterFeedFilter {
43+
// Merchant Center primary feed ID.
44+
int64 primary_feed_id = 1;
45+
46+
// Merchant Center primary feed name. The name is used for the display
47+
// purposes only.
48+
string primary_feed_name = 2;
49+
}
50+
51+
// The state of the link.
52+
enum State {
53+
// Default value.
54+
STATE_UNSPECIFIED = 0;
55+
56+
// Link is created and LRO is not complete.
57+
PENDING = 1;
58+
59+
// Link is active.
60+
ACTIVE = 2;
61+
62+
// Link creation failed.
63+
FAILED = 3;
64+
}
65+
66+
// Output only. Immutable. Full resource name of the Merchant Center Account
67+
// Link, such as
68+
// `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLinks/merchant_center_account_link`.
69+
string name = 1 [
70+
(google.api.field_behavior) = IMMUTABLE,
71+
(google.api.field_behavior) = OUTPUT_ONLY
72+
];
73+
74+
// Output only. Immutable.
75+
// [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
76+
// identifier, which is the final component of
77+
// [name][google.cloud.retail.v2alpha.MerchantCenterAccountLink.name]. This
78+
// field is auto generated and follows the convention:
79+
// `BranchId_MerchantCenterAccountId`.
80+
// `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLinks/id_1`.
81+
string id = 8 [
82+
(google.api.field_behavior) = IMMUTABLE,
83+
(google.api.field_behavior) = OUTPUT_ONLY
84+
];
85+
86+
// Required. The linked [Merchant center account
87+
// id](https://developers.google.com/shopping-content/guides/accountstatuses).
88+
// The account must be a standalone account or a sub-account of a MCA.
89+
int64 merchant_center_account_id = 2 [(google.api.field_behavior) = REQUIRED];
90+
91+
// Required. The branch id (e.g. 0/1/2) within the catalog that products from
92+
// merchant_center_account_id are streamed to. When updating this field, an
93+
// empty value will use the currently configured default branch. However,
94+
// changing the default branch later on won't change the linked branch here.
95+
//
96+
// A single branch id can only have one linked merchant center account id.
97+
string branch_id = 3 [(google.api.field_behavior) = REQUIRED];
98+
99+
// The FeedLabel used to perform filtering.
100+
// Note: this replaces
101+
// [region_id](https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label).
102+
//
103+
// Example value: `US`.
104+
// Example value: `FeedLabel1`.
105+
string feed_label = 4;
106+
107+
// Language of the title/description and other string attributes. Use language
108+
// tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
109+
// ISO 639-1.
110+
//
111+
// This specifies the language of offers in Merchant Center that will be
112+
// accepted. If empty, no language filtering will be performed.
113+
//
114+
// Example value: `en`.
115+
string language_code = 5;
116+
117+
// Criteria for the Merchant Center feeds to be ingested via the link.
118+
// All offers will be ingested if the list is empty.
119+
// Otherwise the offers will be ingested from selected feeds.
120+
repeated MerchantCenterFeedFilter feed_filters = 6;
121+
122+
// Output only. Represents the state of the link.
123+
State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
124+
125+
// Output only. GCP project ID.
126+
string project_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
127+
}
128+
129+
// Common metadata related to the progress of the operations.
130+
message CreateMerchantCenterAccountLinkMetadata {
131+
// Operation create time.
132+
google.protobuf.Timestamp create_time = 1;
133+
134+
// Operation last update time. If the operation is done, this is also the
135+
// finish time.
136+
google.protobuf.Timestamp update_time = 2;
137+
}

0 commit comments

Comments
 (0)