pub const READ_BLUEPRINTS: &str = "esi-corporations.read_blueprints.v1";
pub const READ_CONTAINER_LOGS: &str = "esi-corporations.read_container_logs.v1";
pub const READ_CORPORATION_MEMBERSHIP: &str = "esi-corporations.read_corporation_membership.v1";
pub const READ_DIVISIONS: &str = "esi-corporations.read_divisions.v1";
pub const READ_FACILITIES: &str = "esi-corporations.read_facilities.v1";
pub const READ_MEDALS: &str = "esi-corporations.read_medals.v1";
pub const READ_STANDINGS: &str = "esi-corporations.read_standings.v1";
pub const READ_STARBASES: &str = "esi-corporations.read_starbases.v1";
pub const READ_STRUCTURES: &str = "esi-corporations.read_structures.v1";
pub const READ_TITLES: &str = "esi-corporations.read_titles.v1";
pub const TRACK_MEMBERS: &str = "esi-corporations.track_members.v1";
pub const READ_CONTACTS: &str = "esi-corporations.read_contacts.v1";
pub struct CorporationsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for CorporationsScopes {
fn default() -> Self {
Self::new()
}
}
impl CorporationsScopes {
pub fn new() -> Self {
CorporationsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
CorporationsScopes::new()
.read_blueprints()
.read_container_logs()
.read_divisions()
.read_facilities()
.read_medals()
.track_members()
.read_titles()
.read_corporation_membership()
.read_standings()
.read_starbases()
.read_structures()
.read_contacts()
}
pub fn read_blueprints(mut self) -> Self {
self.scopes.push(READ_BLUEPRINTS.to_string());
self
}
pub fn read_container_logs(mut self) -> Self {
self.scopes.push(READ_CONTAINER_LOGS.to_string());
self
}
pub fn read_corporation_membership(mut self) -> Self {
self.scopes.push(READ_CORPORATION_MEMBERSHIP.to_string());
self
}
pub fn read_divisions(mut self) -> Self {
self.scopes.push(READ_DIVISIONS.to_string());
self
}
pub fn read_facilities(mut self) -> Self {
self.scopes.push(READ_FACILITIES.to_string());
self
}
pub fn read_medals(mut self) -> Self {
self.scopes.push(READ_MEDALS.to_string());
self
}
pub fn read_standings(mut self) -> Self {
self.scopes.push(READ_STANDINGS.to_string());
self
}
pub fn read_starbases(mut self) -> Self {
self.scopes.push(READ_STARBASES.to_string());
self
}
pub fn read_structures(mut self) -> Self {
self.scopes.push(READ_STRUCTURES.to_string());
self
}
pub fn read_titles(mut self) -> Self {
self.scopes.push(READ_TITLES.to_string());
self
}
pub fn track_members(mut self) -> Self {
self.scopes.push(TRACK_MEMBERS.to_string());
self
}
pub fn read_contacts(mut self) -> Self {
self.scopes.push(READ_CONTACTS.to_string());
self
}
}
#[cfg(test)]
mod corporation_scopes_tests {
use crate::scope::CorporationsScopes;
#[test]
fn test_corporation_scopes_default() {
let corporation_scopes = CorporationsScopes::default();
assert_eq!(corporation_scopes.scopes.len(), 0)
}
}