common.proto 31 KB

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