Skip to content

Commit

Permalink
feat: support batch products purge (v2alpha)
Browse files Browse the repository at this point in the history
feat: users cannot switch to empty default branch unless force override (v2alpha)
feat: allow search users to skip validation for invalid boost specs (v2alpha)
feat: support search personalization (v2alpha)
feat: search returns applied control ids in the response (v2alpha)
docs: users can self enroll retail search feature on cloud console (v2alpha)
docs: suggest search users not to send IP and use hashed user id (v2alpha)
docs: deprecate request_id in ImportProductsRequest (v2alpha)
docs: deprecate search dynamic_facet_spec and suggest to config on cloud console (v2alpha)
docs: keep the API doc up-to-date with recent changes (v2alpha)

PiperOrigin-RevId: 440123036
  • Loading branch information
Google APIs authored and Copybara-Service committed Apr 7, 2022
1 parent 9191985 commit bc99550
Show file tree
Hide file tree
Showing 20 changed files with 923 additions and 146 deletions.
27 changes: 26 additions & 1 deletion google/cloud/retail/v2alpha/BUILD.bazel
Expand Up @@ -25,13 +25,18 @@ proto_library(
"catalog_service.proto",
"common.proto",
"completion_service.proto",
"control.proto",
"control_service.proto",
"export_config.proto",
"import_config.proto",
"prediction_service.proto",
"product.proto",
"product_service.proto",
"promotion.proto",
"purge_config.proto",
"search_service.proto",
"serving_config.proto",
"serving_config_service.proto",
"user_event.proto",
"user_event_service.proto",
],
Expand Down Expand Up @@ -87,7 +92,9 @@ java_grpc_library(
java_gapic_library(
name = "retail_java_gapic",
srcs = [":retail_proto_with_info"],
gapic_yaml = "retail_gapic.yaml",
grpc_service_config = "retail_grpc_service_config.json",
service_yaml = "retail_v2alpha.yaml",
test_deps = [
":retail_java_grpc",
],
Expand All @@ -102,9 +109,11 @@ java_gapic_test(
test_classes = [
"com.google.cloud.retail.v2alpha.CatalogServiceClientTest",
"com.google.cloud.retail.v2alpha.CompletionServiceClientTest",
"com.google.cloud.retail.v2alpha.ControlServiceClientTest",
"com.google.cloud.retail.v2alpha.PredictionServiceClientTest",
"com.google.cloud.retail.v2alpha.ProductServiceClientTest",
"com.google.cloud.retail.v2alpha.SearchServiceClientTest",
"com.google.cloud.retail.v2alpha.ServingConfigServiceClientTest",
"com.google.cloud.retail.v2alpha.UserEventServiceClientTest",
],
runtime_deps = [":retail_java_gapic_test"],
Expand Down Expand Up @@ -366,4 +375,20 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# Put your C++ rules here
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)

cc_proto_library(
name = "retail_cc_proto",
deps = [":retail_proto"],
)

cc_grpc_library(
name = "retail_cc_grpc",
srcs = [":retail_proto"],
grpc_only = True,
deps = [":retail_cc_proto"],
)
231 changes: 228 additions & 3 deletions google/cloud/retail/v2alpha/catalog.proto
Expand Up @@ -16,7 +16,6 @@ syntax = "proto3";

package google.cloud.retail.v2alpha;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/common.proto";
Expand Down Expand Up @@ -85,6 +84,231 @@ message ProductLevelConfig {
string merchant_center_product_id_field = 2;
}

// Catalog level attribute config for an attribute. For example, if customers
// want to enable/disable facet for a specific attribute.
message CatalogAttribute {
// The type of an attribute.
enum AttributeType {
// The type of the attribute is unknown.
//
// Used when type cannot be derived from attribute that is not
// [in_use][google.cloud.retail.v2alpha.CatalogAttribute.in_use].
UNKNOWN = 0;

// Textual attribute.
TEXTUAL = 1;

// Numerical attribute.
NUMERICAL = 2;
}

// The status of the indexable option of a catalog attribute.
enum IndexableOption {
// Value used when unset. Defaults to
// [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
INDEXABLE_OPTION_UNSPECIFIED = 0;

// Indexable option enabled for an attribute.
INDEXABLE_ENABLED = 1;

// Indexable option disabled for an attribute.
INDEXABLE_DISABLED = 2;
}

// The status of the dynamic facetable option of a catalog attribute.
enum DynamicFacetableOption {
// Value used when unset. Defaults to
// [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0;

// Dynamic facetable option enabled for an attribute.
DYNAMIC_FACETABLE_ENABLED = 1;

// Dynamic facetable option disabled for an attribute.
DYNAMIC_FACETABLE_DISABLED = 2;
}

// The status of the searchable option of a catalog attribute.
enum SearchableOption {
// Value used when unset. Defaults to
// [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
SEARCHABLE_OPTION_UNSPECIFIED = 0;

// Searchable option enabled for an attribute.
SEARCHABLE_ENABLED = 1;

// Searchable option disabled for an attribute.
SEARCHABLE_DISABLED = 2;
}

// Required. Attribute name.
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
// `attributes.xyz`.
string key = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Indicates whether this attribute has been used by any
// products. `True` if at least one
// [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
// [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
// Otherwise, this field is `False`.
//
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
// pre-loaded by using [AddCatalogAttribute][], [ImportCatalogAttributes][],
// or [UpdateAttributesConfig][] APIs. This field is `False` for pre-loaded
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
//
// Only [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that
// are not in use by products can be deleted.
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
// in use by products cannot be deleted; however, their configuration
// properties will reset to default values upon removal request.
//
// After catalog changes, it takes about 10 minutes for this field to update.
bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The type of this attribute. This is derived from the attribute
// in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
AttributeType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// When
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
// are indexed so that it can be filtered, faceted, or boosted in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
IndexableOption indexable_option = 5;

// If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
// facet. Could only be DYNAMIC_FACETABLE_DISABLED if
// [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
// is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
DynamicFacetableOption dynamic_facetable_option = 6;

// When
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
// are searchable by text queries in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
//
// If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
// will not be searchable by text queries in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
// as there are no text values associated to numerical attributes.
SearchableOption searchable_option = 7;
}

// Catalog level attribute config.
message AttributesConfig {
option (google.api.resource) = {
type: "retail.googleapis.com/AttributesConfig"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig"
};

// Required. Immutable. The fully qualified resource name of the attribute
// config. Format: "projects/*/locations/*/catalogs/*/attributesConfig"
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Enable attribute(s) config at catalog level.
// For example, indexable, dynamic_facetable, or searchable for each
// attribute.
//
// The key is catalog attribute's name.
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
// `attributes.xyz`.
//
// The maximum number of catalog attributes allowed in a request is 1000.
map<string, CatalogAttribute> catalog_attributes = 2;

// Output only. The
// [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
// used for this catalog.
AttributeConfigLevel attribute_config_level = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Catalog level autocomplete config for customers to customize autocomplete
// feature's settings.
message CompletionConfig {
option (google.api.resource) = {
type: "retail.googleapis.com/CompletionConfig"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig"
};

// Required. Immutable. Fully qualified name
// projects/*/locations/*/catalogs/*/completionConfig
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Specifies the matching order for autocomplete suggestions, e.g., a query
// consisting of 'sh' with 'out-of-order' specified would suggest "women's
// shoes", whereas a query of 'red s' with 'exact-prefix' specified would
// suggest "red shoes". Currently supported values:
//
// * 'out-of-order'
// * 'exact-prefix'
//
// Default value: 'exact-prefix'.
string matching_order = 2;

// The maximum number of autocomplete suggestions returned per term. The
// maximum allowed max suggestions is 20. Default value is 20. If left unset
// or set to 0, then will fallback to default value.
int32 max_suggestions = 3;

// The minimum number of characters needed to be typed in order to get
// suggestions. Default value is 2. If left unset or set to 0, then will
// fallback to default value.
int32 min_prefix_length = 4;

// If set to true, the auto learning function is enabled. Auto learning uses
// user data to generate suggestions using ML techniques. Default value is
// false. Only after enabling auto learning can users use `cloud-retail`
// data in
// [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
bool auto_learning = 11;

// Output only. The input config for the import of the source data that
// contains the autocomplete phrases uploaded by the customer.
CompletionDataInputConfig suggestions_input_config = 5
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Name of the LRO corresponding to the latest suggestion terms
// list import.
//
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
// retrieve the latest state of the Long Running Operation.
string last_suggestions_import_operation = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The input config for the import of the source data that
// contains the / autocomplete denylist phrases uploaded by the customer.
CompletionDataInputConfig denylist_input_config = 7
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. LRO corresponding to the latest denylist import.
//
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
// retrieve the latest state of the Long Running Operation.
string last_denylist_import_operation = 8
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The input config for the import of the source data that
// contains the autocomplete allowlist phrases uploaded by the customer.
CompletionDataInputConfig allowlist_input_config = 9
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. LRO corresponding to the latest allowlist import.
//
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
// retrieve the latest state of the Long Running Operation.
string last_allowlist_import_operation = 10
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Represents a link between a Merchant Center account and a branch.
// Once a link is established, products from the linked merchant center account
// will be streamed to the linked branch.
Expand Down Expand Up @@ -125,8 +349,9 @@ message MerchantCenterLink {
// ISO 639-1.
//
// This specifies the language of offers in Merchant Center that will be
// accepted.
// If empty no language filtering will be performed.
// accepted. If empty no language filtering will be performed.
//
// Example value: `en`.
string language_code = 5;
}

Expand Down

0 comments on commit bc99550

Please sign in to comment.