google-cloud-retail-v2 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -0
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +240 -40
  4. data/lib/google/cloud/retail/v2/catalog_service/paths.rb +21 -0
  5. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +16 -0
  6. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +46 -0
  7. data/lib/google/cloud/retail/v2/common_pb.rb +46 -0
  8. data/lib/google/cloud/retail/v2/completion_service/client.rb +545 -0
  9. data/lib/google/cloud/retail/v2/completion_service/credentials.rb +51 -0
  10. data/lib/google/cloud/retail/v2/completion_service/operations.rb +664 -0
  11. data/lib/google/cloud/retail/v2/completion_service/paths.rb +52 -0
  12. data/lib/google/cloud/retail/v2/completion_service.rb +54 -0
  13. data/lib/google/cloud/retail/v2/completion_service_pb.rb +50 -0
  14. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +61 -0
  15. data/lib/google/cloud/retail/v2/import_config_pb.rb +32 -0
  16. data/lib/google/cloud/retail/v2/prediction_service/client.rb +66 -70
  17. data/lib/google/cloud/retail/v2/product_pb.rb +21 -0
  18. data/lib/google/cloud/retail/v2/product_service/client.rb +682 -43
  19. data/lib/google/cloud/retail/v2/product_service/operations.rb +30 -21
  20. data/lib/google/cloud/retail/v2/product_service_pb.rb +56 -0
  21. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +75 -0
  22. data/lib/google/cloud/retail/v2/search_service/client.rb +552 -0
  23. data/lib/google/cloud/retail/v2/search_service/credentials.rb +51 -0
  24. data/lib/google/cloud/retail/v2/search_service/paths.rb +54 -0
  25. data/lib/google/cloud/retail/v2/search_service.rb +53 -0
  26. data/lib/google/cloud/retail/v2/search_service_pb.rb +133 -0
  27. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +53 -0
  28. data/lib/google/cloud/retail/v2/user_event_pb.rb +11 -0
  29. data/lib/google/cloud/retail/v2/user_event_service/client.rb +45 -42
  30. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +30 -21
  31. data/lib/google/cloud/retail/v2/user_event_service/paths.rb +19 -0
  32. data/lib/google/cloud/retail/v2/version.rb +1 -1
  33. data/lib/google/cloud/retail/v2.rb +2 -0
  34. data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
  35. data/proto_docs/google/cloud/retail/v2/catalog_service.rb +53 -4
  36. data/proto_docs/google/cloud/retail/v2/common.rb +272 -4
  37. data/proto_docs/google/cloud/retail/v2/completion_service.rb +164 -0
  38. data/proto_docs/google/cloud/retail/v2/import_config.rb +122 -6
  39. data/proto_docs/google/cloud/retail/v2/prediction_service.rb +32 -31
  40. data/proto_docs/google/cloud/retail/v2/product.rb +265 -9
  41. data/proto_docs/google/cloud/retail/v2/product_service.rb +362 -2
  42. data/proto_docs/google/cloud/retail/v2/purge_config.rb +1 -1
  43. data/proto_docs/google/cloud/retail/v2/search_service.rb +711 -0
  44. data/proto_docs/google/cloud/retail/v2/user_event.rb +110 -6
  45. data/proto_docs/google/type/date.rb +53 -0
  46. metadata +20 -4
@@ -23,6 +23,40 @@ module Google
23
23
  module V2
24
24
  # Product captures all metadata information of items to be recommended or
25
25
  # searched.
26
+ # @!attribute [rw] expire_time
27
+ # @return [::Google::Protobuf::Timestamp]
28
+ # The timestamp when this product becomes unavailable for
29
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}.
30
+ #
31
+ # If it is set, the {::Google::Cloud::Retail::V2::Product Product} is not
32
+ # available for
33
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} after
34
+ # {::Google::Cloud::Retail::V2::Product#expire_time expire_time}. However, the
35
+ # product can still be retrieved by
36
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}
37
+ # and
38
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}.
39
+ #
40
+ # Google Merchant Center property
41
+ # [expiration_date](https://support.google.com/merchants/answer/6324499).
42
+ # @!attribute [rw] ttl
43
+ # @return [::Google::Protobuf::Duration]
44
+ # Input only. The TTL (time to live) of the product.
45
+ #
46
+ # If it is set, {::Google::Cloud::Retail::V2::Product#expire_time expire_time}
47
+ # is set as current timestamp plus
48
+ # {::Google::Cloud::Retail::V2::Product#ttl ttl}. The derived
49
+ # {::Google::Cloud::Retail::V2::Product#expire_time expire_time} is returned in
50
+ # the output and {::Google::Cloud::Retail::V2::Product#ttl ttl} is left blank
51
+ # when retrieving the {::Google::Cloud::Retail::V2::Product Product}.
52
+ #
53
+ # If it is set, the product is not available for
54
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search} after
55
+ # current timestamp plus {::Google::Cloud::Retail::V2::Product#ttl ttl}.
56
+ # However, the product can still be retrieved by
57
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}
58
+ # and
59
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}.
26
60
  # @!attribute [rw] name
27
61
  # @return [::String]
28
62
  # Immutable. Full resource name of the product, such as
@@ -45,7 +79,9 @@ module Google
45
79
  # Property [Product.sku](https://schema.org/sku).
46
80
  # @!attribute [rw] type
47
81
  # @return [::Google::Cloud::Retail::V2::Product::Type]
48
- # Immutable. The type of the product. This field is output-only.
82
+ # Immutable. The type of the product. Default to
83
+ # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type}
84
+ # if unset.
49
85
  # @!attribute [rw] primary_product_id
50
86
  # @return [::String]
51
87
  # Variant group identifier. Must be an
@@ -69,6 +105,31 @@ module Google
69
105
  #
70
106
  # This field must be enabled before it can be used. [Learn
71
107
  # more](/recommendations-ai/docs/catalog#item-group-id).
108
+ # @!attribute [rw] collection_member_ids
109
+ # @return [::Array<::String>]
110
+ # The {::Google::Cloud::Retail::V2::Product#id id} of the collection members when
111
+ # {::Google::Cloud::Retail::V2::Product#type type} is
112
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}.
113
+ #
114
+ # Should not set it for other types. A maximum of 1000 values are allowed.
115
+ # Otherwise, an INVALID_ARGUMENT error is return.
116
+ # @!attribute [rw] gtin
117
+ # @return [::String]
118
+ # The Global Trade Item Number (GTIN) of the product.
119
+ #
120
+ # This field must be a UTF-8 encoded string with a length limit of 128
121
+ # characters. Otherwise, an INVALID_ARGUMENT error is returned.
122
+ #
123
+ # Google Merchant Center property
124
+ # [gtin](https://support.google.com/merchants/answer/6324461).
125
+ # Schema.org property
126
+ # [Product.isbn](https://schema.org/isbn) or
127
+ # [Product.gtin8](https://schema.org/gtin8) or
128
+ # [Product.gtin12](https://schema.org/gtin12) or
129
+ # [Product.gtin13](https://schema.org/gtin13) or
130
+ # [Product.gtin14](https://schema.org/gtin14).
131
+ #
132
+ # If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned.
72
133
  # @!attribute [rw] categories
73
134
  # @return [::Array<::String>]
74
135
  # Product categories. This field is repeated for supporting one product
@@ -109,12 +170,23 @@ module Google
109
170
  # @return [::String]
110
171
  # Required. Product title.
111
172
  #
112
- # This field must be a UTF-8 encoded string with a length limit of 128
173
+ # This field must be a UTF-8 encoded string with a length limit of 1,000
113
174
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
114
175
  #
115
176
  # Google Merchant Center property
116
177
  # [title](https://support.google.com/merchants/answer/6324415). Schema.org
117
178
  # property [Product.name](https://schema.org/name).
179
+ # @!attribute [rw] brands
180
+ # @return [::Array<::String>]
181
+ # The brands of the product.
182
+ #
183
+ # A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
184
+ # string with a length limit of 1,000 characters. Otherwise, an
185
+ # INVALID_ARGUMENT error is returned.
186
+ #
187
+ # Google Merchant Center property
188
+ # [brand](https://support.google.com/merchants/answer/6324351). Schema.org
189
+ # property [Product.brand](https://schema.org/brand).
118
190
  # @!attribute [rw] description
119
191
  # @return [::String]
120
192
  # Product description.
@@ -125,6 +197,18 @@ module Google
125
197
  # Google Merchant Center property
126
198
  # [description](https://support.google.com/merchants/answer/6324468).
127
199
  # schema.org property [Product.description](https://schema.org/description).
200
+ # @!attribute [rw] language_code
201
+ # @return [::String]
202
+ # Language of the title/description and other string attributes. Use language
203
+ # tags defined by [BCP 47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
204
+ #
205
+ # For product prediction, this field is ignored and the model automatically
206
+ # detects the text language. The {::Google::Cloud::Retail::V2::Product Product}
207
+ # can include text in different languages, but duplicating
208
+ # {::Google::Cloud::Retail::V2::Product Product}s to provide text in multiple
209
+ # languages can result in degraded model performance.
210
+ #
211
+ # For product search this field is in use. It defaults to "en-US" if unset.
128
212
  # @!attribute [rw] attributes
129
213
  # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Retail::V2::CustomAttribute}]
130
214
  # Highly encouraged. Extra product attributes to be included. For example,
@@ -143,11 +227,14 @@ module Google
143
227
  # "lengths_cm": \\{"numbers":[2.3, 15.4]}, "heights_cm": \\{"numbers":[8.1, 6.4]}
144
228
  # }`.
145
229
  #
146
- # A maximum of 150 attributes are allowed. Otherwise, an INVALID_ARGUMENT
147
- # error is returned.
230
+ # This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT
231
+ # error is returned:
148
232
  #
149
- # The key must be a UTF-8 encoded string with a length limit of 5,000
150
- # characters. Otherwise, an INVALID_ARGUMENT error is returned.
233
+ # * Max entries count: 200.
234
+ # * The key must be a UTF-8 encoded string with a length limit of 128
235
+ # characters.
236
+ # * For indexable attribute, the key must match the pattern:
237
+ # [a-zA-Z0-9][a-zA-Z0-9_]*. For example, key0LikeThis or KEY_1_LIKE_THIS.
151
238
  # @!attribute [rw] tags
152
239
  # @return [::Array<::String>]
153
240
  # Custom tags associated with the product.
@@ -169,10 +256,14 @@ module Google
169
256
  #
170
257
  # Google Merchant Center property
171
258
  # [price](https://support.google.com/merchants/answer/6324371).
259
+ # @!attribute [rw] rating
260
+ # @return [::Google::Cloud::Retail::V2::Rating]
261
+ # The rating of this product.
172
262
  # @!attribute [rw] available_time
173
263
  # @return [::Google::Protobuf::Timestamp]
174
264
  # The timestamp when this {::Google::Cloud::Retail::V2::Product Product} becomes
175
- # available recommendation and search.
265
+ # available for
266
+ # {::Google::Cloud::Retail::V2::SearchService::Client#search SearchService.Search}.
176
267
  # @!attribute [rw] availability
177
268
  # @return [::Google::Cloud::Retail::V2::Product::Availability]
178
269
  # The online availability of the {::Google::Cloud::Retail::V2::Product Product}.
@@ -185,10 +276,21 @@ module Google
185
276
  # @!attribute [rw] available_quantity
186
277
  # @return [::Google::Protobuf::Int32Value]
187
278
  # The available quantity of the item.
279
+ # @!attribute [rw] fulfillment_info
280
+ # @return [::Array<::Google::Cloud::Retail::V2::FulfillmentInfo>]
281
+ # Fulfillment information, such as the store IDs for in-store pickup or
282
+ # region IDs for different shipping methods.
283
+ #
284
+ # All the elements must have distinct
285
+ # {::Google::Cloud::Retail::V2::FulfillmentInfo#type FulfillmentInfo.type}.
286
+ # Otherwise, an INVALID_ARGUMENT error is returned.
188
287
  # @!attribute [rw] uri
189
288
  # @return [::String]
190
289
  # Canonical URL directly linking to the product detail page.
191
290
  #
291
+ # It is strongly recommended to provide a valid uri for the product,
292
+ # otherwise the service performance could be significantly degraded.
293
+ #
192
294
  # This field must be a UTF-8 encoded string with a length limit of 5,000
193
295
  # characters. Otherwise, an INVALID_ARGUMENT error is returned.
194
296
  #
@@ -197,13 +299,166 @@ module Google
197
299
  # property [Offer.url](https://schema.org/url).
198
300
  # @!attribute [rw] images
199
301
  # @return [::Array<::Google::Cloud::Retail::V2::Image>]
200
- # Product images for the product.
302
+ # Product images for the product.Highly recommended to put the main image
303
+ # to the first.
201
304
  #
202
305
  # A maximum of 300 images are allowed.
203
306
  #
204
307
  # Google Merchant Center property
205
308
  # [image_link](https://support.google.com/merchants/answer/6324350).
206
309
  # Schema.org property [Product.image](https://schema.org/image).
310
+ # @!attribute [rw] audience
311
+ # @return [::Google::Cloud::Retail::V2::Audience]
312
+ # The target group associated with a given audience (e.g. male, veterans,
313
+ # car owners, musicians, etc.) of the product.
314
+ # @!attribute [rw] color_info
315
+ # @return [::Google::Cloud::Retail::V2::ColorInfo]
316
+ # The color of the product.
317
+ #
318
+ # Google Merchant Center property
319
+ # [color](https://support.google.com/merchants/answer/6324487). Schema.org
320
+ # property [Product.color](https://schema.org/color).
321
+ # @!attribute [rw] sizes
322
+ # @return [::Array<::String>]
323
+ # The size of the product. To represent different size systems or size types,
324
+ # consider using this format: [[[size_system:]size_type:]size_value].
325
+ #
326
+ # For example, in "US:MENS:M", "US" represents size system; "MENS" represents
327
+ # size type; "M" represents size value. In "GIRLS:27", size system is empty;
328
+ # "GIRLS" represents size type; "27" represents size value. In "32 inches",
329
+ # both size system and size type are empty, while size value is "32 inches".
330
+ #
331
+ # A maximum of 20 values are allowed per
332
+ # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8
333
+ # encoded string with a length limit of 128 characters. Otherwise, an
334
+ # INVALID_ARGUMENT error is returned.
335
+ #
336
+ # Google Merchant Center property
337
+ # [size](https://support.google.com/merchants/answer/6324492),
338
+ # [size_type](https://support.google.com/merchants/answer/6324497) and
339
+ # [size_system](https://support.google.com/merchants/answer/6324502).
340
+ # Schema.org property [Product.size](https://schema.org/size).
341
+ # @!attribute [rw] materials
342
+ # @return [::Array<::String>]
343
+ # The material of the product. For example, "leather", "wooden".
344
+ #
345
+ # A maximum of 20 values are allowed. Each value must be a UTF-8 encoded
346
+ # string with a length limit of 128 characters. Otherwise, an
347
+ # INVALID_ARGUMENT error is returned.
348
+ #
349
+ # Google Merchant Center property
350
+ # [material](https://support.google.com/merchants/answer/6324410). Schema.org
351
+ # property [Product.material](https://schema.org/material).
352
+ # @!attribute [rw] patterns
353
+ # @return [::Array<::String>]
354
+ # The pattern or graphic print of the product. For example, "striped", "polka
355
+ # dot", "paisley".
356
+ #
357
+ # A maximum of 5 values are allowed per
358
+ # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8
359
+ # encoded string with a length limit of 128 characters. Otherwise, an
360
+ # INVALID_ARGUMENT error is returned.
361
+ #
362
+ # Google Merchant Center property
363
+ # [pattern](https://support.google.com/merchants/answer/6324483). Schema.org
364
+ # property [Product.pattern](https://schema.org/pattern).
365
+ # @!attribute [rw] conditions
366
+ # @return [::Array<::String>]
367
+ # The condition of the product. Strongly encouraged to use the standard
368
+ # values: "new", "refurbished", "used".
369
+ #
370
+ # A maximum of 5 values are allowed per
371
+ # {::Google::Cloud::Retail::V2::Product Product}. Each value must be a UTF-8
372
+ # encoded string with a length limit of 128 characters. Otherwise, an
373
+ # INVALID_ARGUMENT error is returned.
374
+ #
375
+ # Google Merchant Center property
376
+ # [condition](https://support.google.com/merchants/answer/6324469).
377
+ # Schema.org property
378
+ # [Offer.itemCondition](https://schema.org/itemCondition).
379
+ # @!attribute [rw] promotions
380
+ # @return [::Array<::Google::Cloud::Retail::V2::Promotion>]
381
+ # The promotions applied to the product. A maximum of 10 values are allowed
382
+ # per {::Google::Cloud::Retail::V2::Product Product}.
383
+ # @!attribute [rw] publish_time
384
+ # @return [::Google::Protobuf::Timestamp]
385
+ # The timestamp when the product is published by the retailer for the first
386
+ # time, which indicates the freshness of the products. Note that this field
387
+ # is different from
388
+ # {::Google::Cloud::Retail::V2::Product#available_time available_time}, given it
389
+ # purely describes product freshness regardless of when it is available on
390
+ # search and recommendation.
391
+ # @!attribute [rw] retrievable_fields
392
+ # @return [::Google::Protobuf::FieldMask]
393
+ # Indicates which fields in the {::Google::Cloud::Retail::V2::Product Product}s
394
+ # are returned in {::Google::Cloud::Retail::V2::SearchResponse SearchResponse}.
395
+ #
396
+ # Supported fields for all {::Google::Cloud::Retail::V2::Product#type type}s:
397
+ #
398
+ # * {::Google::Cloud::Retail::V2::Product#audience audience}
399
+ # * {::Google::Cloud::Retail::V2::Product#availability availability}
400
+ # * {::Google::Cloud::Retail::V2::Product#brands brands}
401
+ # * {::Google::Cloud::Retail::V2::Product#color_info color_info}
402
+ # * {::Google::Cloud::Retail::V2::Product#conditions conditions}
403
+ # * {::Google::Cloud::Retail::V2::Product#gtin gtin}
404
+ # * {::Google::Cloud::Retail::V2::Product#materials materials}
405
+ # * {::Google::Cloud::Retail::V2::Product#name name}
406
+ # * {::Google::Cloud::Retail::V2::Product#patterns patterns}
407
+ # * {::Google::Cloud::Retail::V2::Product#price_info price_info}
408
+ # * {::Google::Cloud::Retail::V2::Product#rating rating}
409
+ # * {::Google::Cloud::Retail::V2::Product#sizes sizes}
410
+ # * {::Google::Cloud::Retail::V2::Product#title title}
411
+ # * {::Google::Cloud::Retail::V2::Product#uri uri}
412
+ #
413
+ # Supported fields only for
414
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and
415
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}:
416
+ #
417
+ # * {::Google::Cloud::Retail::V2::Product#categories categories}
418
+ # * {::Google::Cloud::Retail::V2::Product#description description}
419
+ # * {::Google::Cloud::Retail::V2::Product#images images}
420
+ #
421
+ # Supported fields only for
422
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}:
423
+ #
424
+ # * Only the first image in {::Google::Cloud::Retail::V2::Product#images images}
425
+ #
426
+ # To mark {::Google::Cloud::Retail::V2::Product#attributes attributes} as
427
+ # retrievable, include paths of the form "attributes.key" where "key" is the
428
+ # key of a custom attribute, as specified in
429
+ # {::Google::Cloud::Retail::V2::Product#attributes attributes}.
430
+ #
431
+ # For {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} and
432
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Type.COLLECTION}, the
433
+ # following fields are always returned in
434
+ # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} by default:
435
+ #
436
+ # * {::Google::Cloud::Retail::V2::Product#name name}
437
+ #
438
+ # For {::Google::Cloud::Retail::V2::Product::Type::VARIANT Type.VARIANT}, the
439
+ # following fields are always returned in by default:
440
+ #
441
+ # * {::Google::Cloud::Retail::V2::Product#name name}
442
+ # * {::Google::Cloud::Retail::V2::Product#color_info color_info}
443
+ #
444
+ # Maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is
445
+ # returned.
446
+ #
447
+ # Note: Returning more fields in
448
+ # {::Google::Cloud::Retail::V2::SearchResponse SearchResponse} may increase
449
+ # response payload size and serving latency.
450
+ # @!attribute [r] variants
451
+ # @return [::Array<::Google::Cloud::Retail::V2::Product>]
452
+ # Output only. Product variants grouped together on primary product which
453
+ # share similar product attributes. It's automatically grouped by
454
+ # {::Google::Cloud::Retail::V2::Product#primary_product_id primary_product_id} for
455
+ # all the product variants. Only populated for
456
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY}
457
+ # {::Google::Cloud::Retail::V2::Product Product}s.
458
+ #
459
+ # Note: This field is OUTPUT_ONLY for
460
+ # {::Google::Cloud::Retail::V2::ProductService::Client#get_product ProductService.GetProduct}.
461
+ # Do not set this field in API requests.
207
462
  class Product
208
463
  include ::Google::Protobuf::MessageExts
209
464
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -220,7 +475,8 @@ module Google
220
475
  # The type of this product.
221
476
  module Type
222
477
  # Default value. Default to
223
- # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Type.PRIMARY} if unset.
478
+ # {::Google::Cloud::Retail::V2::ProductLevelConfig#ingestion_product_type Catalog.product_level_config.ingestion_product_type}
479
+ # if unset.
224
480
  TYPE_UNSPECIFIED = 0
225
481
 
226
482
  # The primary type.
@@ -78,8 +78,10 @@ module Google
78
78
  # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
79
79
  # exists, a PERMISSION_DENIED error is returned.
80
80
  #
81
- # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist,
82
- # a NOT_FOUND error is returned.
81
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update does not exist
82
+ # and
83
+ # {::Google::Cloud::Retail::V2::UpdateProductRequest#allow_missing allow_missing}
84
+ # is not set, a NOT_FOUND error is returned.
83
85
  # @!attribute [rw] update_mask
84
86
  # @return [::Google::Protobuf::FieldMask]
85
87
  # Indicates which fields in the provided
@@ -89,6 +91,11 @@ module Google
89
91
  #
90
92
  # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
91
93
  # is returned.
94
+ # @!attribute [rw] allow_missing
95
+ # @return [::Boolean]
96
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
97
+ # found, a new {::Google::Cloud::Retail::V2::Product Product} will be created. In
98
+ # this situation, `update_mask` is ignored.
92
99
  class UpdateProductRequest
93
100
  include ::Google::Protobuf::MessageExts
94
101
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -107,10 +114,363 @@ module Google
107
114
  #
108
115
  # If the {::Google::Cloud::Retail::V2::Product Product} to delete does not exist,
109
116
  # a NOT_FOUND error is returned.
117
+ #
118
+ # The {::Google::Cloud::Retail::V2::Product Product} to delete can neither be a
119
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
120
+ # {::Google::Cloud::Retail::V2::Product Product} member nor a
121
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
122
+ # {::Google::Cloud::Retail::V2::Product Product} with more than one
123
+ # {::Google::Cloud::Retail::V2::Product::Type::VARIANT variants}. Otherwise, an
124
+ # INVALID_ARGUMENT error is returned.
125
+ #
126
+ # All inventory information for the named
127
+ # {::Google::Cloud::Retail::V2::Product Product} will be deleted.
110
128
  class DeleteProductRequest
111
129
  include ::Google::Protobuf::MessageExts
112
130
  extend ::Google::Protobuf::MessageExts::ClassMethods
113
131
  end
132
+
133
+ # Request message for
134
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
135
+ # method.
136
+ # @!attribute [rw] parent
137
+ # @return [::String]
138
+ # Required. The parent branch resource name, such as
139
+ # `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
140
+ # `default_branch` as the branch ID, to list products under the default
141
+ # branch.
142
+ #
143
+ # If the caller does not have permission to list
144
+ # {::Google::Cloud::Retail::V2::Product Product}s under this branch, regardless of
145
+ # whether or not this branch exists, a PERMISSION_DENIED error is returned.
146
+ # @!attribute [rw] page_size
147
+ # @return [::Integer]
148
+ # Maximum number of {::Google::Cloud::Retail::V2::Product Product}s to return. If
149
+ # unspecified, defaults to 100. The maximum allowed value is 1000. Values
150
+ # above 1000 will be coerced to 1000.
151
+ #
152
+ # If this field is negative, an INVALID_ARGUMENT error is returned.
153
+ # @!attribute [rw] page_token
154
+ # @return [::String]
155
+ # A page token
156
+ # {::Google::Cloud::Retail::V2::ListProductsResponse#next_page_token ListProductsResponse.next_page_token},
157
+ # received from a previous
158
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
159
+ # call. Provide this to retrieve the subsequent page.
160
+ #
161
+ # When paginating, all other parameters provided to
162
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
163
+ # must match the call that provided the page token. Otherwise, an
164
+ # INVALID_ARGUMENT error is returned.
165
+ # @!attribute [rw] filter
166
+ # @return [::String]
167
+ # A filter to apply on the list results. Supported features:
168
+ #
169
+ # * List all the products under the parent branch if
170
+ # {::Google::Cloud::Retail::V2::ListProductsRequest#filter filter} is unset.
171
+ # * List {::Google::Cloud::Retail::V2::Product::Type::VARIANT Product.Type.VARIANT}
172
+ # {::Google::Cloud::Retail::V2::Product Product}s sharing the same
173
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
174
+ # {::Google::Cloud::Retail::V2::Product Product}. For example:
175
+ # `primary_product_id = "some_product_id"`
176
+ # * List {::Google::Cloud::Retail::V2::Product Product}s bundled in a
177
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
178
+ # {::Google::Cloud::Retail::V2::Product Product}.
179
+ # For example:
180
+ # `collection_product_id = "some_product_id"`
181
+ # * List {::Google::Cloud::Retail::V2::Product Product}s with a partibular type.
182
+ # For example:
183
+ # `type = "PRIMARY"`
184
+ # `type = "VARIANT"`
185
+ # `type = "COLLECTION"`
186
+ #
187
+ # If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
188
+ #
189
+ # If the specified
190
+ # {::Google::Cloud::Retail::V2::Product::Type::PRIMARY Product.Type.PRIMARY}
191
+ # {::Google::Cloud::Retail::V2::Product Product} or
192
+ # {::Google::Cloud::Retail::V2::Product::Type::COLLECTION Product.Type.COLLECTION}
193
+ # {::Google::Cloud::Retail::V2::Product Product} does not exist, a NOT_FOUND error
194
+ # is returned.
195
+ # @!attribute [rw] read_mask
196
+ # @return [::Google::Protobuf::FieldMask]
197
+ # The fields of {::Google::Cloud::Retail::V2::Product Product} to return in the
198
+ # responses. If not set or empty, the following fields are returned:
199
+ #
200
+ # * {::Google::Cloud::Retail::V2::Product#name Product.name}
201
+ # * {::Google::Cloud::Retail::V2::Product#id Product.id}
202
+ # * {::Google::Cloud::Retail::V2::Product#title Product.title}
203
+ # * {::Google::Cloud::Retail::V2::Product#uri Product.uri}
204
+ # * {::Google::Cloud::Retail::V2::Product#images Product.images}
205
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
206
+ # * {::Google::Cloud::Retail::V2::Product#brands Product.brands}
207
+ #
208
+ # If "*" is provided, all fields are returned.
209
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is always returned no
210
+ # matter what mask is set.
211
+ #
212
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
213
+ # is returned.
214
+ class ListProductsRequest
215
+ include ::Google::Protobuf::MessageExts
216
+ extend ::Google::Protobuf::MessageExts::ClassMethods
217
+ end
218
+
219
+ # Response message for
220
+ # {::Google::Cloud::Retail::V2::ProductService::Client#list_products ProductService.ListProducts}
221
+ # method.
222
+ # @!attribute [rw] products
223
+ # @return [::Array<::Google::Cloud::Retail::V2::Product>]
224
+ # The {::Google::Cloud::Retail::V2::Product Product}s.
225
+ # @!attribute [rw] next_page_token
226
+ # @return [::String]
227
+ # A token that can be sent as
228
+ # {::Google::Cloud::Retail::V2::ListProductsRequest#page_token ListProductsRequest.page_token}
229
+ # to retrieve the next page. If this field is omitted, there are no
230
+ # subsequent pages.
231
+ class ListProductsResponse
232
+ include ::Google::Protobuf::MessageExts
233
+ extend ::Google::Protobuf::MessageExts::ClassMethods
234
+ end
235
+
236
+ # Request message for [SetInventory][] method.
237
+ # @!attribute [rw] inventory
238
+ # @return [::Google::Cloud::Retail::V2::Product]
239
+ # Required. The inventory information to update. The allowable fields to
240
+ # update are:
241
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
242
+ # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
243
+ # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
244
+ # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
245
+ # The updated inventory fields must be specified in
246
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_mask SetInventoryRequest.set_mask}.
247
+ #
248
+ # If [SetInventoryRequest.inventory.name][] is empty or invalid, an
249
+ # INVALID_ARGUMENT error is returned.
250
+ #
251
+ # If the caller does not have permission to update the
252
+ # {::Google::Cloud::Retail::V2::Product Product} named in
253
+ # {::Google::Cloud::Retail::V2::Product#name Product.name}, regardless of whether
254
+ # or not it exists, a PERMISSION_DENIED error is returned.
255
+ #
256
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update does not have
257
+ # existing inventory information, the provided inventory information will be
258
+ # inserted.
259
+ #
260
+ # If the {::Google::Cloud::Retail::V2::Product Product} to update has existing
261
+ # inventory information, the provided inventory information will be merged
262
+ # while respecting the last update time for each inventory field, using the
263
+ # provided or default value for
264
+ # {::Google::Cloud::Retail::V2::SetInventoryRequest#set_time SetInventoryRequest.set_time}.
265
+ #
266
+ # The last update time is recorded for the following inventory fields:
267
+ # * {::Google::Cloud::Retail::V2::Product#price_info Product.price_info}
268
+ # * {::Google::Cloud::Retail::V2::Product#availability Product.availability}
269
+ # * {::Google::Cloud::Retail::V2::Product#available_quantity Product.available_quantity}
270
+ # * {::Google::Cloud::Retail::V2::Product#fulfillment_info Product.fulfillment_info}
271
+ #
272
+ # If a full overwrite of inventory information while ignoring timestamps is
273
+ # needed, [UpdateProduct][] should be invoked instead.
274
+ # @!attribute [rw] set_mask
275
+ # @return [::Google::Protobuf::FieldMask]
276
+ # Indicates which inventory fields in the provided
277
+ # {::Google::Cloud::Retail::V2::Product Product} to update. If not set or set with
278
+ # empty paths, all inventory fields will be updated.
279
+ #
280
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
281
+ # is returned and the entire update will be ignored.
282
+ # @!attribute [rw] set_time
283
+ # @return [::Google::Protobuf::Timestamp]
284
+ # The time when the request is issued, used to prevent
285
+ # out-of-order updates on inventory fields with the last update time
286
+ # recorded. If not provided, the internal system time will be used.
287
+ # @!attribute [rw] allow_missing
288
+ # @return [::Boolean]
289
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} with name
290
+ # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the
291
+ # inventory update will still be processed and retained for at most 1 day
292
+ # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to
293
+ # false, an INVALID_ARGUMENT error is returned if the
294
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
295
+ class SetInventoryRequest
296
+ include ::Google::Protobuf::MessageExts
297
+ extend ::Google::Protobuf::MessageExts::ClassMethods
298
+ end
299
+
300
+ # Metadata related to the progress of the SetInventory operation.
301
+ # Currently empty because there is no meaningful metadata populated from the
302
+ # [SetInventory][] method.
303
+ class SetInventoryMetadata
304
+ include ::Google::Protobuf::MessageExts
305
+ extend ::Google::Protobuf::MessageExts::ClassMethods
306
+ end
307
+
308
+ # Response of the SetInventoryRequest. Currently empty because
309
+ # there is no meaningful response populated from the [SetInventory][]
310
+ # method.
311
+ class SetInventoryResponse
312
+ include ::Google::Protobuf::MessageExts
313
+ extend ::Google::Protobuf::MessageExts::ClassMethods
314
+ end
315
+
316
+ # Request message for [AddFulfillmentPlaces][] method.
317
+ # @!attribute [rw] product
318
+ # @return [::String]
319
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
320
+ # such as
321
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
322
+ #
323
+ # If the caller does not have permission to access the
324
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
325
+ # exists, a PERMISSION_DENIED error is returned.
326
+ # @!attribute [rw] type
327
+ # @return [::String]
328
+ # Required. The fulfillment type, including commonly used types (such as
329
+ # pickup in store and same day delivery), and custom types.
330
+ #
331
+ # Supported values:
332
+ #
333
+ # * "pickup-in-store"
334
+ # * "ship-to-store"
335
+ # * "same-day-delivery"
336
+ # * "next-day-delivery"
337
+ # * "custom-type-1"
338
+ # * "custom-type-2"
339
+ # * "custom-type-3"
340
+ # * "custom-type-4"
341
+ # * "custom-type-5"
342
+ #
343
+ # If this field is set to an invalid value other than these, an
344
+ # INVALID_ARGUMENT error is returned.
345
+ #
346
+ # This field directly corresponds to [Product.fulfillment_info.type][].
347
+ # @!attribute [rw] place_ids
348
+ # @return [::Array<::String>]
349
+ # Required. The IDs for this
350
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}, such as
351
+ # the store IDs for "pickup-in-store" or the region IDs for
352
+ # "same-day-delivery" to be added for this
353
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type}. Duplicate
354
+ # IDs will be automatically ignored.
355
+ #
356
+ # At least 1 value is required, and a maximum of 2000 values are allowed.
357
+ # Each value must be a string with a length limit of 10 characters, matching
358
+ # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
359
+ # INVALID_ARGUMENT error is returned.
360
+ #
361
+ # If the total number of place IDs exceeds 2000 for this
362
+ # {::Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest#type type} after
363
+ # adding, then the update will be rejected.
364
+ # @!attribute [rw] add_time
365
+ # @return [::Google::Protobuf::Timestamp]
366
+ # The time when the fulfillment updates are issued, used to prevent
367
+ # out-of-order updates on fulfillment information. If not provided, the
368
+ # internal system time will be used.
369
+ # @!attribute [rw] allow_missing
370
+ # @return [::Boolean]
371
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
372
+ # found, the fulfillment information will still be processed and retained for
373
+ # at most 1 day and processed once the
374
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
375
+ # INVALID_ARGUMENT error is returned if the
376
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
377
+ class AddFulfillmentPlacesRequest
378
+ include ::Google::Protobuf::MessageExts
379
+ extend ::Google::Protobuf::MessageExts::ClassMethods
380
+ end
381
+
382
+ # Metadata related to the progress of the AddFulfillmentPlaces operation.
383
+ # Currently empty because there is no meaningful metadata populated from the
384
+ # [AddFulfillmentPlaces][] method.
385
+ class AddFulfillmentPlacesMetadata
386
+ include ::Google::Protobuf::MessageExts
387
+ extend ::Google::Protobuf::MessageExts::ClassMethods
388
+ end
389
+
390
+ # Response of the RemoveFulfillmentPlacesRequest. Currently empty because
391
+ # there is no meaningful response populated from the [AddFulfillmentPlaces][]
392
+ # method.
393
+ class AddFulfillmentPlacesResponse
394
+ include ::Google::Protobuf::MessageExts
395
+ extend ::Google::Protobuf::MessageExts::ClassMethods
396
+ end
397
+
398
+ # Request message for [RemoveFulfillmentPlaces][] method.
399
+ # @!attribute [rw] product
400
+ # @return [::String]
401
+ # Required. Full resource name of {::Google::Cloud::Retail::V2::Product Product},
402
+ # such as
403
+ # `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
404
+ #
405
+ # If the caller does not have permission to access the
406
+ # {::Google::Cloud::Retail::V2::Product Product}, regardless of whether or not it
407
+ # exists, a PERMISSION_DENIED error is returned.
408
+ # @!attribute [rw] type
409
+ # @return [::String]
410
+ # Required. The fulfillment type, including commonly used types (such as
411
+ # pickup in store and same day delivery), and custom types.
412
+ #
413
+ # Supported values:
414
+ #
415
+ # * "pickup-in-store"
416
+ # * "ship-to-store"
417
+ # * "same-day-delivery"
418
+ # * "next-day-delivery"
419
+ # * "custom-type-1"
420
+ # * "custom-type-2"
421
+ # * "custom-type-3"
422
+ # * "custom-type-4"
423
+ # * "custom-type-5"
424
+ #
425
+ # If this field is set to an invalid value other than these, an
426
+ # INVALID_ARGUMENT error is returned.
427
+ #
428
+ # This field directly corresponds to [Product.fulfillment_info.type][].
429
+ # @!attribute [rw] place_ids
430
+ # @return [::Array<::String>]
431
+ # Required. The IDs for this
432
+ # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}, such as
433
+ # the store IDs for "pickup-in-store" or the region IDs for
434
+ # "same-day-delivery", to be removed for this
435
+ # {::Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest#type type}.
436
+ #
437
+ # At least 1 value is required, and a maximum of 2000 values are allowed.
438
+ # Each value must be a string with a length limit of 10 characters, matching
439
+ # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
440
+ # INVALID_ARGUMENT error is returned.
441
+ # @!attribute [rw] remove_time
442
+ # @return [::Google::Protobuf::Timestamp]
443
+ # The time when the fulfillment updates are issued, used to prevent
444
+ # out-of-order updates on fulfillment information. If not provided, the
445
+ # internal system time will be used.
446
+ # @!attribute [rw] allow_missing
447
+ # @return [::Boolean]
448
+ # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
449
+ # found, the fulfillment information will still be processed and retained for
450
+ # at most 1 day and processed once the
451
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
452
+ # INVALID_ARGUMENT error is returned if the
453
+ # {::Google::Cloud::Retail::V2::Product Product} is not found.
454
+ class RemoveFulfillmentPlacesRequest
455
+ include ::Google::Protobuf::MessageExts
456
+ extend ::Google::Protobuf::MessageExts::ClassMethods
457
+ end
458
+
459
+ # Metadata related to the progress of the RemoveFulfillmentPlaces operation.
460
+ # Currently empty because there is no meaningful metadata populated from the
461
+ # [RemoveFulfillmentPlaces][] method.
462
+ class RemoveFulfillmentPlacesMetadata
463
+ include ::Google::Protobuf::MessageExts
464
+ extend ::Google::Protobuf::MessageExts::ClassMethods
465
+ end
466
+
467
+ # Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
468
+ # is no meaningful response populated from the [RemoveFulfillmentPlaces][]
469
+ # method.
470
+ class RemoveFulfillmentPlacesResponse
471
+ include ::Google::Protobuf::MessageExts
472
+ extend ::Google::Protobuf::MessageExts::ClassMethods
473
+ end
114
474
  end
115
475
  end
116
476
  end