syntax = "proto3";

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

package gitlab.agent.runner.rpc;

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

import "buf/validate/validate.proto";

message GetJobRequest {
  // JSON containing the payload to send to the main GitLab application to retrieve CI jobs.
  // We treat this as a black box (at least for now).
  bytes job_request = 1 [(buf.validate.field).bytes.min_len = 1];
}

message GetJobResponse {
  // JSON response from the main GitLab application.
  // We treat this as a black box (at least for now).
  // Can be empty for No Content responses.
  bytes job_response = 1;
}

service JobRouter {
  // GetJob allows Runner to request a job.
  rpc GetJob (GetJobRequest) returns (GetJobResponse) {
  }
}
