Files
Datarush/api/proto/task.proto
T

69 lines
1.5 KiB
Protocol Buffer

syntax = "proto3";
package task;
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
option go_package = "pkg/api/task";
service TaskService {
rpc CreateTask(Task) returns (Task);
rpc GetTask(GetTaskRequest) returns (Task);
rpc EditTask(Task) returns (Task);
rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty);
rpc ListCompetitionTasks(ListCompetitionTasksRequest) returns (ListCompetitionTasksResponse);
rpc GetTaskAttachments(GetTaskAttachmentsRequest) returns (GetTaskAttachmentsResponse);
}
enum TaskType {
TASK_TYPE_UNSPECIFIED = 0;
TASK_TYPE_INPUT = 1;
TASK_TYPE_CHECKER = 2;
TASK_TYPE_REVIEW = 3;
}
message Task {
string id = 1;
string competition_id = 2;
string title = 3;
string description = 4;
int32 in_competition_position = 5;
int32 max_points = 6;
int32 max_attempts = 7;
TaskType type = 8;
string answer_url = 11;
google.protobuf.Timestamp created_at = 9;
google.protobuf.Timestamp updated_at = 10;
}
message TaskAttachment {
string id = 1;
string file_url = 2;
string mountpoint = 3;
bool is_public = 4;
}
message GetTaskRequest {
string task_id = 1;
}
message DeleteTaskRequest {
string task_id = 1;
}
message ListCompetitionTasksRequest {
string competition_id = 1;
}
message ListCompetitionTasksResponse {
repeated Task tasks = 1;
}
message GetTaskAttachmentsRequest {
string task_id = 1;
optional bool show_private = 2;
}
message GetTaskAttachmentsResponse {
repeated TaskAttachment attachments = 1;
}