syntax = "proto3";

// If you make any changes make sure you run: make regenerate-proto

package gitlab.agent.configuration_project.rpc;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/internal/module/configuration_project/rpc";

import "pkg/constraint/constraint.proto";
import "buf/validate/validate.proto";
import "pkg/entity/entity.proto";

message ListAgentConfigFilesRequest {
  entity.GitalyRepository repository = 1 [(buf.validate.field).required = true];
  entity.GitalyInfo gitaly_info = 2 [(buf.validate.field).required = true];
  string default_branch = 3;
}

message ListAgentConfigFilesResponse {
  repeated AgentConfigFile config_files = 1 [json_name = "config_files"];
}

message AgentConfigFile {
  string name = 1 [json_name = "name"];
  string agent_name = 2 [json_name = "agent_name", (buf.validate.field).string.(constraint.is_agent_name) = true];
}

service ConfigurationProject {
  rpc ListAgentConfigFiles (ListAgentConfigFilesRequest) returns (ListAgentConfigFilesResponse) {
    option idempotency_level = NO_SIDE_EFFECTS;
  }
}
