// Copyright 2020-2025 Buf Technologies, Inc.
//
// 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 buf.alpha.registry.v1alpha1;

// The protocols supported by Studio agent.
enum StudioAgentProtocol {
  STUDIO_AGENT_PROTOCOL_UNSPECIFIED = 0;
  STUDIO_AGENT_PROTOCOL_GRPC = 1;
  STUDIO_AGENT_PROTOCOL_CONNECT = 2;
}

// StudioAgentPreset is the information about an agent preset in the Studio.
message StudioAgentPreset {
  // The agent URL in the Studio.
  string url = 1;
  // The optional alias of the agent URL.
  string alias = 2;
  // The protocol the agent should use to forward requests.
  StudioAgentProtocol protocol = 3;
  // The URL of the target host.
  string target_url = 4;
}

// StudioService is the Studio service.
service StudioService {
  // ListStudioAgentPresets returns a list of agent presets in the server.
  rpc ListStudioAgentPresets(ListStudioAgentPresetsRequest) returns (ListStudioAgentPresetsResponse) {
    option idempotency_level = NO_SIDE_EFFECTS;
  }
  // SetStudioAgentPresets sets the list of agent presets in the server.
  rpc SetStudioAgentPresets(SetStudioAgentPresetsRequest) returns (SetStudioAgentPresetsResponse);
}

message ListStudioAgentPresetsRequest {}

message ListStudioAgentPresetsResponse {
  repeated StudioAgentPreset agents = 1;
}

message SetStudioAgentPresetsRequest {
  repeated StudioAgentPreset agents = 1;
}

message SetStudioAgentPresetsResponse {}
