diff --git a/google/cloud/retail/logging/error_log.proto b/google/cloud/retail/logging/error_log.proto index 1286ea8458..b0944768d9 100644 --- a/google/cloud/retail/logging/error_log.proto +++ b/google/cloud/retail/logging/error_log.proto @@ -59,9 +59,9 @@ message ErrorContext { SourceLocation report_location = 2; } -// The error payload that is populated on LRO import APIs. Including: -// "google.cloud.retail.v2.ProductService.ImportProducts" -// "google.cloud.retail.v2.EventService.ImportUserEvents" +// The error payload that is populated on LRO import APIs, including +// "google.cloud.retail.v2.ProductService.ImportProducts" and +// "google.cloud.retail.v2.EventService.ImportUserEvents". message ImportErrorContext { // The operation resource name of the LRO. string operation_name = 1; diff --git a/google/cloud/retail/v2alpha/catalog.proto b/google/cloud/retail/v2alpha/catalog.proto index f6c114d7ca..95b7dd9443 100644 --- a/google/cloud/retail/v2alpha/catalog.proto +++ b/google/cloud/retail/v2alpha/catalog.proto @@ -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. @@ -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. @@ -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. @@ -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`. @@ -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]; @@ -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 @@ -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 @@ -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. @@ -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" @@ -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. diff --git a/google/cloud/retail/v2alpha/catalog_service.proto b/google/cloud/retail/v2alpha/catalog_service.proto index 088c01922d..d14a79a83c 100644 --- a/google/cloud/retail/v2alpha/catalog_service.proto +++ b/google/cloud/retail/v2alpha/catalog_service.proto @@ -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 @@ -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) = { @@ -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. diff --git a/google/cloud/retail/v2alpha/common.proto b/google/cloud/retail/v2alpha/common.proto index 02cf05ba8e..4a06b4273e 100644 --- a/google/cloud/retail/v2alpha/common.proto +++ b/google/cloud/retail/v2alpha/common.proto @@ -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 @@ -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. @@ -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 { @@ -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 { diff --git a/google/cloud/retail/v2alpha/completion_service.proto b/google/cloud/retail/v2alpha/completion_service.proto index 9f399d2233..323bc05d60 100644 --- a/google/cloud/retail/v2alpha/completion_service.proto +++ b/google/cloud/retail/v2alpha/completion_service.proto @@ -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) = @@ -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" @@ -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) = { @@ -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. // @@ -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. @@ -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; @@ -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 attribute_results = 4; } diff --git a/google/cloud/retail/v2alpha/control.proto b/google/cloud/retail/v2alpha/control.proto index cdd683d573..6ad604ea42 100644 --- a/google/cloud/retail/v2alpha/control.proto +++ b/google/cloud/retail/v2alpha/control.proto @@ -30,8 +30,9 @@ option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; -// Configures dynamic serving time metadata that is used to pre and post -// process search/recommendation model results. +// Configures dynamic metadata that can be linked to a +// [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and affect search +// or recommendation results at serving time. message Control { option (google.api.resource) = { type: "retail.googleapis.com/Control" @@ -45,7 +46,10 @@ message Control { // INVALID_ARGUMENT will be returned if either condition is violated. oneof control { // A facet specification to perform faceted search. - SearchRequest.FacetSpec facet_spec = 3; + // + // Note that this field is deprecated and will throw NOT_IMPLEMENTED if + // used for creating a control. + SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; // A rule control - a condition-action pair. // Enacts a set action when the condition is triggered. @@ -63,30 +67,34 @@ message Control { // characters. Otherwise, an INVALID_ARGUMENT error is thrown. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - // Output only. List of serving configuration ids that that are associated - // with this control. Note the association is managed via the ServingConfig, - // this is an output only denormalizeed view. Assumed to be in the same - // catalog. + // Output only. List of [serving + // config][google.cloud.retail.v2alpha.ServingConfig] ids that are associated + // with this control in the same + // [Catalog][google.cloud.retail.v2alpha.Catalog]. + // + // Note the association is managed via the + // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig], this is an + // output only denormalized view. repeated string associated_serving_config_ids = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. Immutable. The solution types that the serving config is used - // for. Currently we support setting only one type of solution at creation - // time. + // Required. Immutable. The solution types that the control is used for. + // Currently we support setting only one type of solution at creation time. // // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. // If no solution type is provided at creation time, will default to - // SOLUTION_TYPE_SEARCH. + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. repeated SolutionType solution_types = 6 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Specifies the use case for the control. + // Specifies the use case for the control. // Affects what condition fields can be set. // Only settable by search controls. - // Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. - // Currently only allow one search_solution_use_case per control. - repeated SearchSolutionUseCase search_solution_use_case = 7 - [(google.api.field_behavior) = REQUIRED]; + // Will default to + // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + // if not specified. Currently only allow one search_solution_use_case per + // control. + repeated SearchSolutionUseCase search_solution_use_case = 7; } diff --git a/google/cloud/retail/v2alpha/control_service.proto b/google/cloud/retail/v2alpha/control_service.proto index d69201a3d1..53744cded2 100644 --- a/google/cloud/retail/v2alpha/control_service.proto +++ b/google/cloud/retail/v2alpha/control_service.proto @@ -66,7 +66,7 @@ service ControlService { // // [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different // oneof field, if so an INVALID_ARGUMENT is returned. If the - // [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a + // [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a // NOT_FOUND error is returned. rpc UpdateControl(UpdateControlRequest) returns (Control) { option (google.api.http) = { @@ -84,7 +84,8 @@ service ControlService { option (google.api.method_signature) = "name"; } - // Lists all Controls linked to this catalog. + // Lists all Controls by their parent + // [Catalog][google.cloud.retail.v2alpha.Catalog]. rpc ListControls(ListControlsRequest) returns (ListControlsResponse) { option (google.api.http) = { get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/controls" @@ -140,7 +141,7 @@ message DeleteControlRequest { // Request for GetControl method. message GetControlRequest { - // Required. The resource name of the Control to delete. Format: + // Required. The resource name of the Control to get. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/google/cloud/retail/v2alpha/export_config.proto b/google/cloud/retail/v2alpha/export_config.proto index dd907d1ea9..831bb2ec55 100644 --- a/google/cloud/retail/v2alpha/export_config.proto +++ b/google/cloud/retail/v2alpha/export_config.proto @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.retail.v2alpha; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -40,7 +42,7 @@ message ExportErrorsConfig { } } -// Metadata related to the progress of the Export operation. This will be +// Metadata related to the progress of the Export operation. This is // returned by the google.longrunning.Operation.metadata field. message ExportMetadata { // Operation create time. @@ -79,10 +81,14 @@ message ExportUserEventsResponse { OutputResult output_result = 3; } -// Output result. +// Output result that stores the information about where the exported data is +// stored. message OutputResult { - // Export result in BigQuery. + // The BigQuery location where the result is stored. repeated BigQueryOutputResult bigquery_result = 1; + + // The Google Cloud Storage location where the result is stored. + repeated GcsOutputResult gcs_result = 2; } // A BigQuery output result. @@ -93,3 +99,9 @@ message BigQueryOutputResult { // The ID of a BigQuery Table. string table_id = 2; } + +// A Gcs output result. +message GcsOutputResult { + // The uri of Gcs output + string output_uri = 1; +} diff --git a/google/cloud/retail/v2alpha/import_config.proto b/google/cloud/retail/v2alpha/import_config.proto index 319edb1eac..8b7d87b956 100644 --- a/google/cloud/retail/v2alpha/import_config.proto +++ b/google/cloud/retail/v2alpha/import_config.proto @@ -35,7 +35,6 @@ option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; // Google Cloud Storage location for input content. -// format. message GcsSource { // Required. Google Cloud Storage URIs to input files. URI can be up to // 2000 characters long. URIs can match the full object path (for example, @@ -66,12 +65,12 @@ message GcsSource { // // Supported values for control imports: // - // * 'control' (default): One JSON + // * `control` (default): One JSON // [Control][google.cloud.retail.v2alpha.Control] per line. // // Supported values for catalog attribute imports: // - // * 'catalog_attribute' (default): One CSV + // * `catalog_attribute` (default): One CSV // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line. string data_schema = 2; } @@ -83,9 +82,8 @@ message BigQuerySource { oneof partition { // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. + // Only supported in + // [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest]. google.type.Date partition_date = 6; } @@ -124,8 +122,7 @@ message BigQuerySource { // * `user_event_ga360`: // The schema is available here: // https://support.google.com/analytics/answer/3437719. - // * `user_event_ga4`: This feature is in private preview. Please contact the - // support team for importing Google Analytics 4 events. + // * `user_event_ga4`: // The schema is available here: // https://support.google.com/analytics/answer/7029846. // @@ -156,7 +153,7 @@ message ImportErrorsConfig { // Required. Errors destination. oneof destination { // Google Cloud Storage prefix for import errors. This must be an empty, - // existing Cloud Storage directory. Import errors will be written to + // existing Cloud Storage directory. Import errors are written to // sharded files in this directory, one per line, as a JSON-encoded // `google.rpc.Status` message. string gcs_prefix = 1; @@ -176,16 +173,6 @@ message ImportProductsRequest { // Calculates diff and replaces the entire product dataset. Existing // products may be deleted if they are not present in the source location. - // - // Can only be set while using - // [BigQuerySource][google.cloud.retail.v2alpha.BigQuerySource]. And the - // BigQuery dataset must be created in the data location "us (multiple - // regions in United States)", otherwise a PERMISSION_DENIED error is - // thrown. - // - // Add the IAM permission "BigQuery Data Viewer" for - // cloud-retail-customer-data-access@system.gserviceaccount.com before - // using this feature otherwise an error is thrown. FULL = 2; } @@ -208,8 +195,8 @@ message ImportProductsRequest { // The desired location of errors incurred during the Import. ImportErrorsConfig errors_config = 3; - // Indicates which fields in the provided imported 'products' to update. If - // not set, will by default update all fields. + // Indicates which fields in the provided imported `products` to update. If + // not set, all fields are updated. google.protobuf.FieldMask update_mask = 4; // The mode of reconciliation between existing products and the products to be @@ -218,24 +205,19 @@ message ImportProductsRequest { ReconciliationMode reconciliation_mode = 5; // Full Pub/Sub topic name for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has // to be within the same project as // [ImportProductsRequest.parent][google.cloud.retail.v2alpha.ImportProductsRequest.parent]. - // Make sure that both - // `cloud-retail-customer-data-access@system.gserviceaccount.com` and - // `service-@gcp-sa-retail.iam.gserviceaccount.com` - // have the `pubsub.topics.publish` IAM permission on the topic. - // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. + // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the + // `pubsub.topics.publish` IAM permission on the topic. string notification_pubsub_topic = 7; - // If true, will perform the FULL import even if it would delete a large + // If true, this performs the FULL import even if it would delete a large // proportion of the products in the default branch, which could potentially // cause outages if you have live predict/search traffic. // @@ -277,8 +259,8 @@ message ImportCompletionDataRequest { [(google.api.field_behavior) = REQUIRED]; // Pub/Sub topic for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. string notification_pubsub_topic = 3; @@ -338,7 +320,7 @@ message CompletionDataInputConfig { } } -// Metadata related to the progress of the Import operation. This will be +// Metadata related to the progress of the Import operation. This is // returned by the google.longrunning.Operation.metadata field. message ImportMetadata { // Operation create time. @@ -358,11 +340,24 @@ message ImportMetadata { string request_id = 5 [deprecated = true]; // Pub/Sub topic for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. string notification_pubsub_topic = 6; + + // Metadata related to transform user events. + TransformedUserEventsMetadata transformed_user_events_metadata = 7; +} + +// Metadata related to transform user events operation. +message TransformedUserEventsMetadata { + // Count of entries in the source user events BigQuery table. + int64 source_events_count = 1; + + // Count of entries in the transformed user events BigQuery table, which could + // be different from the actually imported number of user events. + int64 transformed_events_count = 2; } // Response of the diff --git a/google/cloud/retail/v2alpha/model.proto b/google/cloud/retail/v2alpha/model.proto index 5f4ead9f7d..1b60792dbf 100644 --- a/google/cloud/retail/v2alpha/model.proto +++ b/google/cloud/retail/v2alpha/model.proto @@ -34,7 +34,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // [Model][google.cloud.retail.v2alpha.Model]. A // [Model][google.cloud.retail.v2alpha.Model] can be associated with a // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and then queried -// through the Predict api. +// through the Predict API. message Model { option (google.api.resource) = { type: "retail.googleapis.com/Model" @@ -44,7 +44,7 @@ message Model { // The PageOptimizationConfig for model training. // // This determines how many panels to optimize for, and which serving - // configurations to consider for each panel. + // configs to consider for each panel. // The purpose of this model is to optimize which // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to show on which // panels in way that optimizes the visitors shopping journey. @@ -56,9 +56,9 @@ message Model { oneof candidate { // This has to be a valid // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - // identifier. e.g. for a ServingConfig with full name: - // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config` - // this would be 'my_candidate_config' + // identifier. For example, for a ServingConfig with full name: + // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, + // this would be `my_candidate_config`. string serving_config_id = 1; } } @@ -71,13 +71,11 @@ message Model { string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. The candidates to consider on the panel. - // - // Limit = 10. repeated Candidate candidates = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The default candidate (in case the model fails at serving - // time, we can fall back to the default). + // Required. The default candidate. If the model fails at serving time, + // we fall back to the default. Candidate default_candidate = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -127,7 +125,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_SERVING_CONFIG_RESTRICTION + // `Restriction` = `UNIQUE_SERVING_CONFIG_RESTRICTION` // // `Valid combinations`: // @@ -160,7 +158,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_MODEL_RESTRICTION + // `Restriction` = `UNIQUE_MODEL_RESTRICTION` // // `Valid combinations`: // @@ -192,7 +190,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_MODEL_RESTRICTION + // `Restriction` = `UNIQUE_MODEL_RESTRICTION` // // `Valid combinations`: // @@ -247,10 +245,10 @@ message Model { } // Represents an ordered combination of valid serving configs, which - // / may be used for PAGE_OPTIMIZATION recommendations. + // can be used for `PAGE_OPTIMIZATION` recommendations. message ServingConfigList { // Optional. A set of valid serving configs that may be used for - // PAGE_OPTIMIZATION. + // `PAGE_OPTIMIZATION`. repeated string serving_config_ids = 1 [(google.api.field_behavior) = OPTIONAL]; } @@ -266,7 +264,7 @@ message Model { // The model is serving and can be queried. ACTIVE = 2; - // The model is trained on tuned hyperparameters, and can be + // The model is trained on tuned hyperparameters and can be // queried. TUNED = 3; } @@ -285,26 +283,26 @@ message Model { // Describes whether periodic tuning is enabled for this model // or not. Periodic tuning is scheduled at most every three months. You can - // start a tuning process manually by using the ModelTune + // start a tuning process manually by using the `TuneModel` // method, which starts a tuning process immediately and resets the quarterly // schedule. Enabling or disabling periodic tuning does not affect any // current tuning processes. enum PeriodicTuningState { - // Unspecified default value - should never be explicitly set. + // Unspecified default value, should never be explicitly set. PERIODIC_TUNING_STATE_UNSPECIFIED = 0; // The model has periodic tuning disabled. Tuning - // can be reenabled by calling the EnableModelPeriodicTuning - // method or by calling the TuneModel method. + // can be reenabled by calling the `EnableModelPeriodicTuning` + // method or by calling the `TuneModel` method. PERIODIC_TUNING_DISABLED = 1; // The model cannot be tuned with periodic tuning OR the - // TuneModel method. Hide the options in customer UI and + // `TuneModel` method. Hide the options in customer UI and // reject any requests through the backend self serve API. ALL_TUNING_DISABLED = 3; // The model has periodic tuning enabled. Tuning - // can be disabled by calling the DisableModelPeriodicTuning + // can be disabled by calling the `DisableModelPeriodicTuning` // method. PERIODIC_TUNING_ENABLED = 2; } @@ -312,7 +310,7 @@ message Model { // Describes whether this model have sufficient training data // to be continuously trained. enum DataState { - // Unspecified default value - should never be explicitly set. + // Unspecified default value, should never be explicitly set. DATA_STATE_UNSPECIFIED = 0; // The model has sufficient training data. @@ -335,7 +333,7 @@ message Model { // Required. The fully qualified resource name of the model. // // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` // catalog_id has char limit of 50. // recommendation_model_id has char limit of 40. string name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -343,21 +341,21 @@ message Model { // Required. The display name of the model. // // Should be human readable, used to display Recommendation Models in the - // Retail Cloud Cosole Dashboard. UTF-8 encoded string with limit of 1024 + // Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 // characters. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. The training state that the model is in (e.g. - // TRAINING or PAUSED). + // `TRAINING` or `PAUSED`). // // Since part of the cost of running the service // is frequency of training - this can be used to determine when to train // model in order to control cost. If not specified: the default value for - // CreateModel method is TRAINING. the default value for - // UpdateModel method is to keep the state the same as before. + // `CreateModel` method is `TRAINING`. The default value for + // `UpdateModel` method is to keep the state the same as before. TrainingState training_state = 3 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The serving state of the model: ACTIVE, NOT_ACTIVE. + // Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. ServingState serving_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Timestamp the Recommendation Model was created at. @@ -373,8 +371,19 @@ message Model { // Required. The type of model e.g. `home-page`. // // Currently supported values: `recommended-for-you`, `others-you-may-like`, - // `frequently-bought-together`, `page-optimization`, 'similar-items', - // 'buy-it-again', `recently-viewed`(readonly value). + // `frequently-bought-together`, `page-optimization`, `similar-items`, + // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + // + // + // This field together with + // [optimization_objective][google.cloud.retail.v2alpha.Model.optimization_objective] + // describe model metadata to use to control model training and serving. + // See https://cloud.google.com/retail/docs/models + // for more details on what the model metadata control and which combination + // of parameters are valid. For invalid combinations of parameters (e.g. type + // = `frequently-bought-together` and optimization_objective = `ctr`), you + // receive an error 400 if you try to create/update a recommendation with + // this set of knobs. string type = 7 [(google.api.field_behavior) = REQUIRED]; // Optional. The optimization objective e.g. `cvr`. @@ -390,13 +399,23 @@ message Model { // `others-you-may-like` => `ctr` // // `frequently-bought-together` => `revenue_per_order` + // + // This field together with + // [optimization_objective][google.cloud.retail.v2alpha.Model.type] + // describe model metadata to use to control model training and serving. + // See https://cloud.google.com/retail/docs/models + // for more details on what the model metadata control and which combination + // of parameters are valid. For invalid combinations of parameters (e.g. type + // = `frequently-bought-together` and optimization_objective = `ctr`), you + // receive an error 400 if you try to create/update a recommendation with + // this set of knobs. string optimization_objective = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. The state of periodic tuning. // // The period we use is 3 months - to do a - // one-off tune earlier use the TuneModel method. Default value - // is PERIODIC_TUNING_ENABLED. + // one-off tune earlier use the `TuneModel` method. Default value + // is `PERIODIC_TUNING_ENABLED`. PeriodicTuningState periodic_tuning_state = 11 [(google.api.field_behavior) = OPTIONAL]; @@ -410,18 +429,18 @@ message Model { // recommendation. Empty field implies no tune is goig on. string tuning_operation = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The state of data requirements for this model: DATA_OK and - // DATA_ERROR. + // Output only. The state of data requirements for this model: `DATA_OK` and + // `DATA_ERROR`. // // Recommendation model cannot be trained if the data is in - // DATA_ERROR state. Recommendation model can have DATA_ERROR state even if - // serving state is ACTIVE: models were trained successfully before, but + // `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + // if serving state is `ACTIVE`: models were trained successfully before, but // cannot be refreshed because model no longer has sufficient // data for training. DataState data_state = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. If RECOMMENDATIONS_FILTERING_ENABLED, recommendation filtering by - // attributes is enabled for the model. + // Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + // by attributes is enabled for the model. RecommendationsFilteringOption filtering_option = 18 [(google.api.field_behavior) = OPTIONAL]; diff --git a/google/cloud/retail/v2alpha/model_service.proto b/google/cloud/retail/v2alpha/model_service.proto index 30690f538f..af057c5142 100644 --- a/google/cloud/retail/v2alpha/model_service.proto +++ b/google/cloud/retail/v2alpha/model_service.proto @@ -36,11 +36,11 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Service for performing CRUD operations on models. // Recommendation models contain all the metadata necessary to generate a set of -// models for the Predict() api. A model is queried +// models for the `Predict()` API. A model is queried // indirectly via a ServingConfig, which associates a model with a // given Placement (e.g. Frequently Bought Together on Home Page). // -// This service allows customers to e.g.: +// This service allows you to do the following: // // * Initiate training of a model. // * Pause training of an existing model. @@ -59,8 +59,8 @@ service ModelService { }; option (google.api.method_signature) = "parent,model"; option (google.longrunning.operation_info) = { - response_type: "Model" - metadata_type: "CreateModelMetadata" + response_type: "google.cloud.retail.v2alpha.Model" + metadata_type: "google.cloud.retail.v2alpha.CreateModelMetadata" }; } @@ -99,8 +99,9 @@ service ModelService { } // Update of model metadata. Only fields that - // currently can be updated are: filtering_option, periodic_tuning_state. - // If other values are provided, this API method will ignore them. + // currently can be updated are: `filtering_option` and + // `periodic_tuning_state`. + // If other values are provided, this API method ignores them. rpc UpdateModel(UpdateModelRequest) returns (Model) { option (google.api.http) = { patch: "/v2alpha/{model.name=projects/*/locations/*/catalogs/*/models/*}" @@ -117,8 +118,8 @@ service ModelService { }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { - response_type: "TuneModelResponse" - metadata_type: "TuneModelMetadata" + response_type: "google.cloud.retail.v2alpha.TuneModelResponse" + metadata_type: "google.cloud.retail.v2alpha.TuneModelMetadata" }; } } @@ -126,27 +127,29 @@ service ModelService { // Request for creating a model. message CreateModelRequest { // Required. The parent resource under which to create the model. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } ]; - // Required. The payload of the [Model] to create. + // Required. The payload of the [Model][google.cloud.retail.v2alpha.Model] to + // create. Model model = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Whether to run a dry_run to validate the request (without + // Optional. Whether to run a dry run to validate the request (without // actually creating the model). bool dry_run = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request for updating an existing model. message UpdateModelRequest { - // Required. The body of the updated [Model]. + // Required. The body of the updated + // [Model][google.cloud.retail.v2alpha.Model]. Model model = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates which fields in the provided 'model' to - // update. If not set, will by default update all fields. + // update. If not set, by default updates all fields. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -155,7 +158,7 @@ message UpdateModelRequest { message PauseModelRequest { // Required. The name of the model to pause. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -166,7 +169,7 @@ message PauseModelRequest { message ResumeModelRequest { // Required. The name of the model to resume. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -174,7 +177,7 @@ message ResumeModelRequest { message ListModelsRequest { // Required. The parent for which to list models. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -191,9 +194,9 @@ message ListModelsRequest { // Request for deleting a model. message DeleteModelRequest { - // Required. The resource name of the [Model] to delete. - // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // Required. The resource name of the + // [Model][google.cloud.retail.v2alpha.Model] to delete. Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -214,7 +217,7 @@ message ListModelsResponse { message TuneModelRequest { // Required. The resource name of the model to tune. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -225,7 +228,7 @@ message TuneModelRequest { message CreateModelMetadata { // The resource name of the model that this create applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string model = 1; } @@ -233,7 +236,7 @@ message CreateModelMetadata { message TuneModelMetadata { // The resource name of the model that this tune applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string model = 1; } diff --git a/google/cloud/retail/v2alpha/prediction_service.proto b/google/cloud/retail/v2alpha/prediction_service.proto index b76aed50b1..b88e97e7a3 100644 --- a/google/cloud/retail/v2alpha/prediction_service.proto +++ b/google/cloud/retail/v2alpha/prediction_service.proto @@ -19,6 +19,7 @@ package google.cloud.retail.v2alpha; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/retail/v2alpha/user_event.proto"; import "google/protobuf/struct.proto"; @@ -61,7 +62,7 @@ message PredictRequest { // The ID of the Recommendations AI serving config or placement. // Before you can request predictions from your model, you must create at // least one serving config or placement for it. For more information, see - // [Managing serving configurations] + // [Manage serving configs] // (https://cloud.google.com/retail/docs/manage-configs). // // The full list of available serving configs can be seen at @@ -84,13 +85,13 @@ message PredictRequest { // [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id] unset. UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; - // Maximum number of results to return per page. Set this property - // to the number of prediction results needed. If zero, the service will - // choose a reasonable default. The maximum allowed value is 100. Values - // above 100 will be coerced to 100. + // Maximum number of results to return. Set this property to the number of + // prediction results needed. If zero, the service will choose a reasonable + // default. The maximum allowed value is 100. Values above 100 will be coerced + // to 100. int32 page_size = 3; - // This field is not used for now; leave it unset. + // This field is not used; leave it unset. string page_token = 4 [deprecated = true]; // Filter for restricting prediction results with a length limit of 5,000 @@ -116,12 +117,11 @@ message PredictRequest { // * filterOutOfStockItems tag=(-"promotional") // * filterOutOfStockItems // - // If your filter blocks all prediction results, the API will return generic - // (unfiltered) popular products. If you only want results strictly matching - // the filters, set `strictFiltering` to True in `PredictRequest.params` to - // receive empty results instead. - // Note that the API will never return items with storageStatus of "EXPIRED" - // or "DELETED" regardless of filter choices. + // If your filter blocks all prediction results, the API will return *no* + // results. If instead you want empty result sets to return generic + // (unfiltered) popular products, set `strictFiltering` to False in + // `PredictRequest.params`. Note that the API will never return items with + // storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. // // If `filterSyntaxV2` is set to true under the `params` field, then // attribute-based expressions are expected instead of the above described @@ -148,7 +148,7 @@ message PredictRequest { // * `returnScore`: Boolean. If set to true, the prediction 'score' // corresponding to each returned product will be set in the // `results.metadata` field in the prediction response. The given - // 'score' indicates the probability of an product being clicked/purchased + // 'score' indicates the probability of a product being clicked/purchased // given the user's context and history. // * `strictFiltering`: Boolean. True by default. If set to false, the service // will return generic (unfiltered) popular products instead of empty if diff --git a/google/cloud/retail/v2alpha/product.proto b/google/cloud/retail/v2alpha/product.proto index f4826f1bdd..7dd20a744b 100644 --- a/google/cloud/retail/v2alpha/product.proto +++ b/google/cloud/retail/v2alpha/product.proto @@ -105,6 +105,13 @@ message Product { oneof expiration { // The timestamp when this product becomes unavailable for // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // Note that this is only applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + // and ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In + // general, we suggest the users to delete the stale products explicitly, + // instead of using this field to determine staleness. // // If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not // available for @@ -125,7 +132,14 @@ message Product { // [expiration_date](https://support.google.com/merchants/answer/6324499). google.protobuf.Timestamp expire_time = 16; - // Input only. The TTL (time to live) of the product. + // Input only. The TTL (time to live) of the product. Note that this is only + // applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + // and ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In + // general, we suggest the users to delete the stale products explicitly, + // instead of using this field to determine staleness. // // If it is set, it must be a non-negative value, and // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as @@ -200,7 +214,7 @@ message Product { // The [type][google.cloud.retail.v2alpha.Product.type] of the members must be // either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise - // and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + // an INVALID_ARGUMENT error is thrown. Should not set it for other types. A // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is // return. repeated string collection_member_ids = 5; @@ -231,7 +245,7 @@ message Product { // // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // For example, if a shoes product belongs to both @@ -364,6 +378,11 @@ message Product { // The timestamp when this [Product][google.cloud.retail.v2alpha.Product] // becomes available for // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // Note that this is only applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], and + // ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. google.protobuf.Timestamp available_time = 18; // The online availability of the @@ -551,7 +570,9 @@ message Product { // Note: Returning more fields in // [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] can increase // response payload size and serving latency. - google.protobuf.FieldMask retrievable_fields = 30; + // + // This field is deprecated. Use the retrievable site-wide control instead. + google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; // Output only. Product variants grouped together on primary product which // share similar product attributes. It's automatically grouped by @@ -564,4 +585,15 @@ message Product { // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. // Do not set this field in API requests. repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of local inventories specific to different places. + // + // This is only available for users who have Retail Search enabled, and it can + // be managed by + // [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] + // and + // [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] + // APIs. + repeated LocalInventory local_inventories = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/google/cloud/retail/v2alpha/product_service.proto b/google/cloud/retail/v2alpha/product_service.proto index 1a5f702bb0..ec82c437f4 100644 --- a/google/cloud/retail/v2alpha/product_service.proto +++ b/google/cloud/retail/v2alpha/product_service.proto @@ -141,9 +141,9 @@ service ProductService { // // This process is asynchronous and does not require the // [Product][google.cloud.retail.v2alpha.Product] to exist before updating - // fulfillment information. If the request is valid, the update will be - // enqueued and processed downstream. As a consequence, when a response is - // returned, updates are not immediately manifested in the + // fulfillment information. If the request is valid, the update is enqueued + // and processed downstream. As a consequence, when a response is returned, + // updates are not immediately manifested in the // [Product][google.cloud.retail.v2alpha.Product] queried by // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] // or @@ -153,10 +153,10 @@ service ProductService { // [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] // and // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - // the specified inventory field value(s) will overwrite any existing value(s) + // the specified inventory field value(s) overwrite any existing value(s) // while ignoring the last update time for this field. Furthermore, the last - // update time for the specified inventory fields will be overwritten to the - // time of the + // update times for the specified inventory fields are overwritten by the + // times of the // [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] // or // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -164,11 +164,11 @@ service ProductService { // // If no inventory fields are set in // [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - // then any pre-existing inventory information for this product will be used. + // then any pre-existing inventory information for this product is used. // // If no inventory fields are set in // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - // then any existing inventory information will be preserved. + // then any existing inventory information is preserved. // // Pre-existing inventory information can only be updated with // [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -176,8 +176,17 @@ service ProductService { // and // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. // + // The returned [Operation][google.longrunning.Operation]s is obsolete after + // one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + // API returns `NOT_FOUND` afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates are not marked as [done][google.longrunning.Operation.done] until + // they are obsolete. + // // 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 SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2alpha/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" @@ -203,8 +212,17 @@ service ProductService { // or // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // 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 AddFulfillmentPlaces(AddFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -231,8 +249,17 @@ service ProductService { // or // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // 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 RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -266,8 +293,17 @@ service ProductService { // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] // has no effect on local inventories. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // 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 AddLocalInventories(AddLocalInventoriesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -299,8 +335,17 @@ service ProductService { // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] // has no effect on local inventories. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // 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 RemoveLocalInventories(RemoveLocalInventoriesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/google/cloud/retail/v2alpha/retail_v2alpha.yaml b/google/cloud/retail/v2alpha/retail_v2alpha.yaml index 65d5b6a58a..8955dd1bc4 100644 --- a/google/cloud/retail/v2alpha/retail_v2alpha.yaml +++ b/google/cloud/retail/v2alpha/retail_v2alpha.yaml @@ -64,12 +64,16 @@ backend: rules: - selector: google.cloud.retail.v2alpha.CatalogService.UpdateCatalog deadline: 10.0 + - selector: google.cloud.retail.v2alpha.CompletionService.ImportCompletionData + deadline: 300.0 - selector: 'google.cloud.retail.v2alpha.ModelService.*' deadline: 60.0 - selector: 'google.cloud.retail.v2alpha.ProductService.*' deadline: 30.0 - selector: google.cloud.retail.v2alpha.ProductService.ImportProducts deadline: 300.0 + - selector: google.cloud.retail.v2alpha.UserEventService.CollectUserEvent + deadline: 10.0 - selector: google.cloud.retail.v2alpha.UserEventService.ImportUserEvents deadline: 600.0 - selector: google.cloud.retail.v2alpha.UserEventService.PurgeUserEvents @@ -82,6 +86,7 @@ http: - selector: google.longrunning.Operations.GetOperation get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}' additional_bindings: + - get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}' - get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}' - get: '/v2alpha/{name=projects/*/locations/*/operations/*}' - get: '/v2alpha/{name=projects/*/operations/*}' diff --git a/google/cloud/retail/v2alpha/search_service.proto b/google/cloud/retail/v2alpha/search_service.proto index 24bfa34aac..37526c1f75 100644 --- a/google/cloud/retail/v2alpha/search_service.proto +++ b/google/cloud/retail/v2alpha/search_service.proto @@ -37,7 +37,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Service for search. // // 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 SearchService { option (google.api.default_host) = "retail.googleapis.com"; option (google.api.oauth_scopes) = @@ -46,7 +46,7 @@ service SearchService { // Performs a search. // // 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 Search(SearchRequest) returns (SearchResponse) { option (google.api.http) = { post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" @@ -218,7 +218,7 @@ message SearchRequest { FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED]; // Maximum of facet values that should be returned for this facet. If - // unspecified, defaults to 20. The maximum allowed value is 300. Values + // unspecified, defaults to 50. The maximum allowed value is 300. Values // above 300 will be coerced to 300. // // If this field is negative, an INVALID_ARGUMENT is returned. @@ -396,7 +396,8 @@ message SearchRequest { // [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. MODE_UNSPECIFIED = 0; - // Let CRS decide whether to use personalization. + // Let CRS decide whether to use personalization based on quality of user + // event data. AUTO = 1; // Disable personalization. @@ -458,15 +459,21 @@ message SearchRequest { // The search mode of each search request. enum SearchMode { // Default value. In this case both product search and faceted search will - // be performed. Both [SearchResponse.SearchResult] and - // [SearchResponse.Facet] will be returned. + // be performed. Both + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] + // and + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will be returned. SEARCH_MODE_UNSPECIFIED = 0; // Only product search will be performed. The faceted search will be // disabled. // - // Only [SearchResponse.SearchResult] will be returned. - // [SearchResponse.Facet] will not be returned, even if + // Only + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] + // will be returned. + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will not be returned, even if // [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs] // or // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] @@ -481,7 +488,9 @@ message SearchRequest { // and // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] // should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - // [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will be returned. + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] // will not be returned. FACETED_SEARCH_ONLY = 2; } @@ -490,7 +499,7 @@ message SearchRequest { // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` // or the name of the legacy placement resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - // This field is used to identify the serving configuration name and the set + // This field is used to identify the serving config name and the set // of models that will be used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; @@ -713,7 +722,7 @@ message SearchRequest { // [UserEvent.page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories]; // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // Category pages include special pages such as sales or promotions. For @@ -726,6 +735,15 @@ message SearchRequest { SearchMode search_mode = 31; // The specification for personalization. + // + // Notice that if both + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + // and + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // are set. + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // will override + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. PersonalizationSpec personalization_spec = 32; // The labels applied to a resource must meet the following requirements: @@ -829,6 +847,21 @@ message SearchResponse { // `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there // are 10 variants in this product are available in the store "store1". map variant_rollup_values = 5; + + // Specifies previous events related to this product for this user based on + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] with same + // [SearchRequest.visitor_id][google.cloud.retail.v2alpha.SearchRequest.visitor_id] + // or [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id]. + // + // This is set only when + // [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.mode] + // is + // [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. + // + // Possible values: + // + // * `purchased`: Indicates that this product has been purchased before. + repeated string personal_labels = 7; } // A facet result. diff --git a/google/cloud/retail/v2alpha/serving_config.proto b/google/cloud/retail/v2alpha/serving_config.proto index d052401245..d4d02c70c4 100644 --- a/google/cloud/retail/v2alpha/serving_config.proto +++ b/google/cloud/retail/v2alpha/serving_config.proto @@ -32,14 +32,25 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Configures metadata that is used to generate serving time results (e.g. // search results or recommendation predictions). -// The ServingConfig is passed in the search and predict request and together -// with the Catalog.default_branch, generates results. message ServingConfig { option (google.api.resource) = { type: "retail.googleapis.com/ServingConfig" pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}" }; + // What type of diversity - data or rule based. + // If none is specified, default to rule based. + enum DiversityType { + // Default value. + DIVERSITY_TYPE_UNSPECIFIED = 0; + + // Rule based diversity. + RULE_BASED_DIVERSITY = 2; + + // Data driven diversity. + DATA_DRIVEN_DIVERSITY = 3; + } + // Immutable. Fully qualified name // `projects/*/locations/global/catalogs/*/servingConfig/*` string name = 1 [(google.api.field_behavior) = IMMUTABLE]; @@ -51,7 +62,8 @@ message ServingConfig { // characters. Otherwise, an INVALID_ARGUMENT error is returned. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - // The id of the model to use at serving time. + // The id of the model in the same + // [Catalog][google.cloud.retail.v2alpha.Catalog] to use at serving time. // Currently only RecommendationModels are supported: // https://cloud.google.com/retail/recommendations-ai/docs/create-models // Can be changed but only to a compatible model (e.g. @@ -70,13 +82,13 @@ message ServingConfig { // click-through and conversion rates. // Allowed values are: // - // * 'no-price-reranking' - // * 'low-price-raranking' - // * 'medium-price-reranking' - // * 'high-price-reranking' + // * `no-price-reranking` + // * `low-price-raranking` + // * `medium-price-reranking` + // * `high-price-reranking` // // If not specified, we choose default based on model type. Default value: - // 'no-price-reranking'. + // `no-price-reranking`. // // Can only be set if // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] @@ -205,16 +217,16 @@ message ServingConfig { repeated string ignore_control_ids = 15; // How much diversity to use in recommendation model results e.g. - // 'medium-diversity' or 'high-diversity'. Currently supported values: + // `medium-diversity` or `high-diversity`. Currently supported values: // - // * 'no-diversity' - // * 'low-diversity' - // * 'medium-diversity' - // * 'high-diversity' - // * 'auto-diversity' + // * `no-diversity` + // * `low-diversity` + // * `medium-diversity` + // * `high-diversity` + // * `auto-diversity` // // If not specified, we choose default based on recommendation model - // type. Default value: 'no-diversity'. + // type. Default value: `no-diversity`. // // Can only be set if // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] @@ -222,13 +234,16 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string diversity_level = 8; - // Whether to add additional category filters on the 'similar-items' model. + // What kind of diversity to use - data driven or rule based. + DiversityType diversity_type = 20; + + // Whether to add additional category filters on the `similar-items` model. // If not specified, we enable it by default. // Allowed values are: // - // * 'no-category-match': No additional filtering of original results from + // * `no-category-match`: No additional filtering of original results from // the model and the customer's filters. - // * 'relaxed-category-match': Only keep results with categories that match + // * `relaxed-category-match`: Only keep results with categories that match // at least one item categories in the PredictRequests's context item. // * If customer also sends filters in the PredictRequest, then the results // will satisfy both conditions (user given and category match). @@ -239,6 +254,23 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string enable_category_filter_level = 16; + // The specification for personalization spec. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + // + // Notice that if both + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + // and + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // are set. + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // will override + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. + SearchRequest.PersonalizationSpec personalization_spec = 21; + // Required. Immutable. Specifies the solution types that a serving config can // be associated with. Currently we support setting only one type of solution. repeated SolutionType solution_types = 19 [ diff --git a/google/cloud/retail/v2alpha/serving_config_service.proto b/google/cloud/retail/v2alpha/serving_config_service.proto index 311126510e..387091079c 100644 --- a/google/cloud/retail/v2alpha/serving_config_service.proto +++ b/google/cloud/retail/v2alpha/serving_config_service.proto @@ -159,7 +159,7 @@ message UpdateServingConfigRequest { // Request for DeleteServingConfig method. message DeleteServingConfigRequest { // Required. The resource name of the ServingConfig to delete. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -171,7 +171,7 @@ message DeleteServingConfigRequest { // Request for GetServingConfig method. message GetServingConfigRequest { // Required. The resource name of the ServingConfig to get. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -183,7 +183,7 @@ message GetServingConfigRequest { // Request for ListServingConfigs method. message ListServingConfigsRequest { // Required. The catalog resource name. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -211,7 +211,7 @@ message ListServingConfigsResponse { // Request for AddControl method. message AddControlRequest { // Required. The source ServingConfig resource name . Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string serving_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -227,7 +227,7 @@ message AddControlRequest { // Request for RemoveControl method. message RemoveControlRequest { // Required. The source ServingConfig resource name . Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string serving_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/google/cloud/retail/v2alpha/user_event.proto b/google/cloud/retail/v2alpha/user_event.proto index ca25f3003f..6d24ca2448 100644 --- a/google/cloud/retail/v2alpha/user_event.proto +++ b/google/cloud/retail/v2alpha/user_event.proto @@ -229,7 +229,7 @@ message UserEvent { // The categories associated with a category page. // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // Category pages include special pages such as sales or promotions. For diff --git a/google/cloud/retail/v2alpha/user_event_service.proto b/google/cloud/retail/v2alpha/user_event_service.proto index 35fe33f4ba..5e0702bca5 100644 --- a/google/cloud/retail/v2alpha/user_event_service.proto +++ b/google/cloud/retail/v2alpha/user_event_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/httpbody.proto"; +import "google/api/resource.proto"; import "google/cloud/retail/v2alpha/import_config.proto"; import "google/cloud/retail/v2alpha/purge_config.proto"; import "google/cloud/retail/v2alpha/user_event.proto"; @@ -79,9 +80,9 @@ service UserEventService { // synchronous. Events that already exist are skipped. // Use this method for backfilling historical user events. // - // Operation.response is of type ImportResponse. Note that it is + // `Operation.response` is of type `ImportResponse`. Note that it is // possible for a subset of the items to be successfully inserted. - // Operation.metadata is of type ImportMetadata. + // `Operation.metadata` is of type `ImportMetadata`. rpc ImportUserEvents(ImportUserEventsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -94,14 +95,14 @@ service UserEventService { }; } - // Starts a user event rejoin operation with latest product catalog. Events - // will not be annotated with detailed product information if product is - // missing from the catalog at the time the user event is ingested, and these - // events are stored as unjoined events with a limited usage on training and - // serving. This method can be used to start a join operation on specified - // events with latest version of product catalog. It can also be used to - // correct events joined with the wrong product catalog. A rejoin operation - // can take hours or days to complete. + // Starts a user-event rejoin operation with latest product catalog. Events + // are not annotated with detailed product information for products that are + // missing from the catalog when the user event is ingested. These + // events are stored as unjoined events with limited usage on training and + // serving. You can use this method to start a join operation on specified + // events with the latest version of product catalog. You can also use this + // method to correct events joined with the wrong product catalog. A rejoin + // operation can take hours or days to complete. rpc RejoinUserEvents(RejoinUserEventsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -123,10 +124,24 @@ message WriteUserEventRequest { // Required. User event to write. UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, the user event will be written asynchronously after + // validation, and the API will respond without waiting for the write. + // Therefore, silent failures can occur even if the API returns success. In + // case of silent failures, error messages can be found in Stackdriver logs. + bool write_async = 3; } // Request message for CollectUserEvent method. message CollectUserEventRequest { + // The rule that can convert the raw_json to a user event. It is needed + // only when the raw_json is set. + oneof conversion_rule { + // The prebuilt rule name that can convert a specific type of raw_json. + // For example: "default_schema/v1.0" + string prebuilt_rule = 6; + } + // Required. The parent catalog name, such as // `projects/1234/locations/global/catalogs/default_catalog`. string parent = 1 [(google.api.field_behavior) = REQUIRED]; @@ -145,17 +160,23 @@ message CollectUserEventRequest { // otherwise identical get requests. The name is abbreviated to reduce the // payload bytes. int64 ets = 4; + + // An arbitrary serialized JSON string that contains necessary information + // that can comprise a user event. When this field is specified, the + // user_event field will be ignored. Note: line-delimited JSON is not + // supported, a single JSON only. + string raw_json = 5; } // Request message for RejoinUserEvents method. message RejoinUserEventsRequest { // The scope of user events to be rejoined with the latest product catalog. // If the rejoining aims at reducing number of unjoined events, set - // UserEventRejoinScope to UNJOINED_EVENTS. + // `UserEventRejoinScope` to `UNJOINED_EVENTS`. // If the rejoining aims at correcting product catalog information in joined - // events, set UserEventRejoinScope to JOINED_EVENTS. - // If all events needs to be rejoined, set UserEventRejoinScope to - // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED. + // events, set `UserEventRejoinScope` to `JOINED_EVENTS`. + // If all events needs to be rejoined, set `UserEventRejoinScope` to + // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`. enum UserEventRejoinScope { // Rejoin all events with the latest product catalog, including both joined // events and unjoined events. @@ -174,16 +195,16 @@ message RejoinUserEventsRequest { // The type of the user event rejoin to define the scope and range of the user // events to be rejoined with the latest product catalog. Defaults to - // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an - // invalid integer value. + // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + // an invalid integer value. UserEventRejoinScope user_event_rejoin_scope = 2; } -// Response message for RejoinUserEvents method. +// Response message for `RejoinUserEvents` method. message RejoinUserEventsResponse { // Number of user events that were joined with latest product catalog. int64 rejoined_user_events_count = 1; } -// Metadata for RejoinUserEvents method. +// Metadata for `RejoinUserEvents` method. message RejoinUserEventsMetadata {}