• 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.v2;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/retail/v2/common.proto";
24import "google/cloud/retail/v2/import_config.proto";
25import "google/cloud/retail/v2/product.proto";
26import "google/longrunning/operations.proto";
27import "google/protobuf/empty.proto";
28import "google/protobuf/field_mask.proto";
29import "google/protobuf/timestamp.proto";
30
31option csharp_namespace = "Google.Cloud.Retail.V2";
32option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb";
33option java_multiple_files = true;
34option java_outer_classname = "ProductServiceProto";
35option java_package = "com.google.cloud.retail.v2";
36option objc_class_prefix = "RETAIL";
37option php_namespace = "Google\\Cloud\\Retail\\V2";
38option ruby_package = "Google::Cloud::Retail::V2";
39
40// Service for ingesting [Product][google.cloud.retail.v2.Product] information
41// of the customer's website.
42service ProductService {
43  option (google.api.default_host) = "retail.googleapis.com";
44  option (google.api.oauth_scopes) =
45      "https://www.googleapis.com/auth/cloud-platform";
46
47  // Creates a [Product][google.cloud.retail.v2.Product].
48  rpc CreateProduct(CreateProductRequest) returns (Product) {
49    option (google.api.http) = {
50      post: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
51      body: "product"
52    };
53    option (google.api.method_signature) = "parent,product,product_id";
54  }
55
56  // Gets a [Product][google.cloud.retail.v2.Product].
57  rpc GetProduct(GetProductRequest) returns (Product) {
58    option (google.api.http) = {
59      get: "/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
60    };
61    option (google.api.method_signature) = "name";
62  }
63
64  // Gets a list of [Product][google.cloud.retail.v2.Product]s.
65  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
66    option (google.api.http) = {
67      get: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products"
68    };
69    option (google.api.method_signature) = "parent";
70  }
71
72  // Updates a [Product][google.cloud.retail.v2.Product].
73  rpc UpdateProduct(UpdateProductRequest) returns (Product) {
74    option (google.api.http) = {
75      patch: "/v2/{product.name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
76      body: "product"
77    };
78    option (google.api.method_signature) = "product,update_mask";
79  }
80
81  // Deletes a [Product][google.cloud.retail.v2.Product].
82  rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) {
83    option (google.api.http) = {
84      delete: "/v2/{name=projects/*/locations/*/catalogs/*/branches/*/products/**}"
85    };
86    option (google.api.method_signature) = "name";
87  }
88
89  // Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
90  //
91  // Request processing may be synchronous.
92  // Non-existing items are created.
93  //
94  // Note that it is possible for a subset of the
95  // [Product][google.cloud.retail.v2.Product]s to be successfully updated.
96  rpc ImportProducts(ImportProductsRequest)
97      returns (google.longrunning.Operation) {
98    option (google.api.http) = {
99      post: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import"
100      body: "*"
101    };
102    option (google.longrunning.operation_info) = {
103      response_type: "google.cloud.retail.v2.ImportProductsResponse"
104      metadata_type: "google.cloud.retail.v2.ImportMetadata"
105    };
106  }
107
108  // Updates inventory information for a
109  // [Product][google.cloud.retail.v2.Product] while respecting the last update
110  // timestamps of each inventory field.
111  //
112  // This process is asynchronous and does not require the
113  // [Product][google.cloud.retail.v2.Product] to exist before updating
114  // fulfillment information. If the request is valid, the update is enqueued
115  // and processed downstream. As a consequence, when a response is returned,
116  // updates are not immediately manifested in the
117  // [Product][google.cloud.retail.v2.Product] queried by
118  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
119  // or
120  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
121  //
122  // When inventory is updated with
123  // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
124  // and
125  // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct],
126  // the specified inventory field value(s) overwrite any existing value(s)
127  // while ignoring the last update time for this field. Furthermore, the last
128  // update times for the specified inventory fields are overwritten by the
129  // times of the
130  // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
131  // or
132  // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
133  // request.
134  //
135  // If no inventory fields are set in
136  // [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product],
137  // then any pre-existing inventory information for this product is used.
138  //
139  // If no inventory fields are set in
140  // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask],
141  // then any existing inventory information is preserved.
142  //
143  // Pre-existing inventory information can only be updated with
144  // [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory],
145  // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces],
146  // and
147  // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].
148  //
149  // The returned [Operation][google.longrunning.Operation]s is obsolete after
150  // one day, and the [GetOperation][google.longrunning.Operations.GetOperation]
151  // API returns `NOT_FOUND` afterwards.
152  //
153  // If conflicting updates are issued, the
154  // [Operation][google.longrunning.Operation]s associated with the stale
155  // updates are not marked as [done][google.longrunning.Operation.done] until
156  // they are obsolete.
157  rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) {
158    option (google.api.http) = {
159      post: "/v2/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory"
160      body: "*"
161    };
162    option (google.api.method_signature) = "inventory,set_mask";
163    option (google.longrunning.operation_info) = {
164      response_type: "google.cloud.retail.v2.SetInventoryResponse"
165      metadata_type: "google.cloud.retail.v2.SetInventoryMetadata"
166    };
167  }
168
169  // It is recommended to use the
170  // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
171  // method instead of
172  // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces].
173  // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
174  // achieves the same results but provides more fine-grained control over
175  // ingesting local inventory data.
176  //
177  // Incrementally adds place IDs to
178  // [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
179  //
180  // This process is asynchronous and does not require the
181  // [Product][google.cloud.retail.v2.Product] to exist before updating
182  // fulfillment information. If the request is valid, the update will be
183  // enqueued and processed downstream. As a consequence, when a response is
184  // returned, the added place IDs are not immediately manifested in the
185  // [Product][google.cloud.retail.v2.Product] queried by
186  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
187  // or
188  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
189  //
190  // The returned [Operation][google.longrunning.Operation]s will be obsolete
191  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
192  // API will return NOT_FOUND afterwards.
193  //
194  // If conflicting updates are issued, the
195  // [Operation][google.longrunning.Operation]s associated with the stale
196  // updates will not be marked as [done][google.longrunning.Operation.done]
197  // until being obsolete.
198  rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest)
199      returns (google.longrunning.Operation) {
200    option (google.api.http) = {
201      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addFulfillmentPlaces"
202      body: "*"
203    };
204    option (google.api.method_signature) = "product";
205    option (google.longrunning.operation_info) = {
206      response_type: "google.cloud.retail.v2.AddFulfillmentPlacesResponse"
207      metadata_type: "google.cloud.retail.v2.AddFulfillmentPlacesMetadata"
208    };
209  }
210
211  // It is recommended to use the
212  // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
213  // method instead of
214  // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].
215  // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
216  // achieves the same results but provides more fine-grained control over
217  // ingesting local inventory data.
218  //
219  // Incrementally removes place IDs from a
220  // [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].
221  //
222  // This process is asynchronous and does not require the
223  // [Product][google.cloud.retail.v2.Product] to exist before updating
224  // fulfillment information. If the request is valid, the update will be
225  // enqueued and processed downstream. As a consequence, when a response is
226  // returned, the removed place IDs are not immediately manifested in the
227  // [Product][google.cloud.retail.v2.Product] queried by
228  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
229  // or
230  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
231  //
232  // The returned [Operation][google.longrunning.Operation]s will be obsolete
233  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
234  // API will return NOT_FOUND afterwards.
235  //
236  // If conflicting updates are issued, the
237  // [Operation][google.longrunning.Operation]s associated with the stale
238  // updates will not be marked as [done][google.longrunning.Operation.done]
239  // until being obsolete.
240  rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest)
241      returns (google.longrunning.Operation) {
242    option (google.api.http) = {
243      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeFulfillmentPlaces"
244      body: "*"
245    };
246    option (google.api.method_signature) = "product";
247    option (google.longrunning.operation_info) = {
248      response_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesResponse"
249      metadata_type: "google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata"
250    };
251  }
252
253  // Updates local inventory information for a
254  // [Product][google.cloud.retail.v2.Product] at a list of places, while
255  // respecting the last update timestamps of each inventory field.
256  //
257  // This process is asynchronous and does not require the
258  // [Product][google.cloud.retail.v2.Product] to exist before updating
259  // inventory information. If the request is valid, the update will be enqueued
260  // and processed downstream. As a consequence, when a response is returned,
261  // updates are not immediately manifested in the
262  // [Product][google.cloud.retail.v2.Product] queried by
263  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
264  // or
265  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
266  //
267  // Local inventory information can only be modified using this method.
268  // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
269  // and
270  // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
271  // has no effect on local inventories.
272  //
273  // The returned [Operation][google.longrunning.Operation]s will be obsolete
274  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
275  // API will return NOT_FOUND afterwards.
276  //
277  // If conflicting updates are issued, the
278  // [Operation][google.longrunning.Operation]s associated with the stale
279  // updates will not be marked as [done][google.longrunning.Operation.done]
280  // until being obsolete.
281  rpc AddLocalInventories(AddLocalInventoriesRequest)
282      returns (google.longrunning.Operation) {
283    option (google.api.http) = {
284      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:addLocalInventories"
285      body: "*"
286    };
287    option (google.api.method_signature) = "product";
288    option (google.longrunning.operation_info) = {
289      response_type: "google.cloud.retail.v2.AddLocalInventoriesResponse"
290      metadata_type: "google.cloud.retail.v2.AddLocalInventoriesMetadata"
291    };
292  }
293
294  // Remove local inventory information for a
295  // [Product][google.cloud.retail.v2.Product] at a list of places at a removal
296  // timestamp.
297  //
298  // This process is asynchronous. If the request is valid, the removal will be
299  // enqueued and processed downstream. As a consequence, when a response is
300  // returned, removals are not immediately manifested in the
301  // [Product][google.cloud.retail.v2.Product] queried by
302  // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
303  // or
304  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].
305  //
306  // Local inventory information can only be removed using this method.
307  // [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
308  // and
309  // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
310  // has no effect on local inventories.
311  //
312  // The returned [Operation][google.longrunning.Operation]s will be obsolete
313  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
314  // API will return NOT_FOUND afterwards.
315  //
316  // If conflicting updates are issued, the
317  // [Operation][google.longrunning.Operation]s associated with the stale
318  // updates will not be marked as [done][google.longrunning.Operation.done]
319  // until being obsolete.
320  rpc RemoveLocalInventories(RemoveLocalInventoriesRequest)
321      returns (google.longrunning.Operation) {
322    option (google.api.http) = {
323      post: "/v2/{product=projects/*/locations/*/catalogs/*/branches/*/products/**}:removeLocalInventories"
324      body: "*"
325    };
326    option (google.api.method_signature) = "product";
327    option (google.longrunning.operation_info) = {
328      response_type: "google.cloud.retail.v2.RemoveLocalInventoriesResponse"
329      metadata_type: "google.cloud.retail.v2.RemoveLocalInventoriesMetadata"
330    };
331  }
332}
333
334// Request message for
335// [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct]
336// method.
337message CreateProductRequest {
338  // Required. The parent catalog resource name, such as
339  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.
340  string parent = 1 [
341    (google.api.field_behavior) = REQUIRED,
342    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
343  ];
344
345  // Required. The [Product][google.cloud.retail.v2.Product] to create.
346  Product product = 2 [(google.api.field_behavior) = REQUIRED];
347
348  // Required. The ID to use for the [Product][google.cloud.retail.v2.Product],
349  // which will become the final component of the
350  // [Product.name][google.cloud.retail.v2.Product.name].
351  //
352  // If the caller does not have permission to create the
353  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
354  // exists, a PERMISSION_DENIED error is returned.
355  //
356  // This field must be unique among all
357  // [Product][google.cloud.retail.v2.Product]s with the same
358  // [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an
359  // ALREADY_EXISTS error is returned.
360  //
361  // This field must be a UTF-8 encoded string with a length limit of 128
362  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
363  string product_id = 3 [(google.api.field_behavior) = REQUIRED];
364}
365
366// Request message for
367// [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct]
368// method.
369message GetProductRequest {
370  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
371  // such as
372  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
373  //
374  // If the caller does not have permission to access the
375  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
376  // exists, a PERMISSION_DENIED error is returned.
377  //
378  // If the requested [Product][google.cloud.retail.v2.Product] does not exist,
379  // a NOT_FOUND error is returned.
380  string name = 1 [
381    (google.api.field_behavior) = REQUIRED,
382    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
383  ];
384}
385
386// Request message for
387// [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
388// method.
389message UpdateProductRequest {
390  // Required. The product to update/create.
391  //
392  // If the caller does not have permission to update the
393  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
394  // exists, a PERMISSION_DENIED error is returned.
395  //
396  // If the [Product][google.cloud.retail.v2.Product] to update does not exist
397  // and
398  // [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing]
399  // is not set, a NOT_FOUND error is returned.
400  Product product = 1 [(google.api.field_behavior) = REQUIRED];
401
402  // Indicates which fields in the provided
403  // [Product][google.cloud.retail.v2.Product] to update. The immutable and
404  // output only fields are NOT supported. If not set, all supported fields (the
405  // fields that are neither immutable nor output only) are updated.
406  //
407  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
408  // is returned.
409  //
410  // The attribute key can be updated by setting the mask path as
411  // "attributes.${key_name}". If a key name is present in the mask but not in
412  // the patching product from the request, this key will be deleted after the
413  // update.
414  google.protobuf.FieldMask update_mask = 2;
415
416  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
417  // found, a new [Product][google.cloud.retail.v2.Product] will be created. In
418  // this situation, `update_mask` is ignored.
419  bool allow_missing = 3;
420}
421
422// Request message for
423// [ProductService.DeleteProduct][google.cloud.retail.v2.ProductService.DeleteProduct]
424// method.
425message DeleteProductRequest {
426  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
427  // such as
428  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
429  //
430  // If the caller does not have permission to delete the
431  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
432  // exists, a PERMISSION_DENIED error is returned.
433  //
434  // If the [Product][google.cloud.retail.v2.Product] to delete does not exist,
435  // a NOT_FOUND error is returned.
436  //
437  // The [Product][google.cloud.retail.v2.Product] to delete can neither be a
438  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
439  // [Product][google.cloud.retail.v2.Product] member nor a
440  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
441  // [Product][google.cloud.retail.v2.Product] with more than one
442  // [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an
443  // INVALID_ARGUMENT error is returned.
444  //
445  // All inventory information for the named
446  // [Product][google.cloud.retail.v2.Product] will be deleted.
447  string name = 1 [
448    (google.api.field_behavior) = REQUIRED,
449    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
450  ];
451}
452
453// Request message for
454// [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
455// method.
456message ListProductsRequest {
457  // Required. The parent branch resource name, such as
458  // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use
459  // `default_branch` as the branch ID, to list products under the default
460  // branch.
461  //
462  // If the caller does not have permission to list
463  // [Product][google.cloud.retail.v2.Product]s under this branch, regardless of
464  // whether or not this branch exists, a PERMISSION_DENIED error is returned.
465  string parent = 1 [
466    (google.api.field_behavior) = REQUIRED,
467    (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
468  ];
469
470  // Maximum number of [Product][google.cloud.retail.v2.Product]s to return. If
471  // unspecified, defaults to 100. The maximum allowed value is 1000. Values
472  // above 1000 will be coerced to 1000.
473  //
474  // If this field is negative, an INVALID_ARGUMENT error is returned.
475  int32 page_size = 2;
476
477  // A page token
478  // [ListProductsResponse.next_page_token][google.cloud.retail.v2.ListProductsResponse.next_page_token],
479  // received from a previous
480  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
481  // call. Provide this to retrieve the subsequent page.
482  //
483  // When paginating, all other parameters provided to
484  // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
485  // must match the call that provided the page token. Otherwise, an
486  // INVALID_ARGUMENT error is returned.
487  string page_token = 3;
488
489  // A filter to apply on the list results. Supported features:
490  //
491  // * List all the products under the parent branch if
492  // [filter][google.cloud.retail.v2.ListProductsRequest.filter] is unset.
493  // * List [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]
494  // [Product][google.cloud.retail.v2.Product]s sharing the same
495  //   [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
496  //   [Product][google.cloud.retail.v2.Product]. For example:
497  //     `primary_product_id = "some_product_id"`
498  // * List [Product][google.cloud.retail.v2.Product]s bundled in a
499  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
500  // [Product][google.cloud.retail.v2.Product].
501  //   For example:
502  //     `collection_product_id = "some_product_id"`
503  // * List [Product][google.cloud.retail.v2.Product]s with a partibular type.
504  // For example:
505  //     `type = "PRIMARY"`
506  //     `type = "VARIANT"`
507  //     `type = "COLLECTION"`
508  //
509  // If the field is unrecognizable, an INVALID_ARGUMENT error is returned.
510  //
511  // If the specified
512  // [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]
513  // [Product][google.cloud.retail.v2.Product] or
514  // [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]
515  // [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error
516  // is returned.
517  string filter = 4;
518
519  // The fields of [Product][google.cloud.retail.v2.Product] to return in the
520  // responses. If not set or empty, the following fields are returned:
521  //
522  // * [Product.name][google.cloud.retail.v2.Product.name]
523  // * [Product.id][google.cloud.retail.v2.Product.id]
524  // * [Product.title][google.cloud.retail.v2.Product.title]
525  // * [Product.uri][google.cloud.retail.v2.Product.uri]
526  // * [Product.images][google.cloud.retail.v2.Product.images]
527  // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
528  // * [Product.brands][google.cloud.retail.v2.Product.brands]
529  //
530  // If "*" is provided, all fields are returned.
531  // [Product.name][google.cloud.retail.v2.Product.name] is always returned no
532  // matter what mask is set.
533  //
534  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
535  // is returned.
536  google.protobuf.FieldMask read_mask = 5;
537}
538
539// Response message for
540// [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]
541// method.
542message ListProductsResponse {
543  // The [Product][google.cloud.retail.v2.Product]s.
544  repeated Product products = 1;
545
546  // A token that can be sent as
547  // [ListProductsRequest.page_token][google.cloud.retail.v2.ListProductsRequest.page_token]
548  // to retrieve the next page. If this field is omitted, there are no
549  // subsequent pages.
550  string next_page_token = 2;
551}
552
553// Request message for
554// [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
555// method.
556message SetInventoryRequest {
557  // Required. The inventory information to update. The allowable fields to
558  // update are:
559  //
560  // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
561  // * [Product.availability][google.cloud.retail.v2.Product.availability]
562  // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
563  // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
564  // The updated inventory fields must be specified in
565  // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].
566  //
567  // If
568  // [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name]
569  // is empty or invalid, an INVALID_ARGUMENT error is returned.
570  //
571  // If the caller does not have permission to update the
572  // [Product][google.cloud.retail.v2.Product] named in
573  // [Product.name][google.cloud.retail.v2.Product.name], regardless of whether
574  // or not it exists, a PERMISSION_DENIED error is returned.
575  //
576  // If the [Product][google.cloud.retail.v2.Product] to update does not have
577  // existing inventory information, the provided inventory information will be
578  // inserted.
579  //
580  // If the [Product][google.cloud.retail.v2.Product] to update has existing
581  // inventory information, the provided inventory information will be merged
582  // while respecting the last update time for each inventory field, using the
583  // provided or default value for
584  // [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time].
585  //
586  // The caller can replace place IDs for a subset of fulfillment types in the
587  // following ways:
588  //
589  // * Adds "fulfillment_info" in
590  // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
591  // * Specifies only the desired fulfillment types and corresponding place IDs
592  // to update in
593  // [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
594  //
595  // The caller can clear all place IDs from a subset of fulfillment types in
596  // the following ways:
597  //
598  // * Adds "fulfillment_info" in
599  // [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
600  // * Specifies only the desired fulfillment types to clear in
601  // [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
602  // * Checks that only the desired fulfillment info types have empty
603  // [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]
604  //
605  // The last update time is recorded for the following inventory fields:
606  // * [Product.price_info][google.cloud.retail.v2.Product.price_info]
607  // * [Product.availability][google.cloud.retail.v2.Product.availability]
608  // * [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
609  // * [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
610  //
611  // If a full overwrite of inventory information while ignoring timestamps is
612  // needed,
613  // [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct]
614  // should be invoked instead.
615  Product inventory = 1 [(google.api.field_behavior) = REQUIRED];
616
617  // Indicates which inventory fields in the provided
618  // [Product][google.cloud.retail.v2.Product] to update.
619  //
620  // At least one field must be provided.
621  //
622  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
623  // is returned and the entire update will be ignored.
624  google.protobuf.FieldMask set_mask = 2;
625
626  // The time when the request is issued, used to prevent
627  // out-of-order updates on inventory fields with the last update time
628  // recorded. If not provided, the internal system time will be used.
629  google.protobuf.Timestamp set_time = 3;
630
631  // If set to true, and the [Product][google.cloud.retail.v2.Product] with name
632  // [Product.name][google.cloud.retail.v2.Product.name] is not found, the
633  // inventory update will still be processed and retained for at most 1 day
634  // until the [Product][google.cloud.retail.v2.Product] is created. If set to
635  // false, a NOT_FOUND error is returned if the
636  // [Product][google.cloud.retail.v2.Product] is not found.
637  bool allow_missing = 4;
638}
639
640// Metadata related to the progress of the SetInventory operation.
641// Currently empty because there is no meaningful metadata populated from the
642// [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
643// method.
644message SetInventoryMetadata {}
645
646// Response of the SetInventoryRequest.  Currently empty because
647// there is no meaningful response populated from the
648// [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory]
649// method.
650message SetInventoryResponse {}
651
652// Request message for
653// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
654// method.
655message AddFulfillmentPlacesRequest {
656  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
657  // such as
658  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
659  //
660  // If the caller does not have permission to access the
661  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
662  // exists, a PERMISSION_DENIED error is returned.
663  string product = 1 [
664    (google.api.field_behavior) = REQUIRED,
665    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
666  ];
667
668  // Required. The fulfillment type, including commonly used types (such as
669  // pickup in store and same day delivery), and custom types.
670  //
671  // Supported values:
672  //
673  // * "pickup-in-store"
674  // * "ship-to-store"
675  // * "same-day-delivery"
676  // * "next-day-delivery"
677  // * "custom-type-1"
678  // * "custom-type-2"
679  // * "custom-type-3"
680  // * "custom-type-4"
681  // * "custom-type-5"
682  //
683  // If this field is set to an invalid value other than these, an
684  // INVALID_ARGUMENT error is returned.
685  //
686  // This field directly corresponds to
687  // [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type].
688  string type = 2 [(google.api.field_behavior) = REQUIRED];
689
690  // Required. The IDs for this
691  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
692  // the store IDs for "pickup-in-store" or the region IDs for
693  // "same-day-delivery" to be added for this
694  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
695  // IDs will be automatically ignored.
696  //
697  // At least 1 value is required, and a maximum of 2000 values are allowed.
698  // Each value must be a string with a length limit of 10 characters, matching
699  // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
700  // INVALID_ARGUMENT error is returned.
701  //
702  // If the total number of place IDs exceeds 2000 for this
703  // [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
704  // adding, then the update will be rejected.
705  repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
706
707  // The time when the fulfillment updates are issued, used to prevent
708  // out-of-order updates on fulfillment information. If not provided, the
709  // internal system time will be used.
710  google.protobuf.Timestamp add_time = 4;
711
712  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
713  // found, the fulfillment information will still be processed and retained for
714  // at most 1 day and processed once the
715  // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
716  // NOT_FOUND error is returned if the
717  // [Product][google.cloud.retail.v2.Product] is not found.
718  bool allow_missing = 5;
719}
720
721// Metadata related to the progress of the AddFulfillmentPlaces operation.
722// Currently empty because there is no meaningful metadata populated from the
723// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
724// method.
725message AddFulfillmentPlacesMetadata {}
726
727// Response of the AddFulfillmentPlacesRequest.  Currently empty because
728// there is no meaningful response populated from the
729// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]
730// method.
731message AddFulfillmentPlacesResponse {}
732
733// Request message for
734// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
735// method.
736message AddLocalInventoriesRequest {
737  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
738  // such as
739  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
740  //
741  // If the caller does not have permission to access the
742  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
743  // exists, a PERMISSION_DENIED error is returned.
744  string product = 1 [
745    (google.api.field_behavior) = REQUIRED,
746    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
747  ];
748
749  // Required. A list of inventory information at difference places. Each place
750  // is identified by its place ID. At most 3000 inventories are allowed per
751  // request.
752  repeated LocalInventory local_inventories = 2
753      [(google.api.field_behavior) = REQUIRED];
754
755  // Indicates which inventory fields in the provided list of
756  // [LocalInventory][google.cloud.retail.v2.LocalInventory] to update. The
757  // field is updated to the provided value.
758  //
759  // If a field is set while the place does not have a previous local inventory,
760  // the local inventory at that store is created.
761  //
762  // If a field is set while the value of that field is not provided, the
763  // original field value, if it exists, is deleted.
764  //
765  // If the mask is not set or set with empty paths, all inventory fields will
766  // be updated.
767  //
768  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
769  // is returned and the entire update will be ignored.
770  google.protobuf.FieldMask add_mask = 4;
771
772  // The time when the inventory updates are issued. Used to prevent
773  // out-of-order updates on local inventory fields. If not provided, the
774  // internal system time will be used.
775  google.protobuf.Timestamp add_time = 5;
776
777  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
778  // found, the local inventory will still be processed and retained for at most
779  // 1 day and processed once the [Product][google.cloud.retail.v2.Product] is
780  // created. If set to false, a NOT_FOUND error is returned if the
781  // [Product][google.cloud.retail.v2.Product] is not found.
782  bool allow_missing = 6;
783}
784
785// Metadata related to the progress of the AddLocalInventories operation.
786// Currently empty because there is no meaningful metadata populated from the
787// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
788// method.
789message AddLocalInventoriesMetadata {}
790
791// Response of the
792// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
793// API.  Currently empty because there is no meaningful response populated from
794// the
795// [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories]
796// method.
797message AddLocalInventoriesResponse {}
798
799// Request message for
800// [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
801// method.
802message RemoveLocalInventoriesRequest {
803  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
804  // such as
805  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
806  //
807  // If the caller does not have permission to access the
808  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
809  // exists, a PERMISSION_DENIED error is returned.
810  string product = 1 [
811    (google.api.field_behavior) = REQUIRED,
812    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
813  ];
814
815  // Required. A list of place IDs to have their inventory deleted.
816  // At most 3000 place IDs are allowed per request.
817  repeated string place_ids = 2 [(google.api.field_behavior) = REQUIRED];
818
819  // The time when the inventory deletions are issued. Used to prevent
820  // out-of-order updates and deletions on local inventory fields. If not
821  // provided, the internal system time will be used.
822  google.protobuf.Timestamp remove_time = 5;
823
824  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
825  // found, the local inventory removal request will still be processed and
826  // retained for at most 1 day and processed once the
827  // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
828  // NOT_FOUND error is returned if the
829  // [Product][google.cloud.retail.v2.Product] is not found.
830  bool allow_missing = 3;
831}
832
833// Metadata related to the progress of the RemoveLocalInventories operation.
834// Currently empty because there is no meaningful metadata populated from the
835// [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
836// method.
837message RemoveLocalInventoriesMetadata {}
838
839// Response of the
840// [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
841// API.  Currently empty because there is no meaningful response populated from
842// the
843// [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories]
844// method.
845message RemoveLocalInventoriesResponse {}
846
847// Request message for
848// [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
849// method.
850message RemoveFulfillmentPlacesRequest {
851  // Required. Full resource name of [Product][google.cloud.retail.v2.Product],
852  // such as
853  // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
854  //
855  // If the caller does not have permission to access the
856  // [Product][google.cloud.retail.v2.Product], regardless of whether or not it
857  // exists, a PERMISSION_DENIED error is returned.
858  string product = 1 [
859    (google.api.field_behavior) = REQUIRED,
860    (google.api.resource_reference) = { type: "retail.googleapis.com/Product" }
861  ];
862
863  // Required. The fulfillment type, including commonly used types (such as
864  // pickup in store and same day delivery), and custom types.
865  //
866  // Supported values:
867  //
868  // * "pickup-in-store"
869  // * "ship-to-store"
870  // * "same-day-delivery"
871  // * "next-day-delivery"
872  // * "custom-type-1"
873  // * "custom-type-2"
874  // * "custom-type-3"
875  // * "custom-type-4"
876  // * "custom-type-5"
877  //
878  // If this field is set to an invalid value other than these, an
879  // INVALID_ARGUMENT error is returned.
880  //
881  // This field directly corresponds to
882  // [Product.fulfillment_info.type][google.cloud.retail.v2.FulfillmentInfo.type].
883  string type = 2 [(google.api.field_behavior) = REQUIRED];
884
885  // Required. The IDs for this
886  // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type], such as
887  // the store IDs for "pickup-in-store" or the region IDs for
888  // "same-day-delivery", to be removed for this
889  // [type][google.cloud.retail.v2.RemoveFulfillmentPlacesRequest.type].
890  //
891  // At least 1 value is required, and a maximum of 2000 values are allowed.
892  // Each value must be a string with a length limit of 10 characters, matching
893  // the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
894  // INVALID_ARGUMENT error is returned.
895  repeated string place_ids = 3 [(google.api.field_behavior) = REQUIRED];
896
897  // The time when the fulfillment updates are issued, used to prevent
898  // out-of-order updates on fulfillment information. If not provided, the
899  // internal system time will be used.
900  google.protobuf.Timestamp remove_time = 4;
901
902  // If set to true, and the [Product][google.cloud.retail.v2.Product] is not
903  // found, the fulfillment information will still be processed and retained for
904  // at most 1 day and processed once the
905  // [Product][google.cloud.retail.v2.Product] is created. If set to false, a
906  // NOT_FOUND error is returned if the
907  // [Product][google.cloud.retail.v2.Product] is not found.
908  bool allow_missing = 5;
909}
910
911// Metadata related to the progress of the RemoveFulfillmentPlaces operation.
912// Currently empty because there is no meaningful metadata populated from the
913// [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
914// method.
915message RemoveFulfillmentPlacesMetadata {}
916
917// Response of the RemoveFulfillmentPlacesRequest. Currently empty because there
918// is no meaningful response populated from the
919// [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]
920// method.
921message RemoveFulfillmentPlacesResponse {}
922