chore: add method to query status only for a workspace

This commit is contained in:
Zack Fu Zi Xiang 2024-07-10 13:52:50 +08:00
parent 5583257184
commit 4623077cdd
No known key found for this signature in database
1 changed files with 21 additions and 0 deletions

View File

@ -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<Vec<WorkspaceSubscriptionStatus>, 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::<Vec<WorkspaceSubscriptionStatus>>::from_response(resp)
.await?
.into_data()
}
}