pub const READ_FLEET: &str = "esi-fleets.read_fleet.v1";
pub const WRITE_FLEET: &str = "esi-fleets.write_fleet.v1";
pub struct FleetsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for FleetsScopes {
fn default() -> Self {
Self::new()
}
}
impl FleetsScopes {
pub fn new() -> Self {
FleetsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
FleetsScopes::new().read_fleet().write_fleet()
}
pub fn read_fleet(mut self) -> Self {
self.scopes.push(READ_FLEET.to_string());
self
}
pub fn write_fleet(mut self) -> Self {
self.scopes.push(WRITE_FLEET.to_string());
self
}
}
#[cfg(test)]
mod fleets_scopes_tests {
use crate::scope::FleetsScopes;
#[test]
fn test_fleets_scopes_default() {
let fleets_scopes = FleetsScopes::default();
assert_eq!(fleets_scopes.scopes.len(), 0)
}
}