use crate::Client;
use crate::client::api::ApiError;
use crate::client::api::device::Device;
impl Client {
pub async fn get_devices(&self) -> Result<Vec<Device>, ApiError> {
self.api
.get_device_data(
&*self
.refresh_tokens_if_needed()
.await
.map_err(ApiError::AuthenticationRefreshFailed)?,
)
.await
.map(|data| data.into_iter().map(Device::new).collect())
}
}