@@ -18,6 +18,7 @@ syntax = "proto3";
1818package google.cloud.vision.v1 ;
1919
2020import "google/api/annotations.proto" ;
21+ import "google/api/client.proto" ;
2122import "google/cloud/vision/v1/geometry.proto" ;
2223import "google/cloud/vision/v1/product_search.proto" ;
2324import "google/cloud/vision/v1/text_annotation.proto" ;
@@ -40,12 +41,25 @@ option objc_class_prefix = "GCVN";
4041// images, such as face, landmark, logo, label, and text detection. The
4142// ImageAnnotator service returns detected entities from the images.
4243service ImageAnnotator {
44+ option (google.api.default_host ) = "vision.googleapis.com" ;
45+ option (google.api.oauth_scopes ) =
46+ "https://www.googleapis.com/auth/cloud-platform,"
47+ "https://www.googleapis.com/auth/cloud-vision" ;
48+
4349 // Run image detection and annotation for a batch of images.
4450 rpc BatchAnnotateImages (BatchAnnotateImagesRequest )
4551 returns (BatchAnnotateImagesResponse ) {
4652 option (google.api.http ) = {
4753 post : "/v1/images:annotate"
4854 body : "*"
55+ additional_bindings {
56+ post : "/v1/{parent=projects/*/locations/*}/images:annotate"
57+ body : "*"
58+ }
59+ additional_bindings {
60+ post : "/v1/{parent=projects/*}/images:annotate"
61+ body : "*"
62+ }
4963 };
5064 }
5165
@@ -61,6 +75,14 @@ service ImageAnnotator {
6175 option (google.api.http ) = {
6276 post : "/v1/files:annotate"
6377 body : "*"
78+ additional_bindings {
79+ post : "/v1/{parent=projects/*/locations/*}/files:annotate"
80+ body : "*"
81+ }
82+ additional_bindings {
83+ post : "/v1/{parent=projects/*}/files:annotate"
84+ body : "*"
85+ }
6486 };
6587 }
6688
@@ -78,6 +100,14 @@ service ImageAnnotator {
78100 option (google.api.http ) = {
79101 post : "/v1/images:asyncBatchAnnotate"
80102 body : "*"
103+ additional_bindings {
104+ post : "/v1/{parent=projects/*/locations/*}/images:asyncBatchAnnotate"
105+ body : "*"
106+ }
107+ additional_bindings {
108+ post : "/v1/{parent=projects/*}/images:asyncBatchAnnotate"
109+ body : "*"
110+ }
81111 };
82112 }
83113
@@ -92,6 +122,14 @@ service ImageAnnotator {
92122 option (google.api.http ) = {
93123 post : "/v1/files:asyncBatchAnnotate"
94124 body : "*"
125+ additional_bindings {
126+ post : "/v1/{parent=projects/*/locations/*}/files:asyncBatchAnnotate"
127+ body : "*"
128+ }
129+ additional_bindings {
130+ post : "/v1/{parent=projects/*}/files:asyncBatchAnnotate"
131+ body : "*"
132+ }
95133 };
96134 }
97135}
@@ -166,19 +204,19 @@ enum Likelihood {
166204 // Unknown likelihood.
167205 UNKNOWN = 0 ;
168206
169- // It is very unlikely that the image belongs to the specified vertical .
207+ // It is very unlikely.
170208 VERY_UNLIKELY = 1 ;
171209
172- // It is unlikely that the image belongs to the specified vertical .
210+ // It is unlikely.
173211 UNLIKELY = 2 ;
174212
175- // It is possible that the image belongs to the specified vertical .
213+ // It is possible.
176214 POSSIBLE = 3 ;
177215
178- // It is likely that the image belongs to the specified vertical .
216+ // It is likely.
179217 LIKELY = 4 ;
180218
181- // It is very likely that the image belongs to the specified vertical .
219+ // It is very likely.
182220 VERY_LIKELY = 5 ;
183221}
184222
@@ -700,17 +738,36 @@ message AnnotateFileResponse {
700738 // Information about the file for which this response is generated.
701739 InputConfig input_config = 1 ;
702740
703- // Individual responses to images found within the file.
741+ // Individual responses to images found within the file. This field will be
742+ // empty if the `error` field is set.
704743 repeated AnnotateImageResponse responses = 2 ;
705744
706745 // This field gives the total number of pages in the file.
707746 int32 total_pages = 3 ;
747+
748+ // If set, represents the error message for the failed request. The
749+ // `responses` field will not be set in this case.
750+ google.rpc.Status error = 4 ;
708751}
709752
710753// Multiple image annotation requests are batched into a single service call.
711754message BatchAnnotateImagesRequest {
712755 // Individual image annotation requests for this batch.
713756 repeated AnnotateImageRequest requests = 1 ;
757+
758+ // Optional. Target project and location to make a call.
759+ //
760+ // Format: `projects/{project-id}/locations/{location-id}`.
761+ //
762+ // If no parent is specified, a region will be chosen automatically.
763+ //
764+ // Supported location-ids:
765+ // `us`: USA country only,
766+ // `asia`: East asia areas, like Japan, Taiwan,
767+ // `eu`: The European Union.
768+ //
769+ // Example: `projects/project-A/locations/eu`.
770+ string parent = 4 ;
714771}
715772
716773// Response to a batch image annotation request.
@@ -752,6 +809,20 @@ message BatchAnnotateFilesRequest {
752809 // The list of file annotation requests. Right now we support only one
753810 // AnnotateFileRequest in BatchAnnotateFilesRequest.
754811 repeated AnnotateFileRequest requests = 1 ;
812+
813+ // Optional. Target project and location to make a call.
814+ //
815+ // Format: `projects/{project-id}/locations/{location-id}`.
816+ //
817+ // If no parent is specified, a region will be chosen automatically.
818+ //
819+ // Supported location-ids:
820+ // `us`: USA country only,
821+ // `asia`: East asia areas, like Japan, Taiwan,
822+ // `eu`: The European Union.
823+ //
824+ // Example: `projects/project-A/locations/eu`.
825+ string parent = 3 ;
755826}
756827
757828// A list of file annotation responses.
@@ -789,6 +860,20 @@ message AsyncBatchAnnotateImagesRequest {
789860
790861 // Required. The desired output location and metadata (e.g. format).
791862 OutputConfig output_config = 2 ;
863+
864+ // Optional. Target project and location to make a call.
865+ //
866+ // Format: `projects/{project-id}/locations/{location-id}`.
867+ //
868+ // If no parent is specified, a region will be chosen automatically.
869+ //
870+ // Supported location-ids:
871+ // `us`: USA country only,
872+ // `asia`: East asia areas, like Japan, Taiwan,
873+ // `eu`: The European Union.
874+ //
875+ // Example: `projects/project-A/locations/eu`.
876+ string parent = 4 ;
792877}
793878
794879// Response to an async batch image annotation request.
@@ -802,6 +887,20 @@ message AsyncBatchAnnotateImagesResponse {
802887message AsyncBatchAnnotateFilesRequest {
803888 // Individual async file annotation requests for this batch.
804889 repeated AsyncAnnotateFileRequest requests = 1 ;
890+
891+ // Optional. Target project and location to make a call.
892+ //
893+ // Format: `projects/{project-id}/locations/{location-id}`.
894+ //
895+ // If no parent is specified, a region will be chosen automatically.
896+ //
897+ // Supported location-ids:
898+ // `us`: USA country only,
899+ // `asia`: East asia areas, like Japan, Taiwan,
900+ // `eu`: The European Union.
901+ //
902+ // Example: `projects/project-A/locations/eu`.
903+ string parent = 4 ;
805904}
806905
807906// Response to an async batch file annotation request.
0 commit comments