use crate::client::Client;
use crate::error::Error;
use nordnet_model::models::countries::Country;
impl Client {
#[doc(alias = "GET /countries")]
pub async fn list_countries(&self) -> Result<Vec<Country>, Error> {
self.get("/countries").await
}
#[doc(alias = "GET /countries/{country}")]
pub async fn get_country(&self, code: &str) -> Result<Vec<Country>, Error> {
let path = format!("/countries/{code}");
match self.get::<Vec<Country>>(&path).await {
Ok(countries) => Ok(countries),
Err(Error::Decode { ref body, .. }) if body.trim().is_empty() => Ok(vec![]),
Err(e) => Err(e),
}
}
}