pub const MANAGE_PLANETS: &str = "esi-planets.manage_planets.v1";
pub const READ_CUSTOMS_OFFICES: &str = "esi-planets.read_customs_offices.v1";
pub struct PlanetsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for PlanetsScopes {
fn default() -> Self {
Self::new()
}
}
impl PlanetsScopes {
pub fn new() -> Self {
PlanetsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
PlanetsScopes::new().manage_planets().read_customs_offices()
}
pub fn manage_planets(mut self) -> Self {
self.scopes.push(MANAGE_PLANETS.to_string());
self
}
pub fn read_customs_offices(mut self) -> Self {
self.scopes.push(READ_CUSTOMS_OFFICES.to_string());
self
}
}
#[cfg(test)]
mod planets_scopes_tests {
use crate::scope::PlanetsScopes;
#[test]
fn test_planets_scopes_default() {
let planets_scopes = PlanetsScopes::default();
assert_eq!(planets_scopes.scopes.len(), 0)
}
}