xref: /aosp_15_r20/external/googleapis/google/cloud/visionai/v1/warehouse.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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.visionai.v1;
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/visionai/v1/common.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/any.proto";
26import "google/protobuf/duration.proto";
27import "google/protobuf/empty.proto";
28import "google/protobuf/field_mask.proto";
29import "google/protobuf/struct.proto";
30import "google/protobuf/timestamp.proto";
31import "google/rpc/status.proto";
32import "google/type/datetime.proto";
33
34option csharp_namespace = "Google.Cloud.VisionAI.V1";
35option go_package = "cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb";
36option java_multiple_files = true;
37option java_outer_classname = "WarehouseProto";
38option java_package = "com.google.cloud.visionai.v1";
39option php_namespace = "Google\\Cloud\\VisionAI\\V1";
40option ruby_package = "Google::Cloud::VisionAI::V1";
41
42// Service that manages media content + metadata for streaming.
43service Warehouse {
44  option (google.api.default_host) = "visionai.googleapis.com";
45  option (google.api.oauth_scopes) =
46      "https://www.googleapis.com/auth/cloud-platform";
47
48  // Creates an asset inside corpus.
49  rpc CreateAsset(CreateAssetRequest) returns (Asset) {
50    option (google.api.http) = {
51      post: "/v1/{parent=projects/*/locations/*/corpora/*}/assets"
52      body: "asset"
53    };
54    option (google.api.method_signature) = "parent,asset,asset_id";
55  }
56
57  // Updates an asset inside corpus.
58  rpc UpdateAsset(UpdateAssetRequest) returns (Asset) {
59    option (google.api.http) = {
60      patch: "/v1/{asset.name=projects/*/locations/*/corpora/*/assets/*}"
61      body: "asset"
62    };
63    option (google.api.method_signature) = "asset,update_mask";
64  }
65
66  // Reads an asset inside corpus.
67  rpc GetAsset(GetAssetRequest) returns (Asset) {
68    option (google.api.http) = {
69      get: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}"
70    };
71    option (google.api.method_signature) = "name";
72  }
73
74  // Lists an list of assets inside corpus.
75  rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) {
76    option (google.api.http) = {
77      get: "/v1/{parent=projects/*/locations/*/corpora/*}/assets"
78    };
79    option (google.api.method_signature) = "parent";
80  }
81
82  // Deletes asset inside corpus.
83  rpc DeleteAsset(DeleteAssetRequest) returns (google.longrunning.Operation) {
84    option (google.api.http) = {
85      delete: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}"
86    };
87    option (google.api.method_signature) = "name";
88    option (google.longrunning.operation_info) = {
89      response_type: "google.protobuf.Empty"
90      metadata_type: "DeleteAssetMetadata"
91    };
92  }
93
94  // Upload asset by specifing the asset Cloud Storage uri.
95  // For video warehouse, it requires users who call this API have read access
96  // to the cloud storage file. Once it is uploaded, it can be retrieved by
97  // GenerateRetrievalUrl API which by default, only can retrieve cloud storage
98  // files from the same project of the warehouse. To allow retrieval cloud
99  // storage files that are in a separate project, it requires to find the
100  // vision ai service account (Go to IAM, check checkbox to show "Include
101  // Google-provided role grants", search for "Cloud Vision AI Service Agent")
102  // and grant the read access of the cloud storage files to that service
103  // account.
104  rpc UploadAsset(UploadAssetRequest) returns (google.longrunning.Operation) {
105    option (google.api.http) = {
106      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload"
107      body: "*"
108    };
109    option (google.longrunning.operation_info) = {
110      response_type: "UploadAssetResponse"
111      metadata_type: "UploadAssetMetadata"
112    };
113  }
114
115  // Generates a signed url for downloading the asset.
116  // For video warehouse, please see comment of UploadAsset about how to allow
117  // retrieval of cloud storage files in a different project.
118  rpc GenerateRetrievalUrl(GenerateRetrievalUrlRequest)
119      returns (GenerateRetrievalUrlResponse) {
120    option (google.api.http) = {
121      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateRetrievalUrl"
122      body: "*"
123    };
124  }
125
126  // Analyze asset to power search capability.
127  rpc AnalyzeAsset(AnalyzeAssetRequest) returns (google.longrunning.Operation) {
128    option (google.api.http) = {
129      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:analyze"
130      body: "*"
131    };
132    option (google.longrunning.operation_info) = {
133      response_type: "AnalyzeAssetResponse"
134      metadata_type: "AnalyzeAssetMetadata"
135    };
136  }
137
138  // Index one asset for search.
139  // Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND
140  rpc IndexAsset(IndexAssetRequest) returns (google.longrunning.Operation) {
141    option (google.api.http) = {
142      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:index"
143      body: "*"
144    };
145    option (google.longrunning.operation_info) = {
146      response_type: "IndexAssetResponse"
147      metadata_type: "IndexAssetMetadata"
148    };
149  }
150
151  // Remove one asset's index data for search.
152  // Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND
153  rpc RemoveIndexAsset(RemoveIndexAssetRequest)
154      returns (google.longrunning.Operation) {
155    option (google.api.http) = {
156      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:removeIndex"
157      body: "*"
158    };
159    option (google.longrunning.operation_info) = {
160      response_type: "RemoveIndexAssetResponse"
161      metadata_type: "RemoveIndexAssetMetadata"
162    };
163  }
164
165  // Lists assets inside an index.
166  rpc ViewIndexedAssets(ViewIndexedAssetsRequest)
167      returns (ViewIndexedAssetsResponse) {
168    option (google.api.http) = {
169      get: "/v1/{index=projects/*/locations/*/corpora/*/indexes/*}:viewAssets"
170    };
171    option (google.api.method_signature) = "index";
172  }
173
174  // Creates an Index under the corpus.
175  rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) {
176    option (google.api.http) = {
177      post: "/v1/{parent=projects/*/locations/*/corpora/*}/indexes"
178      body: "index"
179    };
180    option (google.api.method_signature) = "parent,index,index_id";
181    option (google.longrunning.operation_info) = {
182      response_type: "Index"
183      metadata_type: "CreateIndexMetadata"
184    };
185  }
186
187  // Updates an Index under the corpus.
188  // Users can perform a metadata-only update or trigger a full index rebuild
189  // with different update_mask values.
190  rpc UpdateIndex(UpdateIndexRequest) returns (google.longrunning.Operation) {
191    option (google.api.http) = {
192      patch: "/v1/{index.name=projects/*/locations/*/corpora/*/indexes/*}"
193      body: "index"
194    };
195    option (google.api.method_signature) = "index,update_mask";
196    option (google.longrunning.operation_info) = {
197      response_type: "Index"
198      metadata_type: "UpdateIndexMetadata"
199    };
200  }
201
202  // Gets the details of a single Index under a Corpus.
203  rpc GetIndex(GetIndexRequest) returns (Index) {
204    option (google.api.http) = {
205      get: "/v1/{name=projects/*/locations/*/corpora/*/indexes/*}"
206    };
207    option (google.api.method_signature) = "name";
208  }
209
210  // List all Indexes in a given Corpus.
211  rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) {
212    option (google.api.http) = {
213      get: "/v1/{parent=projects/*/locations/*/corpora/*}/indexes"
214    };
215    option (google.api.method_signature) = "parent";
216  }
217
218  // Delete a single Index. In order to delete an index, the caller must
219  // make sure that it is not deployed to any index endpoint.
220  rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) {
221    option (google.api.http) = {
222      delete: "/v1/{name=projects/*/locations/*/corpora/*/indexes/*}"
223    };
224    option (google.api.method_signature) = "name";
225    option (google.longrunning.operation_info) = {
226      response_type: "google.protobuf.Empty"
227      metadata_type: "DeleteIndexMetadata"
228    };
229  }
230
231  // Creates a corpus inside a project.
232  rpc CreateCorpus(CreateCorpusRequest) returns (google.longrunning.Operation) {
233    option (google.api.http) = {
234      post: "/v1/{parent=projects/*/locations/*}/corpora"
235      body: "corpus"
236    };
237    option (google.api.method_signature) = "parent,corpus";
238    option (google.longrunning.operation_info) = {
239      response_type: "Corpus"
240      metadata_type: "CreateCorpusMetadata"
241    };
242  }
243
244  // Gets corpus details inside a project.
245  rpc GetCorpus(GetCorpusRequest) returns (Corpus) {
246    option (google.api.http) = {
247      get: "/v1/{name=projects/*/locations/*/corpora/*}"
248    };
249    option (google.api.method_signature) = "name";
250  }
251
252  // Updates a corpus in a project.
253  rpc UpdateCorpus(UpdateCorpusRequest) returns (Corpus) {
254    option (google.api.http) = {
255      patch: "/v1/{corpus.name=projects/*/locations/*/corpora/*}"
256      body: "corpus"
257    };
258    option (google.api.method_signature) = "corpus,update_mask";
259  }
260
261  // Lists all corpora in a project.
262  rpc ListCorpora(ListCorporaRequest) returns (ListCorporaResponse) {
263    option (google.api.http) = {
264      get: "/v1/{parent=projects/*/locations/*}/corpora"
265    };
266    option (google.api.method_signature) = "parent";
267  }
268
269  // Deletes a corpus only if its empty.
270  // Returns empty response.
271  rpc DeleteCorpus(DeleteCorpusRequest) returns (google.protobuf.Empty) {
272    option (google.api.http) = {
273      delete: "/v1/{name=projects/*/locations/*/corpora/*}"
274    };
275    option (google.api.method_signature) = "name";
276  }
277
278  // Analyzes a corpus.
279  rpc AnalyzeCorpus(AnalyzeCorpusRequest)
280      returns (google.longrunning.Operation) {
281    option (google.api.http) = {
282      post: "/v1/{name=projects/*/locations/*/corpora/*}:analyze"
283      body: "*"
284    };
285    option (google.longrunning.operation_info) = {
286      response_type: "AnalyzeCorpusResponse"
287      metadata_type: "AnalyzeCorpusMetadata"
288    };
289  }
290
291  // Creates data schema inside corpus.
292  rpc CreateDataSchema(CreateDataSchemaRequest) returns (DataSchema) {
293    option (google.api.http) = {
294      post: "/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas"
295      body: "data_schema"
296    };
297    option (google.api.method_signature) = "parent,data_schema";
298  }
299
300  // Updates data schema inside corpus.
301  rpc UpdateDataSchema(UpdateDataSchemaRequest) returns (DataSchema) {
302    option (google.api.http) = {
303      patch: "/v1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}"
304      body: "data_schema"
305    };
306    option (google.api.method_signature) = "data_schema,update_mask";
307  }
308
309  // Gets data schema inside corpus.
310  rpc GetDataSchema(GetDataSchemaRequest) returns (DataSchema) {
311    option (google.api.http) = {
312      get: "/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}"
313    };
314    option (google.api.method_signature) = "name";
315  }
316
317  // Deletes data schema inside corpus.
318  rpc DeleteDataSchema(DeleteDataSchemaRequest)
319      returns (google.protobuf.Empty) {
320    option (google.api.http) = {
321      delete: "/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}"
322    };
323    option (google.api.method_signature) = "name";
324  }
325
326  // Lists a list of data schemas inside corpus.
327  rpc ListDataSchemas(ListDataSchemasRequest)
328      returns (ListDataSchemasResponse) {
329    option (google.api.http) = {
330      get: "/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas"
331    };
332    option (google.api.method_signature) = "parent";
333  }
334
335  // Creates annotation inside asset.
336  rpc CreateAnnotation(CreateAnnotationRequest) returns (Annotation) {
337    option (google.api.http) = {
338      post: "/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations"
339      body: "annotation"
340    };
341    option (google.api.method_signature) = "parent,annotation,annotation_id";
342  }
343
344  // Reads annotation inside asset.
345  rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) {
346    option (google.api.http) = {
347      get: "/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}"
348    };
349    option (google.api.method_signature) = "name";
350  }
351
352  // Lists a list of annotations inside asset.
353  rpc ListAnnotations(ListAnnotationsRequest)
354      returns (ListAnnotationsResponse) {
355    option (google.api.http) = {
356      get: "/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations"
357    };
358    option (google.api.method_signature) = "parent";
359  }
360
361  // Updates annotation inside asset.
362  rpc UpdateAnnotation(UpdateAnnotationRequest) returns (Annotation) {
363    option (google.api.http) = {
364      patch: "/v1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}"
365      body: "annotation"
366    };
367    option (google.api.method_signature) = "annotation,update_mask";
368  }
369
370  // Deletes annotation inside asset.
371  rpc DeleteAnnotation(DeleteAnnotationRequest)
372      returns (google.protobuf.Empty) {
373    option (google.api.http) = {
374      delete: "/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}"
375    };
376    option (google.api.method_signature) = "name";
377  }
378
379  // Ingests data for the asset. It is not allowed to ingest a data chunk which
380  // is already expired according to TTL.
381  // This method is only available via the gRPC API (not HTTP since
382  // bi-directional streaming is not supported via HTTP).
383  rpc IngestAsset(stream IngestAssetRequest)
384      returns (stream IngestAssetResponse) {}
385
386  // Generates clips for downloading. The api takes in a time range, and
387  // generates a clip of the first content available after start_time and
388  // before end_time, which may overflow beyond these bounds.
389  // Returned clips are truncated if the total size of the clips are larger
390  // than 100MB.
391  rpc ClipAsset(ClipAssetRequest) returns (ClipAssetResponse) {
392    option (google.api.http) = {
393      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:clip"
394      body: "*"
395    };
396  }
397
398  // Generates a uri for an HLS manifest. The api takes in a collection of time
399  // ranges, and generates a URI for an HLS manifest that covers all the
400  // requested time ranges.
401  rpc GenerateHlsUri(GenerateHlsUriRequest) returns (GenerateHlsUriResponse) {
402    option (google.api.http) = {
403      post: "/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri"
404      body: "*"
405    };
406  }
407
408  // Imports assets (images plus annotations) from a meta file on cloud storage.
409  // Each row in the meta file is corresponding to an image (specified by a
410  // cloud storage uri) and its annotations.
411  rpc ImportAssets(ImportAssetsRequest) returns (google.longrunning.Operation) {
412    option (google.api.http) = {
413      post: "/v1/{parent=projects/*/locations/*/corpora/*}/assets:import"
414      body: "*"
415    };
416    option (google.longrunning.operation_info) = {
417      response_type: "ImportAssetsResponse"
418      metadata_type: "ImportAssetsMetadata"
419    };
420  }
421
422  // Creates a search configuration inside a corpus.
423  //
424  // Please follow the rules below to create a valid CreateSearchConfigRequest.
425  // --- General Rules ---
426  // 1. Request.search_config_id must not be associated with an existing
427  //    SearchConfig.
428  // 2. Request must contain at least one non-empty search_criteria_property or
429  //    facet_property.
430  // 3. mapped_fields must not be empty, and must map to existing UGA keys.
431  // 4. All mapped_fields must be of the same type.
432  // 5. All mapped_fields must share the same granularity.
433  // 6. All mapped_fields must share the same semantic SearchConfig match
434  //    options.
435  // For property-specific rules, please reference the comments for
436  // FacetProperty and SearchCriteriaProperty.
437  rpc CreateSearchConfig(CreateSearchConfigRequest) returns (SearchConfig) {
438    option (google.api.http) = {
439      post: "/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs"
440      body: "search_config"
441    };
442    option (google.api.method_signature) =
443        "parent,search_config,search_config_id";
444  }
445
446  // Updates a search configuration inside a corpus.
447  //
448  // Please follow the rules below to create a valid UpdateSearchConfigRequest.
449  // --- General Rules ---
450  // 1. Request.search_configuration.name must already exist.
451  // 2. Request must contain at least one non-empty search_criteria_property or
452  // facet_property.
453  // 3. mapped_fields must not be empty, and must map to existing UGA keys.
454  // 4. All mapped_fields must be of the same type.
455  // 5. All mapped_fields must share the same granularity.
456  // 6. All mapped_fields must share the same semantic SearchConfig match
457  //    options.
458  // For property-specific rules, please reference the comments for
459  // FacetProperty and SearchCriteriaProperty.
460  rpc UpdateSearchConfig(UpdateSearchConfigRequest) returns (SearchConfig) {
461    option (google.api.http) = {
462      patch: "/v1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}"
463      body: "search_config"
464    };
465    option (google.api.method_signature) = "search_config,update_mask";
466  }
467
468  // Gets a search configuration inside a corpus.
469  rpc GetSearchConfig(GetSearchConfigRequest) returns (SearchConfig) {
470    option (google.api.http) = {
471      get: "/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}"
472    };
473    option (google.api.method_signature) = "name";
474  }
475
476  // Deletes a search configuration inside a corpus.
477  //
478  // For a DeleteSearchConfigRequest to be valid,
479  // Request.search_configuration.name must already exist.
480  rpc DeleteSearchConfig(DeleteSearchConfigRequest)
481      returns (google.protobuf.Empty) {
482    option (google.api.http) = {
483      delete: "/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}"
484    };
485    option (google.api.method_signature) = "name";
486  }
487
488  // Lists all search configurations inside a corpus.
489  rpc ListSearchConfigs(ListSearchConfigsRequest)
490      returns (ListSearchConfigsResponse) {
491    option (google.api.http) = {
492      get: "/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs"
493    };
494    option (google.api.method_signature) = "parent";
495  }
496
497  // Creates a SearchHypernym inside a corpus.
498  rpc CreateSearchHypernym(CreateSearchHypernymRequest)
499      returns (SearchHypernym) {
500    option (google.api.http) = {
501      post: "/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms"
502      body: "search_hypernym"
503    };
504    option (google.api.method_signature) =
505        "parent,search_hypernym,search_hypernym_id";
506  }
507
508  // Updates a SearchHypernym inside a corpus.
509  rpc UpdateSearchHypernym(UpdateSearchHypernymRequest)
510      returns (SearchHypernym) {
511    option (google.api.http) = {
512      patch: "/v1/{search_hypernym.name=projects/*/locations/*/corpora/*/searchHypernyms/*}"
513      body: "search_hypernym"
514    };
515    option (google.api.method_signature) = "search_hypernym,update_mask";
516  }
517
518  // Gets a SearchHypernym inside a corpus.
519  rpc GetSearchHypernym(GetSearchHypernymRequest) returns (SearchHypernym) {
520    option (google.api.http) = {
521      get: "/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}"
522    };
523    option (google.api.method_signature) = "name";
524  }
525
526  // Deletes a SearchHypernym inside a corpus.
527  rpc DeleteSearchHypernym(DeleteSearchHypernymRequest)
528      returns (google.protobuf.Empty) {
529    option (google.api.http) = {
530      delete: "/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}"
531    };
532    option (google.api.method_signature) = "name";
533  }
534
535  // Lists SearchHypernyms inside a corpus.
536  rpc ListSearchHypernyms(ListSearchHypernymsRequest)
537      returns (ListSearchHypernymsResponse) {
538    option (google.api.http) = {
539      get: "/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms"
540    };
541    option (google.api.method_signature) = "parent";
542  }
543
544  // Search media asset.
545  rpc SearchAssets(SearchAssetsRequest) returns (SearchAssetsResponse) {
546    option (google.api.http) = {
547      post: "/v1/{corpus=projects/*/locations/*/corpora/*}:searchAssets"
548      body: "*"
549    };
550  }
551
552  // Search a deployed index endpoint (IMAGE corpus type only).
553  rpc SearchIndexEndpoint(SearchIndexEndpointRequest)
554      returns (SearchIndexEndpointResponse) {
555    option (google.api.http) = {
556      post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:searchIndexEndpoint"
557      body: "*"
558    };
559  }
560
561  // Creates an IndexEndpoint.
562  rpc CreateIndexEndpoint(CreateIndexEndpointRequest)
563      returns (google.longrunning.Operation) {
564    option (google.api.http) = {
565      post: "/v1/{parent=projects/*/locations/*}/indexEndpoints"
566      body: "index_endpoint"
567    };
568    option (google.api.method_signature) =
569        "parent,index_endpoint,index_endpoint_id";
570    option (google.longrunning.operation_info) = {
571      response_type: "IndexEndpoint"
572      metadata_type: "CreateIndexEndpointMetadata"
573    };
574  }
575
576  // Gets an IndexEndpoint.
577  rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) {
578    option (google.api.http) = {
579      get: "/v1/{name=projects/*/locations/*/indexEndpoints/*}"
580    };
581    option (google.api.method_signature) = "name";
582  }
583
584  // Lists all IndexEndpoints in a project.
585  rpc ListIndexEndpoints(ListIndexEndpointsRequest)
586      returns (ListIndexEndpointsResponse) {
587    option (google.api.http) = {
588      get: "/v1/{parent=projects/*/locations/*}/indexEndpoints"
589    };
590    option (google.api.method_signature) = "parent";
591  }
592
593  // Updates an IndexEndpoint.
594  rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest)
595      returns (google.longrunning.Operation) {
596    option (google.api.http) = {
597      patch: "/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}"
598      body: "index_endpoint"
599    };
600    option (google.api.method_signature) = "index_endpoint,update_mask";
601    option (google.longrunning.operation_info) = {
602      response_type: "IndexEndpoint"
603      metadata_type: "UpdateIndexEndpointMetadata"
604    };
605  }
606
607  // Deletes an IndexEndpoint.
608  rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest)
609      returns (google.longrunning.Operation) {
610    option (google.api.http) = {
611      delete: "/v1/{name=projects/*/locations/*/indexEndpoints/*}"
612    };
613    option (google.api.method_signature) = "name";
614    option (google.longrunning.operation_info) = {
615      response_type: "google.protobuf.Empty"
616      metadata_type: "DeleteIndexEndpointMetadata"
617    };
618  }
619
620  // Deploys an Index to IndexEndpoint.
621  rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) {
622    option (google.api.http) = {
623      post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex"
624      body: "*"
625    };
626    option (google.longrunning.operation_info) = {
627      response_type: "DeployIndexResponse"
628      metadata_type: "DeployIndexMetadata"
629    };
630  }
631
632  // Undeploys an Index from IndexEndpoint.
633  rpc UndeployIndex(UndeployIndexRequest)
634      returns (google.longrunning.Operation) {
635    option (google.api.http) = {
636      post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex"
637      body: "*"
638    };
639    option (google.longrunning.operation_info) = {
640      response_type: "UndeployIndexResponse"
641      metadata_type: "UndeployIndexMetadata"
642    };
643  }
644
645  // Creates a collection.
646  rpc CreateCollection(CreateCollectionRequest)
647      returns (google.longrunning.Operation) {
648    option (google.api.http) = {
649      post: "/v1/{parent=projects/*/locations/*/corpora/*}/collections"
650      body: "collection"
651    };
652    option (google.api.method_signature) = "parent,collection,collection_id";
653    option (google.longrunning.operation_info) = {
654      response_type: "Collection"
655      metadata_type: "CreateCollectionMetadata"
656    };
657  }
658
659  // Deletes a collection.
660  rpc DeleteCollection(DeleteCollectionRequest)
661      returns (google.longrunning.Operation) {
662    option (google.api.http) = {
663      delete: "/v1/{name=projects/*/locations/*/corpora/*/collections/*}"
664    };
665    option (google.api.method_signature) = "name";
666    option (google.longrunning.operation_info) = {
667      response_type: "google.protobuf.Empty"
668      metadata_type: "DeleteCollectionMetadata"
669    };
670  }
671
672  // Gets a collection.
673  rpc GetCollection(GetCollectionRequest) returns (Collection) {
674    option (google.api.http) = {
675      get: "/v1/{name=projects/*/locations/*/corpora/*/collections/*}"
676    };
677    option (google.api.method_signature) = "name";
678  }
679
680  // Updates a collection.
681  rpc UpdateCollection(UpdateCollectionRequest) returns (Collection) {
682    option (google.api.http) = {
683      patch: "/v1/{collection.name=projects/*/locations/*/corpora/*/collections/*}"
684      body: "collection"
685    };
686    option (google.api.method_signature) = "collection,update_mask";
687  }
688
689  // Lists collections inside a corpus.
690  rpc ListCollections(ListCollectionsRequest)
691      returns (ListCollectionsResponse) {
692    option (google.api.http) = {
693      get: "/v1/{parent=projects/*/locations/*/corpora/*}/collections"
694    };
695    option (google.api.method_signature) = "parent";
696  }
697
698  // Adds an item into a Collection.
699  rpc AddCollectionItem(AddCollectionItemRequest)
700      returns (AddCollectionItemResponse) {
701    option (google.api.http) = {
702      post: "/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:addCollectionItem"
703      body: "*"
704    };
705    option (google.api.method_signature) = "item";
706  }
707
708  // Removes an item from a collection.
709  rpc RemoveCollectionItem(RemoveCollectionItemRequest)
710      returns (RemoveCollectionItemResponse) {
711    option (google.api.http) = {
712      post: "/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:removeCollectionItem"
713      body: "*"
714    };
715    option (google.api.method_signature) = "item";
716  }
717
718  // View items inside a collection.
719  rpc ViewCollectionItems(ViewCollectionItemsRequest)
720      returns (ViewCollectionItemsResponse) {
721    option (google.api.http) = {
722      get: "/v1/{collection=projects/*/locations/*/corpora/*/collections/*}:viewCollectionItems"
723    };
724    option (google.api.method_signature) = "collection";
725  }
726}
727
728// Different types for a facet bucket.
729enum FacetBucketType {
730  // Unspecified type.
731  FACET_BUCKET_TYPE_UNSPECIFIED = 0;
732
733  // Value type.
734  FACET_BUCKET_TYPE_VALUE = 1;
735
736  // Datetime type.
737  FACET_BUCKET_TYPE_DATETIME = 2;
738
739  // Fixed Range type.
740  FACET_BUCKET_TYPE_FIXED_RANGE = 3;
741
742  // Custom Range type.
743  FACET_BUCKET_TYPE_CUSTOM_RANGE = 4;
744}
745
746// Request message for CreateAssetRequest.
747message CreateAssetRequest {
748  // Required. The parent resource where this asset will be created.
749  // Format:
750  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
751  string parent = 1 [
752    (google.api.field_behavior) = REQUIRED,
753    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
754  ];
755
756  // Required. The asset to create.
757  Asset asset = 2 [(google.api.field_behavior) = REQUIRED];
758
759  // Optional. The ID to use for the asset, which will become the final
760  // component of the asset's resource name if user choose to specify.
761  // Otherwise, asset id will be generated by system.
762  //
763  // This value should be up to 63 characters, and valid characters
764  // are /[a-z][0-9]-/. The first character must be a letter, the last could be
765  // a letter or a number.
766  optional string asset_id = 3 [(google.api.field_behavior) = OPTIONAL];
767}
768
769// Request message for GetAsset.
770message GetAssetRequest {
771  // Required. The name of the asset to retrieve.
772  // Format:
773  // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}
774  string name = 1 [
775    (google.api.field_behavior) = REQUIRED,
776    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
777  ];
778}
779
780// Request message for ListAssets.
781message ListAssetsRequest {
782  // Required. The parent, which owns this collection of assets.
783  // Format:
784  // `projects/{project_number}/locations/{location}/corpora/{corpus}`
785  string parent = 1 [
786    (google.api.field_behavior) = REQUIRED,
787    (google.api.resource_reference) = {
788      child_type: "visionai.googleapis.com/Asset"
789    }
790  ];
791
792  // The maximum number of assets to return. The service may return fewer than
793  // this value.
794  // If unspecified, at most 50 assets will be returned.
795  // The maximum value is 1000; values above 1000 will be coerced to 1000.
796  int32 page_size = 2;
797
798  // A page token, received from a previous `ListAssets` call.
799  // Provide this to retrieve the subsequent page.
800  //
801  // When paginating, all other parameters provided to `ListAssets` must match
802  // the call that provided the page token.
803  string page_token = 3;
804
805  // The filter applied to the returned list.
806  // Only the following filterings are supported:
807  // "assets_with_contents = true", which returns assets with contents uploaded;
808  // "assets_with_contents = false", which returns assets without contents.
809  string filter = 5;
810}
811
812// Response message for ListAssets.
813message ListAssetsResponse {
814  // The assets from the specified corpus.
815  repeated Asset assets = 1;
816
817  // A token, which can be sent as `page_token` to retrieve the next page.
818  // If this field is omitted, there are no subsequent pages.
819  string next_page_token = 2;
820}
821
822// Request message for UpdateAsset.
823message UpdateAssetRequest {
824  // Required. The asset to update.
825  //
826  // The asset's `name` field is used to identify the asset to be updated.
827  // Format:
828  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`
829  Asset asset = 1 [(google.api.field_behavior) = REQUIRED];
830
831  // The list of fields to be updated.
832  google.protobuf.FieldMask update_mask = 2;
833}
834
835// Request message for DeleteAsset.
836message DeleteAssetRequest {
837  // Required. The name of the asset to delete.
838  // Format:
839  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`
840  string name = 1 [
841    (google.api.field_behavior) = REQUIRED,
842    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
843  ];
844}
845
846// The source of the asset.
847message AssetSource {
848  // The asset source is from Cloud Storage.
849  message AssetGcsSource {
850    // Cloud storage uri.
851    string gcs_uri = 1;
852  }
853
854  // The content of the asset.
855  message AssetContentData {
856    bytes asset_content_data = 1;
857  }
858
859  oneof source_form {
860    // The source of the asset is from Cloud Storage.
861    AssetGcsSource asset_gcs_source = 1;
862
863    // The source of the asset is from content bytes.
864    AssetContentData asset_content_data = 2;
865  }
866}
867
868// Request message for UploadAsset.
869message UploadAssetRequest {
870  // Required. The resource name of the asset to upload.
871  // Format:
872  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
873  string name = 1 [
874    (google.api.field_behavior) = REQUIRED,
875    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
876  ];
877
878  // The source of the asset.
879  AssetSource asset_source = 2;
880}
881
882// Response message for UploadAsset.
883message UploadAssetResponse {}
884
885// Metadata for UploadAsset.
886message UploadAssetMetadata {
887  // The start time of the operation.
888  google.protobuf.Timestamp start_time = 1;
889
890  // The update time of the operation.
891  google.protobuf.Timestamp update_time = 2;
892}
893
894// Request message for GenerateRetrievalUrl API.
895message GenerateRetrievalUrlRequest {
896  // Required. The resource name of the asset to request signed url for.
897  // Format:
898  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
899  string name = 1 [
900    (google.api.field_behavior) = REQUIRED,
901    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
902  ];
903}
904
905// Response message for GenerateRetrievalUrl API.
906message GenerateRetrievalUrlResponse {
907  // A signed url to download the content of the asset.
908  string signed_uri = 1;
909}
910
911// An asset is a resource in corpus. It represents a media object inside corpus,
912// contains metadata and another resource annotation. Different feature could be
913// applied to the asset to generate annotations. User could specified annotation
914// related to the target asset.
915message Asset {
916  option (google.api.resource) = {
917    type: "visionai.googleapis.com/Asset"
918    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}"
919  };
920
921  // Resource name of the asset.
922  // Format:
923  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
924  string name = 1;
925
926  // The duration for which all media assets, associated metadata, and search
927  // documents can exist. If not set, then it will using the default ttl in the
928  // parent corpus resource.
929  google.protobuf.Duration ttl = 2;
930
931  // Output only. The original cloud storage source uri that is associated with
932  // this asset.
933  AssetSource.AssetGcsSource asset_gcs_source = 4
934      [(google.api.field_behavior) = OUTPUT_ONLY];
935}
936
937// Request message for AnalyzeAsset.
938message AnalyzeAssetRequest {
939  // Required. The resource name of the asset to analyze.
940  // Format:
941  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
942  string name = 1 [
943    (google.api.field_behavior) = REQUIRED,
944    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
945  ];
946}
947
948// Metadata for AnalyzeAsset.
949message AnalyzeAssetMetadata {
950  // The status of analysis on each search capability.
951  message AnalysisStatus {
952    // The state of the search capability.
953    enum State {
954      // The default process state should never happen.
955      STATE_UNSPECIFIED = 0;
956
957      // The feature is in progress.
958      IN_PROGRESS = 1;
959
960      // The process is successfully done.
961      SUCCEEDED = 2;
962
963      // The process failed.
964      FAILED = 3;
965    }
966
967    State state = 2;
968
969    string status_message = 3;
970
971    // The search capability requested.
972    SearchCapability search_capability = 4;
973  }
974
975  // The status of analysis on all search capabilities.
976  repeated AnalysisStatus analysis_status = 1;
977
978  // The start time of the operation.
979  google.protobuf.Timestamp start_time = 2;
980
981  // The update time of the operation.
982  google.protobuf.Timestamp update_time = 3;
983}
984
985// Response message for AnalyzeAsset.
986message AnalyzeAssetResponse {}
987
988// The status of indexing for the asset.
989message IndexingStatus {
990  // State enum for this asset's indexing.
991  enum State {
992    // The default process state should never happen.
993    STATE_UNSPECIFIED = 0;
994
995    // The indexing is in progress.
996    IN_PROGRESS = 1;
997
998    // The process is successfully done.
999    SUCCEEDED = 2;
1000
1001    // The process failed.
1002    FAILED = 3;
1003  }
1004
1005  // Output only. State of this asset's indexing.
1006  State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1007
1008  // Detailed message describing the state.
1009  string status_message = 3;
1010}
1011
1012// Request message for IndexAsset.
1013message IndexAssetRequest {
1014  // Required. The resource name of the asset to index.
1015  // Format:
1016  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
1017  string name = 1 [
1018    (google.api.field_behavior) = REQUIRED,
1019    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
1020  ];
1021
1022  // Optional. The name of the index.
1023  // Format:
1024  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1025  string index = 2 [
1026    (google.api.field_behavior) = OPTIONAL,
1027    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1028  ];
1029}
1030
1031// Metadata for IndexAsset.
1032message IndexAssetMetadata {
1033  // The status of indexing this asset.
1034  IndexingStatus status = 4;
1035
1036  // The start time of the operation.
1037  google.protobuf.Timestamp start_time = 2;
1038
1039  // The update time of the operation.
1040  google.protobuf.Timestamp update_time = 3;
1041}
1042
1043// Response message for IndexAsset.
1044message IndexAssetResponse {}
1045
1046// Request message for RemoveIndexAsset.
1047message RemoveIndexAssetRequest {
1048  // Required. The resource name of the asset to index.
1049  // Format:
1050  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
1051  string name = 1 [
1052    (google.api.field_behavior) = REQUIRED,
1053    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
1054  ];
1055
1056  // Optional. The name of the index.
1057  // Format:
1058  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1059  string index = 2 [
1060    (google.api.field_behavior) = OPTIONAL,
1061    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1062  ];
1063}
1064
1065// Metadata for RemoveIndexAsset.
1066message RemoveIndexAssetMetadata {
1067  // The status of indexing this asset.
1068  IndexingStatus indexing_status = 1;
1069
1070  // The start time of the operation.
1071  google.protobuf.Timestamp start_time = 2;
1072
1073  // The update time of the operation.
1074  google.protobuf.Timestamp update_time = 3;
1075}
1076
1077// Response message for RemoveIndexAsset.
1078message RemoveIndexAssetResponse {}
1079
1080// An IndexedAsset is an asset that the index is built upon.
1081message IndexedAsset {
1082  // Required. The index that this indexed asset belongs to.
1083  // Format:
1084  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1085  string index = 1 [
1086    (google.api.field_behavior) = REQUIRED,
1087    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1088  ];
1089
1090  // Required. The resource name of the asset.
1091  // Format:
1092  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
1093  string asset = 2 [
1094    (google.api.field_behavior) = REQUIRED,
1095    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
1096  ];
1097
1098  // Output only. The create timestamp.
1099  google.protobuf.Timestamp create_time = 3
1100      [(google.api.field_behavior) = OUTPUT_ONLY];
1101
1102  // Output only. The update timestamp.
1103  google.protobuf.Timestamp update_time = 4
1104      [(google.api.field_behavior) = OUTPUT_ONLY];
1105}
1106
1107// Request message for ViewIndexedAssets.
1108message ViewIndexedAssetsRequest {
1109  // Required. The index that owns this collection of assets.
1110  // Format:
1111  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1112  string index = 1 [
1113    (google.api.field_behavior) = REQUIRED,
1114    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1115  ];
1116
1117  // The maximum number of assets to return. The service may return fewer than
1118  // this value.
1119  // If unspecified, at most 50 assets will be returned.
1120  // The maximum value is 1000; values above 1000 will be coerced to 1000.
1121  int32 page_size = 2;
1122
1123  // A page token, received from a previous `ViewIndexedAssets` call.
1124  // Provide this to retrieve the subsequent page.
1125  //
1126  // When paginating, all other parameters provided to `ViewIndexedAssets` must
1127  // match the call that provided the page token.
1128  string page_token = 3;
1129
1130  // The filter applied to the returned list.
1131  // Only the following filterings are supported:
1132  // "asset_id = xxxx", which returns asset with specified id.
1133  // "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids.
1134  string filter = 4;
1135}
1136
1137// Response message for ViewIndexedAssets.
1138message ViewIndexedAssetsResponse {
1139  // The assets from the specified index.
1140  repeated IndexedAsset indexed_assets = 1;
1141
1142  // A token, which can be sent as `page_token` to retrieve the next page.
1143  // If this field is omitted, there are no subsequent pages.
1144  string next_page_token = 2;
1145}
1146
1147// Request message of CreateCorpus API.
1148message CreateCorpusRequest {
1149  // Required. Form: `projects/{project_number}/locations/{location_id}`
1150  string parent = 1 [(google.api.field_behavior) = REQUIRED];
1151
1152  // Required. The corpus to be created.
1153  Corpus corpus = 2 [(google.api.field_behavior) = REQUIRED];
1154}
1155
1156// Metadata for CreateCorpus API.
1157message CreateCorpusMetadata {
1158  // The create time of the create corpus operation.
1159  google.protobuf.Timestamp create_time = 2;
1160
1161  // The update time of the create corpus operation.
1162  google.protobuf.Timestamp update_time = 3;
1163}
1164
1165// The capability and metadata of search capability.
1166message SearchCapability {
1167  // Capability to perform different search on assets.
1168  enum Type {
1169    // Unspecified search capability, should never be used.
1170    TYPE_UNSPECIFIED = 0;
1171
1172    // Embedding search.
1173    EMBEDDING_SEARCH = 1;
1174  }
1175
1176  // The search capability to enable.
1177  Type type = 1;
1178}
1179
1180// Setting for search capability to enable.
1181message SearchCapabilitySetting {
1182  // The metadata of search capability to enable.
1183  repeated SearchCapability search_capabilities = 1;
1184}
1185
1186// Metadata message for CreateCollectionRequest
1187message CreateCollectionMetadata {
1188  // Common metadata of the long-running operation.
1189  OperationMetadata operation_metadata = 1;
1190}
1191
1192// Request message for CreateCollection.
1193message CreateCollectionRequest {
1194  // Required. The parent resource where this collection will be created.
1195  // Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`
1196  string parent = 1 [
1197    (google.api.field_behavior) = REQUIRED,
1198    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1199  ];
1200
1201  // Required. The collection resource to be created.
1202  Collection collection = 2 [(google.api.field_behavior) = REQUIRED];
1203
1204  // Optional. The ID to use for the collection, which will become the final
1205  // component of the resource name if user choose to specify. Otherwise,
1206  // collection id will be generated by system.
1207  //
1208  // This value should be up to 55 characters, and valid characters
1209  // are /[a-z][0-9]-/. The first character must be a letter, the last could be
1210  // a letter or a number.
1211  optional string collection_id = 3 [(google.api.field_behavior) = OPTIONAL];
1212}
1213
1214// Metadata message for DeleteCollectionRequest
1215message DeleteCollectionMetadata {
1216  // Common metadata of the long-running operation.
1217  OperationMetadata operation_metadata = 1;
1218}
1219
1220// Request message for DeleteCollectionRequest.
1221message DeleteCollectionRequest {
1222  // Required. The name of the collection to delete. Format:
1223  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1224  string name = 1 [
1225    (google.api.field_behavior) = REQUIRED,
1226    (google.api.resource_reference) = {
1227      type: "visionai.googleapis.com/Collection"
1228    }
1229  ];
1230}
1231
1232// Request message for GetCollectionRequest.
1233message GetCollectionRequest {
1234  // Required. The name of the collection to retrieve. Format:
1235  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1236  string name = 1 [
1237    (google.api.field_behavior) = REQUIRED,
1238    (google.api.resource_reference) = {
1239      type: "visionai.googleapis.com/Collection"
1240    }
1241  ];
1242}
1243
1244// Request message for UpdateCollectionRequest.
1245message UpdateCollectionRequest {
1246  // Required. The collection to update.
1247  //
1248  // The collection's `name` field is used to identify the collection to be
1249  // updated. Format:
1250  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1251  Collection collection = 1 [(google.api.field_behavior) = REQUIRED];
1252
1253  // The list of fields to be updated.
1254  // - Unset `update_mask` or set `update_mask` to be a single "*" only will
1255  //   update all updatable fields with the value provided in `collection`.
1256  // - To update `display_name` value to empty string, set it in the
1257  // `collection`
1258  //   to empty string, and set `update_mask` with "display_name". Same applies
1259  //   to other updatable string fields in the `collection`.
1260  google.protobuf.FieldMask update_mask = 2;
1261}
1262
1263// Request message for ListCollections.
1264message ListCollectionsRequest {
1265  // Required. The parent corpus. Format:
1266  // `projects/{project_number}/locations/{location}/corpora/{corpus}`
1267  string parent = 1 [
1268    (google.api.field_behavior) = REQUIRED,
1269    (google.api.resource_reference) = {
1270      child_type: "visionai.googleapis.com/Collection"
1271    }
1272  ];
1273
1274  // The maximum number of collections to return. The service may return fewer
1275  // than this value. If unspecified, at most 50 collections will be returned.
1276  // The maximum value is 1000; values above 1000 will be coerced to 1000.
1277  int32 page_size = 2;
1278
1279  // A page token, received from a previous `ListCollectionsRequest` call.
1280  // Provide this to retrieve the subsequent page.
1281  //
1282  // When paginating, all other parameters provided to `ListCollectionsRequest`
1283  // must match the call that provided the page token.
1284  string page_token = 3;
1285}
1286
1287// Response message for ListCollections.
1288message ListCollectionsResponse {
1289  // The collections from the specified corpus.
1290  repeated Collection collections = 1;
1291
1292  // A token, which can be sent as `page_token` to retrieve the next page.
1293  // If this field is omitted, there are no subsequent pages.
1294  string next_page_token = 2;
1295}
1296
1297// Request message for AddCollectionItem.
1298message AddCollectionItemRequest {
1299  // Required. The item to be added.
1300  CollectionItem item = 1 [(google.api.field_behavior) = REQUIRED];
1301}
1302
1303// Response message for AddCollectionItem.
1304message AddCollectionItemResponse {
1305  // The item that has already been added.
1306  CollectionItem item = 1;
1307}
1308
1309// Request message for RemoveCollectionItem.
1310message RemoveCollectionItemRequest {
1311  // Required. The item to be removed.
1312  CollectionItem item = 1 [(google.api.field_behavior) = REQUIRED];
1313}
1314
1315// Request message for RemoveCollectionItem.
1316message RemoveCollectionItemResponse {
1317  // The item that has already been removed.
1318  CollectionItem item = 1;
1319}
1320
1321// Request message for ViewCollectionItems.
1322message ViewCollectionItemsRequest {
1323  // Required. The collection to view. Format:
1324  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1325  string collection = 1 [
1326    (google.api.field_behavior) = REQUIRED,
1327    (google.api.resource_reference) = {
1328      type: "visionai.googleapis.com/Collection"
1329    }
1330  ];
1331
1332  // The maximum number of collections to return. The service may return fewer
1333  // than this value. If unspecified, at most 50 collections will be returned.
1334  // The maximum value is 1000; values above 1000 will be coerced to 1000.
1335  int32 page_size = 2;
1336
1337  // A page token, received from a previous `ViewCollectionItemsRequest` call.
1338  // Provide this to retrieve the subsequent page.
1339  //
1340  // When paginating, all other parameters provided to
1341  // `ViewCollectionItemsRequest` must match the call that provided the page
1342  // token.
1343  string page_token = 3;
1344}
1345
1346// Response message for ViewCollectionItems.
1347message ViewCollectionItemsResponse {
1348  // The items from the specified collection.
1349  repeated CollectionItem items = 1;
1350
1351  // A token, which can be sent as `page_token` to retrieve the next page.
1352  // If this field is omitted, there are no subsequent pages.
1353  string next_page_token = 2;
1354}
1355
1356// A collection is a resource in a corpus. It serves as a container of
1357// references to original resources.
1358message Collection {
1359  option (google.api.resource) = {
1360    type: "visionai.googleapis.com/Collection"
1361    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}"
1362  };
1363
1364  // Output only. Resource name of the collection. Format:
1365  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1366  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1367
1368  // Optional. The collection name for displaying.
1369  // The name can be up to 256 characters long.
1370  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
1371
1372  // Optional. Description of the collection. Can be up to 25000 characters
1373  // long.
1374  string description = 3 [(google.api.field_behavior) = OPTIONAL];
1375}
1376
1377// A CollectionItem is an item in a collection.
1378// Each item is a reference to the original resource in a collection.
1379message CollectionItem {
1380  // CollectionItem types.
1381  enum Type {
1382    // The default type of item should never happen.
1383    TYPE_UNSPECIFIED = 0;
1384
1385    // Asset type item.
1386    ASSET = 1;
1387  }
1388
1389  // Required. The collection name that this item belongs to. Format:
1390  // `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
1391  string collection = 1 [
1392    (google.api.field_behavior) = REQUIRED,
1393    (google.api.resource_reference) = {
1394      type: "visionai.googleapis.com/Collection"
1395    }
1396  ];
1397
1398  // Required. The type of item.
1399  Type type = 2 [(google.api.field_behavior) = REQUIRED];
1400
1401  // Required. The name of the CollectionItem. Its format depends on the `type`
1402  // above. For ASSET:
1403  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`
1404  string item_resource = 3 [(google.api.field_behavior) = REQUIRED];
1405}
1406
1407// Message for creating an Index.
1408message CreateIndexRequest {
1409  // Required. Value for the parent. The resource name of the Corpus under which
1410  // this index is created. Format:
1411  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
1412  string parent = 1 [
1413    (google.api.field_behavior) = REQUIRED,
1414    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1415  ];
1416
1417  // Optional. The ID for the index. This will become the final resource name
1418  // for the index. If the user does not specify this value, it will be
1419  // generated by system.
1420  //
1421  // This value should be up to 63 characters, and valid characters
1422  // are /[a-z][0-9]-/. The first character must be a letter, the last could be
1423  // a letter or a number.
1424  string index_id = 2 [(google.api.field_behavior) = OPTIONAL];
1425
1426  // Required. The index being created.
1427  Index index = 3 [(google.api.field_behavior) = REQUIRED];
1428}
1429
1430// Metadata message for CreateIndexRequest
1431message CreateIndexMetadata {
1432  // Common metadata of the long-running operation.
1433  OperationMetadata operation_metadata = 1;
1434}
1435
1436// Request message for UpdateIndex.
1437message UpdateIndexRequest {
1438  // Required. The resource being updated.
1439  Index index = 1 [(google.api.field_behavior) = REQUIRED];
1440
1441  // Required. Field mask is used to specify the fields to be overwritten in the
1442  // Index resource by the update. The fields specified in the update_mask are
1443  // relative to the resource, not the full request. A field of the resource
1444  // will be overwritten if it is in the mask. Empty field mask is not allowed.
1445  // If the mask is "*", it triggers a full update of the index, and also a
1446  // whole rebuild of index data.
1447  google.protobuf.FieldMask update_mask = 2
1448      [(google.api.field_behavior) = REQUIRED];
1449}
1450
1451// Metadata message for UpdateIndexRequest
1452message UpdateIndexMetadata {
1453  // Common metadata of the long-running operation.
1454  OperationMetadata operation_metadata = 1;
1455}
1456
1457// Request message for getting an Index.
1458message GetIndexRequest {
1459  // Required. Name of the Index resource.
1460  // Format:
1461  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1462  string name = 1 [
1463    (google.api.field_behavior) = REQUIRED,
1464    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1465  ];
1466}
1467
1468// Request message for listing Indexes.
1469message ListIndexesRequest {
1470  // Required. The parent corpus that owns this collection of indexes.
1471  // Format:
1472  // `projects/{project_number}/locations/{location}/corpora/{corpus}`
1473  string parent = 1 [
1474    (google.api.field_behavior) = REQUIRED,
1475    (google.api.resource_reference) = {
1476      child_type: "visionai.googleapis.com/Index"
1477    }
1478  ];
1479
1480  // The maximum number of indexes to return. The service may return fewer than
1481  // this value.
1482  // If unspecified, at most 50 indexes will be returned.
1483  // The maximum value is 1000; values above 1000 will be coerced to 1000.
1484  int32 page_size = 2;
1485
1486  // A page token, received from a previous `ListIndexes` call.
1487  // Provide this to retrieve the subsequent page.
1488  //
1489  // When paginating, all other parameters provided to `ListIndexes` must match
1490  // the call that provided the page token.
1491  string page_token = 3;
1492}
1493
1494// Response message for ListIndexes.
1495message ListIndexesResponse {
1496  // The indexes under the specified corpus.
1497  repeated Index indexes = 1;
1498
1499  // A token, which can be sent as `page_token` to retrieve the next page.
1500  // If this field is omitted, there are no subsequent pages.
1501  string next_page_token = 2;
1502}
1503
1504// Request message for DeleteIndex.
1505message DeleteIndexRequest {
1506  // Required. The name of the index to delete.
1507  // Format:
1508  // `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`
1509  string name = 1 [
1510    (google.api.field_behavior) = REQUIRED,
1511    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
1512  ];
1513}
1514
1515// Metadata message for DeleteIndexRequest
1516message DeleteIndexMetadata {}
1517
1518// An Index is a resource in Corpus. It contains an indexed version of the
1519// assets and annotations. When deployed to an endpoint, it will allow users to
1520// search the Index.
1521message Index {
1522  option (google.api.resource) = {
1523    type: "visionai.googleapis.com/Index"
1524    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}"
1525  };
1526
1527  // Enum representing the different states through which an Index might cycle
1528  // during its lifetime.
1529  enum State {
1530    // The default value. Should not be used.
1531    STATE_UNSPECIFIED = 0;
1532
1533    // State CREATING.
1534    CREATING = 1;
1535
1536    // State CREATED.
1537    CREATED = 2;
1538
1539    // State UPDATING.
1540    UPDATING = 3;
1541  }
1542
1543  // Specifies how assets are selected for this index. Default to
1544  // entire_corpus if unspecified. Behavior in UpdateIndex: if update_mask
1545  // includes one of the asset_filter field paths, the index will be rebuilt
1546  // with latest assets, including their analyzed data and annotations.
1547  oneof asset_filter {
1548    // Include all assets under the corpus.
1549    bool entire_corpus = 9;
1550  }
1551
1552  // Output only. Resource name of the Index resource.
1553  // Format:
1554  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}`
1555  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1556
1557  // Optional. Optional user-specified display name of the index.
1558  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
1559
1560  // Optional. Optional description of the index.
1561  string description = 3 [(google.api.field_behavior) = OPTIONAL];
1562
1563  // Output only. State of the index.
1564  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1565
1566  // Output only. The create timestamp.
1567  google.protobuf.Timestamp create_time = 5
1568      [(google.api.field_behavior) = OUTPUT_ONLY];
1569
1570  // Output only. The update timestamp.
1571  google.protobuf.Timestamp update_time = 6
1572      [(google.api.field_behavior) = OUTPUT_ONLY];
1573
1574  // Output only. References to the deployed index instance.
1575  // Index of VIDEO_ON_DEMAND corpus can have at most one deployed index.
1576  // Index of IMAGE corpus can have multiple deployed indexes.
1577  repeated DeployedIndexReference deployed_indexes = 8
1578      [(google.api.field_behavior) = OUTPUT_ONLY];
1579}
1580
1581// Points to a DeployedIndex.
1582message DeployedIndexReference {
1583  // Immutable. A resource name of the IndexEndpoint.
1584  string index_endpoint = 1 [
1585    (google.api.field_behavior) = IMMUTABLE,
1586    (google.api.resource_reference) = {
1587      type: "visionai.googleapis.com/IndexEndpoint"
1588    }
1589  ];
1590}
1591
1592// Corpus is a set of media contents for management.
1593// Within a corpus, media shares the same data schema. Search is also restricted
1594// within a single corpus.
1595message Corpus {
1596  option (google.api.resource) = {
1597    type: "visionai.googleapis.com/Corpus"
1598    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}"
1599  };
1600
1601  // Type of the asset inside the corpus.
1602  enum Type {
1603    // The default type, not supposed to be used. If this default type is used,
1604    // the corpus will be created as STREAM_VIDEO corpus.
1605    TYPE_UNSPECIFIED = 0;
1606
1607    // Asset is a live streaming video.
1608    STREAM_VIDEO = 1;
1609
1610    // Asset is an image.
1611    IMAGE = 2;
1612
1613    // Asset is a batch video.
1614    VIDEO_ON_DEMAND = 3;
1615  }
1616
1617  // Resource name of the corpus.
1618  // Format:
1619  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
1620  string name = 1;
1621
1622  // Required. The corpus name to shown in the UI. The name can be up to 32
1623  // characters long.
1624  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
1625
1626  // Optional. Description of the corpus. Can be up to 25000 characters long.
1627  string description = 3 [(google.api.field_behavior) = OPTIONAL];
1628
1629  // Optional. The default TTL value for all assets under the corpus without a
1630  // asset level user-defined TTL. For STREAM_VIDEO type corpora, this is
1631  // required and the maximum allowed
1632  //   default_ttl is 10 years.
1633  google.protobuf.Duration default_ttl = 5
1634      [(google.api.field_behavior) = OPTIONAL];
1635
1636  // Optional. Type of the asset inside corpus.
1637  Type type = 7 [(google.api.field_behavior) = OPTIONAL];
1638
1639  // Default search capability setting on corpus level.
1640  SearchCapabilitySetting search_capability_setting = 8;
1641}
1642
1643// Request message for GetCorpus.
1644message GetCorpusRequest {
1645  // Required. The resource name of the corpus to retrieve.
1646  string name = 1 [
1647    (google.api.field_behavior) = REQUIRED,
1648    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1649  ];
1650}
1651
1652// Request message for UpdateCorpus.
1653message UpdateCorpusRequest {
1654  // Required. The corpus which replaces the resource on the server.
1655  Corpus corpus = 1 [(google.api.field_behavior) = REQUIRED];
1656
1657  // The list of fields to be updated.
1658  google.protobuf.FieldMask update_mask = 2;
1659}
1660
1661// Request message for ListCorpora.
1662message ListCorporaRequest {
1663  // Required. The resource name of the project from which to list corpora.
1664  string parent = 1 [(google.api.field_behavior) = REQUIRED];
1665
1666  // Requested page size. API may return fewer results than requested.
1667  // If negative, INVALID_ARGUMENT error will be returned.
1668  // If unspecified or 0, API will pick a default size, which is 10.
1669  // If the requested page size is larger than the maximum size, API will pick
1670  // use the maximum size, which is 20.
1671  int32 page_size = 2;
1672
1673  // A token identifying a page of results for the server to return.
1674  // Typically obtained via
1675  // [ListCorporaResponse.next_page_token][google.cloud.visionai.v1.ListCorporaResponse.next_page_token]
1676  // of the previous
1677  // [Warehouse.ListCorpora][google.cloud.visionai.v1.Warehouse.ListCorpora]
1678  // call.
1679  string page_token = 3;
1680
1681  // The filter applied to the returned corpora list.
1682  // Only the following restrictions are supported:
1683  // `type=<Corpus.Type>`,
1684  // `type!=<Corpus.Type>`.
1685  string filter = 5;
1686}
1687
1688// Response message for ListCorpora.
1689message ListCorporaResponse {
1690  // The corpora in the project.
1691  repeated Corpus corpora = 1;
1692
1693  // A token to retrieve next page of results.
1694  // Pass to
1695  // [ListCorporaRequest.page_token][google.cloud.visionai.v1.ListCorporaRequest.page_token]
1696  // to obtain that page.
1697  string next_page_token = 2;
1698}
1699
1700// Request message for DeleteCorpus.
1701message DeleteCorpusRequest {
1702  // Required. The resource name of the corpus to delete.
1703  string name = 1 [
1704    (google.api.field_behavior) = REQUIRED,
1705    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1706  ];
1707}
1708
1709// Request message for AnalyzeCorpus.
1710message AnalyzeCorpusRequest {
1711  // Required. The parent corpus resource where the assets will be analyzed.
1712  // Format:
1713  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
1714  string name = 1 [
1715    (google.api.field_behavior) = REQUIRED,
1716    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1717  ];
1718}
1719
1720// The metadata message for AnalyzeCorpus LRO.
1721message AnalyzeCorpusMetadata {
1722  // The metadata of the operation.
1723  OperationMetadata metadata = 1;
1724}
1725
1726// The response message for AnalyzeCorpus LRO.
1727message AnalyzeCorpusResponse {}
1728
1729// Request message for CreateDataSchema.
1730message CreateDataSchemaRequest {
1731  // Required. The parent resource where this data schema will be created.
1732  // Format:
1733  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
1734  string parent = 1 [
1735    (google.api.field_behavior) = REQUIRED,
1736    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
1737  ];
1738
1739  // Required. The data schema to create.
1740  DataSchema data_schema = 2 [(google.api.field_behavior) = REQUIRED];
1741}
1742
1743// Data schema indicates how the user specified annotation is interpreted in the
1744// system.
1745message DataSchema {
1746  option (google.api.resource) = {
1747    type: "visionai.googleapis.com/DataSchema"
1748    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}"
1749  };
1750
1751  // Resource name of the data schema in the form of:
1752  // `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}`
1753  // where {data_schema} part should be the same as the `key` field below.
1754  string name = 1;
1755
1756  // Required. The key of this data schema. This key should be matching the key
1757  // of user specified annotation and unique inside corpus. This value can be up
1758  // to 63 characters, and valid characters are /[a-z][0-9]-/. The first
1759  // character must be a letter, the last could be a letter or a number.
1760  string key = 2 [(google.api.field_behavior) = REQUIRED];
1761
1762  // The schema details mapping to the key.
1763  DataSchemaDetails schema_details = 3;
1764}
1765
1766// Data schema details indicates the data type and the data struct corresponding
1767// to the key of user specified annotation.
1768message DataSchemaDetails {
1769  // The configuration for `PROTO_ANY` data type.
1770  message ProtoAnyConfig {
1771    // The type URI of the proto message.
1772    string type_uri = 1;
1773  }
1774
1775  // The configuration for `LIST` data type.
1776  message ListConfig {
1777    // The value's data schema in the list.
1778    DataSchemaDetails value_schema = 1;
1779  }
1780
1781  // The configuration for `CUSTOMIZED_STRUCT` data type.
1782  message CustomizedStructConfig {
1783    // Direct child elements data schemas.
1784    map<string, DataSchemaDetails> field_schemas = 1;
1785  }
1786
1787  // The search strategy for annotations value of the `key`.
1788  message SearchStrategy {
1789    // The types of search strategies to be applied on the annotation key.
1790    enum SearchStrategyType {
1791      // Annotatation values of the `key` above will not be searchable.
1792      NO_SEARCH = 0;
1793
1794      // When searching with `key`, the value must be exactly as the annotation
1795      // value that has been ingested.
1796      EXACT_SEARCH = 1;
1797
1798      // When searching with `key`, Warehouse will perform broad search based on
1799      // semantic of the annotation value.
1800      SMART_SEARCH = 2;
1801    }
1802
1803    // The type of search strategy to be applied on the `key` above.
1804    // The allowed `search_strategy_type` is different for different data types,
1805    // which is documented in the DataSchemaDetails.DataType. Specifying
1806    // unsupported `search_strategy_type` for data types will result in
1807    // INVALID_ARGUMENT error.
1808    SearchStrategyType search_strategy_type = 1;
1809  }
1810
1811  // Data type of the annotation.
1812  enum DataType {
1813    // Unspecified type.
1814    DATA_TYPE_UNSPECIFIED = 0;
1815
1816    // Integer type.
1817    // Allowed search strategies:
1818    // - DataSchema.SearchStrategy.NO_SEARCH,
1819    // - DataSchema.SearchStrategy.EXACT_SEARCH.
1820    //   Supports query by IntRangeArray.
1821    INTEGER = 1;
1822
1823    // Float type.
1824    // Allowed search strategies:
1825    // - DataSchema.SearchStrategy.NO_SEARCH,
1826    // - DataSchema.SearchStrategy.EXACT_SEARCH.
1827    //   Supports query by FloatRangeArray.
1828    FLOAT = 2;
1829
1830    // String type.
1831    // Allowed search strategies:
1832    // - DataSchema.SearchStrategy.NO_SEARCH,
1833    // - DataSchema.SearchStrategy.EXACT_SEARCH,
1834    // - DataSchema.SearchStrategy.SMART_SEARCH.
1835    STRING = 3;
1836
1837    // Supported formats:
1838    // %Y-%m-%dT%H:%M:%E*S%E*z (absl::RFC3339_full)
1839    // %Y-%m-%dT%H:%M:%E*S
1840    // %Y-%m-%dT%H:%M%E*z
1841    // %Y-%m-%dT%H:%M
1842    // %Y-%m-%dT%H%E*z
1843    // %Y-%m-%dT%H
1844    // %Y-%m-%d%E*z
1845    // %Y-%m-%d
1846    // %Y-%m
1847    // %Y
1848    // Allowed search strategies:
1849    // - DataSchema.SearchStrategy.NO_SEARCH,
1850    // - DataSchema.SearchStrategy.EXACT_SEARCH.
1851    //   Supports query by DateTimeRangeArray.
1852    DATETIME = 5;
1853
1854    // Geo coordinate type.
1855    // Allowed search strategies:
1856    // - DataSchema.SearchStrategy.NO_SEARCH,
1857    // - DataSchema.SearchStrategy.EXACT_SEARCH.
1858    //   Supports query by GeoLocationArray.
1859    GEO_COORDINATE = 7;
1860
1861    // Type to pass any proto as available in annotations.proto. Only use
1862    // internally.
1863    // Available proto types and its corresponding search behavior:
1864    // - ImageObjectDetectionPredictionResult, allows SMART_SEARCH on
1865    //   display_names and NO_SEARCH.
1866    // - ClassificationPredictionResult, allows SMART_SEARCH on display_names
1867    //   and NO_SEARCH.
1868    // - ImageSegmentationPredictionResult, allows NO_SEARCH.
1869    // - VideoActionRecognitionPredictionResult, allows SMART_SEARCH on
1870    //   display_name and NO_SEARCH.
1871    // - VideoObjectTrackingPredictionResult, allows SMART_SEARCH on
1872    //   display_name and NO_SEARCH.
1873    // - VideoClassificationPredictionResult, allows SMART_SEARCH on
1874    //   display_name and NO_SEARCH.
1875    // - OccupancyCountingPredictionResult, allows EXACT_SEARCH on
1876    //   stats.full_frame_count.count and NO_SEARCH.
1877    // - ObjectDetectionPredictionResult, allows SMART_SEARCH on
1878    //   identified_boxes.entity.label_string and NO_SEARCH.
1879    PROTO_ANY = 8;
1880
1881    // Boolean type.
1882    // Allowed search strategies:
1883    // - DataSchema.SearchStrategy.NO_SEARCH,
1884    // - DataSchema.SearchStrategy.EXACT_SEARCH.
1885    BOOLEAN = 9;
1886
1887    // List type.
1888    //  - Each element in the list must be of the exact same data schema;
1889    //    otherwise, they are invalid arguments.
1890    //  - List level cannot set search strategy. Leaf node level can do.
1891    //  - Elements cannot be another list (no list of list).
1892    //  - Elements can be CUSTOMIZED_STRUCT, and max number of layers is 10.
1893    LIST = 10;
1894
1895    // Struct type.
1896    // - SearchStrategy:
1897    //   * Data Schema that's CUSTOMIZED_STRUCT cannot set search strategy.
1898    //   * Leaf-node elements allow setting search strategy based on element's
1899    //     SearchStrategy restriction.
1900    // - Nested layer restrictions:
1901    //   * Data Schema that's CUSTOMIZED_STRUCT allows its fields to be of
1902    //     CUSTOMIZED_STRUCT as well, but the overall layers restriction is 10.
1903    CUSTOMIZED_STRUCT = 6;
1904  }
1905
1906  // The granularity of annotations under this DataSchema.
1907  enum Granularity {
1908    // Unspecified granularity.
1909    GRANULARITY_UNSPECIFIED = 0;
1910
1911    // Asset-level granularity (annotations must not contain partition info).
1912    GRANULARITY_ASSET_LEVEL = 1;
1913
1914    // Partition-level granularity (annotations must contain partition info).
1915    GRANULARITY_PARTITION_LEVEL = 2;
1916  }
1917
1918  // Type of the annotation.
1919  DataType type = 1;
1920
1921  // Config for protobuf any type.
1922  ProtoAnyConfig proto_any_config = 6;
1923
1924  // Config for List data type.
1925  ListConfig list_config = 8;
1926
1927  // Config for CustomizedStruct data type.
1928  CustomizedStructConfig customized_struct_config = 9;
1929
1930  // The granularity associated with this DataSchema.
1931  Granularity granularity = 5;
1932
1933  // The search strategy to be applied on the `key` above.
1934  SearchStrategy search_strategy = 7;
1935}
1936
1937// Request message for UpdateDataSchema.
1938message UpdateDataSchemaRequest {
1939  // Required. The data schema's `name` field is used to identify the data
1940  // schema to be updated. Format:
1941  // `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}`
1942  DataSchema data_schema = 1 [(google.api.field_behavior) = REQUIRED];
1943
1944  // The list of fields to be updated.
1945  google.protobuf.FieldMask update_mask = 2;
1946}
1947
1948// Request message for GetDataSchema.
1949message GetDataSchemaRequest {
1950  // Required. The name of the data schema to retrieve.
1951  // Format:
1952  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`
1953  string name = 1 [
1954    (google.api.field_behavior) = REQUIRED,
1955    (google.api.resource_reference) = {
1956      type: "visionai.googleapis.com/DataSchema"
1957    }
1958  ];
1959}
1960
1961// Request message for DeleteDataSchema.
1962message DeleteDataSchemaRequest {
1963  // Required. The name of the data schema to delete.
1964  // Format:
1965  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`
1966  string name = 1 [
1967    (google.api.field_behavior) = REQUIRED,
1968    (google.api.resource_reference) = {
1969      type: "visionai.googleapis.com/DataSchema"
1970    }
1971  ];
1972}
1973
1974// Request message for ListDataSchemas.
1975message ListDataSchemasRequest {
1976  // Required. The parent, which owns this collection of data schemas.
1977  // Format:
1978  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
1979  string parent = 1 [
1980    (google.api.field_behavior) = REQUIRED,
1981    (google.api.resource_reference) = {
1982      child_type: "visionai.googleapis.com/DataSchema"
1983    }
1984  ];
1985
1986  // The maximum number of data schemas to return. The service may return fewer
1987  // than this value. If unspecified, at most 50 data schemas will be returned.
1988  // The maximum value is 1000; values above 1000 will be coerced to 1000.
1989  int32 page_size = 2;
1990
1991  // A page token, received from a previous `ListDataSchemas` call.
1992  // Provide this to retrieve the subsequent page.
1993  //
1994  // When paginating, all other parameters provided to `ListDataSchemas` must
1995  // match the call that provided the page token.
1996  string page_token = 3;
1997}
1998
1999// Response message for ListDataSchemas.
2000message ListDataSchemasResponse {
2001  // The data schemas from the specified corpus.
2002  repeated DataSchema data_schemas = 1;
2003
2004  // A token, which can be sent as `page_token` to retrieve the next page.
2005  // If this field is omitted, there are no subsequent pages.
2006  string next_page_token = 2;
2007}
2008
2009// Request message for CreateAnnotation.
2010message CreateAnnotationRequest {
2011  // Required. The parent resource where this annotation will be created.
2012  // Format:
2013  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
2014  string parent = 1 [
2015    (google.api.field_behavior) = REQUIRED,
2016    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
2017  ];
2018
2019  // Required. The annotation to create.
2020  Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED];
2021
2022  // Optional. The ID to use for the annotation, which will become the final
2023  // component of the annotation's resource name if user choose to specify.
2024  // Otherwise, annotation id will be generated by system.
2025  //
2026  // This value should be up to 63 characters, and valid characters
2027  // are /[a-z][0-9]-/. The first character must be a letter, the last could be
2028  // a letter or a number.
2029  optional string annotation_id = 3 [(google.api.field_behavior) = OPTIONAL];
2030}
2031
2032// An annotation is a resource in asset. It represents a key-value mapping of
2033// content in asset.
2034message Annotation {
2035  option (google.api.resource) = {
2036    type: "visionai.googleapis.com/Annotation"
2037    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}"
2038  };
2039
2040  // Resource name of the annotation.
2041  // Format:
2042  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`
2043  string name = 1;
2044
2045  // User provided annotation.
2046  UserSpecifiedAnnotation user_specified_annotation = 2;
2047}
2048
2049// Annotation provided by users.
2050message UserSpecifiedAnnotation {
2051  // Required. Key of the annotation. The key must be set with type by
2052  // CreateDataSchema.
2053  string key = 1 [(google.api.field_behavior) = REQUIRED];
2054
2055  // Value of the annotation. The value must be able to convert
2056  // to the type according to the data schema.
2057  AnnotationValue value = 2;
2058
2059  // Partition information in time and space for the sub-asset level annotation.
2060  Partition partition = 3;
2061}
2062
2063// Location Coordinate Representation
2064message GeoCoordinate {
2065  // Latitude Coordinate. Degrees [-90 .. 90]
2066  double latitude = 1;
2067
2068  // Longitude Coordinate. Degrees [-180 .. 180]
2069  double longitude = 2;
2070}
2071
2072// Value of annotation, including all types available in data schema.
2073message AnnotationValue {
2074  oneof value {
2075    // Value of int type annotation.
2076    int64 int_value = 1;
2077
2078    // Value of float type annotation.
2079    float float_value = 2;
2080
2081    // Value of string type annotation.
2082    string str_value = 3;
2083
2084    // Value of date time type annotation.
2085    string datetime_value = 5;
2086
2087    // Value of geo coordinate type annotation.
2088    GeoCoordinate geo_coordinate = 7;
2089
2090    // Value of any proto value.
2091    google.protobuf.Any proto_any_value = 8;
2092
2093    // Value of boolean type annotation.
2094    bool bool_value = 9;
2095
2096    // Value of customized struct annotation. This field does not have effects.
2097    // Use customized_struct_value instead for customized struct annotation.
2098    google.protobuf.Struct customized_struct_data_value = 10;
2099
2100    // Value of list type annotation.
2101    AnnotationList list_value = 11;
2102
2103    // Value of custom struct type annotation.
2104    AnnotationCustomizedStruct customized_struct_value = 6;
2105  }
2106}
2107
2108// List representation in annotation.
2109message AnnotationList {
2110  // The values of `LIST` data type annotation.
2111  repeated AnnotationValue values = 1;
2112}
2113
2114// Customized struct represnation in annotation.
2115message AnnotationCustomizedStruct {
2116  // A map from elements' keys to element's annotation value.
2117  map<string, AnnotationValue> elements = 2;
2118}
2119
2120// Request message for GetAnnotation API.
2121message ListAnnotationsRequest {
2122  // The parent, which owns this collection of annotations.
2123  // Format:
2124  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`
2125  string parent = 1 [
2126    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
2127  ];
2128
2129  // The maximum number of annotations to return. The service may return fewer
2130  // than this value. If unspecified, at most 50 annotations will be returned.
2131  // The maximum value is 1000; values above 1000 will be coerced to 1000.
2132  int32 page_size = 2;
2133
2134  // A page token, received from a previous `ListAnnotations` call.
2135  // Provide this to retrieve the subsequent page.
2136  //
2137  // When paginating, all other parameters provided to `ListAnnotations` must
2138  // match the call that provided the page token.
2139  string page_token = 3;
2140
2141  // The filter applied to the returned list.
2142  // We only support filtering for the following fields:
2143  // `partition.temporal_partition.start_time`,
2144  // `partition.temporal_partition.end_time`, and `key`.
2145  // For corpus of IMAGE type, only `key` is supported.
2146  // Timestamps are specified in the RFC-3339 format, and only one restriction
2147  // may be applied per field, joined by conjunctions.
2148  // Format:
2149  // "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND
2150  // partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND
2151  // key = "example_key""
2152  string filter = 4;
2153}
2154
2155// Request message for ListAnnotations API.
2156message ListAnnotationsResponse {
2157  // The annotations from the specified asset.
2158  repeated Annotation annotations = 1;
2159
2160  // A token, which can be sent as `page_token` to retrieve the next page.
2161  // If this field is omitted, there are no subsequent pages.
2162  string next_page_token = 2;
2163}
2164
2165// Request message for GetAnnotation API.
2166message GetAnnotationRequest {
2167  // Required. The name of the annotation to retrieve.
2168  // Format:
2169  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`
2170  string name = 1 [
2171    (google.api.field_behavior) = REQUIRED,
2172    (google.api.resource_reference) = {
2173      type: "visionai.googleapis.com/Annotation"
2174    }
2175  ];
2176}
2177
2178// Request message for UpdateAnnotation API.
2179message UpdateAnnotationRequest {
2180  // Required. The annotation to update.
2181  // The annotation's `name` field is used to identify the annotation to be
2182  // updated. Format:
2183  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`
2184  Annotation annotation = 1 [(google.api.field_behavior) = REQUIRED];
2185
2186  // The list of fields to be updated.
2187  google.protobuf.FieldMask update_mask = 2;
2188}
2189
2190// Request message for DeleteAnnotation API.
2191message DeleteAnnotationRequest {
2192  // Required. The name of the annotation to delete.
2193  // Format:
2194  // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`
2195  string name = 1 [
2196    (google.api.field_behavior) = REQUIRED,
2197    (google.api.resource_reference) = {
2198      type: "visionai.googleapis.com/Annotation"
2199    }
2200  ];
2201}
2202
2203// The request message for ImportAssets.
2204message ImportAssetsRequest {
2205  // The source.
2206  oneof source {
2207    // The file contains all assets information to be imported.
2208    // * The file is in JSONL format.
2209    // * Each line corresponding to one asset.
2210    // * Each line will be converted into InputImageAsset proto.
2211    string assets_gcs_uri = 2;
2212  }
2213
2214  // Required. The parent corpus resource where the assets will be imported.
2215  // Format:
2216  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
2217  string parent = 1 [
2218    (google.api.field_behavior) = REQUIRED,
2219    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
2220  ];
2221}
2222
2223// The metadata message for ImportAssets LRO.
2224message ImportAssetsMetadata {
2225  // The metadata of the operation.
2226  OperationMetadata metadata = 1;
2227}
2228
2229// The response message for ImportAssets LRO.
2230message ImportAssetsResponse {}
2231
2232// Request message for CreateSearchConfig.
2233message CreateSearchConfigRequest {
2234  // Required. The parent resource where this search configuration will be
2235  // created. Format:
2236  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`
2237  string parent = 1 [
2238    (google.api.field_behavior) = REQUIRED,
2239    (google.api.resource_reference) = {
2240      child_type: "visionai.googleapis.com/SearchConfig"
2241    }
2242  ];
2243
2244  // Required. The search config to create.
2245  SearchConfig search_config = 2 [(google.api.field_behavior) = REQUIRED];
2246
2247  // Required. ID to use for the new search config. Will become the final
2248  // component of the SearchConfig's resource name. This value should be up to
2249  // 63 characters, and valid characters are /[a-z][0-9]-_/. The first character
2250  // must be a letter, the last could be a letter or a number.
2251  string search_config_id = 3 [(google.api.field_behavior) = REQUIRED];
2252}
2253
2254// Request message for UpdateSearchConfig.
2255message UpdateSearchConfigRequest {
2256  // Required. The search configuration to update.
2257  //
2258  // The search configuration's `name` field is used to identify the resource to
2259  // be updated. Format:
2260  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`
2261  SearchConfig search_config = 1 [(google.api.field_behavior) = REQUIRED];
2262
2263  // The list of fields to be updated. If left unset, all field paths will be
2264  // updated/overwritten.
2265  google.protobuf.FieldMask update_mask = 2;
2266}
2267
2268// Request message for GetSearchConfig.
2269message GetSearchConfigRequest {
2270  // Required. The name of the search configuration to retrieve.
2271  // Format:
2272  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`
2273  string name = 1 [
2274    (google.api.field_behavior) = REQUIRED,
2275    (google.api.resource_reference) = {
2276      type: "visionai.googleapis.com/SearchConfig"
2277    }
2278  ];
2279}
2280
2281// Request message for DeleteSearchConfig.
2282message DeleteSearchConfigRequest {
2283  // Required. The name of the search configuration to delete.
2284  // Format:
2285  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`
2286  string name = 1 [
2287    (google.api.field_behavior) = REQUIRED,
2288    (google.api.resource_reference) = {
2289      type: "visionai.googleapis.com/SearchConfig"
2290    }
2291  ];
2292}
2293
2294// Request message for ListSearchConfigs.
2295message ListSearchConfigsRequest {
2296  // Required. The parent, which owns this collection of search configurations.
2297  // Format:
2298  // `projects/{project_number}/locations/{location}/corpora/{corpus}`
2299  string parent = 1 [
2300    (google.api.field_behavior) = REQUIRED,
2301    (google.api.resource_reference) = {
2302      child_type: "visionai.googleapis.com/SearchConfig"
2303    }
2304  ];
2305
2306  // The maximum number of search configurations to return. The service may
2307  // return fewer than this value. If unspecified, a page size of 50 will be
2308  // used. The maximum value is 1000; values above 1000 will be coerced to 1000.
2309  int32 page_size = 2;
2310
2311  // A page token, received from a previous `ListSearchConfigs` call.
2312  // Provide this to retrieve the subsequent page.
2313  //
2314  // When paginating, all other parameters provided to
2315  // `ListSearchConfigs` must match the call that provided the page
2316  // token.
2317  string page_token = 3;
2318}
2319
2320// Response message for ListSearchConfigs.
2321message ListSearchConfigsResponse {
2322  // The search configurations from the specified corpus.
2323  repeated SearchConfig search_configs = 1;
2324
2325  // A token, which can be sent as `page_token` to retrieve the next page.
2326  // If this field is omitted, there are no subsequent pages.
2327  string next_page_token = 2;
2328}
2329
2330// SearchConfig stores different properties that will affect search
2331// behaviors and search results.
2332message SearchConfig {
2333  option (google.api.resource) = {
2334    type: "visionai.googleapis.com/SearchConfig"
2335    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}"
2336  };
2337
2338  // Resource name of the search configuration.
2339  // For CustomSearchCriteria, search_config would be the search
2340  // operator name. For Facets, search_config would be the facet
2341  // dimension name.
2342  // Format:
2343  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`
2344  string name = 1;
2345
2346  // Establishes a FacetDimension and associated specifications.
2347  FacetProperty facet_property = 2;
2348
2349  // Creates a mapping between a custom SearchCriteria and one or more UGA keys.
2350  SearchCriteriaProperty search_criteria_property = 3;
2351}
2352
2353// Message representing IndexEndpoint resource. Indexes are deployed into it.
2354message IndexEndpoint {
2355  option (google.api.resource) = {
2356    type: "visionai.googleapis.com/IndexEndpoint"
2357    pattern: "projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}"
2358  };
2359
2360  // IndexEndpoint stage.
2361  enum State {
2362    // The default value. Should not be used.
2363    STATE_UNSPECIFIED = 0;
2364
2365    // State CREATING.
2366    CREATING = 1;
2367
2368    // State CREATED.
2369    CREATED = 2;
2370
2371    // State UPDATING.
2372    UPDATING = 3;
2373
2374    // State FAILED.
2375    FAILED = 4;
2376  }
2377
2378  // Output only. Resource name of the IndexEndpoint.
2379  // Format:
2380  // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint_id}`
2381  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
2382
2383  // Optional. Display name of the IndexEndpoint. Can be up to 32 characters
2384  // long.
2385  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
2386
2387  // Optional. Description of the IndexEndpoint. Can be up to 25000 characters
2388  // long.
2389  string description = 3 [(google.api.field_behavior) = OPTIONAL];
2390
2391  // Output only. The Index deployed in this IndexEndpoint.
2392  DeployedIndex deployed_index = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
2393
2394  // Output only. IndexEndpoint state.
2395  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
2396
2397  // Optional. The labels applied to a resource must meet the following
2398  // requirements:
2399  //
2400  // * Each resource can have multiple labels, up to a maximum of 64.
2401  // * Each label must be a key-value pair.
2402  // * Keys have a minimum length of 1 character and a maximum length of 63
2403  //   characters and cannot be empty. Values can be empty and have a maximum
2404  //   length of 63 characters.
2405  // * Keys and values can contain only lowercase letters, numeric characters,
2406  //   underscores, and dashes. All characters must use UTF-8 encoding, and
2407  //   international characters are allowed.
2408  // * The key portion of a label must be unique. However, you can use the same
2409  //   key with multiple resources.
2410  // * Keys must start with a lowercase letter or international character.
2411  //
2412  // See [Google Cloud
2413  // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
2414  // for more details.
2415  map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
2416
2417  // Output only. Create timestamp.
2418  google.protobuf.Timestamp create_time = 7
2419      [(google.api.field_behavior) = OUTPUT_ONLY];
2420
2421  // Output only. Update timestamp.
2422  google.protobuf.Timestamp update_time = 8
2423      [(google.api.field_behavior) = OUTPUT_ONLY];
2424}
2425
2426// Request message for CreateIndexEndpoint.
2427message CreateIndexEndpointRequest {
2428  // Required. Format: `projects/{project}/locations/{location}`
2429  string parent = 1 [
2430    (google.api.field_behavior) = REQUIRED,
2431    (google.api.resource_reference) = {
2432      type: "locations.googleapis.com/Location"
2433    }
2434  ];
2435
2436  // Optional. The ID to use for the IndexEndpoint, which will become the final
2437  // component of the IndexEndpoint's resource name if the user specifies it.
2438  // Otherwise, IndexEndpoint id will be autogenerated.
2439  //
2440  // This value should be up to 63 characters, and valid characters
2441  // are a-z, 0-9 and dash (-). The first character must be a letter, the last
2442  // must be a letter or a number.
2443  string index_endpoint_id = 2 [(google.api.field_behavior) = OPTIONAL];
2444
2445  // Required. The resource being created.
2446  IndexEndpoint index_endpoint = 3 [(google.api.field_behavior) = REQUIRED];
2447}
2448
2449// Metadata message for CreateIndexEndpoint.
2450message CreateIndexEndpointMetadata {
2451  // Common metadata of the long-running operation.
2452  OperationMetadata operation_metadata = 1;
2453}
2454
2455// Request message for GetIndexEndpoint.
2456message GetIndexEndpointRequest {
2457  // Required. Name of the IndexEndpoint resource.
2458  string name = 1 [
2459    (google.api.field_behavior) = REQUIRED,
2460    (google.api.resource_reference) = {
2461      type: "visionai.googleapis.com/IndexEndpoint"
2462    }
2463  ];
2464}
2465
2466// Request message for ListIndexEndpoints.
2467message ListIndexEndpointsRequest {
2468  // Required. Format: `projects/{project}/locations/{location}`
2469  string parent = 1 [
2470    (google.api.field_behavior) = REQUIRED,
2471    (google.api.resource_reference) = {
2472      type: "locations.googleapis.com/Location"
2473    }
2474  ];
2475
2476  // Optional. Requested page size. Server may return fewer items than
2477  // requested. The service may return fewer than this value. If unspecified, a
2478  // page size of 50 will be used. The maximum value is 1000; values above 1000
2479  // will be coerced to 1000.
2480  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
2481
2482  // Optional. A token identifying a page of results the server should return.
2483  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
2484
2485  // Optional. The filter applied to the returned list.
2486  // We only support filtering for the `deployed_image_index.image_index` field.
2487  // However, to filter by a corpus instead of an image index, simply use
2488  // `deployed_image_index.corpus`, which will return all endpoints with
2489  // `deployed_image_index.image_index` inside of the given corpus.
2490  // A basic filter on image index would look like:
2491  //   deployed_image_index.image_index =
2492  //     "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index"
2493  // A basic filter on corpus would look like:
2494  //   deployed_image_index.corpus =
2495  //     "projects/123/locations/us-central1/corpora/my_corpus"
2496  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
2497}
2498
2499// Response message for ListIndexEndpoints.
2500message ListIndexEndpointsResponse {
2501  // The list of IndexEndpoints.
2502  repeated IndexEndpoint index_endpoints = 1;
2503
2504  // A token identifying a page of results the server should return.
2505  string next_page_token = 2;
2506}
2507
2508// Request message for UpdateIndexEndpoint.
2509message UpdateIndexEndpointRequest {
2510  // Required. The resource being updated.
2511  IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED];
2512
2513  // Required. Field mask is used to specify the fields to be overwritten in the
2514  // IndexEndpoint resource by the update.
2515  // The fields specified in the update_mask are relative to the resource, not
2516  // the full request.
2517  // A field of the resource will be overwritten if it is in the mask.
2518  // Empty field mask is not allowed.
2519  // If the mask is "*", then this is a full replacement of the resource.
2520  google.protobuf.FieldMask update_mask = 2
2521      [(google.api.field_behavior) = REQUIRED];
2522}
2523
2524// Metadata message for UpdateIndexEndpoint.
2525message UpdateIndexEndpointMetadata {
2526  // Common metadata of the long-running operation.
2527  OperationMetadata operation_metadata = 1;
2528}
2529
2530// Request message for DeleteIndexEndpoint.
2531message DeleteIndexEndpointRequest {
2532  // Required. Name of the resource.
2533  string name = 1 [
2534    (google.api.field_behavior) = REQUIRED,
2535    (google.api.resource_reference) = {
2536      type: "visionai.googleapis.com/IndexEndpoint"
2537    }
2538  ];
2539}
2540
2541// Metadata message for DeleteIndexEndpoint.
2542message DeleteIndexEndpointMetadata {
2543  // Common metadata of the long-running operation.
2544  OperationMetadata operation_metadata = 1;
2545}
2546
2547// Request message for DeployIndex.
2548message DeployIndexRequest {
2549  // Required. IndexEndpoint the index is deployed to.
2550  // Format:
2551  // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
2552  string index_endpoint = 1 [
2553    (google.api.field_behavior) = REQUIRED,
2554    (google.api.resource_reference) = {
2555      type: "visionai.googleapis.com/IndexEndpoint"
2556    }
2557  ];
2558
2559  // Required. Index to deploy.
2560  DeployedIndex deployed_index = 3 [(google.api.field_behavior) = REQUIRED];
2561}
2562
2563// DeployIndex response once the operation is done.
2564message DeployIndexResponse {}
2565
2566// Metadata message for DeployIndex.
2567message DeployIndexMetadata {
2568  // Common metadata of the long-running operation.
2569  OperationMetadata operation_metadata = 1;
2570
2571  // Output only. The index being deployed.
2572  string deployed_index = 2 [
2573    (google.api.field_behavior) = OUTPUT_ONLY,
2574    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
2575  ];
2576}
2577
2578// Metadata message for UndeployIndex.
2579message UndeployIndexMetadata {
2580  // Common metadata of the long-running operation.
2581  OperationMetadata operation_metadata = 1;
2582
2583  // Output only. The index being undeployed.
2584  string deployed_index = 2 [
2585    (google.api.field_behavior) = OUTPUT_ONLY,
2586    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
2587  ];
2588}
2589
2590// Request message for UndeployIndexEndpoint.
2591message UndeployIndexRequest {
2592  // Required. Resource name of the IndexEndpoint resource on which the
2593  // undeployment will act. Format:
2594  // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
2595  string index_endpoint = 1 [
2596    (google.api.field_behavior) = REQUIRED,
2597    (google.api.resource_reference) = {
2598      type: "visionai.googleapis.com/IndexEndpoint"
2599    }
2600  ];
2601}
2602
2603// UndeployIndex response once the operation is done.
2604message UndeployIndexResponse {}
2605
2606// A deployment of an Index.
2607message DeployedIndex {
2608  // Required. Name of the deployed Index.
2609  // Format:
2610  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}`
2611  string index = 1 [
2612    (google.api.field_behavior) = REQUIRED,
2613    (google.api.resource_reference) = { type: "visionai.googleapis.com/Index" }
2614  ];
2615}
2616
2617// Central configuration for a facet.
2618message FacetProperty {
2619  // If bucket type is FIXED_RANGE, specify how values are bucketized. Use
2620  // FixedRangeBucketSpec when you want to create multiple buckets with equal
2621  // granularities. Using integer bucket value as an example, when
2622  // bucket_start = 0, bucket_granularity = 10, bucket_count = 5, this facet
2623  // will be aggregated via the following buckets:
2624  // [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf).
2625  // Notably, bucket_count <= 1 is an invalid spec.
2626  message FixedRangeBucketSpec {
2627    // Lower bound of the bucket. NOTE: Only integer type is currently supported
2628    // for this field.
2629    FacetValue bucket_start = 1;
2630
2631    // Bucket granularity. NOTE: Only integer type is currently supported for
2632    // this field.
2633    FacetValue bucket_granularity = 2;
2634
2635    // Total number of buckets.
2636    int32 bucket_count = 3;
2637  }
2638
2639  // If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use
2640  // integer bucket value as an example, when the endpoints are 0, 10, 100, and
2641  // 1000, we will generate the following facets:
2642  // [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf).
2643  // Notably:
2644  // - endpoints must be listed in ascending order. Otherwise, the SearchConfig
2645  //   API will reject the facet config.
2646  // - < 1 endpoints is an invalid spec.
2647  message CustomRangeBucketSpec {
2648    // Currently, only integer type is supported for this field.
2649    repeated FacetValue endpoints = 1;
2650  }
2651
2652  // If bucket type is DATE, specify how date values are bucketized.
2653  message DateTimeBucketSpec {
2654    // Granularity enum for the datetime bucket.
2655    enum Granularity {
2656      // Unspecified granularity.
2657      GRANULARITY_UNSPECIFIED = 0;
2658
2659      // Granularity is year.
2660      YEAR = 1;
2661
2662      // Granularity is month.
2663      MONTH = 2;
2664
2665      // Granularity is day.
2666      DAY = 3;
2667    }
2668
2669    // Granularity of date type facet.
2670    Granularity granularity = 1;
2671  }
2672
2673  oneof range_facet_config {
2674    // Fixed range facet bucket config.
2675    FixedRangeBucketSpec fixed_range_bucket_spec = 5;
2676
2677    // Custom range facet bucket config.
2678    CustomRangeBucketSpec custom_range_bucket_spec = 6;
2679
2680    // Datetime range facet bucket config.
2681    DateTimeBucketSpec datetime_bucket_spec = 7;
2682  }
2683
2684  // Name of the facets, which are the dimensions users want to use to refine
2685  // search results. `mapped_fields` will match UserSpecifiedDataSchema keys.
2686  //
2687  // For example, user can add a bunch of UGAs with the same key, such as
2688  // player:adam, player:bob, player:charles. When multiple mapped_fields are
2689  // specified, will merge their value together as final facet value. E.g.
2690  // home_team: a, home_team:b, away_team:a, away_team:c, when facet_field =
2691  // [home_team, away_team], facet_value will be [a, b, c].
2692  //
2693  // UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the
2694  // mapped_field equals the parent SearchConfig.name, the parent must
2695  // also contain a SearchCriteriaProperty that maps to the same fields.
2696  // mapped_fields must not be empty.
2697  repeated string mapped_fields = 1;
2698
2699  // Display name of the facet. To be used by UI for facet rendering.
2700  string display_name = 2;
2701
2702  // Maximum number of unique bucket to return for one facet. Bucket number can
2703  // be large for high-cardinality facet such as "player". We only return top-n
2704  // most related ones to user. If it's <= 0, the server will decide the
2705  // appropriate result_size.
2706  int64 result_size = 3;
2707
2708  // Facet bucket type e.g. value, range.
2709  FacetBucketType bucket_type = 4;
2710}
2711
2712// Search resource: SearchHypernym.
2713// For example,
2714// { hypernym: "vehicle"
2715//   hyponyms: ["sedan", "truck"] }
2716// This means in SMART_SEARCH mode, searching for "vehicle" will also return
2717// results with "sedan" or "truck" as annotations.
2718message SearchHypernym {
2719  option (google.api.resource) = {
2720    type: "visionai.googleapis.com/SearchHypernym"
2721    pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}"
2722  };
2723
2724  // Resource name of the SearchHypernym.
2725  // Format:
2726  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
2727  string name = 1;
2728
2729  // The hypernym.
2730  string hypernym = 2;
2731
2732  // Hyponyms that the hypernym is mapped to.
2733  repeated string hyponyms = 3;
2734}
2735
2736// Request message for creating SearchHypernym.
2737message CreateSearchHypernymRequest {
2738  // Required. The parent resource where this SearchHypernym will be created.
2739  // Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`
2740  string parent = 1 [
2741    (google.api.field_behavior) = REQUIRED,
2742    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
2743  ];
2744
2745  // Required. The SearchHypernym to create.
2746  SearchHypernym search_hypernym = 2 [(google.api.field_behavior) = REQUIRED];
2747
2748  // Optional. The search hypernym id.
2749  // If omitted, a random UUID will be generated.
2750  optional string search_hypernym_id = 3
2751      [(google.api.field_behavior) = OPTIONAL];
2752}
2753
2754// Request message for updating SearchHypernym.
2755message UpdateSearchHypernymRequest {
2756  // Required. The SearchHypernym to update.
2757  // The search hypernym's `name` field is used to identify the search hypernym
2758  // to be updated. Format:
2759  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
2760  SearchHypernym search_hypernym = 1 [(google.api.field_behavior) = REQUIRED];
2761
2762  // The list of fields to be updated. If left unset, all field paths will be
2763  // updated/overwritten.
2764  google.protobuf.FieldMask update_mask = 2;
2765}
2766
2767// Request message for getting SearchHypernym.
2768message GetSearchHypernymRequest {
2769  // Required. The name of the SearchHypernym to retrieve.
2770  // Format:
2771  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
2772  string name = 1 [
2773    (google.api.field_behavior) = REQUIRED,
2774    (google.api.resource_reference) = {
2775      type: "visionai.googleapis.com/SearchHypernym"
2776    }
2777  ];
2778}
2779
2780// Request message for deleting SearchHypernym.
2781message DeleteSearchHypernymRequest {
2782  // Required. The name of the SearchHypernym to delete.
2783  // Format:
2784  // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
2785  string name = 1 [
2786    (google.api.field_behavior) = REQUIRED,
2787    (google.api.resource_reference) = {
2788      type: "visionai.googleapis.com/SearchHypernym"
2789    }
2790  ];
2791}
2792
2793// Request message for listing SearchHypernyms.
2794message ListSearchHypernymsRequest {
2795  // Required. The parent, which owns this collection of SearchHypernyms.
2796  // Format:
2797  // `projects/{project_number}/locations/{location}/corpora/{corpus}`
2798  string parent = 1 [
2799    (google.api.field_behavior) = REQUIRED,
2800    (google.api.resource_reference) = {
2801      child_type: "visionai.googleapis.com/SearchHypernym"
2802    }
2803  ];
2804
2805  // The maximum number of SearchHypernyms returned. The service may
2806  // return fewer than this value. If unspecified, a page size of 50 will be
2807  // used. The maximum value is 1000; values above 1000 will be coerced to 1000.
2808  int32 page_size = 2;
2809
2810  // A page token, received from a previous `SearchHypernym` call.
2811  // Provide this to retrieve the subsequent page.
2812  //
2813  // When paginating, all other parameters provided to
2814  // `SearchHypernym` must match the call that provided the page
2815  // token.
2816  string page_token = 3;
2817}
2818
2819// Response message for listing SearchHypernyms.
2820message ListSearchHypernymsResponse {
2821  // The SearchHypernyms from the specified corpus.
2822  repeated SearchHypernym search_hypernyms = 1;
2823
2824  // A token, which can be sent as `page_token` to retrieve the next page.
2825  // If this field is omitted, there are no subsequent pages.
2826  string next_page_token = 2;
2827}
2828
2829// Central configuration for custom search criteria.
2830message SearchCriteriaProperty {
2831  // Each mapped_field corresponds to a UGA key. To understand how this property
2832  // works, take the following example. In the SearchConfig table, the
2833  // user adds this entry:
2834  //   search_config {
2835  //     name: "person"
2836  //     search_criteria_property {
2837  //       mapped_fields: "player"
2838  //       mapped_fields: "coach"
2839  //     }
2840  //   }
2841  //
2842  // Now, when a user issues a query like:
2843  //   criteria {
2844  //     field: "person"
2845  //     text_array {
2846  //       txt_values: "Tom Brady"
2847  //       txt_values: "Bill Belichick"
2848  //     }
2849  //   }
2850  //
2851  // MWH search will return search documents where (player=Tom Brady ||
2852  // coach=Tom Brady || player=Bill Belichick || coach=Bill Belichick).
2853  repeated string mapped_fields = 1;
2854}
2855
2856// Definition of a single value with generic type.
2857message FacetValue {
2858  oneof value {
2859    // String type value.
2860    string string_value = 1;
2861
2862    // Integer type value.
2863    int64 integer_value = 2;
2864
2865    // Datetime type value.
2866    google.type.DateTime datetime_value = 3;
2867  }
2868}
2869
2870// Holds the facet value, selections state, and metadata.
2871message FacetBucket {
2872  // The range of values [start, end) for which faceting is applied.
2873  message Range {
2874    // Start of the range. Non-existence indicates some bound (e.g. -inf).
2875    FacetValue start = 1;
2876
2877    // End of the range. Non-existence indicates some bound (e.g. inf).
2878    FacetValue end = 2;
2879  }
2880
2881  // Bucket associated with a facet. For example, bucket of facet “team”
2882  // can be "49ers", "patriots", etc; bucket of facet "player" can be "tom
2883  // brady", "drew brees", etc.
2884  oneof bucket_value {
2885    // Singular value.
2886    FacetValue value = 2;
2887
2888    // Range value.
2889    Range range = 4;
2890  }
2891
2892  // Whether one facet bucket is selected. This field represents user's facet
2893  // selection. It is set by frontend in SearchVideosRequest.
2894  bool selected = 3;
2895}
2896
2897// A group of facet buckets to be passed back and forth between backend &
2898// frontend.
2899message FacetGroup {
2900  // Unique id of the facet group.
2901  string facet_id = 1;
2902
2903  // Display name of the facet. To be used by UI for facet rendering.
2904  string display_name = 2;
2905
2906  // Buckets associated with the facet. E.g. for "Team" facet, the bucket
2907  // can be 49ers, patriots, etc.
2908  repeated FacetBucket buckets = 3;
2909
2910  // Facet bucket type.
2911  FacetBucketType bucket_type = 4;
2912
2913  // If true, return query matched annotations for this facet group's selection.
2914  // This option is only applicable for facets based on partition level
2915  // annotations. It supports the following facet values:
2916  //  - INTEGER
2917  //  - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
2918  bool fetch_matched_annotations = 5;
2919}
2920
2921// Request message for IngestAsset API.
2922message IngestAssetRequest {
2923  // Configuration for the data.
2924  message Config {
2925    // Type information for video data.
2926    message VideoType {
2927      // Container format of the video.
2928      enum ContainerFormat {
2929        // The default type, not supposed to be used.
2930        CONTAINER_FORMAT_UNSPECIFIED = 0;
2931
2932        // Mp4 container format.
2933        CONTAINER_FORMAT_MP4 = 1;
2934      }
2935
2936      // Container format of the video data.
2937      ContainerFormat container_format = 1;
2938    }
2939
2940    oneof data_type {
2941      // Type information for video data.
2942      VideoType video_type = 2;
2943    }
2944
2945    // Required. The resource name of the asset that the ingested data belongs
2946    // to.
2947    string asset = 1 [
2948      (google.api.field_behavior) = REQUIRED,
2949      (google.api.resource_reference) = {
2950        type: "visionai.googleapis.com/Asset"
2951      }
2952    ];
2953  }
2954
2955  // Contains the data and the corresponding time range this data is for.
2956  message TimeIndexedData {
2957    // Data to be ingested.
2958    bytes data = 1;
2959
2960    // Time range of the data.
2961    Partition.TemporalPartition temporal_partition = 2;
2962  }
2963
2964  oneof streaming_request {
2965    // Provides information for the data and the asset resource name that the
2966    // data belongs to. The first `IngestAssetRequest` message must only contain
2967    // a `Config` message.
2968    Config config = 1;
2969
2970    // Data to be ingested.
2971    TimeIndexedData time_indexed_data = 2;
2972  }
2973}
2974
2975// Response message for IngestAsset API.
2976message IngestAssetResponse {
2977  // Time range of the data that has been successfully ingested.
2978  Partition.TemporalPartition successfully_ingested_partition = 1;
2979}
2980
2981// Request message for ClipAsset API.
2982message ClipAssetRequest {
2983  // Required. The resource name of the asset to request clips for.
2984  // Format:
2985  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
2986  string name = 1 [
2987    (google.api.field_behavior) = REQUIRED,
2988    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
2989  ];
2990
2991  // Required. The time range to request clips for.
2992  Partition.TemporalPartition temporal_partition = 2
2993      [(google.api.field_behavior) = REQUIRED];
2994}
2995
2996// Response message for ClipAsset API.
2997message ClipAssetResponse {
2998  // Signed uri with corresponding time range.
2999  message TimeIndexedUri {
3000    // Time range of the video that the uri is for.
3001    Partition.TemporalPartition temporal_partition = 1;
3002
3003    // Signed uri to download the video clip.
3004    string uri = 2;
3005  }
3006
3007  // A list of signed uris to download the video clips that cover the requested
3008  // time range ordered by time.
3009  repeated TimeIndexedUri time_indexed_uris = 1;
3010}
3011
3012// Request message for GenerateHlsUri API.
3013message GenerateHlsUriRequest {
3014  // Required. The resource name of the asset to request clips for.
3015  // Format:
3016  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
3017  string name = 1 [
3018    (google.api.field_behavior) = REQUIRED,
3019    (google.api.resource_reference) = { type: "visionai.googleapis.com/Asset" }
3020  ];
3021
3022  // The time range to request clips for. Will be ignored if `get_live_view` is
3023  // set to True. The total time range requested should be smaller than 24h.
3024  repeated Partition.TemporalPartition temporal_partitions = 2;
3025
3026  // Option to exclusively show a livestream of the asset with up to 3 minutes
3027  // of backlog data.
3028  bool live_view_enabled = 3;
3029}
3030
3031// Response message for GenerateHlsUri API.
3032message GenerateHlsUriResponse {
3033  // A signed uri to download the HLS manifest corresponding to the requested
3034  // times.
3035  string uri = 1;
3036
3037  // A list of temporal partitions of the content returned in the order they
3038  // appear in the stream.
3039  repeated Partition.TemporalPartition temporal_partitions = 2;
3040}
3041
3042// Request message for SearchAssets.
3043message SearchAssetsRequest {
3044  // Sorting specification. If this field is not specified, by default:
3045  // - STREAM_VIDEO: search results are sorted by the start time.
3046  oneof sort_spec {
3047    // Sort by the value under the data schema key.
3048    SchemaKeySortingStrategy schema_key_sorting_strategy = 9;
3049  }
3050
3051  // Required. The parent corpus to search.
3052  // Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}'
3053  string corpus = 1 [
3054    (google.api.field_behavior) = REQUIRED,
3055    (google.api.resource_reference) = { type: "visionai.googleapis.com/Corpus" }
3056  ];
3057
3058  // The number of results to be returned in this page. If it's 0, the server
3059  // will decide the appropriate page_size.
3060  int32 page_size = 2;
3061
3062  // The continuation token to fetch the next page. If empty, it means it is
3063  // fetching the first page.
3064  string page_token = 3;
3065
3066  // Time ranges that matching video content must fall within. If no ranges are
3067  // provided, there will be no time restriction. This field is treated just
3068  // like the criteria below, but defined separately for convenience as it is
3069  // used frequently. Note that if the end_time is in the future, it will be
3070  // clamped to the time the request was received.
3071  DateTimeRangeArray content_time_ranges = 5;
3072
3073  // Criteria applied to search results.
3074  repeated Criteria criteria = 4;
3075
3076  // Stores most recent facet selection state. Only facet groups with user's
3077  // selection will be presented here. Selection state is either selected or
3078  // unselected. Only selected facet buckets will be used as search criteria.
3079  repeated FacetGroup facet_selections = 6;
3080
3081  // A list of annotation keys to specify the annotations to be retrieved and
3082  // returned with each search result.
3083  // Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search
3084  // strategy must not be NO_SEARCH.
3085  repeated string result_annotation_keys = 8;
3086
3087  // Global search query. Allows user to search assets without needing to
3088  // specify which field the value belongs to.
3089  string search_query = 10;
3090}
3091
3092// Request message for SearchIndexEndpoint.
3093message SearchIndexEndpointRequest {
3094  // The oneof global search query.
3095  oneof query {
3096    // An image-only query.
3097    ImageQuery image_query = 2;
3098
3099    // A text-only query.
3100    string text_query = 3;
3101  }
3102
3103  // Required. The index endpoint to search.
3104  // Format:
3105  // `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}'
3106  string index_endpoint = 1 [
3107    (google.api.field_behavior) = REQUIRED,
3108    (google.api.resource_reference) = {
3109      type: "visionai.googleapis.com/IndexEndpoint"
3110    }
3111  ];
3112
3113  // Criteria applied to search results.
3114  repeated Criteria criteria = 4;
3115
3116  // Criteria to exclude from search results.
3117  // Note that `fetch_matched_annotations` will be ignored.
3118  repeated Criteria exclusion_criteria = 7;
3119
3120  // Requested page size. API may return fewer results than requested.
3121  // If negative, INVALID_ARGUMENT error will be returned.
3122  // If unspecified or 0, API will pick a default size, which is 10.
3123  // If the requested page size is larger than the maximum size, API will pick
3124  // the maximum size, which is 100.
3125  int32 page_size = 5;
3126
3127  // The continuation token to fetch the next page. If empty, it means it is
3128  // fetching the first page.
3129  string page_token = 6;
3130}
3131
3132// Image query for search endpoint request.
3133message ImageQuery {
3134  oneof image {
3135    // Input image in raw bytes.
3136    bytes input_image = 1;
3137
3138    // Resource name of the asset. Only supported in IMAGE corpus type.
3139    // Format:
3140    // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
3141    string asset = 2 [(google.api.resource_reference) = {
3142      type: "visionai.googleapis.com/Asset"
3143    }];
3144  }
3145}
3146
3147// A strategy to specify how to sort by data schema key.
3148message SchemaKeySortingStrategy {
3149  // Option for one data schema key.
3150  message Option {
3151    // When one result has multiple values with the same key, specify
3152    // which value is used to sort. By default, AGGREGATE_METHOD_LARGEST
3153    // is used when results are sorted in decreasing order,
3154    // AGGREGATE_METHOD_SMALLEST is used when results are sorted in
3155    // incresing order.
3156    enum AggregateMethod {
3157      // The unspecified aggregate method will be overwritten as mentioned
3158      // above.
3159      AGGREGATE_METHOD_UNSPECIFIED = 0;
3160
3161      // Take the (lexicographical or numerical) largest value to sort.
3162      AGGREGATE_METHOD_LARGEST = 1;
3163
3164      // Take the (lexicographical or numerical) smallest value to sort.
3165      AGGREGATE_METHOD_SMALLEST = 2;
3166    }
3167
3168    // The data used to sort.
3169    string data_schema_key = 1;
3170
3171    // Whether to sort in decreasing order or increasing order.
3172    // By default, results are sorted in incresing order.
3173    bool sort_decreasing = 2;
3174
3175    // Aggregate method for the current data schema key.
3176    optional AggregateMethod aggregate_method = 3;
3177  }
3178
3179  // Options in the front have high priority than those in the back.
3180  repeated Option options = 1;
3181}
3182
3183// The metadata for DeleteAsset API that embeds in
3184// [metadata][google.longrunning.Operation.metadata] field.
3185message DeleteAssetMetadata {}
3186
3187// Stores the criteria-annotation matching results for each search result item.
3188message AnnotationMatchingResult {
3189  // The criteria used for matching. It can be an input search criteria or a
3190  // criteria converted from a facet selection.
3191  Criteria criteria = 1;
3192
3193  // Matched annotations for the criteria.
3194  repeated Annotation matched_annotations = 2;
3195
3196  // Status of the match result. Possible values:
3197  // FAILED_PRECONDITION - the criteria is not eligible for match.
3198  // OK - matching is performed.
3199  google.rpc.Status status = 3;
3200}
3201
3202// Search result contains asset name and corresponding time ranges.
3203message SearchResultItem {
3204  // The resource name of the asset.
3205  // Format:
3206  // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
3207  string asset = 1;
3208
3209  // The matched asset segments.
3210  // Deprecated: please use singular `segment` field.
3211  repeated Partition.TemporalPartition segments = 2 [deprecated = true];
3212
3213  // The matched asset segment.
3214  Partition.TemporalPartition segment = 5;
3215
3216  // Relevance of this `SearchResultItem` to user search request.
3217  // Currently available only in Image Warehouse, and by default represents
3218  // cosine similarity.  In the future can be other measures such as "dot
3219  // product" or "topicality" requested in the search request.
3220  double relevance = 6;
3221
3222  // Search result annotations specified by result_annotation_keys in search
3223  // request.
3224  repeated Annotation requested_annotations = 3;
3225
3226  // Criteria or facet-selection based annotation matching results associated to
3227  // this search result item. Only contains results for criteria or
3228  // facet_selections with fetch_matched_annotations=true.
3229  repeated AnnotationMatchingResult annotation_matching_results = 4;
3230}
3231
3232// Response message for SearchAssets.
3233message SearchAssetsResponse {
3234  // Returned search results.
3235  repeated SearchResultItem search_result_items = 1;
3236
3237  // The next-page continuation token.
3238  string next_page_token = 2;
3239
3240  // Facet search results of a given query, which contains user's
3241  // already-selected facet values and updated facet search results.
3242  repeated FacetGroup facet_results = 3;
3243}
3244
3245// Response message for SearchIndexEndpoint.
3246message SearchIndexEndpointResponse {
3247  // Returned search results.
3248  repeated SearchResultItem search_result_items = 1;
3249
3250  // The next-page continuation token.
3251  // If this field is omitted, there are no subsequent pages.
3252  string next_page_token = 2;
3253}
3254
3255// Integer range type.
3256message IntRange {
3257  // Start of the int range.
3258  optional int64 start = 1;
3259
3260  // End of the int range.
3261  optional int64 end = 2;
3262}
3263
3264// Float range type.
3265message FloatRange {
3266  // Start of the float range.
3267  optional float start = 1;
3268
3269  // End of the float range.
3270  optional float end = 2;
3271}
3272
3273// A list of string-type values.
3274message StringArray {
3275  // String type values.
3276  repeated string txt_values = 1;
3277}
3278
3279// A list of integer range values.
3280message IntRangeArray {
3281  // Int range values.
3282  repeated IntRange int_ranges = 1;
3283}
3284
3285// A list of float range values.
3286message FloatRangeArray {
3287  // Float range values.
3288  repeated FloatRange float_ranges = 1;
3289}
3290
3291// Datetime range type.
3292message DateTimeRange {
3293  // Start date time.
3294  google.type.DateTime start = 1;
3295
3296  // End data time.
3297  google.type.DateTime end = 2;
3298}
3299
3300// A list of datetime range values.
3301message DateTimeRangeArray {
3302  // Date time ranges.
3303  repeated DateTimeRange date_time_ranges = 1;
3304}
3305
3306// Representation of a circle area.
3307message CircleArea {
3308  // Latitude of circle area's center. Degrees [-90 .. 90]
3309  double latitude = 1;
3310
3311  // Longitude of circle area's center. Degrees [-180 .. 180]
3312  double longitude = 2;
3313
3314  // Radius of the circle area in meters.
3315  double radius_meter = 3;
3316}
3317
3318// A list of locations.
3319message GeoLocationArray {
3320  // A list of circle areas.
3321  repeated CircleArea circle_areas = 1;
3322}
3323
3324message BoolValue {
3325  bool value = 1;
3326}
3327
3328// Filter criteria applied to current search results.
3329message Criteria {
3330  oneof value {
3331    // The text values associated with the field.
3332    StringArray text_array = 2;
3333
3334    // The integer ranges associated with the field.
3335    IntRangeArray int_range_array = 3;
3336
3337    // The float ranges associated with the field.
3338    FloatRangeArray float_range_array = 4;
3339
3340    // The datetime ranges associated with the field.
3341    DateTimeRangeArray date_time_range_array = 5;
3342
3343    // Geo Location array.
3344    GeoLocationArray geo_location_array = 6;
3345
3346    // A Boolean value.
3347    BoolValue bool_value = 7;
3348  }
3349
3350  // The UGA field or ML field to apply filtering criteria.
3351  string field = 1;
3352
3353  // If true, return query matched annotations for this criteria.
3354  // This option is only applicable for inclusion criteria, i.e., not exclusion
3355  // criteria, with partition level annotations.  It supports the following data
3356  // types:
3357  //  - INTEGER
3358  //  - FLOAT
3359  //  - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
3360  //  - BOOLEAN
3361  bool fetch_matched_annotations = 8;
3362}
3363
3364// Partition to specify the partition in time and space for sub-asset level
3365// annotation.
3366message Partition {
3367  // Partition of asset in UTC Epoch time. Supported by STREAM_VIDEO corpus
3368  // type.
3369  message TemporalPartition {
3370    // Start time of the partition.
3371    google.protobuf.Timestamp start_time = 1;
3372
3373    // End time of the partition.
3374    google.protobuf.Timestamp end_time = 2;
3375  }
3376
3377  // Partition of asset in space.
3378  message SpatialPartition {
3379    // The minimum x coordinate value.
3380    optional int64 x_min = 1;
3381
3382    // The minimum y coordinate value.
3383    optional int64 y_min = 2;
3384
3385    // The maximum x coordinate value.
3386    optional int64 x_max = 3;
3387
3388    // The maximum y coordinate value.
3389    optional int64 y_max = 4;
3390  }
3391
3392  // Partition of asset in relative time. Supported by VIDEO_ON_DEMAND corpus
3393  // type.
3394  message RelativeTemporalPartition {
3395    // Start time offset of the partition.
3396    google.protobuf.Duration start_offset = 1;
3397
3398    // End time offset of the partition.
3399    google.protobuf.Duration end_offset = 2;
3400  }
3401
3402  // Partition of asset in time.
3403  TemporalPartition temporal_partition = 1;
3404
3405  // Partition of asset in space.
3406  SpatialPartition spatial_partition = 2;
3407
3408  // Partition of asset in time.
3409  RelativeTemporalPartition relative_temporal_partition = 3;
3410}
3411