syntax = "proto3";

package svc.feature.v1;

import "types/v1/feature.proto";

option go_package = "svc/feature/v1;featurev1";

service FeatureService {
  rpc HasFeature(HasFeatureRequest) returns (HasFeatureResponse);
  rpc ListFeature(ListFeatureRequest) returns (ListFeatureResponse);

  rpc AllowedUsage(AllowedUsageRequest) returns (AllowedUsageResponse);
}

message HasFeatureRequest {
  string feature = 1;
}

message HasFeatureResponse {
  bool available = 1;
}

message ListFeatureRequest {}

message ListFeatureResponse {
  repeated types.v1.Feature features = 1;
}

message AllowedUsageRequest {}
message AllowedUsageResponse {
  enum LocalhostUsage {
    NO_USAGE = 0;
    PERSONAL_USE = 1;
    COMMERCIAL_USE = 2;
  }
  LocalhostUsage localhost_usage = 1;
}
