pub const READ_AGENTS_RESEARCH: &str = "esi-characters.read_agents_research.v1";
pub const READ_BLUEPRINTS: &str = "esi-characters.read_blueprints.v1";
pub const READ_CHAT_CHANNELS: &str = "esi-characters.read_chat_channels.v1";
pub const READ_CONTACTS: &str = "esi-characters.read_contacts.v1";
pub const READ_CORPORATION_ROLES: &str = "esi-characters.read_corporation_roles.v1";
pub const READ_FATIGUE: &str = "esi-characters.read_fatigue.v1";
pub const READ_FW_STATS: &str = "esi-characters.read_fw_stats.v1";
pub const READ_LOYALTY: &str = "esi-characters.read_loyalty.v1";
pub const READ_MEDALS: &str = "esi-characters.read_medals.v1";
pub const READ_NOTIFICATIONS: &str = "esi-characters.read_notifications.v1";
pub const READ_STANDINGS: &str = "esi-characters.read_standings.v1";
pub const READ_TITLES: &str = "esi-characters.read_titles.v1";
pub const WRITE_CONTACTS: &str = "esi-characters.write_contacts.v1";
pub struct CharactersScopes {
pub(super) scopes: Vec<String>,
}
impl Default for CharactersScopes {
fn default() -> Self {
Self::new()
}
}
impl CharactersScopes {
pub fn new() -> Self {
CharactersScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
CharactersScopes::new()
.read_agents_research()
.read_blueprints()
.read_chat_channels()
.read_contacts()
.read_corporation_roles()
.read_fatigue()
.read_fw_stats()
.read_loyalty()
.read_medals()
.read_notifications()
.read_standings()
.read_titles()
.write_contacts()
}
pub fn read_agents_research(mut self) -> Self {
self.scopes.push(READ_AGENTS_RESEARCH.to_string());
self
}
pub fn read_blueprints(mut self) -> Self {
self.scopes.push(READ_BLUEPRINTS.to_string());
self
}
pub fn read_chat_channels(mut self) -> Self {
self.scopes.push(READ_CHAT_CHANNELS.to_string());
self
}
pub fn read_contacts(mut self) -> Self {
self.scopes.push(READ_CONTACTS.to_string());
self
}
pub fn read_corporation_roles(mut self) -> Self {
self.scopes.push(READ_CORPORATION_ROLES.to_string());
self
}
pub fn read_fatigue(mut self) -> Self {
self.scopes.push(READ_FATIGUE.to_string());
self
}
pub fn read_fw_stats(mut self) -> Self {
self.scopes.push(READ_FW_STATS.to_string());
self
}
pub fn read_loyalty(mut self) -> Self {
self.scopes.push(READ_LOYALTY.to_string());
self
}
pub fn read_medals(mut self) -> Self {
self.scopes.push(READ_MEDALS.to_string());
self
}
pub fn read_notifications(mut self) -> Self {
self.scopes.push(READ_NOTIFICATIONS.to_string());
self
}
pub fn read_standings(mut self) -> Self {
self.scopes.push(READ_STANDINGS.to_string());
self
}
pub fn read_titles(mut self) -> Self {
self.scopes.push(READ_TITLES.to_string());
self
}
pub fn write_contacts(mut self) -> Self {
self.scopes.push(WRITE_CONTACTS.to_string());
self
}
}
#[cfg(test)]
mod character_scopes_tests {
use crate::scope::CharactersScopes;
#[test]
fn test_character_scopes_default() {
let characters_scopes = CharactersScopes::default();
assert_eq!(characters_scopes.scopes.len(), 0)
}
}