aboutsummaryrefslogtreecommitdiff
path: root/google/cloud/vision/v1/product_search_service.proto
blob: 5bbfebfb56f51b2934329a058f0173fd32c2d7a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.vision.v1;

import "google/api/annotations.proto";
import "google/cloud/vision/v1/geometry.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";

option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision";
option java_multiple_files = true;
option java_outer_classname = "ProductSearchServiceProto";
option java_package = "com.google.cloud.vision.v1";
option objc_class_prefix = "GCVN";

// Manages Products and ProductSets of reference images for use in product
// search. It uses the following resource model:
//
// - The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet]
// resources, named `projects/*/locations/*/productSets/*`, which acts as a way
// to put different products into groups to limit identification.
//
// In parallel,
//
// - The API has a collection of [Product][google.cloud.vision.v1.Product]
// resources, named
//   `projects/*/locations/*/products/*`
//
// - Each [Product][google.cloud.vision.v1.Product] has a collection of
// [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
//   `projects/*/locations/*/products/*/referenceImages/*`
service ProductSearch {
  // Creates and returns a new ProductSet resource.
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
  //   4096 characters.
  rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) {
    option (google.api.http) = {
      post: "/v1/{parent=projects/*/locations/*}/productSets"
      body: "product_set"
    };
  }

  // Lists ProductSets in an unspecified order.
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
  //   than 1.
  rpc ListProductSets(ListProductSetsRequest)
      returns (ListProductSetsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*}/productSets"
    };
  }

  // Gets information associated with a ProductSet.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the ProductSet does not exist.
  rpc GetProductSet(GetProductSetRequest) returns (ProductSet) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/productSets/*}"
    };
  }

  // Makes changes to a ProductSet resource.
  // Only display_name can be updated currently.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the ProductSet does not exist.
  // * Returns INVALID_ARGUMENT if display_name is present in update_mask but
  //   missing from the request or longer than 4096 characters.
  rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) {
    option (google.api.http) = {
      patch: "/v1/{product_set.name=projects/*/locations/*/productSets/*}"
      body: "product_set"
    };
  }

  // Permanently deletes a ProductSet. Products and ReferenceImages in the
  // ProductSet are not deleted.
  //
  // The actual image files are not deleted from Google Cloud Storage.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the ProductSet does not exist.
  rpc DeleteProductSet(DeleteProductSetRequest)
      returns (google.protobuf.Empty) {
    option (google.api.http) = {
      delete: "/v1/{name=projects/*/locations/*/productSets/*}"
    };
  }

  // Creates and returns a new product resource.
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
  //   characters.
  // * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  // * Returns INVALID_ARGUMENT if product_category is missing or invalid.
  rpc CreateProduct(CreateProductRequest) returns (Product) {
    option (google.api.http) = {
      post: "/v1/{parent=projects/*/locations/*}/products"
      body: "product"
    };
  }

  // Lists products in an unspecified order.
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*}/products"
    };
  }

  // Gets information associated with a Product.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the Product does not exist.
  rpc GetProduct(GetProductRequest) returns (Product) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/products/*}"
    };
  }

  // Makes changes to a Product resource.
  // Only the `display_name`, `description`, and `labels` fields can be updated
  // right now.
  //
  // If labels are updated, the change will not be reflected in queries until
  // the next index time.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the Product does not exist.
  // * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
  //   missing from the request or longer than 4096 characters.
  // * Returns INVALID_ARGUMENT if description is present in update_mask but is
  //   longer than 4096 characters.
  // * Returns INVALID_ARGUMENT if product_category is present in update_mask.
  rpc UpdateProduct(UpdateProductRequest) returns (Product) {
    option (google.api.http) = {
      patch: "/v1/{product.name=projects/*/locations/*/products/*}"
      body: "product"
    };
  }

  // Permanently deletes a product and its reference images.
  //
  // Metadata of the product and all its images will be deleted right away, but
  // search queries against ProductSets containing the product may still work
  // until all related caches are refreshed.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the product does not exist.
  rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {
      delete: "/v1/{name=projects/*/locations/*/products/*}"
    };
  }

  // Creates and returns a new ReferenceImage resource.
  //
  // The `bounding_poly` field is optional. If `bounding_poly` is not specified,
  // the system will try to detect regions of interest in the image that are
  // compatible with the product_category on the parent product. If it is
  // specified, detection is ALWAYS skipped. The system converts polygons into
  // non-rotated rectangles.
  //
  // Note that the pipeline will resize the image if the image resolution is too
  // large to process (above 50MP).
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
  //   characters.
  // * Returns INVALID_ARGUMENT if the product does not exist.
  // * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
  //   compatible with the parent product's product_category is detected.
  // * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
  rpc CreateReferenceImage(CreateReferenceImageRequest)
      returns (ReferenceImage) {
    option (google.api.http) = {
      post: "/v1/{parent=projects/*/locations/*/products/*}/referenceImages"
      body: "reference_image"
    };
  }

  // Permanently deletes a reference image.
  //
  // The image metadata will be deleted right away, but search queries
  // against ProductSets containing the image may still work until all related
  // caches are refreshed.
  //
  // The actual image files are not deleted from Google Cloud Storage.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the reference image does not exist.
  rpc DeleteReferenceImage(DeleteReferenceImageRequest)
      returns (google.protobuf.Empty) {
    option (google.api.http) = {
      delete: "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}"
    };
  }

  // Lists reference images.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the parent product does not exist.
  // * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
  //   than 1.
  rpc ListReferenceImages(ListReferenceImagesRequest)
      returns (ListReferenceImagesResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*/products/*}/referenceImages"
    };
  }

  // Gets information associated with a ReferenceImage.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the specified image does not exist.
  rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/products/*/referenceImages/*}"
    };
  }

  // Adds a Product to the specified ProductSet. If the Product is already
  // present, no change is made.
  //
  // One Product can be added to at most 100 ProductSets.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
  rpc AddProductToProductSet(AddProductToProductSetRequest)
      returns (google.protobuf.Empty) {
    option (google.api.http) = {
      post: "/v1/{name=projects/*/locations/*/productSets/*}:addProduct"
      body: "*"
    };
  }

  // Removes a Product from the specified ProductSet.
  //
  // Possible errors:
  //
  // * Returns NOT_FOUND If the Product is not found under the ProductSet.
  rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest)
      returns (google.protobuf.Empty) {
    option (google.api.http) = {
      post: "/v1/{name=projects/*/locations/*/productSets/*}:removeProduct"
      body: "*"
    };
  }

  // Lists the Products in a ProductSet, in an unspecified order. If the
  // ProductSet does not exist, the products field of the response will be
  // empty.
  //
  // Possible errors:
  //
  // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
  rpc ListProductsInProductSet(ListProductsInProductSetRequest)
      returns (ListProductsInProductSetResponse) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/productSets/*}/products"
    };
  }

  // Asynchronous API that imports a list of reference images to specified
  // product sets based on a list of image information.
  //
  // The [google.longrunning.Operation][google.longrunning.Operation] API can be
  // used to keep track of the progress and results of the request.
  // `Operation.metadata` contains `BatchOperationMetadata`. (progress)
  // `Operation.response` contains `ImportProductSetsResponse`. (results)
  //
  // The input source of this method is a csv file on Google Cloud Storage.
  // For the format of the csv file please see
  // [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
  rpc ImportProductSets(ImportProductSetsRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1/{parent=projects/*/locations/*}/productSets:import"
      body: "*"
    };
  }
}

// A Product contains ReferenceImages.
message Product {
  // A product label represented as a key-value pair.
  message KeyValue {
    // The key of the label attached to the product. Cannot be empty and cannot
    // exceed 128 bytes.
    string key = 1;

    // The value of the label attached to the product. Cannot be empty and
    // cannot exceed 128 bytes.
    string value = 2;
  }

  // The resource name of the product.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  //
  // This field is ignored when creating a product.
  string name = 1;

  // The user-provided name for this Product. Must not be empty. Must be at most
  // 4096 characters long.
  string display_name = 2;

  // User-provided metadata to be stored with this product. Must be at most 4096
  // characters long.
  string description = 3;

  // The category for the product identified by the reference image. This should
  // be either "homegoods", "apparel", or "toys".
  //
  // This field is immutable.
  string product_category = 4;

  // Key-value pairs that can be attached to a product. At query time,
  // constraints can be specified based on the product_labels.
  //
  // Note that integer values can be provided as strings, e.g. "1199". Only
  // strings with integer values can match a range-based restriction which is
  // to be supported soon.
  //
  // Multiple values can be assigned to the same key. One product may have up to
  // 100 product_labels.
  repeated KeyValue product_labels = 5;
}

// A ProductSet contains Products. A ProductSet can contain a maximum of 1
// million reference images. If the limit is exceeded, periodic indexing will
// fail.
message ProductSet {
  // The resource name of the ProductSet.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
  //
  // This field is ignored when creating a ProductSet.
  string name = 1;

  // The user-provided name for this ProductSet. Must not be empty. Must be at
  // most 4096 characters long.
  string display_name = 2;

  // Output only. The time at which this ProductSet was last indexed. Query
  // results will reflect all updates before this time. If this ProductSet has
  // never been indexed, this field is 0.
  //
  // This field is ignored when creating a ProductSet.
  google.protobuf.Timestamp index_time = 3;

  // Output only. If there was an error with indexing the product set, the field
  // is populated.
  //
  // This field is ignored when creating a ProductSet.
  google.rpc.Status index_error = 4;
}

// A `ReferenceImage` represents a product image and its associated metadata,
// such as bounding boxes.
message ReferenceImage {
  // The resource name of the reference image.
  //
  // Format is:
  //
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
  //
  // This field is ignored when creating a reference image.
  string name = 1;

  // The Google Cloud Storage URI of the reference image.
  //
  // The URI must start with `gs://`.
  //
  // Required.
  string uri = 2;

  // Bounding polygons around the areas of interest in the reference image.
  // Optional. If this field is empty, the system will try to detect regions of
  // interest. At most 10 bounding polygons will be used.
  //
  // The provided shape is converted into a non-rotated rectangle. Once
  // converted, the small edge of the rectangle must be greater than or equal
  // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
  // is not).
  repeated BoundingPoly bounding_polys = 3;
}

// Request message for the `CreateProduct` method.
message CreateProductRequest {
  // The project in which the Product should be created.
  //
  // Format is
  // `projects/PROJECT_ID/locations/LOC_ID`.
  string parent = 1;

  // The product to create.
  Product product = 2;

  // A user-supplied resource id for this Product. If set, the server will
  // attempt to use this value as the resource id. If it is already in use, an
  // error is returned with code ALREADY_EXISTS. Must be at most 128 characters
  // long. It cannot contain the character `/`.
  string product_id = 3;
}

// Request message for the `ListProducts` method.
message ListProductsRequest {
  // The project OR ProductSet from which Products should be listed.
  //
  // Format:
  // `projects/PROJECT_ID/locations/LOC_ID`
  string parent = 1;

  // The maximum number of items to return. Default 10, maximum 100.
  int32 page_size = 2;

  // The next_page_token returned from a previous List request, if any.
  string page_token = 3;
}

// Response message for the `ListProducts` method.
message ListProductsResponse {
  // List of products.
  repeated Product products = 1;

  // Token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;
}

// Request message for the `GetProduct` method.
message GetProductRequest {
  // Resource name of the Product to get.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  string name = 1;
}

// Request message for the `UpdateProduct` method.
message UpdateProductRequest {
  // The Product resource which replaces the one on the server.
  // product.name is immutable.
  Product product = 1;

  // The [FieldMask][google.protobuf.FieldMask] that specifies which fields
  // to update.
  // If update_mask isn't specified, all mutable fields are to be updated.
  // Valid mask paths include `product_labels`, `display_name`, and
  // `description`.
  google.protobuf.FieldMask update_mask = 2;
}

// Request message for the `DeleteProduct` method.
message DeleteProductRequest {
  // Resource name of product to delete.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  string name = 1;
}

// Request message for the `CreateProductSet` method.
message CreateProductSetRequest {
  // The project in which the ProductSet should be created.
  //
  // Format is `projects/PROJECT_ID/locations/LOC_ID`.
  string parent = 1;

  // The ProductSet to create.
  ProductSet product_set = 2;

  // A user-supplied resource id for this ProductSet. If set, the server will
  // attempt to use this value as the resource id. If it is already in use, an
  // error is returned with code ALREADY_EXISTS. Must be at most 128 characters
  // long. It cannot contain the character `/`.
  string product_set_id = 3;
}

// Request message for the `ListProductSets` method.
message ListProductSetsRequest {
  // The project from which ProductSets should be listed.
  //
  // Format is `projects/PROJECT_ID/locations/LOC_ID`.
  string parent = 1;

  // The maximum number of items to return. Default 10, maximum 100.
  int32 page_size = 2;

  // The next_page_token returned from a previous List request, if any.
  string page_token = 3;
}

// Response message for the `ListProductSets` method.
message ListProductSetsResponse {
  // List of ProductSets.
  repeated ProductSet product_sets = 1;

  // Token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;
}

// Request message for the `GetProductSet` method.
message GetProductSetRequest {
  // Resource name of the ProductSet to get.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`
  string name = 1;
}

// Request message for the `UpdateProductSet` method.
message UpdateProductSetRequest {
  // The ProductSet resource which replaces the one on the server.
  ProductSet product_set = 1;

  // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to
  // update.
  // If update_mask isn't specified, all mutable fields are to be updated.
  // Valid mask path is `display_name`.
  google.protobuf.FieldMask update_mask = 2;
}

// Request message for the `DeleteProductSet` method.
message DeleteProductSetRequest {
  // Resource name of the ProductSet to delete.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
  string name = 1;
}

// Request message for the `CreateReferenceImage` method.
message CreateReferenceImageRequest {
  // Resource name of the product in which to create the reference image.
  //
  // Format is
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  string parent = 1;

  // The reference image to create.
  // If an image ID is specified, it is ignored.
  ReferenceImage reference_image = 2;

  // A user-supplied resource id for the ReferenceImage to be added. If set,
  // the server will attempt to use this value as the resource id. If it is
  // already in use, an error is returned with code ALREADY_EXISTS. Must be at
  // most 128 characters long. It cannot contain the character `/`.
  string reference_image_id = 3;
}

// Request message for the `ListReferenceImages` method.
message ListReferenceImagesRequest {
  // Resource name of the product containing the reference images.
  //
  // Format is
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
  string parent = 1;

  // The maximum number of items to return. Default 10, maximum 100.
  int32 page_size = 2;

  // A token identifying a page of results to be returned. This is the value
  // of `nextPageToken` returned in a previous reference image list request.
  //
  // Defaults to the first page if not specified.
  string page_token = 3;
}

// Response message for the `ListReferenceImages` method.
message ListReferenceImagesResponse {
  // The list of reference images.
  repeated ReferenceImage reference_images = 1;

  // The maximum number of items to return. Default 10, maximum 100.
  int32 page_size = 2;

  // The next_page_token returned from a previous List request, if any.
  string next_page_token = 3;
}

// Request message for the `GetReferenceImage` method.
message GetReferenceImageRequest {
  // The resource name of the ReferenceImage to get.
  //
  // Format is:
  //
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
  string name = 1;
}

// Request message for the `DeleteReferenceImage` method.
message DeleteReferenceImageRequest {
  // The resource name of the reference image to delete.
  //
  // Format is:
  //
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
  string name = 1;
}

// Request message for the `AddProductToProductSet` method.
message AddProductToProductSetRequest {
  // The resource name for the ProductSet to modify.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
  string name = 1;

  // The resource name for the Product to be added to this ProductSet.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  string product = 2;
}

// Request message for the `RemoveProductFromProductSet` method.
message RemoveProductFromProductSetRequest {
  // The resource name for the ProductSet to modify.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
  string name = 1;

  // The resource name for the Product to be removed from this ProductSet.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
  string product = 2;
}

// Request message for the `ListProductsInProductSet` method.
message ListProductsInProductSetRequest {
  // The ProductSet resource for which to retrieve Products.
  //
  // Format is:
  // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
  string name = 1;

  // The maximum number of items to return. Default 10, maximum 100.
  int32 page_size = 2;

  // The next_page_token returned from a previous List request, if any.
  string page_token = 3;
}

// Response message for the `ListProductsInProductSet` method.
message ListProductsInProductSetResponse {
  // The list of Products.
  repeated Product products = 1;

  // Token to retrieve the next page of results, or empty if there are no more
  // results in the list.
  string next_page_token = 2;
}

// The Google Cloud Storage location for a csv file which preserves a list of
// ImportProductSetRequests in each line.
message ImportProductSetsGcsSource {
  // The Google Cloud Storage URI of the input csv file.
  //
  // The URI must start with `gs://`.
  //
  // The format of the input csv file should be one image per line.
  // In each line, there are 8 columns.
  //
  // 1.  image-uri
  // 2.  image-id
  // 3.  product-set-id
  // 4.  product-id
  // 5.  product-category
  // 6.  product-display-name
  // 7.  labels
  // 8.  bounding-poly
  //
  // The `image-uri`, `product-set-id`, `product-id`, and `product-category`
  // columns are required. All other columns are optional.
  //
  // If the `ProductSet` or `Product` specified by the `product-set-id` and
  // `product-id` values does not exist, then the system will create a new
  // `ProductSet` or `Product` for the image. In this case, the
  // `product-display-name` column refers to
  // [display_name][google.cloud.vision.v1.Product.display_name], the
  // `product-category` column refers to
  // [product_category][google.cloud.vision.v1.Product.product_category], and
  // the `labels` column refers to
  // [product_labels][google.cloud.vision.v1.Product.product_labels].
  //
  // The `image-id` column is optional but must be unique if provided. If it is
  // empty, the system will automatically assign a unique id to the image.
  //
  // The `product-display-name` column is optional. If it is empty, the system
  // sets the [display_name][google.cloud.vision.v1.Product.display_name] field
  // for the product to a space (" "). You can update the `display_name` later
  // by using the API.
  //
  // If a `Product` with the specified `product-id` already exists, then the
  // system ignores the `product-display-name`, `product-category`, and `labels`
  // columns.
  //
  // The `labels` column (optional) is a line containing a list of
  // comma-separated key-value pairs, in the following format:
  //
  //     "key_1=value_1,key_2=value_2,...,key_n=value_n"
  //
  // The `bounding-poly` column (optional) identifies one region of
  // interest from the image in the same manner as `CreateReferenceImage`. If
  // you do not specify the `bounding-poly` column, then the system will try to
  // detect regions of interest automatically.
  //
  // At most one `bounding-poly` column is allowed per line. If the image
  // contains multiple regions of interest, add a line to the CSV file that
  // includes the same product information, and the `bounding-poly` values for
  // each region of interest.
  //
  // The `bounding-poly` column must contain an even number of comma-separated
  // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use
  // non-negative integers for absolute bounding polygons, and float values
  // in [0, 1] for normalized bounding polygons.
  //
  // The system will resize the image if the image resolution is too
  // large to process (larger than 20MP).
  string csv_file_uri = 1;
}

// The input content for the `ImportProductSets` method.
message ImportProductSetsInputConfig {
  // The source of the input.
  oneof source {
    // The Google Cloud Storage location for a csv file which preserves a list
    // of ImportProductSetRequests in each line.
    ImportProductSetsGcsSource gcs_source = 1;
  }
}

// Request message for the `ImportProductSets` method.
message ImportProductSetsRequest {
  // The project in which the ProductSets should be imported.
  //
  // Format is `projects/PROJECT_ID/locations/LOC_ID`.
  string parent = 1;

  // The input content for the list of requests.
  ImportProductSetsInputConfig input_config = 2;
}

// Response message for the `ImportProductSets` method.
//
// This message is returned by the
// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation]
// method in the returned
// [google.longrunning.Operation.response][google.longrunning.Operation.response]
// field.
message ImportProductSetsResponse {
  // The list of reference_images that are imported successfully.
  repeated ReferenceImage reference_images = 1;

  // The rpc status for each ImportProductSet request, including both successes
  // and errors.
  //
  // The number of statuses here matches the number of lines in the csv file,
  // and statuses[i] stores the success or failure status of processing the i-th
  // line of the csv, starting from line 0.
  repeated google.rpc.Status statuses = 2;
}

// Metadata for the batch operations such as the current state.
//
// This is included in the `metadata` field of the `Operation` returned by the
// `GetOperation` call of the `google::longrunning::Operations` service.
message BatchOperationMetadata {
  // Enumerates the possible states that the batch request can be in.
  enum State {
    // Invalid.
    STATE_UNSPECIFIED = 0;

    // Request is actively being processed.
    PROCESSING = 1;

    // The request is done and at least one item has been successfully
    // processed.
    SUCCESSFUL = 2;

    // The request is done and no item has been successfully processed.
    FAILED = 3;

    // The request is done after the longrunning.Operations.CancelOperation has
    // been called by the user.  Any records that were processed before the
    // cancel command are output as specified in the request.
    CANCELLED = 4;
  }

  // The current state of the batch operation.
  State state = 1;

  // The time when the batch request was submitted to the server.
  google.protobuf.Timestamp submit_time = 2;

  // The time when the batch request is finished and
  // [google.longrunning.Operation.done][google.longrunning.Operation.done] is
  // set to true.
  google.protobuf.Timestamp end_time = 3;
}