syntax = "proto3";

option go_package = "github.com/ubuntu/adsys";

service service {
  rpc Cat(Empty) returns (stream StringResponse);
  rpc Version(Empty) returns (stream StringResponse);
  rpc Status(Empty) returns (stream StringResponse);
  rpc Stop(StopRequest) returns (stream Empty);
  rpc UpdatePolicy(UpdatePolicyRequest) returns (stream Empty);
  rpc DumpPolicies(DumpPoliciesRequest) returns (stream StringResponse);
  rpc DumpPoliciesDefinitions(DumpPolicyDefinitionsRequest) returns (stream DumpPolicyDefinitionsResponse);
  rpc GetDoc(GetDocRequest) returns (stream StringResponse);
  rpc ListDoc(ListDocRequest) returns (stream StringResponse);
  rpc ListActiveUsers(Empty) returns (stream StringResponse);
  rpc GPOListScript(Empty) returns (stream StringResponse);
}

message Empty {}

message StopRequest {
  bool force = 1;
}

message StringResponse {
  string msg = 1;
}

message UpdatePolicyRequest {
  bool isComputer = 1;
  bool all = 2;   // Update policies of the machine and all the users
  string target = 3;
  string krb5cc = 4;
}

message DumpPoliciesRequest {
  string target = 1;
  bool details = 2;   // Show rules in addition to GPO
  bool all = 3;   // Show overridden rules
}

message DumpPolicyDefinitionsRequest {
  string format = 1;
  string distroID = 2; // Force another distro than the built-in one
}

message DumpPolicyDefinitionsResponse {
  string admx = 1;
  string adml = 2;
}

message GetDocRequest {
  string chapter = 1;
}

message ListDocRequest {
  bool raw = 1; // Set to true to not format the output of the table of content
}
