Skip to content

Commit 1513294

Browse files
Google APIscopybara-github
authored andcommitted
feat: release Model Services to v2beta version
feat: release BatchRemoveCatalogAttributes API to v2beta version feat: release ExactSearchableOption for attribute config to v2beta version feat: release diversity_type for ServingConfig in v2beta version feat: add local inventories info to the Product resource feat: deprecate unused page_token field of PredictionRequest in v2beta version feat: deprecate unused facet_spec field of Control in v2beta version docs: improve documentation of SearchRequest for Search Personalization docs: improve documentation for Fullfillment and Inventory API in ProductService docs: minor documentation fixes and improvements PiperOrigin-RevId: 471846764
1 parent 48b9dec commit 1513294

20 files changed

Lines changed: 815 additions & 135 deletions

google/cloud/retail/v2beta/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+
"model.proto",
33+
"model_service.proto",
3234
"prediction_service.proto",
3335
"product.proto",
3436
"product_service.proto",
@@ -114,6 +116,8 @@ java_gapic_test(
114116
"com.google.cloud.retail.v2beta.CompletionServiceClientTest",
115117
"com.google.cloud.retail.v2beta.ControlServiceClientHttpJsonTest",
116118
"com.google.cloud.retail.v2beta.ControlServiceClientTest",
119+
"com.google.cloud.retail.v2beta.ModelServiceClientHttpJsonTest",
120+
"com.google.cloud.retail.v2beta.ModelServiceClientTest",
117121
"com.google.cloud.retail.v2beta.PredictionServiceClientHttpJsonTest",
118122
"com.google.cloud.retail.v2beta.PredictionServiceClientTest",
119123
"com.google.cloud.retail.v2beta.ProductServiceClientHttpJsonTest",

google/cloud/retail/v2beta/catalog.proto

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ message CatalogAttribute {
141141
SEARCHABLE_DISABLED = 2;
142142
}
143143

144+
// The status of the exact-searchable option of a catalog attribute.
145+
enum ExactSearchableOption {
146+
// Value used when unset. Defaults to
147+
// [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
148+
EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;
149+
150+
// Exact searchable option enabled for an attribute.
151+
EXACT_SEARCHABLE_ENABLED = 1;
152+
153+
// Exact searchable option disabled for an attribute.
154+
EXACT_SEARCHABLE_DISABLED = 2;
155+
}
156+
144157
// Required. Attribute name.
145158
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
146159
// `attributes.xyz`.
@@ -211,6 +224,11 @@ message CatalogAttribute {
211224
// This option works for categorical features only,
212225
// does not work for numerical features, inventory filtering.
213226
RecommendationsFilteringOption recommendations_filtering_option = 8;
227+
228+
// If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
229+
// This property only applies to textual custom attributes and requires
230+
// indexable set to enabled to enable exact-searchable.
231+
ExactSearchableOption exact_searchable_option = 11;
214232
}
215233

216234
// Catalog level attribute config.
@@ -348,8 +366,8 @@ message MerchantCenterLink {
348366
string branch_id = 2;
349367

350368
// String representing the destination to import for, all if left empty.
351-
// List of possible values can be found here.
352-
// [https://support.google.com/merchants/answer/7501026]
369+
// List of possible values is given in [Included
370+
// destination](https://support.google.com/merchants/answer/7501026).
353371
// List of allowed string values:
354372
// "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
355373
// _ads", "Free_listings", "Free_local_listings"

google/cloud/retail/v2beta/catalog_service.proto

Lines changed: 45 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.v2beta.CatalogAttribute]s from the
191+
// [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
192+
rpc BatchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest)
193+
returns (BatchRemoveCatalogAttributesResponse) {
194+
option (google.api.http) = {
195+
post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes"
196+
body: "*"
197+
};
198+
}
199+
189200
// Replaces the specified
190201
// [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
191202
// [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
@@ -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,39 @@ message RemoveCatalogAttributeRequest {
449460
string key = 2 [(google.api.field_behavior) = REQUIRED];
450461
}
451462

463+
// Request for
464+
// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.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.v2beta.CatalogAttribute]s to delete.
479+
// 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.v2beta.CatalogService.BatchRemoveCatalogAttributes].
485+
message BatchRemoveCatalogAttributesResponse {
486+
// Catalog attributes that were deleted. Only attributes that are not [in
487+
// use][CatalogAttribute.in_use] by products can be deleted.
488+
repeated string deleted_catalog_attributes = 1;
489+
490+
// Catalog attributes that were reset. Attributes that are [in
491+
// use][CatalogAttribute.in_use] by products cannot be deleted, however their
492+
// configuration properties will reset to default values upon removal request.
493+
repeated string reset_catalog_attributes = 2;
494+
}
495+
452496
// Request for
453497
// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute]
454498
// method.

google/cloud/retail/v2beta/common.proto

Lines changed: 7 additions & 5 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.v2beta.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.v2beta.Control]
134+
// with
135+
// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
134136
message Rule {
135137
// A boost action to apply to results matching condition specified above.
136138
message BoostAction {

google/cloud/retail/v2beta/completion_service.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta";
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: "/v2beta/{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) = {

google/cloud/retail/v2beta/control.proto

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ option objc_class_prefix = "RETAIL";
3030
option php_namespace = "Google\\Cloud\\Retail\\V2beta";
3131
option ruby_package = "Google::Cloud::Retail::V2beta";
3232

33-
// Configures dynamic serving time metadata that is used to pre and post
34-
// process search/recommendation model results.
33+
// Configures dynamic metadata that can be linked to a
34+
// [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
35+
// or recommendation results at serving time.
3536
message Control {
3637
option (google.api.resource) = {
3738
type: "retail.googleapis.com/Control"
@@ -45,7 +46,10 @@ message Control {
4546
// INVALID_ARGUMENT will be returned if either condition is violated.
4647
oneof control {
4748
// A facet specification to perform faceted search.
48-
SearchRequest.FacetSpec facet_spec = 3;
49+
//
50+
// Note that this field is deprecated and will throw NOT_IMPLEMENTED if
51+
// used for creating a control.
52+
SearchRequest.FacetSpec facet_spec = 3 [deprecated = true];
4953

5054
// A rule control - a condition-action pair.
5155
// Enacts a set action when the condition is triggered.
@@ -63,22 +67,34 @@ message Control {
6367
// characters. Otherwise, an INVALID_ARGUMENT error is thrown.
6468
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
6569

66-
// Output only. List of serving configuration ids that that are associated
67-
// with this control. Note the association is managed via the ServingConfig,
68-
// this is an output only denormalizeed view. Assumed to be in the same
69-
// catalog.
70+
// Output only. List of [serving
71+
// configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
72+
// associated with this control in the same
73+
// [Catalog][google.cloud.retail.v2beta.Catalog].
74+
//
75+
// Note the association is managed via the
76+
// [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
77+
// output only denormalized view.
7078
repeated string associated_serving_config_ids = 5
7179
[(google.api.field_behavior) = OUTPUT_ONLY];
7280

73-
// Required. Immutable. The solution types that the serving config is used
74-
// for. Currently we support setting only one type of solution at creation
75-
// time.
81+
// Required. Immutable. The solution types that the control is used for.
82+
// Currently we support setting only one type of solution at creation time.
7683
//
7784
// Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
7885
// If no solution type is provided at creation time, will default to
79-
// SOLUTION_TYPE_SEARCH.
86+
// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
8087
repeated SolutionType solution_types = 6 [
8188
(google.api.field_behavior) = REQUIRED,
8289
(google.api.field_behavior) = IMMUTABLE
8390
];
91+
92+
// Specifies the use case for the control.
93+
// Affects what condition fields can be set.
94+
// Only settable by search controls.
95+
// Will default to
96+
// [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
97+
// if not specified. Currently only allow one search_solution_use_case per
98+
// control.
99+
repeated SearchSolutionUseCase search_solution_use_case = 7;
84100
}

google/cloud/retail/v2beta/control_service.proto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ service ControlService {
6666
//
6767
// [Control][google.cloud.retail.v2beta.Control] cannot be set to a different
6868
// oneof field, if so an INVALID_ARGUMENT is returned. If the
69-
// [Control][google.cloud.retail.v2beta.Control] to delete does not exist, a
69+
// [Control][google.cloud.retail.v2beta.Control] to update does not exist, a
7070
// NOT_FOUND error is returned.
7171
rpc UpdateControl(UpdateControlRequest) returns (Control) {
7272
option (google.api.http) = {
@@ -84,7 +84,8 @@ service ControlService {
8484
option (google.api.method_signature) = "name";
8585
}
8686

87-
// Lists all Controls linked to this catalog.
87+
// Lists all Controls by their parent
88+
// [Catalog][google.cloud.retail.v2beta.Catalog].
8889
rpc ListControls(ListControlsRequest) returns (ListControlsResponse) {
8990
option (google.api.http) = {
9091
get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls"
@@ -140,7 +141,7 @@ message DeleteControlRequest {
140141

141142
// Request for GetControl method.
142143
message GetControlRequest {
143-
// Required. The resource name of the Control to delete. Format:
144+
// Required. The resource name of the Control to get. Format:
144145
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
145146
string name = 1 [
146147
(google.api.field_behavior) = REQUIRED,

google/cloud/retail/v2beta/export_config.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.retail.v2beta;
1818

19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
1921
import "google/protobuf/timestamp.proto";
2022
import "google/rpc/status.proto";
2123

@@ -40,7 +42,7 @@ message ExportErrorsConfig {
4042
}
4143
}
4244

43-
// Metadata related to the progress of the Export operation. This will be
45+
// Metadata related to the progress of the Export operation. This is
4446
// returned by the google.longrunning.Operation.metadata field.
4547
message ExportMetadata {
4648
// Operation create time.

0 commit comments

Comments
 (0)