use reqwest::Method;
use crate::api::{decode_response, ErrorKind};
use crate::client::Client;
use crate::error::Error;
use crate::models::inbox::{InboundQuery, InboundSmsResponse};
impl Client {
pub async fn get_inbound_messages(
&self,
query: &InboundQuery,
) -> Result<InboundSmsResponse, Error> {
let response = self
.request(Method::GET, "sms/1/inbox/reports")?
.query(query)
.send()
.await?;
decode_response(response, ErrorKind::Legacy).await
}
}