// Copyright 2024 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

package chromiumos.test.scheduling;

option go_package = "./proto";

enum TaskState {
  REQUESTED = 0;
  PENDING = 1;
  LAUNCHED = 2;
  COMPLETED = 3;
  EXPIRED = 4;
  CANCELED = 5;
  FAILED_TO_LAUNCH = 6;
}

message CreateTaskStatesResponse {
  map<int64, int64> ids = 1;
}

message ReadTaskStatesResponse {
  repeated TaskWithState tasks = 1;
}

message TaskWithState {
  int64 task_state_id = 1;
  TaskState state = 2;
  int64 bbid = 3;
  string lease_id = 4;
  string device_name = 5;
  // Timestamp in microseconds.
  int64 end_time = 6;
}
