use std::collections::HashSet;
#[derive(Debug, Clone)]
pub struct Contact {
pub uid: String,
pub fn_value: String,
pub structured_name: Option<StructuredName>,
pub org: Option<String>,
pub org_fullname: Option<String>,
pub org_legal_form: Option<String>,
pub emails: Vec<TypedValue>,
pub tels: Vec<Tel>,
pub title: Option<String>,
pub role: Option<String>,
pub note: Option<String>,
pub categories: CategorySet,
pub source_detail: SourceDetail,
pub decision: super::screening::ScreeningDecision,
pub screening_rule: String,
pub merged_uids: Vec<String>,
}
#[derive(Debug, Clone, Default)]
pub struct StructuredName {
pub family: Vec<String>,
pub given: Vec<String>,
pub additional: Vec<String>,
pub prefix: Vec<String>,
pub suffix: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct Tel {
pub value: String,
pub tel_type: TelType,
pub normalized: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TelType {
Cell,
Home,
Work,
Main,
Other,
}
#[derive(Debug, Clone)]
pub struct TypedValue {
pub value: String,
pub types: Vec<String>,
pub pref: u8,
}
#[derive(Debug, Clone, Default)]
pub struct CategorySet {
pub n1: HashSet<String>,
pub n2: HashSet<String>,
pub n3: Vec<String>,
}
impl CategorySet {
pub fn has_n1(&self) -> bool {
!self.n1.is_empty()
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SourceDetail {
ProtonAutosave,
ProtonImport,
ProtonWeb,
Google,
Apple,
Unknown(String),
}