From 4623077cdd1667ec59c13e172ab0ea19abf1be6b Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Wed, 10 Jul 2024 13:52:50 +0800 Subject: [PATCH] chore: add method to query status only for a workspace --- libs/client-api/src/http_billing.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libs/client-api/src/http_billing.rs b/libs/client-api/src/http_billing.rs index cb74b132..25b76513 100644 --- a/libs/client-api/src/http_billing.rs +++ b/libs/client-api/src/http_billing.rs @@ -140,4 +140,25 @@ impl Client { .await? .into_data() } + + /// Query all subscription status for a workspace + pub async fn get_workspace_subscriptions( + &self, + workspace_id: &str, + ) -> Result, AppResponseError> { + let url = format!( + "{}/billing/api/v1/subscription-status/{}", + self.base_billing_url(), + workspace_id + ); + let resp = self + .http_client_with_auth(Method::GET, &url) + .await? + .send() + .await?; + + AppResponse::>::from_response(resp) + .await? + .into_data() + } }