// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.vectorsearch.v1beta;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.VectorSearch.V1Beta";
option go_package = "cloud.google.com/go/vectorsearch/apiv1beta/vectorsearchpb;vectorsearchpb";
option java_multiple_files = true;
option java_outer_classname = "DataObjectProto";
option java_package = "com.google.cloud.vectorsearch.v1beta";
option php_namespace = "Google\\Cloud\\VectorSearch\\V1beta";
option ruby_package = "Google::Cloud::VectorSearch::V1beta";

// A dataObject resource in Vector Search.
message DataObject {
  option (google.api.resource) = {
    type: "vectorsearch.googleapis.com/DataObject"
    pattern: "projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}"
    plural: "dataObjects"
    singular: "dataObject"
  };

  // Identifier. The fully qualified resource name of the dataObject.
  //
  // Format:
  // `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{data_object_id}`
  // The data_object_id must be 1-63 characters
  // long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. The id of the dataObject.
  string data_object_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp the dataObject was created at.
  google.protobuf.Timestamp create_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp the dataObject was last updated.
  google.protobuf.Timestamp update_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The data of the dataObject.
  google.protobuf.Struct data = 6 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The vectors of the dataObject.
  map<string, Vector> vectors = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The etag of the dataObject.
  string etag = 8 [(google.api.field_behavior) = OPTIONAL];
}

// A vector which can be either dense or sparse.
message Vector {
  // The type of the vector.
  oneof vector_type {
    // A dense vector.
    DenseVector dense = 2;

    // A sparse vector.
    SparseVector sparse = 3;
  }

  // Deprecated: Use `dense` or `sparse` instead.
  repeated float values = 1 [deprecated = true];
}

// A dense vector.
message DenseVector {
  // Required. The values of the vector.
  repeated float values = 1 [(google.api.field_behavior) = REQUIRED];
}

// A sparse vector.
message SparseVector {
  // Required. The values of the vector.
  repeated float values = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The corresponding indices for the values.
  repeated int32 indices = 2 [(google.api.field_behavior) = REQUIRED];
}
