chore: add get subscription plan details
This commit is contained in:
parent
37a8b9bfc7
commit
bacb7c4ae6
|
|
@ -1,6 +1,7 @@
|
|||
use crate::Client;
|
||||
use client_api_entity::billing_dto::{
|
||||
SetSubscriptionRecurringInterval, SubscriptionCancelRequest, WorkspaceUsageAndLimit,
|
||||
SetSubscriptionRecurringInterval, SubscriptionCancelRequest, SubscriptionPlanDetail,
|
||||
WorkspaceUsageAndLimit,
|
||||
};
|
||||
use reqwest::Method;
|
||||
use shared_entity::{
|
||||
|
|
@ -198,4 +199,20 @@ impl Client {
|
|||
|
||||
AppResponse::<()>::from_response(resp).await?.into_error()
|
||||
}
|
||||
|
||||
/// get all subscription plan details
|
||||
pub async fn get_subscription_plan_details(
|
||||
&self,
|
||||
) -> Result<Vec<SubscriptionPlanDetail>, AppResponseError> {
|
||||
let url = format!("{}/billing/api/v1/subscriptions", self.base_billing_url(),);
|
||||
let resp = self
|
||||
.http_client_with_auth(Method::POST, &url)
|
||||
.await?
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
AppResponse::<Vec<SubscriptionPlanDetail>>::from_response(resp)
|
||||
.await?
|
||||
.into_data()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue