use crate::calendar::config::CalendarConfig;
use crate::error::CalDirResult;
use crate::remote::protocol::ListCalendars;
use crate::remote::provider::Provider;
pub struct ProviderAccount {
pub provider: Provider,
pub identifier: String,
}
impl ProviderAccount {
pub fn new(provider: Provider, identifier: String) -> Self {
ProviderAccount {
provider,
identifier,
}
}
pub async fn list_calendars(&self) -> CalDirResult<Vec<CalendarConfig>> {
self.provider
.call(ListCalendars {
account_identifier: self.identifier.clone(),
})
.await
}
}