JMAP for Contacts implementation (closes #1576)

This commit is contained in:
mdecimus
2025-10-03 11:55:04 +02:00
parent 3da4619d43
commit d000b5975a
15 changed files with 669 additions and 159 deletions

View File

@@ -14,7 +14,7 @@ use crate::{
},
types::state::State,
};
use jmap_tools::Value;
use jmap_tools::{Key, Map, Value};
use serde::{Deserialize, Deserializer, Serialize};
use types::{blob::BlobId, id::Id};
use utils::map::vec_map::VecMap;
@@ -168,3 +168,15 @@ impl<'de, T: JmapObject> Default for CopyRequest<'de, T> {
}
}
}
impl<T: JmapObject> CopyResponse<T> {
pub fn created(&mut self, id: Id, document_id: impl Into<T::Id>) {
self.created.append(
id,
Value::Object(Map::from(vec![(
Key::Property(T::ID_PROPERTY),
Value::Element(T::Element::from(document_id.into())),
)])),
);
}
}