pub const READ_LOCATION: &str = "esi-location.read_location.v1";
pub const READ_ONLINE: &str = "esi-location.read_online.v1";
pub const READ_SHIP_TYPE: &str = "esi-location.read_ship_type.v1";
pub struct LocationScopes {
pub(super) scopes: Vec<String>,
}
impl Default for LocationScopes {
fn default() -> Self {
Self::new()
}
}
impl LocationScopes {
pub fn new() -> Self {
LocationScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
LocationScopes::new()
.read_location()
.read_online()
.read_ship_type()
}
pub fn read_location(mut self) -> Self {
self.scopes.push(READ_LOCATION.to_string());
self
}
pub fn read_online(mut self) -> Self {
self.scopes.push(READ_ONLINE.to_string());
self
}
pub fn read_ship_type(mut self) -> Self {
self.scopes.push(READ_SHIP_TYPE.to_string());
self
}
}
#[cfg(test)]
mod location_scopes_tests {
use crate::scope::LocationScopes;
#[test]
fn test_location_scopes_default() {
let location_scopes = LocationScopes::default();
assert_eq!(location_scopes.scopes.len(), 0)
}
}