Skip to content

Commit

Permalink
feat: support async write mode for WriteUserEvent API (#3755)
Browse files Browse the repository at this point in the history
* 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

Source-Link: googleapis/googleapis@4e4e58c

Source-Link: googleapis/googleapis-gen@c8c05bf
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiYzhjMDViZmZmZjg4OWE3NzYxNDUyNmU0ZDNiOTBkNDFjNzVjMzFiYyJ9

* 🦉 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>
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 15, 2022
1 parent 283d098 commit 83600d1
Show file tree
Hide file tree
Showing 76 changed files with 4,408 additions and 469 deletions.
1 change: 1 addition & 0 deletions packages/google-cloud-retail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| User_event_service.rejoin_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js,samples/README.md) |
| User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js,samples/README.md) |
| Catalog_service.add_catalog_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js,samples/README.md) |
| Catalog_service.batch_remove_catalog_attributes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js,samples/README.md) |
| Catalog_service.get_attributes_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js,samples/README.md) |
| Catalog_service.get_completion_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js,samples/README.md) |
| Catalog_service.get_default_branch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_default_branch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_default_branch.js,samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ message CatalogAttribute {

// 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].
// Value used when unset.
INDEXABLE_OPTION_UNSPECIFIED = 0;

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

// 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].
// Value used when unset.
DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0;

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

// 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].
// Value used when unset.
SEARCHABLE_OPTION_UNSPECIFIED = 0;

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

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

// Exact searchable option enabled for an attribute.
EXACT_SEARCHABLE_ENABLED = 1;

// Exact searchable option disabled for an attribute.
EXACT_SEARCHABLE_DISABLED = 2;
}

// The status of the retrievable option of a catalog attribute.
enum RetrievableOption {
// Value used when unset. Defaults to
// [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
RETRIEVABLE_OPTION_UNSPECIFIED = 0;

// Retrievable option enabled for an attribute.
RETRIEVABLE_ENABLED = 1;

// Retrievable option disabled for an attribute.
RETRIEVABLE_DISABLED = 2;
}

// Required. Attribute name.
// For example: `color`, `brands`, `attributes.custom_attribute`, such as
// `attributes.xyz`.
Expand All @@ -165,13 +188,13 @@ message CatalogAttribute {
// APIs. This field is `False` for pre-loaded
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
//
// Only pre-loaded
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
// neither in use by products nor predefined can be deleted.
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
// either in use by products or are predefined cannot be deleted; however,
// their configuration properties will reset to default values upon removal
// request.
// Only pre-loaded [catalog
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are neither
// in use by products nor predefined can be deleted. [Catalog
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are
// either in use by products or are predefined attributes 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];
Expand All @@ -185,12 +208,16 @@ message CatalogAttribute {
// 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].
//
// Must be specified, otherwise throws INVALID_FORMAT error.
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.
//
// Must be specified, otherwise throws INVALID_FORMAT error.
DynamicFacetableOption dynamic_facetable_option = 6;

// When
Expand All @@ -203,6 +230,8 @@ message CatalogAttribute {
// 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.
//
// Must be specified, otherwise throws INVALID_FORMAT error.
SearchableOption searchable_option = 7;

// When
Expand All @@ -212,6 +241,15 @@ message CatalogAttribute {
// This option works for categorical features only,
// does not work for numerical features, inventory filtering.
RecommendationsFilteringOption recommendations_filtering_option = 8;

// If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
// This property only applies to textual custom attributes and requires
// indexable set to enabled to enable exact-searchable.
ExactSearchableOption exact_searchable_option = 11;

// If RETRIEVABLE_ENABLED, attribute values are retrievable in the search
// results.
RetrievableOption retrievable_option = 12;
}

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

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

// String representing the destination to import for, all if left empty.
// List of possible values can be found here.
// [https://support.google.com/merchants/answer/7501026]
// List of possible values is given in [Included
// destination](https://support.google.com/merchants/answer/7501026).
// List of allowed string values:
// "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
// _ads", "Free_listings", "Free_local_listings"
Expand All @@ -375,6 +413,21 @@ message MerchantCenterLink {
//
// Example value: `en`.
string language_code = 5;

// Criteria for the Merchant Center feeds to be ingested via the link.
// All offers will be ingested if the list is empty.
// Otherwise the offers will be ingested from selected feeds.
repeated MerchantCenterFeedFilter feeds = 6;
}

// Merchant Center Feed filter criterion.
message MerchantCenterFeedFilter {
// Merchant Center primary feed ID.
int64 primary_feed_id = 1;

// Merchant Center primary feed name. The name is used for the display
// purposes only.
string primary_feed_name = 2;
}

// Configures Merchant Center linking.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,17 @@ service CatalogService {
};
}

// Removes all specified
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s from the
// [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].
rpc BatchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest)
returns (BatchRemoveCatalogAttributesResponse) {
option (google.api.http) = {
post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes"
body: "*"
};
}

// Replaces the specified
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the
// [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by
Expand Down Expand Up @@ -341,7 +352,7 @@ message GetDefaultBranchResponse {
// method.
message GetCompletionConfigRequest {
// Required. Full CompletionConfig resource name. Format:
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -449,6 +460,44 @@ message RemoveCatalogAttributeRequest {
string key = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request for
// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]
// method.
message BatchRemoveCatalogAttributesRequest {
// Required. The attributes config resource shared by all catalog attributes
// being deleted. Format:
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
string attributes_config = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "retail.googleapis.com/AttributesConfig"
}
];

// Required. The attribute name keys of the
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s to
// delete. A maximum of 1000 catalog attributes can be deleted in a batch.
repeated string attribute_keys = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response of the
// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes].
message BatchRemoveCatalogAttributesResponse {
// Catalog attributes that were deleted. Only pre-loaded [catalog
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are
// neither [in
// use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by
// products nor predefined can be deleted.
repeated string deleted_catalog_attributes = 1;

// Catalog attributes that were reset. [Catalog
// attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are either
// [in use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by products
// or are predefined attributes cannot be deleted; however, their
// configuration properties will reset to default values upon removal request.
repeated string reset_catalog_attributes = 2;
}

// Request for
// [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute]
// method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum RecommendationsFilteringOption {
// The use case of Cloud Retail Search.
enum SearchSolutionUseCase {
// The value when it's unspecified. In this case, server behavior defaults to
// [SEARCH_SOLUTION_USE_CASE_SEARCH][].
// [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;

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

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

// A rule is a condition-action pair
//
// * A condition defines when a rule is to be triggered.
// * An action specifies what occurs on that trigger.
// Currently only boost rules are supported.
// Currently only supported by the search endpoint.
// Currently rules only work for [controls][google.cloud.retail.v2alpha.Control]
// with
// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH].
message Rule {
// A boost action to apply to results matching condition specified above.
message BoostAction {
Expand Down Expand Up @@ -216,7 +218,8 @@ message Rule {
}

// Creates a set of terms that will be treated as synonyms of each other.
// Example: synonyms of "sneakers" and "shoes".
// Example: synonyms of "sneakers" and "shoes":
//
// * "sneakers" will use a synonym of "shoes".
// * "shoes" will use a synonym of "sneakers".
message TwowaySynonymsAction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha";
// Auto-completion service for retail.
//
// This feature is only available for users who have Retail Search enabled.
// Please enable Retail Search on Cloud Console before using this feature.
// Enable Retail Search on Cloud Console before using this feature.
service CompletionService {
option (google.api.default_host) = "retail.googleapis.com";
option (google.api.oauth_scopes) =
Expand All @@ -45,7 +45,7 @@ service CompletionService {
// Completes the specified prefix with keyword suggestions.
//
// This feature is only available for users who have Retail Search enabled.
// Please enable Retail Search on Cloud Console before using this feature.
// Enable Retail Search on Cloud Console before using this feature.
rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
option (google.api.http) = {
get: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:completeQuery"
Expand All @@ -60,7 +60,7 @@ service CompletionService {
// are indexed successfully and ready for serving. The process takes hours.
//
// This feature is only available for users who have Retail Search enabled.
// Please enable Retail Search on Cloud Console before using this feature.
// Enable Retail Search on Cloud Console before using this feature.
rpc ImportCompletionData(ImportCompletionDataRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
Expand Down Expand Up @@ -110,8 +110,10 @@ message CompleteQueryRequest {
// number of language codes is 3.
repeated string language_codes = 3;

// The device type context for completion suggestions.
// It is useful to apply different suggestions on different device types, e.g.
// The device type context for completion suggestions. We recommend that you
// leave this field empty.
//
// It can apply different suggestions on different device types, e.g.
// `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
// types.
//
Expand Down Expand Up @@ -148,6 +150,11 @@ message CompleteQueryRequest {
// The maximum allowed max suggestions is 20. If it is set higher, it will be
// capped by 20.
int32 max_suggestions = 5;

// If true, attribute suggestions are enabled and provided in response.
//
// This field is only available for "cloud-retail" dataset.
bool enable_attribute_suggestions = 9;
}

// Response of the auto-complete query.
Expand Down Expand Up @@ -175,6 +182,12 @@ message CompleteQueryResponse {
string recent_search = 1;
}

// Resource that represents attribute results.
message AttributeResult {
// The list of suggestions for the attribute.
repeated string suggestions = 1;
}

// Results of the matching suggestions. The result list is ordered and the
// first result is top suggestion.
repeated CompletionResult completion_results = 1;
Expand Down Expand Up @@ -207,4 +220,14 @@ message CompleteQueryResponse {
// Recent searches are deduplicated. More recent searches will be reserved
// when duplication happens.
repeated RecentSearchResult recent_search_results = 3;

// A map of matched attribute suggestions. This field is only available for
// "cloud-retail" dataset.
//
// Current supported keys:
//
// * `brands`
//
// * `categories`
map<string, AttributeResult> attribute_results = 4;
}
Loading

0 comments on commit 83600d1

Please sign in to comment.