Skip to content

Commit

Permalink
feat(frontier): create product features (#346)
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma authored Mar 17, 2024
1 parent 7b7b4b8 commit b7dbed9
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,39 @@ service FrontierService {
};
}

rpc CreateFeature(CreateFeatureRequest) returns (CreateFeatureResponse) {
option (google.api.http) = {
post: "/v1beta1/billing/features",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Feature";
summary: "Create feature";
description: "Create a new feature for platform.";
};
}

rpc GetFeature(GetFeatureRequest) returns (GetFeatureResponse) {
option (google.api.http) = {get: "/v1beta1/billing/features/{id}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Feature";
summary: "Get feature";
description: "Get a feature by ID.";
};
}

rpc UpdateFeature(UpdateFeatureRequest) returns (UpdateFeatureResponse) {
option (google.api.http) = {
put: "/v1beta1/billing/features/{id}",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Feature";
summary: "Update feature";
description: "Update a feature by ID.";
};
}

rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) {
option (google.api.http) = {get: "/v1beta1/billing/features"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
Expand Down Expand Up @@ -1981,6 +2014,49 @@ message UpdateProductResponse {
Product product = 1;
}

message FeatureRequestBody {
// machine friendly name
string name = 1 [(validate.rules).string.min_len = 3];
// human friendly title
string title = 2;

repeated string product_ids = 3;

google.protobuf.Struct metadata = 20;
}

message CreateFeatureRequest {
// Feature to create
FeatureRequestBody body = 1 [(validate.rules).message.required = true];
}

message CreateFeatureResponse {
// Created feature
Feature feature = 1;
}

message GetFeatureRequest {
// ID of the feature to get
string id = 1 [(validate.rules).string.min_len = 1];
}

message GetFeatureResponse {
// Feature
Feature feature = 1;
}

message UpdateFeatureRequest {
// ID of the feature to update
string id = 1 [(validate.rules).string.min_len = 1];
// Feature to update
FeatureRequestBody body = 2;
}

message UpdateFeatureResponse {
// Updated feature
Feature feature = 1;
}

message ListFeaturesRequest {}

message ListFeaturesResponse {
Expand Down

0 comments on commit b7dbed9

Please sign in to comment.