use super::{Killmail, RecentKillmail};
use crate::{get_authenticated, get_public, Esi, EsiResult, Response};
impl Esi {
pub async fn get_character_recent_killmails(
&self,
character_id: i32,
access_token: &str,
etag: Option<&str>,
) -> EsiResult<Response<Vec<RecentKillmail>>> {
let result = get_authenticated::<Vec<RecentKillmail>>(
access_token,
&format!("characters/{}/killmails/recent/", character_id),
self,
None,
etag,
)
.await?;
Ok(result)
}
pub async fn get_corporation_recent_killmails(
&self,
corporation_id: i32,
access_token: &str,
etag: Option<&str>,
) -> EsiResult<Response<Vec<RecentKillmail>>> {
let result = get_authenticated::<Vec<RecentKillmail>>(
access_token,
&format!("corporations/{}/killmails/recent/", corporation_id),
self,
None,
etag,
)
.await?;
Ok(result)
}
pub async fn get_killmail(
&self,
killmail_id: i32,
killmail_hash: &str,
etag: Option<&str>,
) -> EsiResult<Response<Killmail>> {
let result = get_public::<Killmail>(
&format!("killmails/{}/{}/", killmail_id, killmail_hash),
self,
None,
etag,
)
.await?;
Ok(result)
}
}