Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / cloud / vision / v1 / product_search_service.proto
1 // Copyright 2018 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 //
15
16 syntax = "proto3";
17
18 package google.cloud.vision.v1;
19
20 import "google/api/annotations.proto";
21 import "google/cloud/vision/v1/geometry.proto";
22 import "google/longrunning/operations.proto";
23 import "google/protobuf/empty.proto";
24 import "google/protobuf/field_mask.proto";
25 import "google/protobuf/timestamp.proto";
26 import "google/rpc/status.proto";
27
28 option cc_enable_arenas = true;
29 option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision";
30 option java_multiple_files = true;
31 option java_outer_classname = "ProductSearchServiceProto";
32 option java_package = "com.google.cloud.vision.v1";
33 option objc_class_prefix = "GCVN";
34
35 // Manages Products and ProductSets of reference images for use in product
36 // search. It uses the following resource model:
37 //
38 // - The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet]
39 // resources, named `projects/*/locations/*/productSets/*`, which acts as a way
40 // to put different products into groups to limit identification.
41 //
42 // In parallel,
43 //
44 // - The API has a collection of [Product][google.cloud.vision.v1.Product]
45 // resources, named
46 //   `projects/*/locations/*/products/*`
47 //
48 // - Each [Product][google.cloud.vision.v1.Product] has a collection of
49 // [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
50 //   `projects/*/locations/*/products/*/referenceImages/*`
51 service ProductSearch {
52   // Creates and returns a new ProductSet resource.
53   //
54   // Possible errors:
55   //
56   // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
57   //   4096 characters.
58   rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) {
59     option (google.api.http) = {
60       post: "/v1/{parent=projects/*/locations/*}/productSets"
61       body: "product_set"
62     };
63   }
64
65   // Lists ProductSets in an unspecified order.
66   //
67   // Possible errors:
68   //
69   // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
70   //   than 1.
71   rpc ListProductSets(ListProductSetsRequest)
72       returns (ListProductSetsResponse) {
73     option (google.api.http) = {
74       get: "/v1/{parent=projects/*/locations/*}/productSets"
75     };
76   }
77
78   // Gets information associated with a ProductSet.
79   //
80   // Possible errors:
81   //
82   // * Returns NOT_FOUND if the ProductSet does not exist.
83   rpc GetProductSet(GetProductSetRequest) returns (ProductSet) {
84     option (google.api.http) = {
85       get: "/v1/{name=projects/*/locations/*/productSets/*}"
86     };
87   }
88
89   // Makes changes to a ProductSet resource.
90   // Only display_name can be updated currently.
91   //
92   // Possible errors:
93   //
94   // * Returns NOT_FOUND if the ProductSet does not exist.
95   // * Returns INVALID_ARGUMENT if display_name is present in update_mask but
96   //   missing from the request or longer than 4096 characters.
97   rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) {
98     option (google.api.http) = {
99       patch: "/v1/{product_set.name=projects/*/locations/*/productSets/*}"
100       body: "product_set"
101     };
102   }
103
104   // Permanently deletes a ProductSet. Products and ReferenceImages in the
105   // ProductSet are not deleted.
106   //
107   // The actual image files are not deleted from Google Cloud Storage.
108   //
109   // Possible errors:
110   //
111   // * Returns NOT_FOUND if the ProductSet does not exist.
112   rpc DeleteProductSet(DeleteProductSetRequest)
113       returns (google.protobuf.Empty) {
114     option (google.api.http) = {
115       delete: "/v1/{name=projects/*/locations/*/productSets/*}"
116     };
117   }
118
119   // Creates and returns a new product resource.
120   //
121   // Possible errors:
122   //
123   // * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
124   //   characters.
125   // * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
126   // * Returns INVALID_ARGUMENT if product_category is missing or invalid.
127   rpc CreateProduct(CreateProductRequest) returns (Product) {
128     option (google.api.http) = {
129       post: "/v1/{parent=projects/*/locations/*}/products"
130       body: "product"
131     };
132   }
133
134   // Lists products in an unspecified order.
135   //
136   // Possible errors:
137   //
138   // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
139   rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
140     option (google.api.http) = {
141       get: "/v1/{parent=projects/*/locations/*}/products"
142     };
143   }
144
145   // Gets information associated with a Product.
146   //
147   // Possible errors:
148   //
149   // * Returns NOT_FOUND if the Product does not exist.
150   rpc GetProduct(GetProductRequest) returns (Product) {
151     option (google.api.http) = {
152       get: "/v1/{name=projects/*/locations/*/products/*}"
153     };
154   }
155
156   // Makes changes to a Product resource.
157   // Only the `display_name`, `description`, and `labels` fields can be updated
158   // right now.
159   //
160   // If labels are updated, the change will not be reflected in queries until
161   // the next index time.
162   //
163   // Possible errors:
164   //
165   // * Returns NOT_FOUND if the Product does not exist.
166   // * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
167   //   missing from the request or longer than 4096 characters.
168   // * Returns INVALID_ARGUMENT if description is present in update_mask but is
169   //   longer than 4096 characters.
170   // * Returns INVALID_ARGUMENT if product_category is present in update_mask.
171   rpc UpdateProduct(UpdateProductRequest) returns (Product) {
172     option (google.api.http) = {
173       patch: "/v1/{product.name=projects/*/locations/*/products/*}"
174       body: "product"
175     };
176   }
177
178   // Permanently deletes a product and its reference images.
179   //
180   // Metadata of the product and all its images will be deleted right away, but
181   // search queries against ProductSets containing the product may still work
182   // until all related caches are refreshed.
183   //
184   // Possible errors:
185   //
186   // * Returns NOT_FOUND if the product does not exist.
187   rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) {
188     option (google.api.http) = {
189       delete: "/v1/{name=projects/*/locations/*/products/*}"
190     };
191   }
192
193   // Creates and returns a new ReferenceImage resource.
194   //
195   // The `bounding_poly` field is optional. If `bounding_poly` is not specified,
196   // the system will try to detect regions of interest in the image that are
197   // compatible with the product_category on the parent product. If it is
198   // specified, detection is ALWAYS skipped. The system converts polygons into
199   // non-rotated rectangles.
200   //
201   // Note that the pipeline will resize the image if the image resolution is too
202   // large to process (above 50MP).
203   //
204   // Possible errors:
205   //
206   // * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
207   //   characters.
208   // * Returns INVALID_ARGUMENT if the product does not exist.
209   // * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
210   //   compatible with the parent product's product_category is detected.
211   // * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
212   rpc CreateReferenceImage(CreateReferenceImageRequest)
213       returns (ReferenceImage) {
214     option (google.api.http) = {
215       post: "/v1/{parent=projects/*/locations/*/products/*}/referenceImages"
216       body: "reference_image"
217     };
218   }
219
220   // Permanently deletes a reference image.
221   //
222   // The image metadata will be deleted right away, but search queries
223   // against ProductSets containing the image may still work until all related
224   // caches are refreshed.
225   //
226   // The actual image files are not deleted from Google Cloud Storage.
227   //
228   // Possible errors:
229   //
230   // * Returns NOT_FOUND if the reference image does not exist.
231   rpc DeleteReferenceImage(DeleteReferenceImageRequest)
232       returns (google.protobuf.Empty) {
233     option (google.api.http) = {
234       delete: "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}"
235     };
236   }
237
238   // Lists reference images.
239   //
240   // Possible errors:
241   //
242   // * Returns NOT_FOUND if the parent product does not exist.
243   // * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
244   //   than 1.
245   rpc ListReferenceImages(ListReferenceImagesRequest)
246       returns (ListReferenceImagesResponse) {
247     option (google.api.http) = {
248       get: "/v1/{parent=projects/*/locations/*/products/*}/referenceImages"
249     };
250   }
251
252   // Gets information associated with a ReferenceImage.
253   //
254   // Possible errors:
255   //
256   // * Returns NOT_FOUND if the specified image does not exist.
257   rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) {
258     option (google.api.http) = {
259       get: "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}"
260     };
261   }
262
263   // Adds a Product to the specified ProductSet. If the Product is already
264   // present, no change is made.
265   //
266   // One Product can be added to at most 100 ProductSets.
267   //
268   // Possible errors:
269   //
270   // * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
271   rpc AddProductToProductSet(AddProductToProductSetRequest)
272       returns (google.protobuf.Empty) {
273     option (google.api.http) = {
274       post: "/v1/{name=projects/*/locations/*/productSets/*}:addProduct"
275       body: "*"
276     };
277   }
278
279   // Removes a Product from the specified ProductSet.
280   //
281   // Possible errors:
282   //
283   // * Returns NOT_FOUND If the Product is not found under the ProductSet.
284   rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest)
285       returns (google.protobuf.Empty) {
286     option (google.api.http) = {
287       post: "/v1/{name=projects/*/locations/*/productSets/*}:removeProduct"
288       body: "*"
289     };
290   }
291
292   // Lists the Products in a ProductSet, in an unspecified order. If the
293   // ProductSet does not exist, the products field of the response will be
294   // empty.
295   //
296   // Possible errors:
297   //
298   // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
299   rpc ListProductsInProductSet(ListProductsInProductSetRequest)
300       returns (ListProductsInProductSetResponse) {
301     option (google.api.http) = {
302       get: "/v1/{name=projects/*/locations/*/productSets/*}/products"
303     };
304   }
305
306   // Asynchronous API that imports a list of reference images to specified
307   // product sets based on a list of image information.
308   //
309   // The [google.longrunning.Operation][google.longrunning.Operation] API can be
310   // used to keep track of the progress and results of the request.
311   // `Operation.metadata` contains `BatchOperationMetadata`. (progress)
312   // `Operation.response` contains `ImportProductSetsResponse`. (results)
313   //
314   // The input source of this method is a csv file on Google Cloud Storage.
315   // For the format of the csv file please see
316   // [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
317   rpc ImportProductSets(ImportProductSetsRequest)
318       returns (google.longrunning.Operation) {
319     option (google.api.http) = {
320       post: "/v1/{parent=projects/*/locations/*}/productSets:import"
321       body: "*"
322     };
323   }
324 }
325
326 // A Product contains ReferenceImages.
327 message Product {
328   // A product label represented as a key-value pair.
329   message KeyValue {
330     // The key of the label attached to the product. Cannot be empty and cannot
331     // exceed 128 bytes.
332     string key = 1;
333
334     // The value of the label attached to the product. Cannot be empty and
335     // cannot exceed 128 bytes.
336     string value = 2;
337   }
338
339   // The resource name of the product.
340   //
341   // Format is:
342   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
343   //
344   // This field is ignored when creating a product.
345   string name = 1;
346
347   // The user-provided name for this Product. Must not be empty. Must be at most
348   // 4096 characters long.
349   string display_name = 2;
350
351   // User-provided metadata to be stored with this product. Must be at most 4096
352   // characters long.
353   string description = 3;
354
355   // The category for the product identified by the reference image. This should
356   // be either "homegoods", "apparel", or "toys".
357   //
358   // This field is immutable.
359   string product_category = 4;
360
361   // Key-value pairs that can be attached to a product. At query time,
362   // constraints can be specified based on the product_labels.
363   //
364   // Note that integer values can be provided as strings, e.g. "1199". Only
365   // strings with integer values can match a range-based restriction which is
366   // to be supported soon.
367   //
368   // Multiple values can be assigned to the same key. One product may have up to
369   // 100 product_labels.
370   repeated KeyValue product_labels = 5;
371 }
372
373 // A ProductSet contains Products. A ProductSet can contain a maximum of 1
374 // million reference images. If the limit is exceeded, periodic indexing will
375 // fail.
376 message ProductSet {
377   // The resource name of the ProductSet.
378   //
379   // Format is:
380   // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
381   //
382   // This field is ignored when creating a ProductSet.
383   string name = 1;
384
385   // The user-provided name for this ProductSet. Must not be empty. Must be at
386   // most 4096 characters long.
387   string display_name = 2;
388
389   // Output only. The time at which this ProductSet was last indexed. Query
390   // results will reflect all updates before this time. If this ProductSet has
391   // never been indexed, this field is 0.
392   //
393   // This field is ignored when creating a ProductSet.
394   google.protobuf.Timestamp index_time = 3;
395
396   // Output only. If there was an error with indexing the product set, the field
397   // is populated.
398   //
399   // This field is ignored when creating a ProductSet.
400   google.rpc.Status index_error = 4;
401 }
402
403 // A `ReferenceImage` represents a product image and its associated metadata,
404 // such as bounding boxes.
405 message ReferenceImage {
406   // The resource name of the reference image.
407   //
408   // Format is:
409   //
410   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
411   //
412   // This field is ignored when creating a reference image.
413   string name = 1;
414
415   // The Google Cloud Storage URI of the reference image.
416   //
417   // The URI must start with `gs://`.
418   //
419   // Required.
420   string uri = 2;
421
422   // Bounding polygons around the areas of interest in the reference image.
423   // Optional. If this field is empty, the system will try to detect regions of
424   // interest. At most 10 bounding polygons will be used.
425   //
426   // The provided shape is converted into a non-rotated rectangle. Once
427   // converted, the small edge of the rectangle must be greater than or equal
428   // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
429   // is not).
430   repeated BoundingPoly bounding_polys = 3;
431 }
432
433 // Request message for the `CreateProduct` method.
434 message CreateProductRequest {
435   // The project in which the Product should be created.
436   //
437   // Format is
438   // `projects/PROJECT_ID/locations/LOC_ID`.
439   string parent = 1;
440
441   // The product to create.
442   Product product = 2;
443
444   // A user-supplied resource id for this Product. If set, the server will
445   // attempt to use this value as the resource id. If it is already in use, an
446   // error is returned with code ALREADY_EXISTS. Must be at most 128 characters
447   // long. It cannot contain the character `/`.
448   string product_id = 3;
449 }
450
451 // Request message for the `ListProducts` method.
452 message ListProductsRequest {
453   // The project OR ProductSet from which Products should be listed.
454   //
455   // Format:
456   // `projects/PROJECT_ID/locations/LOC_ID`
457   string parent = 1;
458
459   // The maximum number of items to return. Default 10, maximum 100.
460   int32 page_size = 2;
461
462   // The next_page_token returned from a previous List request, if any.
463   string page_token = 3;
464 }
465
466 // Response message for the `ListProducts` method.
467 message ListProductsResponse {
468   // List of products.
469   repeated Product products = 1;
470
471   // Token to retrieve the next page of results, or empty if there are no more
472   // results in the list.
473   string next_page_token = 2;
474 }
475
476 // Request message for the `GetProduct` method.
477 message GetProductRequest {
478   // Resource name of the Product to get.
479   //
480   // Format is:
481   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
482   string name = 1;
483 }
484
485 // Request message for the `UpdateProduct` method.
486 message UpdateProductRequest {
487   // The Product resource which replaces the one on the server.
488   // product.name is immutable.
489   Product product = 1;
490
491   // The [FieldMask][google.protobuf.FieldMask] that specifies which fields
492   // to update.
493   // If update_mask isn't specified, all mutable fields are to be updated.
494   // Valid mask paths include `product_labels`, `display_name`, and
495   // `description`.
496   google.protobuf.FieldMask update_mask = 2;
497 }
498
499 // Request message for the `DeleteProduct` method.
500 message DeleteProductRequest {
501   // Resource name of product to delete.
502   //
503   // Format is:
504   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
505   string name = 1;
506 }
507
508 // Request message for the `CreateProductSet` method.
509 message CreateProductSetRequest {
510   // The project in which the ProductSet should be created.
511   //
512   // Format is `projects/PROJECT_ID/locations/LOC_ID`.
513   string parent = 1;
514
515   // The ProductSet to create.
516   ProductSet product_set = 2;
517
518   // A user-supplied resource id for this ProductSet. If set, the server will
519   // attempt to use this value as the resource id. If it is already in use, an
520   // error is returned with code ALREADY_EXISTS. Must be at most 128 characters
521   // long. It cannot contain the character `/`.
522   string product_set_id = 3;
523 }
524
525 // Request message for the `ListProductSets` method.
526 message ListProductSetsRequest {
527   // The project from which ProductSets should be listed.
528   //
529   // Format is `projects/PROJECT_ID/locations/LOC_ID`.
530   string parent = 1;
531
532   // The maximum number of items to return. Default 10, maximum 100.
533   int32 page_size = 2;
534
535   // The next_page_token returned from a previous List request, if any.
536   string page_token = 3;
537 }
538
539 // Response message for the `ListProductSets` method.
540 message ListProductSetsResponse {
541   // List of ProductSets.
542   repeated ProductSet product_sets = 1;
543
544   // Token to retrieve the next page of results, or empty if there are no more
545   // results in the list.
546   string next_page_token = 2;
547 }
548
549 // Request message for the `GetProductSet` method.
550 message GetProductSetRequest {
551   // Resource name of the ProductSet to get.
552   //
553   // Format is:
554   // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
555   string name = 1;
556 }
557
558 // Request message for the `UpdateProductSet` method.
559 message UpdateProductSetRequest {
560   // The ProductSet resource which replaces the one on the server.
561   ProductSet product_set = 1;
562
563   // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
564   // update.
565   // If update_mask isn't specified, all mutable fields are to be updated.
566   // Valid mask path is `display_name`.
567   google.protobuf.FieldMask update_mask = 2;
568 }
569
570 // Request message for the `DeleteProductSet` method.
571 message DeleteProductSetRequest {
572   // Resource name of the ProductSet to delete.
573   //
574   // Format is:
575   // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
576   string name = 1;
577 }
578
579 // Request message for the `CreateReferenceImage` method.
580 message CreateReferenceImageRequest {
581   // Resource name of the product in which to create the reference image.
582   //
583   // Format is
584   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
585   string parent = 1;
586
587   // The reference image to create.
588   // If an image ID is specified, it is ignored.
589   ReferenceImage reference_image = 2;
590
591   // A user-supplied resource id for the ReferenceImage to be added. If set,
592   // the server will attempt to use this value as the resource id. If it is
593   // already in use, an error is returned with code ALREADY_EXISTS. Must be at
594   // most 128 characters long. It cannot contain the character `/`.
595   string reference_image_id = 3;
596 }
597
598 // Request message for the `ListReferenceImages` method.
599 message ListReferenceImagesRequest {
600   // Resource name of the product containing the reference images.
601   //
602   // Format is
603   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
604   string parent = 1;
605
606   // The maximum number of items to return. Default 10, maximum 100.
607   int32 page_size = 2;
608
609   // A token identifying a page of results to be returned. This is the value
610   // of `nextPageToken` returned in a previous reference image list request.
611   //
612   // Defaults to the first page if not specified.
613   string page_token = 3;
614 }
615
616 // Response message for the `ListReferenceImages` method.
617 message ListReferenceImagesResponse {
618   // The list of reference images.
619   repeated ReferenceImage reference_images = 1;
620
621   // The maximum number of items to return. Default 10, maximum 100.
622   int32 page_size = 2;
623
624   // The next_page_token returned from a previous List request, if any.
625   string next_page_token = 3;
626 }
627
628 // Request message for the `GetReferenceImage` method.
629 message GetReferenceImageRequest {
630   // The resource name of the ReferenceImage to get.
631   //
632   // Format is:
633   //
634   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
635   string name = 1;
636 }
637
638 // Request message for the `DeleteReferenceImage` method.
639 message DeleteReferenceImageRequest {
640   // The resource name of the reference image to delete.
641   //
642   // Format is:
643   //
644   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
645   string name = 1;
646 }
647
648 // Request message for the `AddProductToProductSet` method.
649 message AddProductToProductSetRequest {
650   // The resource name for the ProductSet to modify.
651   //
652   // Format is:
653   // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
654   string name = 1;
655
656   // The resource name for the Product to be added to this ProductSet.
657   //
658   // Format is:
659   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
660   string product = 2;
661 }
662
663 // Request message for the `RemoveProductFromProductSet` method.
664 message RemoveProductFromProductSetRequest {
665   // The resource name for the ProductSet to modify.
666   //
667   // Format is:
668   // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
669   string name = 1;
670
671   // The resource name for the Product to be removed from this ProductSet.
672   //
673   // Format is:
674   // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
675   string product = 2;
676 }
677
678 // Request message for the `ListProductsInProductSet` method.
679 message ListProductsInProductSetRequest {
680   // The ProductSet resource for which to retrieve Products.
681   //
682   // Format is:
683   // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
684   string name = 1;
685
686   // The maximum number of items to return. Default 10, maximum 100.
687   int32 page_size = 2;
688
689   // The next_page_token returned from a previous List request, if any.
690   string page_token = 3;
691 }
692
693 // Response message for the `ListProductsInProductSet` method.
694 message ListProductsInProductSetResponse {
695   // The list of Products.
696   repeated Product products = 1;
697
698   // Token to retrieve the next page of results, or empty if there are no more
699   // results in the list.
700   string next_page_token = 2;
701 }
702
703 // The Google Cloud Storage location for a csv file which preserves a list of
704 // ImportProductSetRequests in each line.
705 message ImportProductSetsGcsSource {
706   // The Google Cloud Storage URI of the input csv file.
707   //
708   // The URI must start with `gs://`.
709   //
710   // The format of the input csv file should be one image per line.
711   // In each line, there are 8 columns.
712   //
713   // 1.  image-uri
714   // 2.  image-id
715   // 3.  product-set-id
716   // 4.  product-id
717   // 5.  product-category
718   // 6.  product-display-name
719   // 7.  labels
720   // 8.  bounding-poly
721   //
722   // The `image-uri`, `product-set-id`, `product-id`, and `product-category`
723   // columns are required. All other columns are optional.
724   //
725   // If the `ProductSet` or `Product` specified by the `product-set-id` and
726   // `product-id` values does not exist, then the system will create a new
727   // `ProductSet` or `Product` for the image. In this case, the
728   // `product-display-name` column refers to
729   // [display_name][google.cloud.vision.v1.Product.display_name], the
730   // `product-category` column refers to
731   // [product_category][google.cloud.vision.v1.Product.product_category], and
732   // the `labels` column refers to
733   // [product_labels][google.cloud.vision.v1.Product.product_labels].
734   //
735   // The `image-id` column is optional but must be unique if provided. If it is
736   // empty, the system will automatically assign a unique id to the image.
737   //
738   // The `product-display-name` column is optional. If it is empty, the system
739   // sets the [display_name][google.cloud.vision.v1.Product.display_name] field
740   // for the product to a space (" "). You can update the `display_name` later
741   // by using the API.
742   //
743   // If a `Product` with the specified `product-id` already exists, then the
744   // system ignores the `product-display-name`, `product-category`, and `labels`
745   // columns.
746   //
747   // The `labels` column (optional) is a line containing a list of
748   // comma-separated key-value pairs, in the following format:
749   //
750   //     "key_1=value_1,key_2=value_2,...,key_n=value_n"
751   //
752   // The `bounding-poly` column (optional) identifies one region of
753   // interest from the image in the same manner as `CreateReferenceImage`. If
754   // you do not specify the `bounding-poly` column, then the system will try to
755   // detect regions of interest automatically.
756   //
757   // At most one `bounding-poly` column is allowed per line. If the image
758   // contains multiple regions of interest, add a line to the CSV file that
759   // includes the same product information, and the `bounding-poly` values for
760   // each region of interest.
761   //
762   // The `bounding-poly` column must contain an even number of comma-separated
763   // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
764   // non-negative integers for absolute bounding polygons, and float values
765   // in [0, 1] for normalized bounding polygons.
766   //
767   // The system will resize the image if the image resolution is too
768   // large to process (larger than 20MP).
769   string csv_file_uri = 1;
770 }
771
772 // The input content for the `ImportProductSets` method.
773 message ImportProductSetsInputConfig {
774   // The source of the input.
775   oneof source {
776     // The Google Cloud Storage location for a csv file which preserves a list
777     // of ImportProductSetRequests in each line.
778     ImportProductSetsGcsSource gcs_source = 1;
779   }
780 }
781
782 // Request message for the `ImportProductSets` method.
783 message ImportProductSetsRequest {
784   // The project in which the ProductSets should be imported.
785   //
786   // Format is `projects/PROJECT_ID/locations/LOC_ID`.
787   string parent = 1;
788
789   // The input content for the list of requests.
790   ImportProductSetsInputConfig input_config = 2;
791 }
792
793 // Response message for the `ImportProductSets` method.
794 //
795 // This message is returned by the
796 // [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation]
797 // method in the returned
798 // [google.longrunning.Operation.response][google.longrunning.Operation.response]
799 // field.
800 message ImportProductSetsResponse {
801   // The list of reference_images that are imported successfully.
802   repeated ReferenceImage reference_images = 1;
803
804   // The rpc status for each ImportProductSet request, including both successes
805   // and errors.
806   //
807   // The number of statuses here matches the number of lines in the csv file,
808   // and statuses[i] stores the success or failure status of processing the i-th
809   // line of the csv, starting from line 0.
810   repeated google.rpc.Status statuses = 2;
811 }
812
813 // Metadata for the batch operations such as the current state.
814 //
815 // This is included in the `metadata` field of the `Operation` returned by the
816 // `GetOperation` call of the `google::longrunning::Operations` service.
817 message BatchOperationMetadata {
818   // Enumerates the possible states that the batch request can be in.
819   enum State {
820     // Invalid.
821     STATE_UNSPECIFIED = 0;
822
823     // Request is actively being processed.
824     PROCESSING = 1;
825
826     // The request is done and at least one item has been successfully
827     // processed.
828     SUCCESSFUL = 2;
829
830     // The request is done and no item has been successfully processed.
831     FAILED = 3;
832
833     // The request is done after the longrunning.Operations.CancelOperation has
834     // been called by the user.  Any records that were processed before the
835     // cancel command are output as specified in the request.
836     CANCELLED = 4;
837   }
838
839   // The current state of the batch operation.
840   State state = 1;
841
842   // The time when the batch request was submitted to the server.
843   google.protobuf.Timestamp submit_time = 2;
844
845   // The time when the batch request is finished and
846   // [google.longrunning.Operation.done][google.longrunning.Operation.done] is
847   // set to true.
848   google.protobuf.Timestamp end_time = 3;
849 }