Skip to main content

ibridge_server/
account.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Signed-in account as the tools report it. No secrets.
4
5use ibridge_core::AppleId;
6
7/// Whether one service can be used, and why not.
8#[derive(Debug, Clone, PartialEq, Eq)]
9#[non_exhaustive]
10pub enum ServiceStatus {
11    /// The service validated and its tools may run.
12    On,
13    /// The service is off. `reason` is safe to show to the model.
14    Off {
15        /// Why the service is off. No secrets and no server banners.
16        reason: String,
17    },
18}
19
20/// What `account_status` reports for one local server.
21#[derive(Debug, Clone, PartialEq, Eq)]
22pub struct AccountSnapshot {
23    /// Signed-in Apple ID.
24    pub apple_id: AppleId,
25    /// Mail reachability.
26    pub mail: ServiceStatus,
27    /// Calendar reachability.
28    pub calendar: ServiceStatus,
29    /// Contacts reachability.
30    pub contacts: ServiceStatus,
31}