pub const READ_CORPORATION_KILLMAILS: &str = "esi-killmails.read_corporation_killmails.v1";
pub const READ_KILLMAILS: &str = "esi-killmails.read_killmails.v1";
pub struct KillmailsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for KillmailsScopes {
fn default() -> Self {
Self::new()
}
}
impl KillmailsScopes {
pub fn new() -> Self {
KillmailsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
KillmailsScopes::new()
.read_corporation_killmails()
.read_killmails()
}
pub fn read_corporation_killmails(mut self) -> Self {
self.scopes.push(READ_CORPORATION_KILLMAILS.to_string());
self
}
pub fn read_killmails(mut self) -> Self {
self.scopes.push(READ_KILLMAILS.to_string());
self
}
}
#[cfg(test)]
mod killmails_scopes_tests {
use crate::scope::KillmailsScopes;
#[test]
fn test_killmails_scopes_default() {
let killmails_scopes = KillmailsScopes::default();
assert_eq!(killmails_scopes.scopes.len(), 0)
}
}