use crate::email::EmailAddress;
use jmap_types::Id;
use serde::{Deserialize, Serialize};
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Identity {
pub id: Id,
pub name: String,
pub email: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply_to: Option<Vec<EmailAddress>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bcc: Option<Vec<EmailAddress>>,
pub text_signature: String,
pub html_signature: String,
pub may_delete: bool,
}
impl Identity {
pub fn new(id: Id, email: impl Into<String>, may_delete: bool) -> Self {
Self {
id,
email: email.into(),
may_delete,
name: String::new(),
reply_to: None,
bcc: None,
text_signature: String::new(),
html_signature: String::new(),
}
}
}