// Copyright 2025 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.bigtable.v2;

option csharp_namespace = "Google.Cloud.Bigtable.V2";
option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb";
option java_multiple_files = true;
option java_outer_classname = "PeerInfoProto";
option java_package = "com.google.bigtable.v2";
option php_namespace = "Google\\Cloud\\Bigtable\\V2";
option ruby_package = "Google::Cloud::Bigtable::V2";

// PeerInfo contains information about the peer that the client is
// connecting to.
message PeerInfo {
  // The transport type that the client used to connect to this peer.
  enum TransportType {
    // The transport type is unknown.
    TRANSPORT_TYPE_UNKNOWN = 0;

    // The client connected to this peer via an external network
    // (e.g. outside Google Coud).
    TRANSPORT_TYPE_EXTERNAL = 1;

    // The client connected to this peer via CloudPath.
    TRANSPORT_TYPE_CLOUD_PATH = 2;

    // The client connected to this peer via DirectAccess.
    TRANSPORT_TYPE_DIRECT_ACCESS = 3;

    // The client connected to this peer via Bigtable Sessions using an unknown
    // transport type.
    TRANSPORT_TYPE_SESSION_UNKNOWN = 4;

    // The client connected to this peer via Bigtable Sessions on an external
    // network (e.g. outside Google Cloud).
    TRANSPORT_TYPE_SESSION_EXTERNAL = 5;

    // The client connected to this peer via Bigtable Sessions using CloudPath.
    TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6;

    // The client connected to this peer via Bigtable Sessions using
    // DirectAccess.
    TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7;
  }

  // An opaque identifier for the Google Frontend which serviced this request.
  // Only set when not using DirectAccess.
  int64 google_frontend_id = 1;

  // An opaque identifier for the application frontend which serviced this
  // request.
  int64 application_frontend_id = 2;

  // The Cloud zone of the application frontend that served this request.
  string application_frontend_zone = 3;

  // The subzone of the application frontend that served this request, e.g. an
  // identifier for where within the zone the application frontend is.
  string application_frontend_subzone = 4;

  TransportType transport_type = 5;
}
