pub const READ_CHARACTER_WALLET: &str = "esi-wallet.read_character_wallet.v1";
pub const READ_CORPORATION_WALLETS: &str = "esi-wallet.read_corporation_wallets.v1";
pub struct WalletScopes {
pub(super) scopes: Vec<String>,
}
impl Default for WalletScopes {
fn default() -> Self {
Self::new()
}
}
impl WalletScopes {
pub fn new() -> Self {
WalletScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
WalletScopes::new()
.read_character_wallets()
.read_corporation_wallets()
}
pub fn read_character_wallets(mut self) -> Self {
self.scopes.push(READ_CHARACTER_WALLET.to_string());
self
}
pub fn read_corporation_wallets(mut self) -> Self {
self.scopes.push(READ_CORPORATION_WALLETS.to_string());
self
}
}
#[cfg(test)]
mod wallet_scopes_tests {
use crate::scope::WalletScopes;
#[test]
fn test_wallet_scopes_default() {
let wallet_scopes = WalletScopes::default();
assert_eq!(wallet_scopes.scopes.len(), 0)
}
}