syntax = "proto3";

package golem.worker;

import "golem/common/account_id.proto";
import "golem/common/string_filter_comparator.proto";
import "golem/common/filter_comparator.proto";
import "golem/worker/worker_id.proto";
import "golem/worker/worker_status.proto";
import "google/protobuf/timestamp.proto";

message WorkerFilter {
  oneof filter {
    WorkerNameFilter name = 1;
    WorkerVersionFilter version = 2;
    WorkerStatusFilter status = 3;
    WorkerCreatedAtFilter created_at = 4;
    WorkerEnvFilter env = 5;
    WorkerAndFilter and = 6;
    WorkerOrFilter or = 7;
    WorkerNotFilter not = 8;
  }
}

message WorkerNotFilter {
  WorkerFilter filter = 1;
}

message WorkerAndFilter {
  repeated WorkerFilter filters = 1;
}

message WorkerOrFilter {
  repeated WorkerFilter filters = 1;
}

message WorkerNameFilter {
  golem.common.StringFilterComparator comparator = 1;
  string value = 2;
}

message WorkerVersionFilter {
  golem.common.FilterComparator comparator = 1;
  uint64 value = 2;
}

message WorkerCreatedAtFilter {
  golem.common.FilterComparator comparator = 1;
  google.protobuf.Timestamp value = 2;
}

message WorkerStatusFilter {
  golem.common.FilterComparator comparator = 1;
  WorkerStatus value = 2;
}

message WorkerEnvFilter {
  string name = 1;
  golem.common.StringFilterComparator comparator = 2;
  string value = 3;
}