// Copyright 2021 The TensorStore Authors
//
// 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 tensorstore_grpc;

import "google/protobuf/timestamp.proto";
import "google/rpc/code.proto";

// option cc_api_version = 2;

message KeyRange {
  /// Specifies the starting key.
  bytes inclusive_min = 1;

  /// Specifies an optional exclusive ending byte.
  /// If not specified or empty, the full key range starting at `inclusive_min`
  /// is retrieved.
  bytes exclusive_max = 2;
}

message ByteRange {
  /// Specifies the starting byte.
  uint64 inclusive_min = 1;

  /// Specifies an optional exclusive ending byte.
  /// If not specified or 0, the full byte range starting at `inclusive_min` is
  /// retrieved.
  uint64 exclusive_max = 2;
}

message StatusMessage {
  /// The absl::Status code, for returning errors.
  google.rpc.Code code = 1;
  bytes message = 2;
}

message GenerationAndTimestamp {
  /// Generation and timestamp are returned.
  bytes generation = 1;
  google.protobuf.Timestamp timestamp = 2;
}
