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