From b2958b262b78c286ffc6358eef310663dcf3fa1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Vall=C3=A9s?= Date: Tue, 11 Jun 2024 13:24:09 +0200 Subject: [PATCH] feat(mgmt): return remaining perishable and imperishable credit --- core/mgmt/v1beta/mgmt.proto | 12 ++++++++++-- core/mgmt/v1beta/mgmt_public_service.proto | 8 +++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/mgmt/v1beta/mgmt.proto b/core/mgmt/v1beta/mgmt.proto index b8175f8e..09e0af94 100644 --- a/core/mgmt/v1beta/mgmt.proto +++ b/core/mgmt/v1beta/mgmt.proto @@ -589,8 +589,16 @@ message GetRemainingCreditRequest { // GetRemainingCreditResponse contains the remaining credit of a user or // organization. message GetRemainingCreditResponse { - // The requested credit. - float amount = 1; + // 1 is reserved for the previous endpoint version, where only the total + // amount was returned. + reserved 1; + // Amount of perishable credit, i.e. credit with an expiration date. + float perishable = 2; + // Amount of imperishable credit, e.g. purchased credit, which doesn't + // expire. + float imperishable = 3; + // Total remaining credit. + float total = 4; } // GetRemainingCreditAdminRequest represents a request to get the remaining diff --git a/core/mgmt/v1beta/mgmt_public_service.proto b/core/mgmt/v1beta/mgmt_public_service.proto index 663550e6..68882641 100644 --- a/core/mgmt/v1beta/mgmt_public_service.proto +++ b/core/mgmt/v1beta/mgmt_public_service.proto @@ -281,11 +281,9 @@ service MgmtPublicService { // Get the remaining Instill Credit // - // On Instill Cloud, users can use Instill Credit to execute pre-configured - // AI connectors. This simplifies the pipeline setup, removing the need to - // subscribe to third-party AI services. This endpoint returns the remaining - // Instill Credit of a given user or organization. The requested credit owner - // must be either the authenticated user or an organization they belong to. + // This endpoint returns the remaining [Instill Credit](https://www.instill.tech/docs/vdp/credit) of a given user or + // organization. The requested credit owner must be either the authenticated + // user or an organization they belong to. // // On Instill Core, this endpoint will return a 404 Not Found status. rpc GetRemainingCredit(GetRemainingCreditRequest) returns (GetRemainingCreditResponse) {