syntax = "proto3";
package summa.proto;

// API

service ConsumerApi {
  rpc create_consumer (CreateConsumerRequest) returns (CreateConsumerResponse) {}
  rpc get_consumer (GetConsumerRequest) returns (GetConsumerResponse) {}
  rpc get_consumers (GetConsumersRequest) returns (GetConsumersResponse) {}
  rpc delete_consumer (DeleteConsumerRequest) returns (DeleteConsumerResponse) {}
}

// Requests

message CreateConsumerRequest {
  repeated string bootstrap_servers = 1;
  string group_id = 2;
  string index_alias = 3;
  string consumer_name = 4;
  repeated string topics = 5;
  uint32 threads = 6;
}
message CreateConsumerResponse {
  Consumer consumer = 1;
}
message DeleteConsumerRequest {
  string index_alias = 1;
  string consumer_name = 2;
}
message DeleteConsumerResponse {}
message GetConsumerRequest {
  string index_alias = 1;
  string consumer_name = 2;
}
message GetConsumerResponse {
  Consumer consumer = 1;
}
message GetConsumersRequest {}
message GetConsumersResponse {
  repeated Consumer consumers = 1;
}

// Extra structures
message Consumer {
  string index_name = 1;
  string consumer_name = 2;
}
