diff --git a/raystack/frontier/v1beta1/admin.proto b/raystack/frontier/v1beta1/admin.proto index d021bdb8..3a957b86 100644 --- a/raystack/frontier/v1beta1/admin.proto +++ b/raystack/frontier/v1beta1/admin.proto @@ -117,6 +117,15 @@ service AdminService { rpc ListAllBillingAccounts(ListAllBillingAccountsRequest) returns (ListAllBillingAccountsResponse) {} + // Plans + rpc CreatePlan(CreatePlanRequest) returns (CreatePlanResponse) {} + + rpc UpdatePlan(UpdatePlanRequest) returns (UpdatePlanResponse) {} + + // ListAllPlans returns every plan, including disabled ones, unlike + // FrontierService.ListPlans which returns active plans only. + rpc ListAllPlans(ListAllPlansRequest) returns (ListAllPlansResponse) {} + // Usage rpc RevertBillingUsage(RevertBillingUsageRequest) returns (RevertBillingUsageResponse) {} @@ -429,6 +438,72 @@ message ListAllBillingAccountsResponse { repeated BillingAccount billing_accounts = 1; } +message ListAllPlansRequest { + // filter by plan state, e.g. "active" or "disabled". an empty value returns all plans + string state = 1 [(buf.validate.field).string = { + in: [ + "", + "active", + "disabled" + ] + }]; +} + +message ListAllPlansResponse { + repeated Plan plans = 1; +} + +message PlanRequestBody { + string name = 1; + string title = 2; + string description = 3; + + repeated Product products = 4; + // known intervals are "day", "week", "month", and "year" + string interval = 5 [(buf.validate.field).string = { + in: [ + "day", + "week", + "month", + "year" + ] + }]; + int64 on_start_credits = 6 [(buf.validate.field).int64.gte = 0]; + int64 trial_days = 7 [(buf.validate.field).int64.gte = 0]; + + string state = 8 [(buf.validate.field).string = { + in: [ + "", + "active", + "disabled" + ] + }]; + + google.protobuf.Struct metadata = 20; +} + +message CreatePlanRequest { + // Plan to create + PlanRequestBody body = 1 [(buf.validate.field).required = true]; +} + +message CreatePlanResponse { + // Created plan + Plan plan = 1; +} + +message UpdatePlanRequest { + // ID of the plan to update + string id = 1 [(buf.validate.field).string.min_len = 1]; + // Plan to update + PlanRequestBody body = 2; +} + +message UpdatePlanResponse { + // Updated plan + Plan plan = 1; +} + message RevertBillingUsageRequest { string org_id = 1; // DEPRECATED diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index 7515c94e..89b6e095 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -339,14 +339,10 @@ service FrontierService { rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) {} // Plans - rpc CreatePlan(CreatePlanRequest) returns (CreatePlanResponse) {} - rpc ListPlans(ListPlansRequest) returns (ListPlansResponse) {} rpc GetPlan(GetPlanRequest) returns (GetPlanResponse) {} - rpc UpdatePlan(UpdatePlanRequest) returns (UpdatePlanResponse) {} - // Checkout rpc CreateCheckout(CreateCheckoutRequest) returns (CreateCheckoutResponse) {} @@ -864,39 +860,6 @@ message ListFeaturesResponse { repeated Feature features = 1; } -message PlanRequestBody { - string name = 1; - string title = 2; - string description = 3; - - repeated Product products = 4; - // known intervals are "day", "week", "month", and "year" - string interval = 5 [(buf.validate.field).string = { - in: [ - "day", - "week", - "month", - "year" - ] - }]; - int64 on_start_credits = 6; - int64 trial_days = 7; - - string state = 8; - - google.protobuf.Struct metadata = 20; -} - -message CreatePlanRequest { - // Plan to create - PlanRequestBody body = 1 [(buf.validate.field).required = true]; -} - -message CreatePlanResponse { - // Created plan - Plan plan = 1; -} - message GetPlanRequest { // ID of the plan to get string id = 1 [(buf.validate.field).string.min_len = 1]; @@ -907,18 +870,6 @@ message GetPlanResponse { Plan plan = 1; } -message UpdatePlanRequest { - // ID of the plan to update - string id = 1 [(buf.validate.field).string.min_len = 1]; - // Plan to update - PlanRequestBody body = 2; -} - -message UpdatePlanResponse { - // Updated plan - Plan plan = 1; -} - message ListInvoicesRequest { string org_id = 1 [(buf.validate.field).string.min_len = 3]; reserved 2;