1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.retail.v2alpha; 18 19import "google/api/field_behavior.proto"; 20import "google/protobuf/timestamp.proto"; 21 22option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; 23option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; 24option java_multiple_files = true; 25option java_outer_classname = "CommonProto"; 26option java_package = "com.google.cloud.retail.v2alpha"; 27option objc_class_prefix = "RETAIL"; 28option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; 29option ruby_package = "Google::Cloud::Retail::V2alpha"; 30 31// At which level we offer configuration for attributes. 32enum AttributeConfigLevel { 33 // Value used when unset. In this case, server behavior defaults to 34 // [CATALOG_LEVEL_ATTRIBUTE_CONFIG][google.cloud.retail.v2alpha.AttributeConfigLevel.CATALOG_LEVEL_ATTRIBUTE_CONFIG]. 35 ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0; 36 37 // At this level, we honor the attribute configurations set in 38 // [Product.attributes][google.cloud.retail.v2alpha.Product.attributes]. 39 PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1; 40 41 // At this level, we honor the attribute configurations set in 42 // [CatalogConfig.attribute_configs][google.cloud.retail.v2alpha.CatalogConfig.attribute_configs]. 43 CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2; 44} 45 46// The type of solution. 47enum SolutionType { 48 // Default value. 49 SOLUTION_TYPE_UNSPECIFIED = 0; 50 51 // Used for Recommendations AI. 52 SOLUTION_TYPE_RECOMMENDATION = 1; 53 54 // Used for Retail Search. 55 SOLUTION_TYPE_SEARCH = 2; 56} 57 58// If filtering for recommendations is enabled. 59enum RecommendationsFilteringOption { 60 // Value used when unset. 61 // In this case, server behavior defaults to 62 // [RECOMMENDATIONS_FILTERING_DISABLED][google.cloud.retail.v2alpha.RecommendationsFilteringOption.RECOMMENDATIONS_FILTERING_DISABLED]. 63 RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0; 64 65 // Recommendation filtering is disabled. 66 RECOMMENDATIONS_FILTERING_DISABLED = 1; 67 68 // Recommendation filtering is enabled. 69 RECOMMENDATIONS_FILTERING_ENABLED = 3; 70} 71 72// The use case of Cloud Retail Search. 73enum SearchSolutionUseCase { 74 // The value when it's unspecified. In this case, server behavior defaults to 75 // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]. 76 SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; 77 78 // Search use case. Expects the traffic has a non-empty 79 // [query][google.cloud.retail.v2alpha.SearchRequest.query]. 80 SEARCH_SOLUTION_USE_CASE_SEARCH = 1; 81 82 // Browse use case. Expects the traffic has an empty 83 // [query][google.cloud.retail.v2alpha.SearchRequest.query]. 84 SEARCH_SOLUTION_USE_CASE_BROWSE = 2; 85} 86 87// Metadata that is used to define a condition that triggers an action. 88// A valid condition must specify at least one of 'query_terms' or 89// 'products_filter'. If multiple fields are specified, the condition is met if 90// all the fields are satisfied e.g. if a set of query terms and product_filter 91// are set, then only items matching the product_filter for requests with a 92// query matching the query terms wil get boosted. 93message Condition { 94 // Query terms that we want to match on. 95 message QueryTerm { 96 // The value of the term to match on. 97 // Value cannot be empty. 98 // Value can have at most 3 terms if specified as a partial match. Each 99 // space separated string is considered as one term. 100 // For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms 101 // and not allowed for a partial match. 102 string value = 1; 103 104 // Whether this is supposed to be a full or partial match. 105 bool full_match = 2; 106 } 107 108 // Used for time-dependent conditions. 109 // Example: Want to have rule applied for week long sale. 110 message TimeRange { 111 // Start of time range. Range is inclusive. 112 google.protobuf.Timestamp start_time = 1; 113 114 // End of time range. Range is inclusive. 115 google.protobuf.Timestamp end_time = 2; 116 } 117 118 // A list (up to 10 entries) of terms to match the query on. If not 119 // specified, match all queries. 120 // If many query terms are specified, the condition 121 // is matched if any of the terms is a match (i.e. using the OR operator). 122 repeated QueryTerm query_terms = 1; 123 124 // Range of time(s) specifying when Condition is active. 125 // Condition true if any time range matches. 126 repeated TimeRange active_time_range = 3; 127} 128 129// A rule is a condition-action pair 130// 131// * A condition defines when a rule is to be triggered. 132// * An action specifies what occurs on that trigger. 133// Currently rules only work for [controls][google.cloud.retail.v2alpha.Control] 134// with 135// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. 136message Rule { 137 // A boost action to apply to results matching condition specified above. 138 message BoostAction { 139 // Strength of the condition boost, which must be in [-1, 1]. Negative 140 // boost means demotion. Default is 0.0. 141 // 142 // Setting to 1.0 gives the item a big promotion. However, it does not 143 // necessarily mean that the boosted item will be the top result at all 144 // times, nor that other items will be excluded. Results could still be 145 // shown even when none of them matches the condition. And results that 146 // are significantly more relevant to the search query can still trump 147 // your heavily favored but irrelevant items. 148 // 149 // Setting to -1.0 gives the item a big demotion. However, results that 150 // are deeply relevant might still be shown. The item will have an 151 // upstream battle to get a fairly high ranking, but it is not blocked out 152 // completely. 153 // 154 // Setting to 0.0 means no boost applied. The boosting condition is 155 // ignored. 156 float boost = 1; 157 158 // The filter can have a max size of 5000 characters. 159 // An expression which specifies which products to apply an action to. 160 // The syntax and supported fields are the same as a filter expression. See 161 // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] 162 // for detail syntax and limitations. 163 // 164 // Examples: 165 // 166 // * To boost products with product ID "product_1" or "product_2", and 167 // color 168 // "Red" or "Blue":<br> 169 // *(id: ANY("product_1", "product_2"))<br>* 170 // *AND<br>* 171 // *(colorFamilies: ANY("Red", "Blue"))<br>* 172 string products_filter = 2; 173 } 174 175 // * Rule Condition: 176 // - No 177 // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] 178 // provided is a global match. 179 // - 1 or more 180 // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] 181 // provided are combined with OR operator. 182 // * Action Input: The request query and filter that are applied to the 183 // retrieved products, in addition to any filters already provided with the 184 // SearchRequest. The AND operator is used to combine the query's existing 185 // filters with the filter rule(s). NOTE: May result in 0 results when 186 // filters conflict. 187 // * Action Result: Filters the returned objects to be ONLY those that passed 188 // the filter. 189 message FilterAction { 190 // A filter to apply on the matching condition results. Supported features: 191 // 192 // * [filter][google.cloud.retail.v2alpha.Rule.FilterAction.filter] must be 193 // set. 194 // * Filter syntax is identical to 195 // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]. 196 // See more 197 // details at the Retail Search 198 // [user guide](/retail/search/docs/filter-and-order#filter). 199 // * To filter products with product ID "product_1" or "product_2", and 200 // color 201 // "Red" or "Blue":<br> 202 // *(id: ANY("product_1", "product_2"))<br>* 203 // *AND<br>* 204 // *(colorFamilies: ANY("Red", "Blue"))<br>* 205 string filter = 1; 206 } 207 208 // Redirects a shopper to a specific page. 209 // 210 // * Rule Condition: 211 // - Must specify 212 // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]. 213 // * Action Input: Request Query 214 // * Action Result: Redirects shopper to provided uri. 215 message RedirectAction { 216 // URL must have length equal or less than 2000 characters. 217 string redirect_uri = 1; 218 } 219 220 // Creates a set of terms that will be treated as synonyms of each other. 221 // Example: synonyms of "sneakers" and "shoes": 222 // 223 // * "sneakers" will use a synonym of "shoes". 224 // * "shoes" will use a synonym of "sneakers". 225 message TwowaySynonymsAction { 226 // Defines a set of synonyms. 227 // Can specify up to 100 synonyms. 228 // Must specify at least 2 synonyms. 229 repeated string synonyms = 1; 230 } 231 232 // Maps a set of terms to a set of synonyms. 233 // Set of synonyms will be treated as synonyms of each query term only. 234 // `query_terms` will not be treated as synonyms of each other. 235 // Example: "sneakers" will use a synonym of "shoes". 236 // "shoes" will not use a synonym of "sneakers". 237 message OnewaySynonymsAction { 238 // Terms from the search query. 239 // Will treat synonyms as their synonyms. 240 // Not themselves synonyms of the synonyms. 241 // Can specify up to 100 terms. 242 repeated string query_terms = 3; 243 244 // Defines a set of synonyms. 245 // Cannot contain duplicates. 246 // Can specify up to 100 synonyms. 247 repeated string synonyms = 4; 248 249 // Will be [deprecated = true] post migration; 250 repeated string oneway_terms = 2; 251 } 252 253 // Prevents `query_term` from being associated with specified terms during 254 // search. 255 // Example: Don't associate "gShoe" and "cheap". 256 message DoNotAssociateAction { 257 // Terms from the search query. 258 // Will not consider do_not_associate_terms for search if in search query. 259 // Can specify up to 100 terms. 260 repeated string query_terms = 2; 261 262 // Cannot contain duplicates or the query term. 263 // Can specify up to 100 terms. 264 repeated string do_not_associate_terms = 3; 265 266 // Will be [deprecated = true] post migration; 267 repeated string terms = 1; 268 } 269 270 // Replaces a term in the query. Multiple replacement candidates can be 271 // specified. All `query_terms` will be replaced with the replacement term. 272 // Example: Replace "gShoe" with "google shoe". 273 message ReplacementAction { 274 // Terms from the search query. 275 // Will be replaced by replacement term. 276 // Can specify up to 100 terms. 277 repeated string query_terms = 2; 278 279 // Term that will be used for replacement. 280 string replacement_term = 3; 281 282 // Will be [deprecated = true] post migration; 283 string term = 1; 284 } 285 286 // Prevents a term in the query from being used in search. 287 // Example: Don't search for "shoddy". 288 message IgnoreAction { 289 // Terms to ignore in the search query. 290 repeated string ignore_terms = 1; 291 } 292 293 // An action must be provided. 294 oneof action { 295 // A boost action. 296 BoostAction boost_action = 2; 297 298 // Redirects a shopper to a specific page. 299 RedirectAction redirect_action = 3; 300 301 // Treats specific term as a synonym with a group of terms. 302 // Group of terms will not be treated as synonyms with the specific term. 303 OnewaySynonymsAction oneway_synonyms_action = 6; 304 305 // Prevents term from being associated with other terms. 306 DoNotAssociateAction do_not_associate_action = 7; 307 308 // Replaces specific terms in the query. 309 ReplacementAction replacement_action = 8; 310 311 // Ignores specific terms from query during search. 312 IgnoreAction ignore_action = 9; 313 314 // Filters results. 315 FilterAction filter_action = 10; 316 317 // Treats a set of terms as synonyms of one another. 318 TwowaySynonymsAction twoway_synonyms_action = 11; 319 } 320 321 // Required. The condition that triggers the rule. 322 // If the condition is empty, the rule will always apply. 323 Condition condition = 1 [(google.api.field_behavior) = REQUIRED]; 324} 325 326// An intended audience of the [Product][google.cloud.retail.v2alpha.Product] 327// for whom it's sold. 328message Audience { 329 // The genders of the audience. Strongly encouraged to use the standard 330 // values: "male", "female", "unisex". 331 // 332 // At most 5 values are allowed. Each value must be a UTF-8 encoded string 333 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 334 // is returned. 335 // 336 // Google Merchant Center property 337 // [gender](https://support.google.com/merchants/answer/6324479). Schema.org 338 // property 339 // [Product.audience.suggestedGender](https://schema.org/suggestedGender). 340 repeated string genders = 1; 341 342 // The age groups of the audience. Strongly encouraged to use the standard 343 // values: "newborn" (up to 3 months old), "infant" (3–12 months old), 344 // "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically 345 // teens or older). 346 // 347 // At most 5 values are allowed. Each value must be a UTF-8 encoded string 348 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 349 // is returned. 350 // 351 // Google Merchant Center property 352 // [age_group](https://support.google.com/merchants/answer/6324463). 353 // Schema.org property 354 // [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and 355 // [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). 356 repeated string age_groups = 2; 357} 358 359// The color information of a [Product][google.cloud.retail.v2alpha.Product]. 360message ColorInfo { 361 // The standard color families. Strongly recommended to use the following 362 // standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", 363 // "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and 364 // "Mixed". Normally it is expected to have only 1 color family. May consider 365 // using single "Mixed" instead of multiple values. 366 // 367 // A maximum of 5 values are allowed. Each value must be a UTF-8 encoded 368 // string with a length limit of 128 characters. Otherwise, an 369 // INVALID_ARGUMENT error is returned. 370 // 371 // Google Merchant Center property 372 // [color](https://support.google.com/merchants/answer/6324487). Schema.org 373 // property [Product.color](https://schema.org/color). 374 repeated string color_families = 1; 375 376 // The color display names, which may be different from standard color family 377 // names, such as the color aliases used in the website frontend. Normally 378 // it is expected to have only 1 color. May consider using single "Mixed" 379 // instead of multiple values. 380 // 381 // A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded 382 // string with a length limit of 128 characters. Otherwise, an 383 // INVALID_ARGUMENT error is returned. 384 // 385 // Google Merchant Center property 386 // [color](https://support.google.com/merchants/answer/6324487). Schema.org 387 // property [Product.color](https://schema.org/color). 388 repeated string colors = 2; 389} 390 391// A custom attribute that is not explicitly modeled in 392// [Product][google.cloud.retail.v2alpha.Product]. 393message CustomAttribute { 394 // The textual values of this custom attribute. For example, `["yellow", 395 // "green"]` when the key is "color". 396 // 397 // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is 398 // returned. 399 // 400 // Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or 401 // [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be 402 // set. Otherwise, an INVALID_ARGUMENT error is returned. 403 repeated string text = 1; 404 405 // The numerical values of this custom attribute. For example, `[2.3, 15.4]` 406 // when the key is "lengths_cm". 407 // 408 // Exactly one of [text][google.cloud.retail.v2alpha.CustomAttribute.text] or 409 // [numbers][google.cloud.retail.v2alpha.CustomAttribute.numbers] should be 410 // set. Otherwise, an INVALID_ARGUMENT error is returned. 411 repeated double numbers = 2; 412 413 // This field is normally ignored unless 414 // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] 415 // of the [Catalog][google.cloud.retail.v2alpha.Catalog] is set to the 416 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 417 // product-level attribute configuration, see [Configuration 418 // modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). 419 // If true, custom attribute values are searchable by text queries in 420 // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. 421 // 422 // This field is ignored in a 423 // [UserEvent][google.cloud.retail.v2alpha.UserEvent]. 424 // 425 // Only set if type [text][google.cloud.retail.v2alpha.CustomAttribute.text] 426 // is set. Otherwise, a INVALID_ARGUMENT error is returned. 427 optional bool searchable = 3 [deprecated = true]; 428 429 // This field is normally ignored unless 430 // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] 431 // of the [Catalog][google.cloud.retail.v2alpha.Catalog] is set to the 432 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 433 // product-level attribute configuration, see [Configuration 434 // modes](https://cloud.google.com/retail/docs/attribute-config#config-modes). 435 // If true, custom attribute values are indexed, so that they can be filtered, 436 // faceted or boosted in 437 // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. 438 // 439 // This field is ignored in a 440 // [UserEvent][google.cloud.retail.v2alpha.UserEvent]. 441 // 442 // See 443 // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter], 444 // [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs] 445 // and 446 // [SearchRequest.boost_spec][google.cloud.retail.v2alpha.SearchRequest.boost_spec] 447 // for more details. 448 optional bool indexable = 4 [deprecated = true]; 449} 450 451// Fulfillment information, such as the store IDs for in-store pickup or region 452// IDs for different shipping methods. 453message FulfillmentInfo { 454 // The fulfillment type, including commonly used types (such as pickup in 455 // store and same day delivery), and custom types. Customers have to map 456 // custom types to their display names before rendering UI. 457 // 458 // Supported values: 459 // 460 // * "pickup-in-store" 461 // * "ship-to-store" 462 // * "same-day-delivery" 463 // * "next-day-delivery" 464 // * "custom-type-1" 465 // * "custom-type-2" 466 // * "custom-type-3" 467 // * "custom-type-4" 468 // * "custom-type-5" 469 // 470 // If this field is set to an invalid value other than these, an 471 // INVALID_ARGUMENT error is returned. 472 string type = 1; 473 474 // The IDs for this [type][google.cloud.retail.v2alpha.FulfillmentInfo.type], 475 // such as the store IDs for 476 // [FulfillmentInfo.type.pickup-in-store][google.cloud.retail.v2alpha.FulfillmentInfo.type] 477 // or the region IDs for 478 // [FulfillmentInfo.type.same-day-delivery][google.cloud.retail.v2alpha.FulfillmentInfo.type]. 479 // 480 // A maximum of 3000 values are allowed. Each value must be a string with a 481 // length limit of 30 characters, matching the pattern `[a-zA-Z0-9_-]+`, such 482 // as "store1" or "REGION-2". Otherwise, an INVALID_ARGUMENT error is 483 // returned. 484 repeated string place_ids = 2; 485} 486 487// [Product][google.cloud.retail.v2alpha.Product] image. Recommendations AI and 488// Retail Search do not use product images to improve prediction and search 489// results. However, product images can be returned in results, and are shown in 490// prediction or search previews in the console. 491message Image { 492 // Required. URI of the image. 493 // 494 // This field must be a valid UTF-8 encoded URI with a length limit of 5,000 495 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 496 // 497 // Google Merchant Center property 498 // [image_link](https://support.google.com/merchants/answer/6324350). 499 // Schema.org property [Product.image](https://schema.org/image). 500 string uri = 1 [(google.api.field_behavior) = REQUIRED]; 501 502 // Height of the image in number of pixels. 503 // 504 // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is 505 // returned. 506 int32 height = 2; 507 508 // Width of the image in number of pixels. 509 // 510 // This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is 511 // returned. 512 int32 width = 3; 513} 514 515// A floating point interval. 516message Interval { 517 // The lower bound of the interval. If neither of the min fields are set, then 518 // the lower bound is negative infinity. 519 // 520 // This field must not be larger than max. 521 // Otherwise, an INVALID_ARGUMENT error is returned. 522 oneof min { 523 // Inclusive lower bound. 524 double minimum = 1; 525 526 // Exclusive lower bound. 527 double exclusive_minimum = 2; 528 } 529 530 // The upper bound of the interval. If neither of the max fields are set, then 531 // the upper bound is positive infinity. 532 // 533 // This field must be not smaller than min. 534 // Otherwise, an INVALID_ARGUMENT error is returned. 535 oneof max { 536 // Inclusive upper bound. 537 double maximum = 3; 538 539 // Exclusive upper bound. 540 double exclusive_maximum = 4; 541 } 542} 543 544// The price information of a [Product][google.cloud.retail.v2alpha.Product]. 545message PriceInfo { 546 // The price range of all 547 // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] 548 // [Product][google.cloud.retail.v2alpha.Product] having the same 549 // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. 550 message PriceRange { 551 // The inclusive 552 // [Product.pricing_info.price][google.cloud.retail.v2alpha.PriceInfo.price] 553 // interval of all 554 // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] 555 // [Product][google.cloud.retail.v2alpha.Product] having the same 556 // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. 557 Interval price = 1; 558 559 // The inclusive 560 // [Product.pricing_info.original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] 561 // internal of all 562 // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] 563 // [Product][google.cloud.retail.v2alpha.Product] having the same 564 // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]. 565 Interval original_price = 2; 566 } 567 568 // The 3-letter currency code defined in [ISO 569 // 4217](https://www.iso.org/iso-4217-currency-codes.html). 570 // 571 // If this field is an unrecognizable currency code, an INVALID_ARGUMENT 572 // error is returned. 573 // 574 // The 575 // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] 576 // [Product][google.cloud.retail.v2alpha.Product]s with the same 577 // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id] 578 // must share the same 579 // [currency_code][google.cloud.retail.v2alpha.PriceInfo.currency_code]. 580 // Otherwise, a FAILED_PRECONDITION error is returned. 581 string currency_code = 1; 582 583 // Price of the product. 584 // 585 // Google Merchant Center property 586 // [price](https://support.google.com/merchants/answer/6324371). Schema.org 587 // property [Offer.price](https://schema.org/price). 588 float price = 2; 589 590 // Price of the product without any discount. If zero, by default set to be 591 // the [price][google.cloud.retail.v2alpha.PriceInfo.price]. If set, 592 // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] 593 // should be greater than or equal to 594 // [price][google.cloud.retail.v2alpha.PriceInfo.price], otherwise an 595 // INVALID_ARGUMENT error is thrown. 596 float original_price = 3; 597 598 // The costs associated with the sale of a particular product. Used for gross 599 // profit reporting. 600 // 601 // * Profit = [price][google.cloud.retail.v2alpha.PriceInfo.price] - 602 // [cost][google.cloud.retail.v2alpha.PriceInfo.cost] 603 // 604 // Google Merchant Center property 605 // [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895). 606 float cost = 4; 607 608 // The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price] 609 // starts to be effective. This can be set as a future timestamp, and the 610 // [price][google.cloud.retail.v2alpha.PriceInfo.price] is only used for 611 // search after 612 // [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time]. 613 // If so, the 614 // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must 615 // be set and 616 // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is 617 // used before 618 // [price_effective_time][google.cloud.retail.v2alpha.PriceInfo.price_effective_time]. 619 // 620 // Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is 621 // always effective because it will cause additional latency during search. 622 google.protobuf.Timestamp price_effective_time = 5; 623 624 // The timestamp when the [price][google.cloud.retail.v2alpha.PriceInfo.price] 625 // stops to be effective. The 626 // [price][google.cloud.retail.v2alpha.PriceInfo.price] is used for search 627 // before 628 // [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time]. 629 // If this field is set, the 630 // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] must 631 // be set and 632 // [original_price][google.cloud.retail.v2alpha.PriceInfo.original_price] is 633 // used after 634 // [price_expire_time][google.cloud.retail.v2alpha.PriceInfo.price_expire_time]. 635 // 636 // Do not set if [price][google.cloud.retail.v2alpha.PriceInfo.price] is 637 // always effective because it will cause additional latency during search. 638 google.protobuf.Timestamp price_expire_time = 6; 639 640 // Output only. The price range of all the child 641 // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] 642 // [Product][google.cloud.retail.v2alpha.Product]s grouped together on the 643 // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] 644 // [Product][google.cloud.retail.v2alpha.Product]. Only populated for 645 // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] 646 // [Product][google.cloud.retail.v2alpha.Product]s. 647 // 648 // Note: This field is OUTPUT_ONLY for 649 // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. 650 // Do not set this field in API requests. 651 PriceRange price_range = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 652} 653 654// The rating of a [Product][google.cloud.retail.v2alpha.Product]. 655message Rating { 656 // The total number of ratings. This value is independent of the value of 657 // [rating_histogram][google.cloud.retail.v2alpha.Rating.rating_histogram]. 658 // 659 // This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is 660 // returned. 661 int32 rating_count = 1; 662 663 // The average rating of the [Product][google.cloud.retail.v2alpha.Product]. 664 // 665 // The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is 666 // returned. 667 float average_rating = 2; 668 669 // List of rating counts per rating value (index = rating - 1). The list is 670 // empty if there is no rating. If the list is non-empty, its size is 671 // always 5. Otherwise, an INVALID_ARGUMENT error is returned. 672 // 673 // For example, [41, 14, 13, 47, 303]. It means that the 674 // [Product][google.cloud.retail.v2alpha.Product] got 41 ratings with 1 star, 675 // 14 ratings with 2 star, and so on. 676 repeated int32 rating_histogram = 3; 677} 678 679// Information of an end user. 680message UserInfo { 681 // Highly recommended for logged-in users. Unique identifier for logged-in 682 // user, such as a user name. Don't set for anonymous users. 683 // 684 // Always use a hashed value for this ID. 685 // 686 // Don't set the field to the same fixed ID for different users. This mixes 687 // the event history of those users together, which results in degraded 688 // model quality. 689 // 690 // The field must be a UTF-8 encoded string with a length limit of 128 691 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 692 string user_id = 1; 693 694 // The end user's IP address. This field is used to extract location 695 // information for personalization. 696 // 697 // This field must be either an IPv4 address (e.g. "104.133.9.80") or an IPv6 698 // address (e.g. "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an 699 // INVALID_ARGUMENT error is returned. 700 // 701 // This should not be set when: 702 // 703 // * setting 704 // [SearchRequest.user_info][google.cloud.retail.v2alpha.SearchRequest.user_info]. 705 // * using the JavaScript tag in 706 // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] 707 // or if 708 // [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] 709 // is set. 710 string ip_address = 2; 711 712 // User agent as included in the HTTP header. Required for getting 713 // [SearchResponse.sponsored_results][google.cloud.retail.v2alpha.SearchResponse.sponsored_results]. 714 // 715 // The field must be a UTF-8 encoded string with a length limit of 1,000 716 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 717 // 718 // This should not be set when using the client side event reporting with 719 // GTM or JavaScript tag in 720 // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] 721 // or if 722 // [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] 723 // is set. 724 string user_agent = 3; 725 726 // True if the request is made directly from the end user, in which case the 727 // [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and 728 // [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be 729 // populated from the HTTP request. This flag should be set only if the API 730 // request is made directly from the end user such as a mobile app (and not if 731 // a gateway or a server is processing and pushing the user events). 732 // 733 // This should not be set when using the JavaScript tag in 734 // [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent]. 735 bool direct_user_request = 4; 736} 737 738// The inventory information at a place (e.g. a store) identified 739// by a place ID. 740message LocalInventory { 741 // The place ID for the current set of inventory information. 742 string place_id = 1; 743 744 // Product price and cost information. 745 // 746 // Google Merchant Center property 747 // [price](https://support.google.com/merchants/answer/6324371). 748 PriceInfo price_info = 2; 749 750 // Additional local inventory attributes, for example, store name, promotion 751 // tags, etc. 752 // 753 // This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT 754 // error is returned: 755 // 756 // * At most 30 attributes are allowed. 757 // * The key must be a UTF-8 encoded string with a length limit of 32 758 // characters. 759 // * The key must match the pattern: `[a-zA-Z0-9][a-zA-Z0-9_]*`. For example, 760 // key0LikeThis or KEY_1_LIKE_THIS. 761 // * The attribute values must be of the same type (text or number). 762 // * Only 1 value is allowed for each attribute. 763 // * For text values, the length limit is 256 UTF-8 characters. 764 // * The attribute does not support search. The `searchable` field should be 765 // unset or set to false. 766 // * The max summed total bytes of custom attribute keys and values per 767 // product is 5MiB. 768 map<string, CustomAttribute> attributes = 3; 769 770 // Input only. Supported fulfillment types. Valid fulfillment type values 771 // include commonly used types (such as pickup in store and same day 772 // delivery), and custom types. Customers have to map custom types to their 773 // display names before rendering UI. 774 // 775 // Supported values: 776 // 777 // * "pickup-in-store" 778 // * "ship-to-store" 779 // * "same-day-delivery" 780 // * "next-day-delivery" 781 // * "custom-type-1" 782 // * "custom-type-2" 783 // * "custom-type-3" 784 // * "custom-type-4" 785 // * "custom-type-5" 786 // 787 // If this field is set to an invalid value other than these, an 788 // INVALID_ARGUMENT error is returned. 789 // 790 // All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is 791 // returned. 792 repeated string fulfillment_types = 4 793 [(google.api.field_behavior) = INPUT_ONLY]; 794} 795