Remove search features in the public protos

PiperOrigin-RevId: 332381118
This commit is contained in:
Google APIs 2020-09-17 21:45:12 -07:00 committed by Copybara-Service
parent c4c562f89a
commit 3de2cc8c97
11 changed files with 54 additions and 1129 deletions

View File

@ -71,8 +71,7 @@ message PredictRequest {
// pages. For example - More products like this.
//
// * `recently_viewed_default`: Returns up to 75 products recently viewed by
// the
// specified `userId` or `visitorId`, most recent ones first. Returns
// the specified `userId` or `visitorId`, most recent ones first. Returns
// nothing if neither of them has viewed any products yet. For example -
// Recently viewed.
//
@ -91,7 +90,8 @@ message PredictRequest {
// 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.
// choose a reasonable default. The maximum allowed value is 100. Values
// above 100 will be coerced to 100.
int32 page_size = 3;
// The previous PredictResponse.next_page_token.
@ -133,14 +133,13 @@ message PredictRequest {
// Allowed values:
//
// * `returnProduct`: Boolean. If set to true, the associated product
// object will be returned in the
// `PredictResponse.PredictionResult.productMetadata` object in the method
// response.
// object will be returned in the `results.metadata` field in the
// prediction response.
// * `returnScore`: Boolean. If set to true, the prediction 'score'
// corresponding to each returned product will be set in the `metadata`
// field in the prediction response. The given 'score' indicates the
// probability of an product being clicked/purchased given the user's
// context and history.
// 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
// 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
// your filter blocks all prediction results.

View File

@ -61,7 +61,6 @@ proto_library(
"product.proto",
"product_service.proto",
"purge_config.proto",
"search_service.proto",
"user_event.proto",
"user_event_service.proto",
],
@ -123,7 +122,6 @@ java_gapic_test(
"com.google.cloud.retail.v2alpha.CatalogServiceClientTest",
"com.google.cloud.retail.v2alpha.PredictionServiceClientTest",
"com.google.cloud.retail.v2alpha.ProductServiceClientTest",
"com.google.cloud.retail.v2alpha.SearchServiceClientTest",
"com.google.cloud.retail.v2alpha.UserEventServiceClientTest",
],
runtime_deps = [":retail_java_gapic_test"],

View File

@ -29,71 +29,6 @@ option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// An intended audience of the [Product][google.cloud.retail.v2alpha.Product]
// for whom it's sold.
message Audience {
// The genders of the audience. Strongly encouraged to use the standard
// values: "male", "female", "unisex".
//
// At most 5 values are allowed. Each value must be a UTF-8 encoded string
// with a length limit of 128 bytes. Otherwise, an INVALID_ARGUMENT error is
// returned.
//
// Google Merchant Center property
// [gender](https://support.google.com/merchants/answer/6324479). Schema.org
// property
// [Product.audience.suggestedGender](https://schema.org/suggestedGender).
repeated string genders = 1;
// The age groups of the audience. Strongly encouraged to use the standard
// values: "newborn" (up to 3 months old), "infant" (312 months old),
// "toddler" (15 years old), "kids" (513 years old), "adult" (typically
// teens or older).
//
// At most 5 values are allowed. Each value must be a UTF-8 encoded string
// with a length limit of 128 bytes. Otherwise, an INVALID_ARGUMENT error is
// returned.
//
// Google Merchant Center property
// [age_group](https://support.google.com/merchants/answer/6324463).
// Schema.org property
// [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
// [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).
repeated string age_groups = 2;
}
// The color information of a [Product][google.cloud.retail.v2alpha.Product].
message ColorInfo {
// The standard color families. Strongly recommended to use the following
// standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple",
// "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and
// "Mixed". Normally it is expected to have only 1 color family. May consider
// using single "Mixed" instead of multiple values.
//
// A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
// string with a length limit of 128 bytes. Otherwise, an INVALID_ARGUMENT
// error is returned.
//
// Google Merchant Center property
// [color](https://support.google.com/merchants/answer/6324487). Schema.org
// property [Product.color](https://schema.org/color).
repeated string color_families = 1;
// The color display names, which may be different from standard color family
// names, such as the color aliases used in the website frontend. Normally
// it is expected to have only 1 color. May consider using single "Mixed"
// instead of multiple values.
//
// A maximum of 5 colors are allowed. Each value must be a UTF-8 encoded
// string with a length limit of 128 bytes. Otherwise, an INVALID_ARGUMENT
// error is returned.
//
// Google Merchant Center property
// [color](https://support.google.com/merchants/answer/6324487). Schema.org
// property [Product.color](https://schema.org/color).
repeated string colors = 2;
}
// A custom attribute that is not explicitly modeled in
// [Product][google.cloud.retail.v2alpha.Product]].
message CustomAttribute {
@ -119,58 +54,6 @@ message CustomAttribute {
// [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be
// set. Otherwise, a FAILED_PRECONDITION error is returned.
repeated double numbers = 2;
// If true, custom attribute values are searchable by text queries in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
//
// Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text]
// is set. Otherwise, a FAILED_PRECONDITION error is returned.
bool searchable = 3;
// If true, custom attribute values are indexed, so that it can be filtered,
// facted or boosted in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
//
// See
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter],
// [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs]
// and
// [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec]
// for more details.
bool indexable = 4;
}
// Fulfillment information, such as the store IDs for in-store pickup or region
// IDs for different shipping methods.
message FulfillmentInfo {
// The fulfillment type, including commonly used types (such as pickup in
// store and same day delivery), and custom types. Customers have to map
// custom types to their display names before rendering UI.
//
// Suppored values:
//
// * "pickup-in-store"
// * "ship-to-store"
// * "same-day-delivery"
// * "next-day-delivery"
// * "custom-type-1"
// * "custom-type-2"
// * "custom-type-3"
// * "custom-type-4"
// * "custom-type-5"
//
// If this field is set to an invalid value other than these, an
// INVALID_ARGUMENT error is returned.
string type = 1;
// The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type],
// such as the store IDs for [FulfillmentInfo.Type.PICKUP_IN_STORE][] or the
// region IDs for [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
//
// A maximum of 2000 values are allowed. Each value must be a string with a
// length limit of 10 bytes, matching the pattern [a-zA-Z0-9_-]+, such as
// "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned.
repeated string place_ids = 2;
}
// [Product][google.cloud.retail.v2alpha.Product] thumbnail/detail image.
@ -198,57 +81,8 @@ message Image {
int32 width = 3;
}
// A floating point interval.
message Interval {
// The lower bound of the interval. If neither of the min fields are set, then
// the lower bound is negative infinity.
//
// This field must be not larger than
// [max][google.cloud.retail.v2alpha.Interval.max]. Otherwise, an
// INVALID_ARGUMENT error is returned.
oneof min {
// Inclusive lower bound.
double minimum = 1;
// Exclusive lower bound.
double exclusive_minimum = 2;
}
// The upper bound of the interval. If neither of the max fields are set, then
// the upper bound is positive infinity.
//
// This field must be not smaller than
// [min][google.cloud.retail.v2alpha.Interval.min]. Otherwise, an
// INVALID_ARGUMENT error is returned.
oneof max {
// Inclusive upper bound.
double maximum = 3;
// Exclusive upper bound.
double exclusive_maximum = 4;
}
}
// The price information of a [Product][google.cloud.retail.v2alpha.Product].
message PriceInfo {
// The price range of all
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product] having the same
// [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
message PriceRange {
// The inclusive [Product.pricing_info.price][] interval of all
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product] having the same
// [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
Interval price = 1;
// The inclusive [Product.pricing_info.original_price][] internal of all
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product] having the same
// [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id].
Interval original_price = 2;
}
// The 3-letter currency code defined in [ISO
// 4217][https://www.iso.org/iso-4217-currency-codes.html].
//
@ -277,71 +111,6 @@ message PriceInfo {
// Google Merchant Center property
// [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895)
float cost = 4;
// The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
// starts to be effective. This can be set as a future timestamp, and the
// [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for
// search after
// [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
// If so, the
// [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
// be set and
// [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
// used before
// [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time].
//
// Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
// always effective because it will cause additional latency during search.
google.protobuf.Timestamp price_effective_time = 5;
// The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price]
// stops to be effective. The
// [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search
// before
// [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
// If this field is set, the
// [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must
// be set and
// [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is
// used after
// [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time].
//
// Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is
// always effective because it will cause additional latency during search.
google.protobuf.Timestamp price_expire_time = 6;
// Output only. The price range of all the child
// [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s grouped together on the
// [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// [Product][google.cloud.retail.v2alpha.Product] or
// [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
// [Product][google.cloud.retail.v2alpha.Product].
PriceRange price_range = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The rating of a [Product][google.cloud.retail.v2alpha.Product].
message Rating {
// The total number of ratings. This value is independent of the value of
// [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram].
//
// This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
// returned.
int32 rating_count = 1;
// The average rating of the [Product][google.cloud.retail.v2alpha.Product].
//
// The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is
// returned.
float average_rating = 2;
// List of rating counts per rating value (index = rating - 1). The list is
// empty if there is no rating. If the list is non-empty, its size is
// always 5. Otherwise, an INVALID_ARGUMENT error is returned.
//
// For example, [41, 14, 13, 47, 303]. It means that the [Product][] got 41
// ratings with 1 star, 14 ratings with 2 star, and so on.
repeated int32 rating_histogram = 3;
}
// Information of an end user.

View File

@ -71,8 +71,7 @@ message PredictRequest {
// pages. For example - More products like this.
//
// * `recently_viewed_default`: Returns up to 75 products recently viewed by
// the
// specified `userId` or `visitorId`, most recent ones first. Returns
// the specified `userId` or `visitorId`, most recent ones first. Returns
// nothing if neither of them has viewed any products yet. For example -
// Recently viewed.
//
@ -91,7 +90,8 @@ message PredictRequest {
// 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.
// choose a reasonable default. The maximum allowed value is 100. Values
// above 100 will be coerced to 100.
int32 page_size = 3;
// The previous PredictResponse.next_page_token.
@ -133,14 +133,13 @@ message PredictRequest {
// Allowed values:
//
// * `returnProduct`: Boolean. If set to true, the associated product
// object will be returned in the
// `PredictResponse.PredictionResult.productMetadata` object in the method
// response.
// object will be returned in the `results.metadata` field in the
// prediction response.
// * `returnScore`: Boolean. If set to true, the prediction 'score'
// corresponding to each returned product will be set in the `metadata`
// field in the prediction response. The given 'score' indicates the
// probability of an product being clicked/purchased given the user's
// context and history.
// 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
// 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
// your filter blocks all prediction results.

View File

@ -46,41 +46,6 @@ message Product {
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}"
};
// The type of this product.
enum Type {
// Default value. Default to
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] if
// unset.
TYPE_UNSPECIFIED = 0;
// The primary type.
//
// As the primary unit for indexing and search serving, a
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// [Product][google.cloud.retail.v2alpha.Product] is grouped with multiple
// [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s.
PRIMARY = 1;
// The variant type.
//
// [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s usually share some common
// attributes on the same
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// [Product][google.cloud.retail.v2alpha.Product]s, but they have variant
// attributes like different colors, sizes and prices, etc.
VARIANT = 2;
// The collection type. Collection products are bundled
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// [Product][google.cloud.retail.v2alpha.Product]s or
// [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s that are sold together,
// such as a jewelry set with necklaces, earrings and rings, etc.
COLLECTION = 3;
}
// Product availability. If this field is unspecified, the product is
// assumed to be in stock.
enum Availability {
@ -102,44 +67,6 @@ message Product {
BACKORDER = 4;
}
oneof expiration {
// The timestamp when this product becomes unavailable for recommendation
// and search.
//
// If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
// available for recommendation and search after
// [expire_time][google.cloud.retail.v2alpha.Product.expire_time]. However,
// the product can still be retrieved by
// [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
// and
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
//
// Google Merchant Center property
// [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.
//
// If it is set,
// [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as
// current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl].
// The derived
// [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
// returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl]
// is left blank when retrieving the
// [Product][google.cloud.retail.v2alpha.Product].
//
// If it is set, the product is not available for recommendation and search
// after current timestamp plus
// [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can
// still be retrieved by
// [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
// and
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
google.protobuf.Duration ttl = 17
[(google.api.field_behavior) = INPUT_ONLY];
}
// Immutable. Full resource name of the product, such as
//
// "projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id".
@ -162,12 +89,6 @@ message Product {
// schema.org Property [Product.sku](https://schema.org/sku).
string id = 2 [(google.api.field_behavior) = IMMUTABLE];
// Immutable. The type of the product.
//
// Default to [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// if unset.
Type type = 3 [(google.api.field_behavior) = IMMUTABLE];
// Variant group identifier. Must be an
// [id][google.cloud.retail.v2alpha.Product.id], with the same parent branch
// with this product. Otherwise, an error is thrown.
@ -193,31 +114,6 @@ message Product {
// more](/recommendations-ai/docs/catalog#item-group-id).
string primary_product_id = 4;
// The [id][google.cloud.retail.v2alpha.Product.id] of the collection members
// when [type][google.cloud.retail.v2alpha.Product.type] is
// [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION].
//
// 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;
// The Global Trade Item Number (GTIN) of the product.
//
// This field must be a UTF-8 encoded string with a length limit of 128 bytes.
// Otherwise, an INVALID_ARGUMENT error is returned.
//
// Google Merchant Center property
// [gtin](https://support.google.com/merchants/answer/6324461).
// Schema.org property
// [Product.isbn](http://schema.org/isbn) or
// [Product.gtin8](http://schema.org/gtin8) or
// [Product.gtin12](http://schema.org/gtin12) or
// [Product.gtin13](http://schema.org/gtin13) or
// [Product.gtin14](http://schema.org/gtin14).
//
// If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
string gtin = 6;
// Required. Product categories. This field is repeated for supporting one
// product belonging to several parallel categories. Each value is either the
// full path of the category, or the [category
@ -263,21 +159,6 @@ message Product {
// property [Product.name](https://schema.org/name).
string title = 8 [(google.api.field_behavior) = REQUIRED];
// The brand of the product.
//
// This field must be a UTF-8 encoded string with a length limit of 1 KiB.
// Otherwise, an INVALID_ARGUMENT error is returned.
//
// This field can only be set in a
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// [Product][google.cloud.retail.v2alpha.Product]. Otherwise, a
// FAILED_PRECONDITION error is returned.
//
// Google Merchant Center property
// [brand](https://support.google.com/merchants/answer/6324351). Schema.org
// property [Product.brand](https://schema.org/brand).
string brand = 9;
// Product description.
//
// This field must be a UTF-8 encoded string with a length limit of 5 KiB.
@ -342,9 +223,6 @@ message Product {
// [price](https://support.google.com/merchants/answer/6324371).
PriceInfo price_info = 14;
// The rating of this product.
Rating rating = 15;
// The timestamp when this [Product][google.cloud.retail.v2alpha.Product]
// becomes available recommendation and search.
google.protobuf.Timestamp available_time = 18;
@ -364,14 +242,6 @@ message Product {
// The available quantity of the item.
google.protobuf.Int32Value available_quantity = 20;
// Fulfillment information, such as the store IDs for in-store pickup or
// region IDs for different shipping methods.
//
// All the elements must have distinct
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type].
// Otherwise, an INVALID_ARGUMENT error is returned.
repeated FulfillmentInfo fulfillment_info = 21;
// Canonical URL directly linking to the product detail page.
//
// This field must be a UTF-8 encoded string with a length limit of 5 KiB.
@ -389,37 +259,6 @@ message Product {
// Schema.org property [Product.image](https://schema.org/image).
repeated Image images = 23;
// The target group associated with a given audience (e.g. male, veterans,
// car owners, musicians, etc.) of the product.
Audience audience = 24;
// The color of the product.
//
// Google Merchant Center property
// [color](https://support.google.com/merchants/answer/6324487). Schema.org
// property [Product.color](https://schema.org/color).
ColorInfo color_info = 25;
// The size of the product. To represent different size systems or size types,
// consider using this format: [[[size_system:]size_type:]size_value].
//
// For example, in "US:MENS:M", "US" represents size system; "MENS" represents
// size type; "M" represents size value. In "GIRLS:27", size system is empty;
// "GIRLS" represents size type; "27" represents size value. In "32 inches",
// both size system and size type are empty, while size value is "32 inches".
//
// A maximum of 20 values are allowed per
// [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
// encoded string with a length limit of 128 bytes. Otherwise, an
// INVALID_ARGUMENT error is returned.
//
// Google Merchant Center property
// [size](https://support.google.com/merchants/answer/6324492),
// [size_type](https://support.google.com/merchants/answer/6324497) and
// [size_system](https://support.google.com/merchants/answer/6324502).
// Schema.org property [Product.size](https://schema.org/size).
repeated string sizes = 26;
// The material of the product. For example, "leather", "wooden".
//
// A maximum of 5 values are allowed. Each value must be a UTF-8 encoded
@ -431,32 +270,6 @@ message Product {
// property [Product.material](https://schema.org/material).
repeated string materials = 27;
// The pattern or graphic print of the product. For example, "striped", "polka
// dot", "paisley".
//
// A maximum of 5 values are allowed per
// [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
// encoded string with a length limit of 128 bytes. Otherwise, an
// INVALID_ARGUMENT error is returned.
//
// Google Merchant Center property
// [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
// property [Product.pattern](https://schema.org/pattern).
repeated string patterns = 28;
// The condition of the product. Strongly encouraged to use the standard
// values: "new", "refurbished", "used".
//
// A maximum of 5 values are allowed per
// [Product][google.cloud.retail.v2alpha.Product]. Each value must be a UTF-8
// encoded string with a length limit of 128 bytes. Otherwise, an
// INVALID_ARGUMENT error is returned.
//
// Google Merchant Center property
// [condition](https://support.google.com/merchants/answer/6324469).
// Schema.org property [Offer.itemCondition](http://schema.org/itemCondition).
repeated string conditions = 29;
// Indicates which fields in the
// [variants][google.cloud.retail.v2alpha.Product.variants] are retrievable in
// [Search][]. If not set or empty, the following fields are returned:
@ -486,15 +299,4 @@ message Product {
// Maximum number of paths is 10. Otherwise, an INVALID_ARGUMENT error is
// returned.
google.protobuf.FieldMask stocking_unit_retrievable_fields = 30;
// Output only. Product variants grouped together on primary product which
// share similar product attributes. It's automatically grouped by
// [primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
// for all the product variants. Only populated for [Type.PARIMARY][]
// [Product][google.cloud.retail.v2alpha.Product]s.
//
// Note: This field is OUTPUT_ONLY for API calls. In BigQuery inventory batch
// import, it can be used as the input to import both product and product
// variants together at once. For API requests, do not set this field.
repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
}

View File

@ -61,14 +61,6 @@ service ProductService {
option (google.api.method_signature) = "name";
}
// Gets a list of [Product][]s.
rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
option (google.api.http) = {
get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
};
option (google.api.method_signature) = "parent";
}
// Updates a [Product][google.cloud.retail.v2alpha.Product]. Non-existing
// items will be created.
rpc UpdateProduct(UpdateProductRequest) returns (Product) {
@ -125,6 +117,19 @@ service ProductService {
metadata_type: "google.cloud.retail.v2alpha.ImportMetadata"
};
}
// Export of multiple [Product][google.cloud.retail.v2alpha.Product]s.
rpc ExportProducts(ExportProductsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:export"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.retail.v2alpha.ExportProductsResponse"
metadata_type: "google.cloud.retail.v2alpha.ExportMetadata"
};
}
}
// Request message for [CreateProduct][] method.
@ -226,121 +231,3 @@ message DeleteProductRequest {
(google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
];
}
// Request message for
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
// method.
message ListProductsRequest {
// Required. The parent branch resource name, such as
// "projects/*/locations/global/catalogs/default_catalog/branches/0". Use
// "default_branch" as the branch ID, to list products under the default
// branch.
//
// If the caller does not have permission to list
// [Product][google.cloud.retail.v2alpha.Product]s under this branch,
// regardless of whether or not this branch exists, a PERMISSION_DENIED error
// is returned.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
];
// Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
// return. If unspecified, defaults to 100. The maximum allowed value is 1000.
// Values above 1000 will be coerced to 1000.
//
// If this field is negative, an INVALID_ARGUMENT is returned.
int32 page_size = 2;
// A page token
// [ListProductsResponse.next_page_token][google.cloud.retail.v2alpha.ListProductsResponse.next_page_token],
// received from a previous [ProductService.ListCatalogs][] call. Provide this
// to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
// must match the call that provided the page token. Otherwise, an
// INVALID_ARGUMENT error is returned.
string page_token = 3;
// A filter to apply on the list results. Supported features:
//
// * List all the products under the parent branch if
// [filter][google.cloud.retail.v2alpha.ListProductsRequest.filter] is unset.
// * List products bundled in a collection. For example:
// `collection_product_name =
//
// "projects/*/locations/global/catalogs/default_catalog/branches/0/products/some_product_id"`
// * List products with a partibular type. For example:
// `type = "PRIMARY"`
// `type = "VARIANT"`
// `type = "COLLECTION"`
//
// If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
//
// If the caller does not have permission to list
// [Product][google.cloud.retail.v2alpha.Product]s under this the specified
// [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
// [Product][google.cloud.retail.v2alpha.Product], regardless of whether or
// not it exists, a PERMISSION_DENIED error is returned.
//
// If the specified
// [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]
// [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND
// error is returned.
string filter = 4;
// The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
// the responses. If not set or empty, the following fields are returned:
//
// * [Product.name][google.cloud.retail.v2alpha.Product.name]
// * [Product.id][google.cloud.retail.v2alpha.Product.id]
// * [Product.title][google.cloud.retail.v2alpha.Product.title]
// * [Product.uri][google.cloud.retail.v2alpha.Product.uri]
// * [Product.images][google.cloud.retail.v2alpha.Product.images]
//
// If "*" is provided, all fields are returned.
// [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
// no matter what mask is set.
//
// If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
// is returned.
google.protobuf.FieldMask read_mask = 5;
// If true and
// [page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token] is
// empty,
// [ListProductsResponse.total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
// is set to the total count of matched items irrespective of pagination.
//
// Notice that setting this field to true affects the performance.
bool require_total_size = 6;
}
// Response message for
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]
// method.
message ListProductsResponse {
// The [Product][google.cloud.retail.v2alpha.Product]s.
repeated Product products = 1;
// A token that can be sent as
// [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 2;
// The total count of matched [Product][google.cloud.retail.v2alpha.Product]s
// irrespective of pagination. The total number of
// [Product][google.cloud.retail.v2alpha.Product]s returned by pagination may
// be less than the
// [total_size][google.cloud.retail.v2alpha.ListProductsResponse.total_size]
// that matches.
//
// This field is ignored if
// [ListProductsRequest.require_total_size][google.cloud.retail.v2alpha.ListProductsRequest.require_total_size]
// is not set or
// [ListProductsRequest.page_token][google.cloud.retail.v2alpha.ListProductsRequest.page_token]
// is not empty.
int32 total_size = 3;
}

View File

@ -4,8 +4,7 @@
{ "service": "google.cloud.retail.v2alpha.CatalogService" },
{ "service": "google.cloud.retail.v2alpha.ProductService" },
{ "service": "google.cloud.retail.v2alpha.UserEventService" },
{ "service": "google.cloud.retail.v2alpha.PredictionService" },
{ "service": "google.cloud.retail.v2alpha.SearchService" }
{ "service": "google.cloud.retail.v2alpha.PredictionService" }
],
"timeout": "60s",
"retryPolicy": {

View File

@ -7,7 +7,6 @@ apis:
- name: google.cloud.retail.v2alpha.CatalogService
- name: google.cloud.retail.v2alpha.PredictionService
- name: google.cloud.retail.v2alpha.ProductService
- name: google.cloud.retail.v2alpha.SearchService
- name: google.cloud.retail.v2alpha.UserEventService
types:
@ -61,10 +60,6 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.retail.v2alpha.SearchService.Search
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.retail.v2alpha.ProductService.*'
oauth:
canonical_scopes: |-

View File

@ -1,535 +0,0 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
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/common.proto";
import "google/cloud/retail/v2alpha/product.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
option csharp_namespace = "Google.Cloud.Retail.V2alpha";
option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail";
option java_multiple_files = true;
option java_outer_classname = "SearchServiceProto";
option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// Service for search.
service SearchService {
option (google.api.default_host) = "retail.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Performs a search.
rpc Search(SearchRequest) returns (SearchResponse) {
option (google.api.http) = {
post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search"
body: "*"
};
}
}
// Request message for
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
// method.
message SearchRequest {
// A facet specification to perform faceted search.
message FacetSpec {
// Required. Supported textual and numerical facet keys in
// [Product][google.cloud.retail.v2alpha.Product] object, over which the
// facet values are computed. Facet key is case-sensitive.
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string key = 1 [(google.api.field_behavior) = REQUIRED];
// The intervals into which values should be bucketized.
//
// A maximum of 30 values are allowed. Must be set for facets with numerical
// values. Must not be set for facet with text values. Otherwise, an
// INVALID_ARGUMENT is returned.
repeated Interval intervals = 2;
// Only get facet for the given restricted values. For example, when using
// "pickupInStore" as key and set restricted values to ["store123",
// "store456"], only facets for "store123" and "store456" are returned. Only
// supported on textual fields. Maximum is 20.
//
// Must be set for the following facet keys:
//
// * `pickupInStore`
// * `shipToStore`
// * `sameDayDelivery`
// * `nextDayDelivery`
// * `customFulfillment1`
// * `customFulfillment2`
// * `customFulfillment3`
// * `customFulfillment4`
// * `customFulfillment5`
//
// If this field is set to an invalid value other than these, an
// INVALID_ARGUMENT error is returned.
repeated string restricted_values = 3;
// List of keys to exclude when faceting.
//
// By default, [FacetKey.key][] is not excluded from the filter unless it is
// listed in [FacetKey.excluded_filter_keys][].
//
// For example, suppose there are 100 products with color facet "Red" and
// 200 products with color facet "Blue". A query containing the filter
// "colorFamily:ANY("Red")" and have "colorFamily" as [FacetKey.key][] will
// by default return the "Red" with count 100.
//
// If [FacetKey.excluded_filter_keys][] contains "colorFamily", then the
// query returns both the "Red" with count 100 and "Blue" with count 200,
// because the "colorFamily" key is now excluded from the filter.
//
// A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
// is returned.
repeated string excluded_filter_keys = 4;
// Maximum of facet values that should be returned for this facet. If
// unspecified, defaults to 20. The maximum allowed value is 300. Values
// above 300 will be coerced to 300.
//
// If this field is negative, an INVALID_ARGUMENT is returned.
int32 limit = 5;
// The order in which [Facet.values][] are returned.
//
// Allowed values are:
//
// * "count desc", which means order by [Facet.FacetValue.count][]
// descending.
//
// * "value desc", which means order by [Facet.FacetValue.value][]
// descending.
// Only applies to textual facets.
//
// If not set, textual values are sorted in dictionary order; numerical
// intervals are sorted in the order given by
// [FacetSpec.FacetKey.intervals][]; [FulfillmentInfo.ids][] are sorted in
// the order given by [FacetSpec.FacetKey.restricted_values][].
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string order_by = 6;
}
// Boost specification to boost certain items.
message BoostSpec {
// Boost applies to products which match a condition.
message ConditionBoostSpec {
// An expression which specifies a boost condition. The syntax and
// supported fields are the same as a filter expression. See
// [SearchProductsRequest.filter][] for detail syntax and limitations.
//
// Examples:
//
// * To boost products with product ID "product_1" or "product_2", and
// color
// "Red" or "Blue":<br>
// *(productId: ANY("product_1", "product_2"))<br>*
// *AND<br>*
// *(colorFamily: ANY("Red", "Blue"))<br>*
string condition = 1;
// Strength of the condition boost, which should be in [-1, 1]. Negative
// boost means demotion. Default is 0.0.
//
// Setting to 1.0 gives the item a big promotion. However, it does not
// necessarily mean that the boosted item will be the top result at all
// times, nor that other items will be excluded. Results could still be
// shown even when none of them matches the condition. And results that
// are significantly more relevant to the search query can still trump
// your heavily favored but irrelevant items.
//
// Setting to -1.0 gives the item a big demotion. However, results that
// are deeply relevant might still be shown. The item will have an
// upstream battle to get a fairly high ranking, but it is not blocked out
// completely.
//
// Setting to 0.0 means no boost applied. The boosting condition is
// ignored.
float boost = 2;
}
// Condition boost specifications. If a product matches multiple conditions
// in the specifictions, boost scores from these specifications are all
// applied and combined in a non-linear way. Maximum number of
// specifications is 10.
repeated ConditionBoostSpec condition_boost_specs = 1;
}
// Specification to determine under which conditions query expansion should
// occur.
message QueryExpansionSpec {
// Enum describing under which condition query expansion should occur.
enum Condition {
// Unspecified query expansion condition. This defaults to
// [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
CONDITION_UNSPECIFIED = 0;
// Disabled query expansion. Only the exact search query is used, even if
// [SearchProductsResponse.total_size][] is zero.
DISABLED = 1;
// Enable query expansion when [SearchProductsResponse.total_size][] is
// zero.
ZERO_RESULT = 2;
}
// The condition under which query expansion should occur. Default to
// [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
Condition condition = 1;
}
// The relevance threshold of the search results. The higher relevance
// threshold is, the higher relevant results are shown and the less number of
// results are returned.
enum RelevanceThreshold {
// Default value. Defaults to
// [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH].
RELEVANCE_THRESHOLD_UNSPECIFIED = 0;
// High relevance threshold.
HIGH = 1;
// Medium relevance threshold.
MEDIUM = 2;
// Low relevance threshold.
LOW = 3;
// Lowest relevance threshold.
LOWEST = 4;
}
// Required. The resource name of the search engine placement, such as
//
// "projects/*/locations/global/catalogs/default_catalog/placements/default_search".
// This field is used to identify the set of models that will be used to make
// the search.
//
// We currently support one placement with the following ID:
//
// * `default_search`.
string placement = 1 [(google.api.field_behavior) = REQUIRED];
// The branch resource name, such as
// "projects/*/locations/global/catalogs/default_catalog/branches/0".
//
// Use "default_branch" as the branch ID or leave this field empty, to search
// products under the default branch.
string branch = 2 [
(google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
];
// Required. Raw search query.
string query = 3 [(google.api.field_behavior) = REQUIRED];
// Required. A unique identifier for tracking visitors. For example, this
// could be implemented with a http cookie, which should be able to uniquely
// identify a visitor on a single device. This unique identifier should not
// change if the visitor log in/out of the website.
//
// The field must be a UTF-8 encoded string with a length limit of 128 bytes.
// Otherwise, an INVALID_ARGUMENT error is returned.
string visitor_id = 4 [(google.api.field_behavior) = REQUIRED];
// User information.
UserInfo user_info = 5;
// Maximum number of [Product][google.cloud.retail.v2alpha.Product]s to
// return. If unspecified, defaults to a reasonable value. The maximum allowed
// value is 120. Values above 120 will be coerced to 120.
//
// If this field is negative, an INVALID_ARGUMENT is returned.
int32 page_size = 7;
// A page token
// [SearchResponse.next_page_token][google.cloud.retail.v2alpha.SearchResponse.next_page_token],
// received from a previous
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
// must match the call that provided the page token. Otherwise, an
// INVALID_ARGUMENT error is returned.
string page_token = 8;
// A 0-indexed integer that specifies the current offset (that is, starting
// result location, amongst the
// [Product][google.cloud.retail.v2alpha.Product]s deemed by the API as
// relevant) in search results. This field is only considered if
// [page_token][google.cloud.retail.v2alpha.SearchRequest.page_token] is
// unset.
//
// If this field is negative, an INVALID_ARGUMENT is returned.
int32 offset = 9;
// The filter syntax consists of an expression language for constructing a
// predicate from one or more fields of the products being filtered. Filter
// expression is case-sensitive. See more details at this [user
//
// guide](https:
// //cloud.google.com/recommendations/retai
// // l-search/docs/search-advanced#filter).
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string filter = 10;
// The order in which products are returned. Products can be ordered by
// a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
// it unset if ordered by relevance. OrderBy expression is case-sensitive. See
// more details at this [user
//
// guide](https:
// //cloud.google.com/recommendations/retai
// // l-search/docs/search-advanced#order).
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string order_by = 11;
// Facet specifications for faceted search. If empty, no facets are returned.
//
// A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT error
// is returned.
repeated FacetSpec facet_specs = 12;
// Boost specification to boost certain products.
BoostSpec boost_spec = 13;
// The query expansion specification that specifies the conditions under which
// query expansion will occur.
QueryExpansionSpec query_expansion_spec = 14;
// The relevance threshold of the search results.
//
// Defaults to
// [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
// which means only the most relevant results are shown, and the least number
// of results are returned.
RelevanceThreshold relevance_threshold = 15;
// The fields of [Product][google.cloud.retail.v2alpha.Product] to return in
// search responses. If not set or empty, the following fields are returned:
//
// * [Product.name][google.cloud.retail.v2alpha.Product.name]
//
// [Product.name][google.cloud.retail.v2alpha.Product.name] is always returned
// no matter what mask is set.
//
// To read custom attributes, include paths of the form "customAttributes.key"
// where "key" is the key of a custom attribute, as specified in
// [Product.custom_attributes][].
//
// If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
// is returned.
google.protobuf.FieldMask read_mask = 16;
// The keys to fetch and rollup the matching
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s attributes. The attributes
// from all the matching
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s are merged and
// de-duplicated. Notice that rollup
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s attributes will lead to
// extra query latency. Maximum number of keys is 10.
//
// For
// [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info],
// a fulfillment type and a fulfillment ID must be provided in the format of
// "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123",
// "pickupInStore" is fulfillment type and "store123" is the store ID.
//
// Supported keys are:
//
// * colorFamily
// * price
// * originalPrice
// * discount
// * customAttributes.key, where key is any key in the
// [Product.custom_attributes][] map.
// * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.PICKUP_IN_STORE][].
// * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.SHIP_TO_STORE][].
// * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.SAME_DAY_DELIVERY][].
// * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][].
// * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.CUSTOM_TYPE_1][].
// * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.CUSTOM_TYPE_2][].
// * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.CUSTOM_TYPE_3][].
// * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.CUSTOM_TYPE_4][].
// * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type
// [FulfillmentInfo.Type.CUSTOM_TYPE_5][].
//
// If this field is set to an invalid value other than these, an
// INVALID_ARGUMENT error is returned.
repeated string variant_rollup_keys = 17;
}
// Response message for
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
// method.
message SearchResponse {
// Represents the search results.
message SearchResult {
// [Product.id][google.cloud.retail.v2alpha.Product.id] of the searched
// [Product][google.cloud.retail.v2alpha.Product].
string id = 1;
// The product data snippet in the search response. Only
// [Product.name][google.cloud.retail.v2alpha.Product.name] is guaranteed to
// be populated.
//
// [Product.variants][google.cloud.retail.v2alpha.Product.variants] contains
// the product variants that match the search query. If there are multiple
// product variants matching the query, top 5 most relevant product variants
// are returned and ordered by relevancy.
//
// If relevancy can be deternmined, use
// [SearchProductsResponse.matching_variant_fields] to look up matched
// product variants fields. If relevancy cannot be determined, e.g. when
// searching "shoe" all products in a shoe product can be a match, 5
// product variants are returned but order is meaningless.
Product product = 2;
// The count of matched
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product]s.
int32 matching_variant_count = 3;
// If a [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product] matches the search query,
// this map indicates which [Product][google.cloud.retail.v2alpha.Product]
// fields are matched. The key is the
// [Product.name][google.cloud.retail.v2alpha.Product.name], the value is a
// field mask of the matched [Product][google.cloud.retail.v2alpha.Product]
// fields. If matched attributes cannot be determined, this map will be
// empty.
//
// For example, a key "sku1" with field mask
// "child_stocking_units.color_info" indicates there is a match between
// "sku1" [ColorInfo][google.cloud.retail.v2alpha.ColorInfo] and the query.
map<string, google.protobuf.FieldMask> matching_variant_fields = 4;
// The rollup matching
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// [Product][google.cloud.retail.v2alpha.Product] attributes. The key is one
// of the [SearchProductsRequest.stocking_unit_rollup_keys][]. The values
// are the merged and de-duplicated [StockingUnit][] attributes. Notice that
// the rollup values are respect filter. For example, when filtering by
// "colorFamily:ANY(\"red\")" and rollup "colorFamily", only "red" is
// returned.
//
// For textual and numerical attributes, the rollup values is a list of
// string or double values with type
// [google.protobuf.ListValue][google.protobuf.ListValue]. For example, if
// there are two stocking units with colors "red" and "blue", the rollup
// values are { key: "colorFamily"
// value {
// list_value {
// values { string_value: "red" }
// values { string_value: "blue" }
// }
// }
// }
//
// For [StockingUnit.fulfillment_info][], the rollup values is a bool value
// with type [google.protobuf.Value][google.protobuf.Value]. For example,
// {key: "pickupInStore.store1" value { bool_value: true }} means a product
// is available in the store "store1".
map<string, google.protobuf.Value> variant_rollup_values = 5;
}
// A facet result.
message Facet {
// A facet value which contains value names and their count.
message FacetValue {
// A facet value which contains values.
oneof facet_value {
// Text value of a facet, such as "Black" for facet "colorFamily".
string value = 1;
// Interval value for a facet, such as [10, 20) for facet "price".
Interval interval = 2;
}
// Number of items that have this facet value.
int64 count = 3;
}
// The key for this facet. E.g., "colorFamily" or "price" or
// "customAttributes.attr1".
string key = 1;
// The facet values for this field.
repeated FacetValue values = 2;
}
// Information describing query expansion including whether expansion has
// occurred.
message QueryExpansionInfo {
// Bool describing whether query expansion has occurred.
bool expanded_query = 1;
}
// A list of matched items. The order represents the ranking.
repeated SearchResult results = 1;
// Results of facets requested by user.
repeated Facet facets = 2;
// The total count of matched items irrespective of pagination. The total
// number of [results][google.cloud.retail.v2alpha.SearchResponse.results]
// returned by pagination may be less than the
// [total_size][google.cloud.retail.v2alpha.SearchResponse.total_size] that
// matches.
int32 total_size = 3;
// If spell correction applies, the corrected query. Otherwise, empty.
string corrected_query = 4;
// A unique search token. This should be included in the
// [UserEvent][google.cloud.retail.v2alpha.UserEvent] logs resulting from this
// search, which enables accurate attribution of search model performance.
string attribution_token = 5;
// A token that can be sent as
// [SearchRequest.page_token][google.cloud.retail.v2alpha.SearchRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 6;
// Query expansion information for the returned results.
QueryExpansionInfo query_expansion_info = 7;
}

View File

@ -71,8 +71,7 @@ message PredictRequest {
// pages. For example - More products like this.
//
// * `recently_viewed_default`: Returns up to 75 products recently viewed by
// the
// specified `userId` or `visitorId`, most recent ones first. Returns
// the specified `userId` or `visitorId`, most recent ones first. Returns
// nothing if neither of them has viewed any products yet. For example -
// Recently viewed.
//
@ -91,7 +90,8 @@ message PredictRequest {
// 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.
// choose a reasonable default. The maximum allowed value is 100. Values
// above 100 will be coerced to 100.
int32 page_size = 3;
// The previous PredictResponse.next_page_token.
@ -133,14 +133,13 @@ message PredictRequest {
// Allowed values:
//
// * `returnProduct`: Boolean. If set to true, the associated product
// object will be returned in the
// `PredictResponse.PredictionResult.productMetadata` object in the method
// response.
// object will be returned in the `results.metadata` field in the
// prediction response.
// * `returnScore`: Boolean. If set to true, the prediction 'score'
// corresponding to each returned product will be set in the `metadata`
// field in the prediction response. The given 'score' indicates the
// probability of an product being clicked/purchased given the user's
// context and history.
// 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
// 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
// your filter blocks all prediction results.

View File

@ -117,6 +117,19 @@ service ProductService {
metadata_type: "google.cloud.retail.v2beta.ImportMetadata"
};
}
// Export of multiple [Product][google.cloud.retail.v2beta.Product]s.
rpc ExportProducts(ExportProductsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:export"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.retail.v2beta.ExportProductsResponse"
metadata_type: "google.cloud.retail.v2beta.ExportMetadata"
};
}
}
// Request message for [CreateProduct][] method.