// 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.ces.v1;

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

option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb";
option java_multiple_files = true;
option java_outer_classname = "DataStoreProto";
option java_package = "com.google.cloud.ces.v1";

// A DataStore resource in Vertex AI Search.
message DataStore {
  // The connector config for the data store connection.
  message ConnectorConfig {
    // Resource name of the collection the data store belongs to.
    string collection = 1;

    // Display name of the collection the data store belongs to.
    string collection_display_name = 2;

    // The name of the data source.
    // Example: `salesforce`, `jira`, `confluence`, `bigquery`.
    string data_source = 3;
  }

  // The type of the data store.
  enum DataStoreType {
    // Not specified. This value indicates that the data store type is not
    // specified, so it will not be used during search.
    DATA_STORE_TYPE_UNSPECIFIED = 0;

    // A data store that contains public web content.
    PUBLIC_WEB = 1;

    // A data store that contains unstructured private data.
    UNSTRUCTURED = 2;

    // A data store that contains structured data used as FAQ.
    FAQ = 3;

    // A data store that is a connector to a first-party or a third-party
    // service.
    CONNECTOR = 4;
  }

  // The document processing mode of the data store.
  enum DocumentProcessingMode {
    // Not specified.
    DOCUMENT_PROCESSING_MODE_UNSPECIFIED = 0;

    // Documents are processed as documents.
    DOCUMENTS = 1;

    // Documents are converted to chunks.
    CHUNKS = 2;
  }

  // Required. Full resource name of the DataStore.
  // Format:
  // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
  string name = 1 [(google.api.field_behavior) = REQUIRED];

  // Output only. The type of the data store. This field is readonly and
  // populated by the server.
  DataStoreType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The document processing mode for the data store connection.
  // Only set for PUBLIC_WEB and UNSTRUCTURED data stores.
  DocumentProcessingMode document_processing_mode = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The display name of the data store.
  string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp when the data store was created.
  google.protobuf.Timestamp create_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The connector config for the data store connection.
  ConnectorConfig connector_config = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];
}
