catalog.proto 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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/api/resource.proto";
  18. import "google/cloud/retail/v2alpha/common.proto";
  19. import "google/cloud/retail/v2alpha/import_config.proto";
  20. option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "CatalogProto";
  24. option java_package = "com.google.cloud.retail.v2alpha";
  25. option objc_class_prefix = "RETAIL";
  26. option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
  27. option ruby_package = "Google::Cloud::Retail::V2alpha";
  28. // Configures what level the product should be uploaded with regards to
  29. // how users will be send events and how predictions will be made.
  30. message ProductLevelConfig {
  31. // The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
  32. // ingested into the catalog. Acceptable values are:
  33. //
  34. // * `primary` (default): You can ingest
  35. // [Product][google.cloud.retail.v2alpha.Product]s of all types. When
  36. // ingesting a [Product][google.cloud.retail.v2alpha.Product], its type will
  37. // default to
  38. // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
  39. // if unset.
  40. // * `variant` (incompatible with Retail Search): You can only
  41. // ingest
  42. // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
  43. // [Product][google.cloud.retail.v2alpha.Product]s. This means
  44. // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
  45. // cannot be empty.
  46. //
  47. // If this field is set to an invalid value other than these, an
  48. // INVALID_ARGUMENT error is returned.
  49. //
  50. // If this field is `variant` and
  51. // [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
  52. // is `itemGroupId`, an INVALID_ARGUMENT error is returned.
  53. //
  54. // See [Product
  55. // levels](https://cloud.google.com/retail/docs/catalog#product-levels)
  56. // for more details.
  57. string ingestion_product_type = 1;
  58. // Which field of [Merchant Center
  59. // Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
  60. // imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
  61. // Acceptable values are:
  62. //
  63. // * `offerId` (default): Import `offerId` as the product ID.
  64. // * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
  65. // API will choose one item from the ones with the same `itemGroupId`, and
  66. // use it to represent the item group.
  67. //
  68. // If this field is set to an invalid value other than these, an
  69. // INVALID_ARGUMENT error is returned.
  70. //
  71. // If this field is `itemGroupId` and
  72. // [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
  73. // is `variant`, an INVALID_ARGUMENT error is returned.
  74. //
  75. // See [Product
  76. // levels](https://cloud.google.com/retail/docs/catalog#product-levels)
  77. // for more details.
  78. string merchant_center_product_id_field = 2;
  79. }
  80. // Catalog level attribute config for an attribute. For example, if customers
  81. // want to enable/disable facet for a specific attribute.
  82. message CatalogAttribute {
  83. // The type of an attribute.
  84. enum AttributeType {
  85. // The type of the attribute is unknown.
  86. //
  87. // Used when type cannot be derived from attribute that is not
  88. // [in_use][google.cloud.retail.v2alpha.CatalogAttribute.in_use].
  89. UNKNOWN = 0;
  90. // Textual attribute.
  91. TEXTUAL = 1;
  92. // Numerical attribute.
  93. NUMERICAL = 2;
  94. }
  95. // The status of the indexable option of a catalog attribute.
  96. enum IndexableOption {
  97. // Value used when unset. Defaults to
  98. // [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
  99. INDEXABLE_OPTION_UNSPECIFIED = 0;
  100. // Indexable option enabled for an attribute.
  101. INDEXABLE_ENABLED = 1;
  102. // Indexable option disabled for an attribute.
  103. INDEXABLE_DISABLED = 2;
  104. }
  105. // The status of the dynamic facetable option of a catalog attribute.
  106. enum DynamicFacetableOption {
  107. // Value used when unset. Defaults to
  108. // [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED].
  109. DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0;
  110. // Dynamic facetable option enabled for an attribute.
  111. DYNAMIC_FACETABLE_ENABLED = 1;
  112. // Dynamic facetable option disabled for an attribute.
  113. DYNAMIC_FACETABLE_DISABLED = 2;
  114. }
  115. // The status of the searchable option of a catalog attribute.
  116. enum SearchableOption {
  117. // Value used when unset. Defaults to
  118. // [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED].
  119. SEARCHABLE_OPTION_UNSPECIFIED = 0;
  120. // Searchable option enabled for an attribute.
  121. SEARCHABLE_ENABLED = 1;
  122. // Searchable option disabled for an attribute.
  123. SEARCHABLE_DISABLED = 2;
  124. }
  125. // Required. Attribute name.
  126. // For example: `color`, `brands`, `attributes.custom_attribute`, such as
  127. // `attributes.xyz`.
  128. // To be indexable, the attribute name can contain only alpha-numeric
  129. // characters and underscores. For example, an attribute named
  130. // `attributes.abc_xyz` can be indexed, but an attribute named
  131. // `attributes.abc-xyz` cannot be indexed.
  132. string key = 1 [(google.api.field_behavior) = REQUIRED];
  133. // Output only. Indicates whether this attribute has been used by any
  134. // products. `True` if at least one
  135. // [Product][google.cloud.retail.v2alpha.Product] is using this attribute in
  136. // [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
  137. // Otherwise, this field is `False`.
  138. //
  139. // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] can be
  140. // pre-loaded by using
  141. // [CatalogService.AddCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.AddCatalogAttribute],
  142. // [CatalogService.ImportCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.ImportCatalogAttributes],
  143. // or
  144. // [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfig]
  145. // APIs. This field is `False` for pre-loaded
  146. // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s.
  147. //
  148. // Only pre-loaded
  149. // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
  150. // neither in use by products nor predefined can be deleted.
  151. // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are
  152. // either in use by products or are predefined cannot be deleted; however,
  153. // their configuration properties will reset to default values upon removal
  154. // request.
  155. //
  156. // After catalog changes, it takes about 10 minutes for this field to update.
  157. bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. // Output only. The type of this attribute. This is derived from the attribute
  159. // in [Product.attributes][google.cloud.retail.v2alpha.Product.attributes].
  160. AttributeType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // When
  162. // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
  163. // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values
  164. // are indexed so that it can be filtered, faceted, or boosted in
  165. // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
  166. IndexableOption indexable_option = 5;
  167. // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
  168. // facet. Could only be DYNAMIC_FACETABLE_DISABLED if
  169. // [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option]
  170. // is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.
  171. DynamicFacetableOption dynamic_facetable_option = 6;
  172. // When
  173. // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
  174. // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values
  175. // are searchable by text queries in
  176. // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
  177. //
  178. // If SEARCHABLE_ENABLED but attribute type is numerical, attribute values
  179. // will not be searchable by text queries in
  180. // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
  181. // as there are no text values associated to numerical attributes.
  182. SearchableOption searchable_option = 7;
  183. // When
  184. // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
  185. // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if RECOMMENDATIONS_FILTERING_ENABLED,
  186. // attribute values are filterable for recommendations.
  187. // This option works for categorical features only,
  188. // does not work for numerical features, inventory filtering.
  189. RecommendationsFilteringOption recommendations_filtering_option = 8;
  190. }
  191. // Catalog level attribute config.
  192. message AttributesConfig {
  193. option (google.api.resource) = {
  194. type: "retail.googleapis.com/AttributesConfig"
  195. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig"
  196. };
  197. // Required. Immutable. The fully qualified resource name of the attribute
  198. // config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`
  199. string name = 1 [
  200. (google.api.field_behavior) = REQUIRED,
  201. (google.api.field_behavior) = IMMUTABLE
  202. ];
  203. // Enable attribute(s) config at catalog level.
  204. // For example, indexable, dynamic_facetable, or searchable for each
  205. // attribute.
  206. //
  207. // The key is catalog attribute's name.
  208. // For example: `color`, `brands`, `attributes.custom_attribute`, such as
  209. // `attributes.xyz`.
  210. //
  211. // The maximum number of catalog attributes allowed in a request is 1000.
  212. map<string, CatalogAttribute> catalog_attributes = 2;
  213. // Output only. The
  214. // [AttributeConfigLevel][google.cloud.retail.v2alpha.AttributeConfigLevel]
  215. // used for this catalog.
  216. AttributeConfigLevel attribute_config_level = 3
  217. [(google.api.field_behavior) = OUTPUT_ONLY];
  218. }
  219. // Catalog level autocomplete config for customers to customize autocomplete
  220. // feature's settings.
  221. message CompletionConfig {
  222. option (google.api.resource) = {
  223. type: "retail.googleapis.com/CompletionConfig"
  224. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig"
  225. };
  226. // Required. Immutable. Fully qualified name
  227. // `projects/*/locations/*/catalogs/*/completionConfig`
  228. string name = 1 [
  229. (google.api.field_behavior) = REQUIRED,
  230. (google.api.field_behavior) = IMMUTABLE
  231. ];
  232. // Specifies the matching order for autocomplete suggestions, e.g., a query
  233. // consisting of 'sh' with 'out-of-order' specified would suggest "women's
  234. // shoes", whereas a query of 'red s' with 'exact-prefix' specified would
  235. // suggest "red shoes". Currently supported values:
  236. //
  237. // * 'out-of-order'
  238. // * 'exact-prefix'
  239. //
  240. // Default value: 'exact-prefix'.
  241. string matching_order = 2;
  242. // The maximum number of autocomplete suggestions returned per term. Default
  243. // value is 20. If left unset or set to 0, then will fallback to default
  244. // value.
  245. //
  246. // Value range is 1 to 20.
  247. int32 max_suggestions = 3;
  248. // The minimum number of characters needed to be typed in order to get
  249. // suggestions. Default value is 2. If left unset or set to 0, then will
  250. // fallback to default value.
  251. //
  252. // Value range is 1 to 20.
  253. int32 min_prefix_length = 4;
  254. // If set to true, the auto learning function is enabled. Auto learning uses
  255. // user data to generate suggestions using ML techniques. Default value is
  256. // false. Only after enabling auto learning can users use `cloud-retail`
  257. // data in
  258. // [CompleteQueryRequest][google.cloud.retail.v2alpha.CompleteQueryRequest].
  259. bool auto_learning = 11;
  260. // Output only. The source data for the latest import of the autocomplete
  261. // suggestion phrases.
  262. CompletionDataInputConfig suggestions_input_config = 5
  263. [(google.api.field_behavior) = OUTPUT_ONLY];
  264. // Output only. Name of the LRO corresponding to the latest suggestion terms
  265. // list import.
  266. //
  267. // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
  268. // retrieve the latest state of the Long Running Operation.
  269. string last_suggestions_import_operation = 6
  270. [(google.api.field_behavior) = OUTPUT_ONLY];
  271. // Output only. The source data for the latest import of the autocomplete
  272. // denylist phrases.
  273. CompletionDataInputConfig denylist_input_config = 7
  274. [(google.api.field_behavior) = OUTPUT_ONLY];
  275. // Output only. Name of the LRO corresponding to the latest denylist import.
  276. //
  277. // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
  278. // retrieve the latest state of the Long Running Operation.
  279. string last_denylist_import_operation = 8
  280. [(google.api.field_behavior) = OUTPUT_ONLY];
  281. // Output only. The source data for the latest import of the autocomplete
  282. // allowlist phrases.
  283. CompletionDataInputConfig allowlist_input_config = 9
  284. [(google.api.field_behavior) = OUTPUT_ONLY];
  285. // Output only. Name of the LRO corresponding to the latest allowlist import.
  286. //
  287. // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
  288. // retrieve the latest state of the Long Running Operation.
  289. string last_allowlist_import_operation = 10
  290. [(google.api.field_behavior) = OUTPUT_ONLY];
  291. }
  292. // Represents a link between a Merchant Center account and a branch.
  293. // Once a link is established, products from the linked merchant center account
  294. // will be streamed to the linked branch.
  295. message MerchantCenterLink {
  296. // Required. The linked [Merchant center account
  297. // id](https://developers.google.com/shopping-content/guides/accountstatuses).
  298. // The account must be a standalone account or a sub-account of a MCA.
  299. int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED];
  300. // The branch id (e.g. 0/1/2) within this catalog that products from
  301. // merchant_center_account_id are streamed to. When updating this field, an
  302. // empty value will use the currently configured default branch. However,
  303. // changing the default branch later on won't change the linked branch here.
  304. //
  305. // A single branch id can only have one linked merchant center account id.
  306. string branch_id = 2;
  307. // String representing the destination to import for, all if left empty.
  308. // List of possible values can be found here.
  309. // [https://support.google.com/merchants/answer/7501026]
  310. // List of allowed string values:
  311. // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
  312. // _ads", "Free_listings", "Free_local_listings"
  313. // NOTE: The string values are case sensitive.
  314. repeated string destinations = 3;
  315. // Region code of offers to accept. 2-letter Uppercase ISO 3166-1 alpha-2
  316. // code. List of values can be found
  317. // [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
  318. // under the `region` tag. If left blank no region filtering will be
  319. // performed.
  320. //
  321. // Example value: `US`.
  322. string region_code = 4;
  323. // Language of the title/description and other string attributes. Use language
  324. // tags defined by [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  325. // ISO 639-1.
  326. //
  327. // This specifies the language of offers in Merchant Center that will be
  328. // accepted. If empty no language filtering will be performed.
  329. //
  330. // Example value: `en`.
  331. string language_code = 5;
  332. }
  333. // Configures Merchant Center linking.
  334. // Links contained in the config will be used to sync data from a Merchant
  335. // Center account to a Cloud Retail branch.
  336. message MerchantCenterLinkingConfig {
  337. // Links between Merchant Center accounts and branches.
  338. repeated MerchantCenterLink links = 1;
  339. }
  340. // The catalog configuration.
  341. message Catalog {
  342. option (google.api.resource) = {
  343. type: "retail.googleapis.com/Catalog"
  344. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}"
  345. };
  346. // Required. Immutable. The fully qualified resource name of the catalog.
  347. string name = 1 [
  348. (google.api.field_behavior) = REQUIRED,
  349. (google.api.field_behavior) = IMMUTABLE
  350. ];
  351. // Required. Immutable. The catalog display name.
  352. //
  353. // This field must be a UTF-8 encoded string with a length limit of 128
  354. // characters. Otherwise, an INVALID_ARGUMENT error is returned.
  355. string display_name = 2 [
  356. (google.api.field_behavior) = REQUIRED,
  357. (google.api.field_behavior) = IMMUTABLE
  358. ];
  359. // Required. The product level configuration.
  360. ProductLevelConfig product_level_config = 4
  361. [(google.api.field_behavior) = REQUIRED];
  362. // The Merchant Center linking configuration.
  363. // Once a link is added, the data stream from Merchant Center to Cloud Retail
  364. // will be enabled automatically. The requester must have access to the
  365. // merchant center account in order to make changes to this field.
  366. MerchantCenterLinkingConfig merchant_center_linking_config = 6;
  367. }