syntax = "proto3";

package store;

service Store {
  rpc AddItem(AddItemRequest) returns (Empty) {}
  rpc AddItems(stream AddItemRequest) returns (Empty) {}
  rpc RemoveItem(RemoveItemRequest) returns (RemoveItemResponse) {}
  rpc RemoveItems(stream RemoveItemRequest) returns (RemoveItemResponse) {}
  rpc ListInventory(Empty) returns (stream QuantityResponse) {}
  rpc QueryQuantity(QueryItemRequest) returns (QuantityResponse) {}
  rpc QueryQuantities(stream QueryItemRequest) 
                          returns (stream QuantityResponse) {}
}

message Empty {}

message AddItemRequest {
  string name = 1;
}

message RemoveItemRequest {
  string name = 1;
}

message RemoveItemResponse {
  bool was_successful = 1;
}

message QueryItemRequest {
  string name = 1;
}

message QuantityResponse {
  string name = 1;
  int32 count = 2;
}
