syntax = "proto3";

package code.justin.tv.eventbus.controlplane;
option go_package = "rpc";

service FeatureFlags {
  rpc IsEnabled(IsEnabledReq) returns (IsEnabledResp);
  rpc Enable(EnableReq) returns (EnableResp);
  rpc Disable(DisableReq) returns (DisableResp);
  rpc List(ListFeatureFlagsReq) returns (ListFeatureFlagsResp);
  rpc Create(CreateFeatureFlagsReq) returns (CreateFeatureFlagsResp);
  rpc Delete(DeleteFeatureFlagsReq) returns (DeleteFeatureFlagsResp);
}

message IsEnabledReq {
  string name = 1;
}

message IsEnabledResp {
  bool is_enabled = 2;
}

message EnableReq {
  string name = 1;
}

message EnableResp {}

message DisableReq {
  string name = 1;
}

message DisableResp {}

message FeatureFlag {
  string name = 1;
  bool is_enabled = 2; 
}

message ListFeatureFlagsReq {
}

message ListFeatureFlagsResp {
  repeated FeatureFlag feature_flags = 1;
}

message CreateFeatureFlagsReq {
  FeatureFlag feature_flag = 1;
}

message CreateFeatureFlagsResp {
  string id = 1;
}

message DeleteFeatureFlagsReq {
  string name = 1;
}

message DeleteFeatureFlagsResp {
}
