catalog.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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/annotations.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/api/resource.proto";
  19. import "google/cloud/retail/v2alpha/common.proto";
  20. import "google/cloud/retail/v2alpha/import_config.proto";
  21. option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2alpha;retail";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "CatalogProto";
  25. option java_package = "com.google.cloud.retail.v2alpha";
  26. option objc_class_prefix = "RETAIL";
  27. option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
  28. option ruby_package = "Google::Cloud::Retail::V2alpha";
  29. // Configures what level the product should be uploaded with regards to
  30. // how users will be send events and how predictions will be made.
  31. message ProductLevelConfig {
  32. // The type of [Product][google.cloud.retail.v2alpha.Product]s allowed to be
  33. // ingested into the catalog. Acceptable values are:
  34. //
  35. // * `primary` (default): You can only ingest
  36. // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
  37. // [Product][google.cloud.retail.v2alpha.Product]s. This means
  38. // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
  39. // can only be empty or set to the same value as
  40. // [Product.id][google.cloud.retail.v2alpha.Product.id].
  41. // * `variant`: You can only ingest
  42. // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
  43. // [Product][google.cloud.retail.v2alpha.Product]s.
  44. // This means
  45. // [Product.primary_product_id][google.cloud.retail.v2alpha.Product.primary_product_id]
  46. // cannot be empty.
  47. //
  48. // If this field is set to an invalid value other than these, an
  49. // INVALID_ARGUMENT error is returned.
  50. //
  51. // If this field is `variant` and
  52. // [merchant_center_product_id_field][google.cloud.retail.v2alpha.ProductLevelConfig.merchant_center_product_id_field]
  53. // is `itemGroupId`, an INVALID_ARGUMENT error is returned.
  54. //
  55. // See [Using product
  56. // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
  57. // for more details.
  58. string ingestion_product_type = 1;
  59. // Which field of [Merchant Center
  60. // Product](/bigquery-transfer/docs/merchant-center-products-schema) should be
  61. // imported as [Product.id][google.cloud.retail.v2alpha.Product.id].
  62. // Acceptable values are:
  63. //
  64. // * `offerId` (default): Import `offerId` as the product ID.
  65. // * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail
  66. // API will choose one item from the ones with the same `itemGroupId`, and
  67. // use it to represent the item group.
  68. //
  69. // If this field is set to an invalid value other than these, an
  70. // INVALID_ARGUMENT error is returned.
  71. //
  72. // If this field is `itemGroupId` and
  73. // [ingestion_product_type][google.cloud.retail.v2alpha.ProductLevelConfig.ingestion_product_type]
  74. // is `variant`, an INVALID_ARGUMENT error is returned.
  75. //
  76. // See [Using product
  77. // levels](https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels)
  78. // for more details.
  79. string merchant_center_product_id_field = 2;
  80. }
  81. // Represents a link between a Merchant Center account and a branch.
  82. // Once a link is established, products from the linked merchant center account
  83. // will be streamed to the linked branch.
  84. message MerchantCenterLink {
  85. // Required. The linked [Merchant center account
  86. // id](https://developers.google.com/shopping-content/guides/accountstatuses).
  87. // The account must be a standalone account or a sub-account of a MCA.
  88. int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED];
  89. // The branch id (e.g. 0/1/2) within this catalog that products from
  90. // merchant_center_account_id are streamed to. When updating this field, an
  91. // empty value will use the currently configured default branch. However,
  92. // changing the default branch later on won't change the linked branch here.
  93. //
  94. // A single branch id can only have one linked merchant center account id.
  95. string branch_id = 2;
  96. // String representing the destination to import for, all if left empty.
  97. // List of possible values can be found here.
  98. // [https://support.google.com/merchants/answer/7501026?hl=en]
  99. // List of allowed string values:
  100. // "shopping-ads", "buy-on-google-listings", "display-ads", "local-inventory
  101. // -ads", "free-listings", "free-local-listings"
  102. // NOTE: The string values are case sensitive.
  103. repeated string destinations = 3;
  104. }
  105. // Configures Merchant Center linking.
  106. // Links contained in the config will be used to sync data from a Merchant
  107. // Center account to a Cloud Retail branch.
  108. message MerchantCenterLinkingConfig {
  109. // Links between Merchant Center accounts and branches.
  110. repeated MerchantCenterLink links = 1;
  111. }
  112. // The catalog configuration.
  113. message Catalog {
  114. option (google.api.resource) = {
  115. type: "retail.googleapis.com/Catalog"
  116. pattern: "projects/{project}/locations/{location}/catalogs/{catalog}"
  117. };
  118. // Required. Immutable. The fully qualified resource name of the catalog.
  119. string name = 1 [
  120. (google.api.field_behavior) = REQUIRED,
  121. (google.api.field_behavior) = IMMUTABLE
  122. ];
  123. // Required. Immutable. The catalog display name.
  124. //
  125. // This field must be a UTF-8 encoded string with a length limit of 128
  126. // characters. Otherwise, an INVALID_ARGUMENT error is returned.
  127. string display_name = 2 [
  128. (google.api.field_behavior) = REQUIRED,
  129. (google.api.field_behavior) = IMMUTABLE
  130. ];
  131. // Required. The product level configuration.
  132. ProductLevelConfig product_level_config = 4
  133. [(google.api.field_behavior) = REQUIRED];
  134. // The Merchant Center linking configuration.
  135. // Once a link is added, the data stream from Merchant Center to Cloud Retail
  136. // will be enabled automatically. The requester must have access to the
  137. // merchant center account in order to make changes to this field.
  138. MerchantCenterLinkingConfig merchant_center_linking_config = 6;
  139. }