syntax = "proto3";

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

package gitlab.agent.autoflow.rpc;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/internal/module/autoflow/rpc";
option ruby_package = "Gitlab::Agent::AutoFlow::Rpc";

import "buf/validate/validate.proto";
import "pkg/event/event.proto";

message CloudEventRequest {
  event.CloudEvent event = 1 [(buf.validate.field).required = true];
  event.Project flow_project = 2 [(buf.validate.field).required = true];
  // NOTE: these variables are temporary until we have a better way to "configured" workflow data
  // including workflow secrets. We can always expand the variables map to messages later if needed.
  map<string, string> variables = 3;
}

message CloudEventResponse {
}

// Service to send AutoFlow events to KAS.
service AutoFlow {
  // Emit a Cloud Event.
  // See https://cloudevents.io/.
  rpc CloudEvent(CloudEventRequest) returns (CloudEventResponse) {
  }
}
