common.proto 31 KB

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