use crate::Client;
use crate::client::api;
use crate::client::location::Location;
impl Client {
pub async fn get_locations(&self) -> Result<Vec<Location<'_>>, api::ApiError> {
Ok(self
.api
.get_location_data(
&*self
.refresh_tokens_if_needed()
.await
.map_err(api::ApiError::AuthenticationRefreshFailed)?,
)
.await?
.into_iter()
.map(|data| Location::new(self, data))
.collect())
}
}