common.proto 32 KB

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