use reqwest::header::ACCEPT;
use super::{ACCEPT_JSON, OpsdClient, decode_response};
use crate::{
Error,
types::{BusinessId, GetBillingStatusResponse},
};
impl OpsdClient {
pub async fn get_billing_status(
&self,
business_id: BusinessId,
) -> Result<GetBillingStatusResponse, Error> {
let url = self.endpoint(&format!("businesses/{business_id}/billing/status"));
let response = self
.authenticate(self.http_client.get(url))
.header(ACCEPT, ACCEPT_JSON.clone())
.send()
.await?;
decode_response(response).await
}
}