pub const READ_ASSETS: &str = "esi-assets.read_assets.v1";
pub const READ_CORPORATION_ASSETS: &str = "esi-assets.read_corporation_assets.v1";
pub struct AssetsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for AssetsScopes {
fn default() -> Self {
Self::new()
}
}
impl AssetsScopes {
pub fn new() -> Self {
AssetsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
AssetsScopes::new().read_assets().read_corporation_assets()
}
pub fn read_assets(mut self) -> Self {
self.scopes.push(READ_ASSETS.to_string());
self
}
pub fn read_corporation_assets(mut self) -> Self {
self.scopes.push(READ_CORPORATION_ASSETS.to_string());
self
}
}
#[cfg(test)]
mod assets_scopes_tests {
use crate::scope::AssetsScopes;
#[test]
fn test_assets_scopes_default() {
let assets_scopes = AssetsScopes::default();
assert_eq!(assets_scopes.scopes.len(), 0)
}
}