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

import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Cloud.NetworkServices.V1";
option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb";
option java_multiple_files = true;
option java_outer_classname = "RouteViewProto";
option java_package = "com.google.cloud.networkservices.v1";
option php_namespace = "Google\\Cloud\\NetworkServices\\V1";
option ruby_package = "Google::Cloud::NetworkServices::V1";

// GatewayRouteView defines view-only resource for Routes to a Gateway
message GatewayRouteView {
  option (google.api.resource) = {
    type: "networkservices.googleapis.com/GatewayRouteView"
    pattern: "projects/{project}/locations/{location}/gateways/{gateway}/routeViews/{route_view}"
    plural: "gatewayRouteViews"
    singular: "gatewayRouteView"
  };

  // Output only. Identifier. Full path name of the GatewayRouteView resource.
  // Format:
  //   projects/{project_number}/locations/{location}/gateways/{gateway}/routeViews/{route_view}
  string name = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.field_behavior) = IDENTIFIER
  ];

  // Output only. Project number where the route exists.
  int64 route_project_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Location where the route exists.
  string route_location = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or TlsRoute
  string route_type = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The resource id for the route.
  string route_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// MeshRouteView defines view-only resource for Routes to a Mesh
message MeshRouteView {
  option (google.api.resource) = {
    type: "networkservices.googleapis.com/MeshRouteView"
    pattern: "projects/{project}/locations/{location}/meshes/{mesh}/routeViews/{route_view}"
    plural: "meshRouteViews"
    singular: "meshRouteView"
  };

  // Output only. Identifier. Full path name of the MeshRouteView resource.
  // Format:
  //   projects/{project}/locations/{location}/meshes/{mesh}/routeViews/{route_view}
  string name = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.field_behavior) = IDENTIFIER
  ];

  // Output only. Project number where the route exists.
  int64 route_project_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Location where the route exists.
  string route_location = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Type of the route: HttpRoute,GrpcRoute,TcpRoute, or TlsRoute
  string route_type = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The resource id for the route.
  string route_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request used with the GetGatewayRouteView method.
message GetGatewayRouteViewRequest {
  // Required. Name of the GatewayRouteView resource.
  // Formats:
  //   projects/{project}/locations/{location}/gateways/{gateway}/routeViews/{route_view}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "networkservices.googleapis.com/GatewayRouteView"
    }
  ];
}

// Request used with the GetMeshRouteView method.
message GetMeshRouteViewRequest {
  // Required. Name of the MeshRouteView resource.
  // Format:
  //   projects/{project}/locations/{location}/meshes/{mesh}/routeViews/{route_view}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "networkservices.googleapis.com/MeshRouteView"
    }
  ];
}

// Request used with the ListGatewayRouteViews method.
message ListGatewayRouteViewsRequest {
  // Required. The Gateway to which a Route is associated.
  // Formats:
  //   projects/{project}/locations/{location}/gateways/{gateway}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "networkservices.googleapis.com/GatewayRouteView"
    }
  ];

  // Maximum number of GatewayRouteViews to return per call.
  int32 page_size = 2;

  // The value returned by the last `ListGatewayRouteViewsResponse`
  // Indicates that this is a continuation of a prior `ListGatewayRouteViews`
  // call, and that the system should return the next page of data.
  string page_token = 3;
}

// Request used with the ListMeshRouteViews method.
message ListMeshRouteViewsRequest {
  // Required. The Mesh to which a Route is associated.
  // Format:
  //   projects/{project}/locations/{location}/meshes/{mesh}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "networkservices.googleapis.com/MeshRouteView"
    }
  ];

  // Maximum number of MeshRouteViews to return per call.
  int32 page_size = 2;

  // The value returned by the last `ListMeshRouteViewsResponse`
  // Indicates that this is a continuation of a prior `ListMeshRouteViews` call,
  // and that the system should return the next page of data.
  string page_token = 3;
}

// Response returned by the ListGatewayRouteViews method.
message ListGatewayRouteViewsResponse {
  // List of GatewayRouteView resources.
  repeated GatewayRouteView gateway_route_views = 1;

  // A token, which can be sent as `page_token` to retrieve the next page.
  // If this field is omitted, there are no subsequent pages.
  string next_page_token = 2;

  // Unreachable resources. Populated when the request attempts to list all
  // resources across all supported locations, while some locations are
  // temporarily unavailable.
  repeated string unreachable = 3;
}

// Response returned by the ListMeshRouteViews method.
message ListMeshRouteViewsResponse {
  // List of MeshRouteView resources.
  repeated MeshRouteView mesh_route_views = 1;

  // A token, which can be sent as `page_token` to retrieve the next page.
  // If this field is omitted, there are no subsequent pages.
  string next_page_token = 2;

  // Unreachable resources. Populated when the request attempts to list all
  // resources across all supported locations, while some locations are
  // temporarily unavailable.
  repeated string unreachable = 3;
}
