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

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/cloud/locationfinder/v1/cloud_location.proto";

option csharp_namespace = "Google.Cloud.LocationFinder.V1";
option go_package = "cloud.google.com/go/locationfinder/apiv1/locationfinderpb;locationfinderpb";
option java_multiple_files = true;
option java_outer_classname = "ServiceProto";
option java_package = "com.google.cloud.locationfinder.v1";
option php_namespace = "Google\\Cloud\\LocationFinder\\V1";
option ruby_package = "Google::Cloud::LocationFinder::V1";

// Service describing handlers for resources
service CloudLocationFinder {
  option (google.api.default_host) = "cloudlocationfinder.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/cloud-platform";

  // Lists cloud locations under a given project and location.
  rpc ListCloudLocations(ListCloudLocationsRequest)
      returns (ListCloudLocationsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*}/cloudLocations"
    };
    option (google.api.method_signature) = "parent";
  }

  // Retrieves a resource containing information about a cloud location.
  rpc GetCloudLocation(GetCloudLocationRequest) returns (CloudLocation) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/cloudLocations/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Searches for cloud locations from a given source location.
  rpc SearchCloudLocations(SearchCloudLocationsRequest)
      returns (SearchCloudLocationsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*}/cloudLocations:search"
    };
    option (google.api.method_signature) = "parent,source_cloud_location,query";
  }
}
