use crate::seam::ControlResult;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct ClanRoom {
pub cap: Option<u64>,
pub stored: u64,
}
pub trait ClanPlane: Send + Sync {
fn clan_create(&self, name: &str, creator: &str, contribution: u64, room: ClanRoom) -> ControlResult<gunnar_proto::Clan>;
fn clan_get(&self, name: &str) -> ControlResult<Option<gunnar_proto::Clan>>;
fn clans_of(&self, principal: &str) -> ControlResult<Vec<gunnar_proto::Clan>>;
fn clan_invite(&self, clan: &str, by: &str, principal: &str) -> ControlResult<gunnar_proto::Clan>;
fn clan_answer(
&self,
clan: &str,
principal: &str,
accept: bool,
contribution: u64,
room: ClanRoom,
) -> ControlResult<gunnar_proto::Clan>;
fn clan_withdraw(&self, clan: &str, by: &str, principal: &str) -> ControlResult<gunnar_proto::Clan>;
fn clan_set_contribution(
&self,
clan: &str,
member: &str,
bytes: u64,
room: ClanRoom,
used: Option<u64>,
) -> ControlResult<gunnar_proto::Clan>;
fn clan_leave(&self, clan: &str, member: &str, used: Option<u64>) -> ControlResult<gunnar_proto::Clan>;
fn clan_remove(&self, clan: &str, by: &str, member: &str, used: Option<u64>) -> ControlResult<gunnar_proto::Clan>;
fn clan_set_admin(&self, clan: &str, by: &str, member: &str, admin: bool) -> ControlResult<gunnar_proto::Clan>;
fn clan_dissolve(&self, clan: &str, by: &str) -> ControlResult<gunnar_proto::Clan>;
fn clan_room_left(&self, account: &str, room: ClanRoom) -> ControlResult<Option<u64>>;
fn clan_given(&self, account: &str) -> ControlResult<u64>;
fn clan_role(&self, principal: &str, namespace: &str) -> ControlResult<Option<gunnar_proto::ClanRole>>;
fn clan_offer_repo(&self, clan: &str, by: &str, repo: &str, to: &str) -> ControlResult<gunnar_proto::Clan>;
fn clan_repo_offer(&self, clan: &str, repo: &str) -> ControlResult<Option<gunnar_proto::RepoOffer>>;
fn clan_offers_to(&self, to: &str) -> ControlResult<Vec<gunnar_proto::RepoOffer>>;
fn clan_withdraw_offer(&self, clan: &str, by: &str, repo: &str) -> ControlResult<gunnar_proto::Clan>;
fn clan_decline_offer(&self, clan: &str, repo: &str, to: &str) -> ControlResult<gunnar_proto::RepoOffer>;
fn clan_take_offer(
&self,
clan: &str,
repo: &str,
to: &str,
by: &str,
) -> ControlResult<(gunnar_proto::RepoOffer, gunnar_proto::Repo)>;
}