syntax = "proto3";

package grackle;

import "grackle/grackle_types.proto";

service GrackleOrchestration {
  // Tasks
  rpc ListTasks(ListTasksRequest) returns (TaskList);
  rpc SearchTasks(SearchTasksRequest) returns (SearchTasksResponse);
  rpc CreateTask(CreateTaskRequest) returns (Task);
  rpc GetTask(TaskId) returns (Task);
  rpc UpdateTask(UpdateTaskRequest) returns (Task);
  rpc StartTask(StartTaskRequest) returns (Session);
  rpc CompleteTask(TaskId) returns (Task);
  rpc ResumeTask(TaskId) returns (Session);
  rpc StopTask(TaskId) returns (Task);
  rpc SetWorkpad(SetWorkpadRequest) returns (Task);
  rpc DeleteTask(TaskId) returns (Empty);

  // Personas
  rpc ListPersonas(Empty) returns (PersonaList);
  rpc CreatePersona(CreatePersonaRequest) returns (Persona);
  rpc GetPersona(PersonaId) returns (Persona);
  rpc UpdatePersona(UpdatePersonaRequest) returns (Persona);
  rpc DeletePersona(PersonaId) returns (Empty);

  // Findings
  rpc PostFinding(PostFindingRequest) returns (Finding);
  rpc QueryFindings(QueryFindingsRequest) returns (FindingList);
  rpc GetFinding(GetFindingRequest) returns (Finding);

  // Escalations
  rpc CreateEscalation(CreateEscalationRequest) returns (Escalation);
  rpc ListEscalations(ListEscalationsRequest) returns (EscalationList);
  rpc AcknowledgeEscalation(AcknowledgeEscalationRequest) returns (Escalation);
}
