pub const READ_CHARACTER_JOBS: &str = "esi-industry.read_character_jobs.v1";
pub const READ_CHARACTER_MINING: &str = "esi-industry.read_character_mining.v1";
pub const READ_CORPORATION_JOBS: &str = "esi-industry.read_corporation_jobs.v1";
pub const READ_CORPORATION_MINING: &str = "esi-industry.read_corporation_mining.v1";
pub struct IndustryScopes {
pub(super) scopes: Vec<String>,
}
impl Default for IndustryScopes {
fn default() -> Self {
Self::new()
}
}
impl IndustryScopes {
pub fn new() -> Self {
IndustryScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
IndustryScopes::new()
.read_character_jobs()
.read_character_mining()
.read_corporation_jobs()
.read_corporation_mining()
}
pub fn read_character_jobs(mut self) -> Self {
self.scopes.push(READ_CHARACTER_JOBS.to_string());
self
}
pub fn read_character_mining(mut self) -> Self {
self.scopes.push(READ_CHARACTER_MINING.to_string());
self
}
pub fn read_corporation_jobs(mut self) -> Self {
self.scopes.push(READ_CORPORATION_JOBS.to_string());
self
}
pub fn read_corporation_mining(mut self) -> Self {
self.scopes.push(READ_CORPORATION_MINING.to_string());
self
}
}
#[cfg(test)]
mod industry_scopes_tests {
use crate::scope::IndustryScopes;
#[test]
fn test_industry_scopes_default() {
let industry_scopes = IndustryScopes::default();
assert_eq!(industry_scopes.scopes.len(), 0)
}
}