use std::sync::Arc;
use crate::auth::AuthApi;
use crate::endpoints::{
ACCompatApi, AccountApi, BackupAccessPointsApi, BackupApi, BlacklistApi, BurstReportersApi,
DataUsageApi, DdnsApi, DevicesApi, DhcpApi, DiagnosticsApi, DnsApi, DnsPoliciesApi, EerosApi,
EntitlementsApi, EventsApi, ForwardsApi, InsightsApi, MembersApi, NetworksApi,
NotificationsApi, OUICheckApi, PermissionsApi, PowerSavingApi, ProfilesApi, ReservationsApi,
RoutingApi, ScheduleApi, SecurityApi, SqmApi, SubnetsApi, SupportApi, ThreadApi, TransferApi,
UpdatesApi, WanApi, Wpa3Api,
};
use crate::error::Error;
use crate::transport::Transport;
#[derive(Debug)]
pub struct EeroApi {
transport: Arc<Transport>,
auth: AuthApi,
ac_compat: ACCompatApi,
account: AccountApi,
backup: BackupApi,
backup_access_points: BackupAccessPointsApi,
blacklist: BlacklistApi,
burst_reporters: BurstReportersApi,
data_usage: DataUsageApi,
ddns: DdnsApi,
devices: DevicesApi,
dhcp: DhcpApi,
diagnostics: DiagnosticsApi,
dns: DnsApi,
dns_policies: DnsPoliciesApi,
eeros: EerosApi,
entitlements: EntitlementsApi,
events: EventsApi,
forwards: ForwardsApi,
insights: InsightsApi,
members: MembersApi,
networks: NetworksApi,
notifications: NotificationsApi,
ouicheck: OUICheckApi,
permissions: PermissionsApi,
power_saving: PowerSavingApi,
profiles: ProfilesApi,
reservations: ReservationsApi,
routing: RoutingApi,
schedule: ScheduleApi,
security: SecurityApi,
sqm: SqmApi,
subnets: SubnetsApi,
support: SupportApi,
thread: ThreadApi,
transfer: TransferApi,
updates: UpdatesApi,
wan: WanApi,
wpa3: Wpa3Api,
}
impl EeroApi {
#[must_use]
pub fn new(transport: Transport) -> Self {
let transport = Arc::new(transport);
Self {
auth: AuthApi::from_shared(Arc::clone(&transport)),
ac_compat: ACCompatApi::new(Arc::clone(&transport)),
account: AccountApi::new(Arc::clone(&transport)),
backup: BackupApi::new(Arc::clone(&transport)),
backup_access_points: BackupAccessPointsApi::new(Arc::clone(&transport)),
blacklist: BlacklistApi::new(Arc::clone(&transport)),
burst_reporters: BurstReportersApi::new(Arc::clone(&transport)),
data_usage: DataUsageApi::new(Arc::clone(&transport)),
ddns: DdnsApi::new(Arc::clone(&transport)),
devices: DevicesApi::new(Arc::clone(&transport)),
dhcp: DhcpApi::new(Arc::clone(&transport)),
diagnostics: DiagnosticsApi::new(Arc::clone(&transport)),
dns: DnsApi::new(Arc::clone(&transport)),
dns_policies: DnsPoliciesApi::new(Arc::clone(&transport)),
eeros: EerosApi::new(Arc::clone(&transport)),
entitlements: EntitlementsApi::new(Arc::clone(&transport)),
events: EventsApi::new(Arc::clone(&transport)),
forwards: ForwardsApi::new(Arc::clone(&transport)),
insights: InsightsApi::new(Arc::clone(&transport)),
members: MembersApi::new(Arc::clone(&transport)),
networks: NetworksApi::new(Arc::clone(&transport)),
notifications: NotificationsApi::new(Arc::clone(&transport)),
ouicheck: OUICheckApi::new(Arc::clone(&transport)),
permissions: PermissionsApi::new(Arc::clone(&transport)),
power_saving: PowerSavingApi::new(Arc::clone(&transport)),
profiles: ProfilesApi::new(Arc::clone(&transport)),
reservations: ReservationsApi::new(Arc::clone(&transport)),
routing: RoutingApi::new(Arc::clone(&transport)),
schedule: ScheduleApi::new(Arc::clone(&transport)),
security: SecurityApi::new(Arc::clone(&transport)),
sqm: SqmApi::new(Arc::clone(&transport)),
subnets: SubnetsApi::new(Arc::clone(&transport)),
support: SupportApi::new(Arc::clone(&transport)),
thread: ThreadApi::new(Arc::clone(&transport)),
transfer: TransferApi::new(Arc::clone(&transport)),
updates: UpdatesApi::new(Arc::clone(&transport)),
wan: WanApi::new(Arc::clone(&transport)),
wpa3: Wpa3Api::new(Arc::clone(&transport)),
transport,
}
}
#[must_use]
pub fn transport(&self) -> &Transport {
&self.transport
}
#[must_use]
pub fn auth(&self) -> &AuthApi {
&self.auth
}
#[must_use]
pub fn is_authenticated(&self) -> bool {
self.auth.is_authenticated()
}
#[must_use]
pub fn credentials_persisted(&self) -> bool {
self.auth.credentials_persisted()
}
pub async fn logout(&self) -> Result<bool, Error> {
self.auth.logout().await
}
#[must_use]
pub fn ac_compat(&self) -> &ACCompatApi {
&self.ac_compat
}
#[must_use]
pub fn account(&self) -> &AccountApi {
&self.account
}
#[must_use]
pub fn backup(&self) -> &BackupApi {
&self.backup
}
#[must_use]
pub fn backup_access_points(&self) -> &BackupAccessPointsApi {
&self.backup_access_points
}
#[must_use]
pub fn blacklist(&self) -> &BlacklistApi {
&self.blacklist
}
#[must_use]
pub fn burst_reporters(&self) -> &BurstReportersApi {
&self.burst_reporters
}
#[must_use]
pub fn data_usage(&self) -> &DataUsageApi {
&self.data_usage
}
#[must_use]
pub fn ddns(&self) -> &DdnsApi {
&self.ddns
}
#[must_use]
pub fn devices(&self) -> &DevicesApi {
&self.devices
}
#[must_use]
pub fn dhcp(&self) -> &DhcpApi {
&self.dhcp
}
#[must_use]
pub fn diagnostics(&self) -> &DiagnosticsApi {
&self.diagnostics
}
#[must_use]
pub fn dns(&self) -> &DnsApi {
&self.dns
}
#[must_use]
pub fn dns_policies(&self) -> &DnsPoliciesApi {
&self.dns_policies
}
#[must_use]
pub fn eeros(&self) -> &EerosApi {
&self.eeros
}
#[must_use]
pub fn entitlements(&self) -> &EntitlementsApi {
&self.entitlements
}
#[must_use]
pub fn events(&self) -> &EventsApi {
&self.events
}
#[must_use]
pub fn forwards(&self) -> &ForwardsApi {
&self.forwards
}
#[must_use]
pub fn insights(&self) -> &InsightsApi {
&self.insights
}
#[must_use]
pub fn members(&self) -> &MembersApi {
&self.members
}
#[must_use]
pub fn networks(&self) -> &NetworksApi {
&self.networks
}
#[must_use]
pub fn notifications(&self) -> &NotificationsApi {
&self.notifications
}
#[must_use]
pub fn ouicheck(&self) -> &OUICheckApi {
&self.ouicheck
}
#[must_use]
pub fn permissions(&self) -> &PermissionsApi {
&self.permissions
}
#[must_use]
pub fn power_saving(&self) -> &PowerSavingApi {
&self.power_saving
}
#[must_use]
pub fn profiles(&self) -> &ProfilesApi {
&self.profiles
}
#[must_use]
pub fn reservations(&self) -> &ReservationsApi {
&self.reservations
}
#[must_use]
pub fn routing(&self) -> &RoutingApi {
&self.routing
}
#[must_use]
pub fn schedule(&self) -> &ScheduleApi {
&self.schedule
}
#[must_use]
pub fn security(&self) -> &SecurityApi {
&self.security
}
#[must_use]
pub fn sqm(&self) -> &SqmApi {
&self.sqm
}
#[must_use]
pub fn subnets(&self) -> &SubnetsApi {
&self.subnets
}
#[must_use]
pub fn support(&self) -> &SupportApi {
&self.support
}
#[must_use]
pub fn thread(&self) -> &ThreadApi {
&self.thread
}
#[must_use]
pub fn transfer(&self) -> &TransferApi {
&self.transfer
}
#[must_use]
pub fn updates(&self) -> &UpdatesApi {
&self.updates
}
#[must_use]
pub fn wan(&self) -> &WanApi {
&self.wan
}
#[must_use]
pub fn wpa3(&self) -> &Wpa3Api {
&self.wpa3
}
}